Skip to content

Commit ecb41b7

Browse files
Jane Jianalexdeucher
authored andcommitted
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 <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 602ad43 commit ecb41b7

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

drivers/gpu/drm/amd/amdgpu/mmsch_v4_0.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#define RB_ENABLED (1 << 0)
3434
#define RB4_ENABLED (1 << 1)
35-
#define MMSCH_DOORBELL_OFFSET 0x8
3635

3736
#define MMSCH_VF_ENGINE_STATUS__PASS 0x1
3837

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ static int vcn_v4_0_sw_init(void *handle)
100100
struct amdgpu_ring *ring;
101101
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
102102
int i, r;
103-
int vcn_doorbell_index = 0;
104103

105104
r = amdgpu_vcn_sw_init(adev);
106105
if (r)
@@ -112,12 +111,6 @@ static int vcn_v4_0_sw_init(void *handle)
112111
if (r)
113112
return r;
114113

115-
if (amdgpu_sriov_vf(adev)) {
116-
vcn_doorbell_index = adev->doorbell_index.vcn.vcn_ring0_1 - MMSCH_DOORBELL_OFFSET;
117-
/* get DWORD offset */
118-
vcn_doorbell_index = vcn_doorbell_index << 1;
119-
}
120-
121114
for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
122115
volatile struct amdgpu_vcn4_fw_shared *fw_shared;
123116

@@ -135,7 +128,7 @@ static int vcn_v4_0_sw_init(void *handle)
135128
ring = &adev->vcn.inst[i].ring_enc[0];
136129
ring->use_doorbell = true;
137130
if (amdgpu_sriov_vf(adev))
138-
ring->doorbell_index = vcn_doorbell_index + i * (adev->vcn.num_enc_rings + 1) + 1;
131+
ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + i * (adev->vcn.num_enc_rings + 1) + 1;
139132
else
140133
ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 2 + 8 * i;
141134

0 commit comments

Comments
 (0)