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

drm/amdgpu/vcn: re-use original vcn0 doorbell value

root cause that S2A need to use deduct offset flag.
after setting this flag, vcn0 doorbell value works.
so return it as before

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jane Jian and committed by
Alex Deucher
98928bae ef5fca9f

+1 -9
-1
drivers/gpu/drm/amd/amdgpu/mmsch_v4_0.h
··· 32 32 33 33 #define RB_ENABLED (1 << 0) 34 34 #define RB4_ENABLED (1 << 1) 35 - #define MMSCH_DOORBELL_OFFSET 0x8 36 35 37 36 #define MMSCH_VF_ENGINE_STATUS__PASS 0x1 38 37
+1 -8
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
··· 103 103 struct amdgpu_ring *ring; 104 104 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 105 105 int i, r; 106 - int vcn_doorbell_index = 0; 107 106 108 107 r = amdgpu_vcn_sw_init(adev); 109 108 if (r) ··· 113 114 r = amdgpu_vcn_resume(adev); 114 115 if (r) 115 116 return r; 116 - 117 - if (amdgpu_sriov_vf(adev)) { 118 - vcn_doorbell_index = adev->doorbell_index.vcn.vcn_ring0_1 - MMSCH_DOORBELL_OFFSET; 119 - /* get DWORD offset */ 120 - vcn_doorbell_index = vcn_doorbell_index << 1; 121 - } 122 117 123 118 for (i = 0; i < adev->vcn.num_vcn_inst; i++) { 124 119 volatile struct amdgpu_vcn4_fw_shared *fw_shared; ··· 137 144 ring = &adev->vcn.inst[i].ring_enc[0]; 138 145 ring->use_doorbell = true; 139 146 if (amdgpu_sriov_vf(adev)) 140 - ring->doorbell_index = vcn_doorbell_index + i * (adev->vcn.num_enc_rings + 1) + 1; 147 + ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + i * (adev->vcn.num_enc_rings + 1) + 1; 141 148 else 142 149 ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 2 + 8 * i; 143 150