Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Normalize reg offsets on VCN v4.0.3

Remote access to external AIDs isn't possible with VCN RRMT disabled
and it is disabled on SoCs with GC 9.4.4, so use only local offsets.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sathishkumar S and committed by
Alex Deucher
edd345f7 7b1ebbe8

+11 -4
+11 -4
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
··· 95 95 static void vcn_v4_0_3_set_ras_funcs(struct amdgpu_device *adev); 96 96 static void vcn_v4_0_3_enable_ras(struct amdgpu_device *adev, 97 97 int inst_idx, bool indirect); 98 + 99 + static inline bool vcn_v4_0_3_normalizn_reqd(struct amdgpu_device *adev) 100 + { 101 + return (amdgpu_sriov_vf(adev) || 102 + (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 4))); 103 + } 104 + 98 105 /** 99 106 * vcn_v4_0_3_early_init - set function pointers 100 107 * ··· 1435 1428 static void vcn_v4_0_3_enc_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg, 1436 1429 uint32_t val, uint32_t mask) 1437 1430 { 1438 - /* For VF, only local offsets should be used */ 1439 - if (amdgpu_sriov_vf(ring->adev)) 1431 + /* Use normalized offsets when required */ 1432 + if (vcn_v4_0_3_normalizn_reqd(ring->adev)) 1440 1433 reg = NORMALIZE_VCN_REG_OFFSET(reg); 1441 1434 1442 1435 amdgpu_ring_write(ring, VCN_ENC_CMD_REG_WAIT); ··· 1447 1440 1448 1441 static void vcn_v4_0_3_enc_ring_emit_wreg(struct amdgpu_ring *ring, uint32_t reg, uint32_t val) 1449 1442 { 1450 - /* For VF, only local offsets should be used */ 1451 - if (amdgpu_sriov_vf(ring->adev)) 1443 + /* Use normalized offsets when required */ 1444 + if (vcn_v4_0_3_normalizn_reqd(ring->adev)) 1452 1445 reg = NORMALIZE_VCN_REG_OFFSET(reg); 1453 1446 1454 1447 amdgpu_ring_write(ring, VCN_ENC_CMD_REG_WRITE);