Skip to content

Commit 520d9cd

Browse files
Guchun Chenalexdeucher
authored andcommitted
drm/amdgpu: apply vcn harvest quirk
This is a following patch to apply the workaround only on those boards with a bad harvest table in ip discovery. Signed-off-by: Guchun Chen <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent c4849f8 commit 520d9cd

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,30 @@ static inline bool amdgpu_discovery_verify_binary_signature(uint8_t *binary)
243243
return (le32_to_cpu(bhdr->binary_signature) == BINARY_SIGNATURE);
244244
}
245245

246+
static void amdgpu_discovery_harvest_config_quirk(struct amdgpu_device *adev)
247+
{
248+
/*
249+
* So far, apply this quirk only on those Navy Flounder boards which
250+
* have a bad harvest table of VCN config.
251+
*/
252+
if ((adev->ip_versions[UVD_HWIP][1] == IP_VERSION(3, 0, 1)) &&
253+
(adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 2))) {
254+
switch (adev->pdev->revision) {
255+
case 0xC1:
256+
case 0xC2:
257+
case 0xC3:
258+
case 0xC5:
259+
case 0xC7:
260+
case 0xCF:
261+
case 0xDF:
262+
adev->vcn.harvest_config |= AMDGPU_VCN_HARVEST_VCN1;
263+
break;
264+
default:
265+
break;
266+
}
267+
}
268+
}
269+
246270
static int amdgpu_discovery_init(struct amdgpu_device *adev)
247271
{
248272
struct table_info *info;
@@ -548,11 +572,9 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
548572
break;
549573
}
550574
}
551-
/* some IP discovery tables on Navy Flounder don't have this set correctly */
552-
if ((adev->ip_versions[UVD_HWIP][1] == IP_VERSION(3, 0, 1)) &&
553-
(adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 2)) &&
554-
(adev->pdev->revision != 0xFF))
555-
adev->vcn.harvest_config |= AMDGPU_VCN_HARVEST_VCN1;
575+
576+
amdgpu_discovery_harvest_config_quirk(adev);
577+
556578
if (vcn_harvest_count == adev->vcn.num_vcn_inst) {
557579
adev->harvest_ip_mask |= AMD_HARVEST_IP_VCN_MASK;
558580
adev->harvest_ip_mask |= AMD_HARVEST_IP_JPEG_MASK;

0 commit comments

Comments
 (0)