Skip to content

Commit 98928ba

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 ef5fca9 commit 98928ba

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
@@ -103,7 +103,6 @@ static int vcn_v4_0_sw_init(void *handle)
103103
struct amdgpu_ring *ring;
104104
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
105105
int i, r;
106-
int vcn_doorbell_index = 0;
107106

108107
r = amdgpu_vcn_sw_init(adev);
109108
if (r)
@@ -115,12 +114,6 @@ static int vcn_v4_0_sw_init(void *handle)
115114
if (r)
116115
return r;
117116

118-
if (amdgpu_sriov_vf(adev)) {
119-
vcn_doorbell_index = adev->doorbell_index.vcn.vcn_ring0_1 - MMSCH_DOORBELL_OFFSET;
120-
/* get DWORD offset */
121-
vcn_doorbell_index = vcn_doorbell_index << 1;
122-
}
123-
124117
for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
125118
volatile struct amdgpu_vcn4_fw_shared *fw_shared;
126119

@@ -144,7 +137,7 @@ static int vcn_v4_0_sw_init(void *handle)
144137
ring = &adev->vcn.inst[i].ring_enc[0];
145138
ring->use_doorbell = true;
146139
if (amdgpu_sriov_vf(adev))
147-
ring->doorbell_index = vcn_doorbell_index + i * (adev->vcn.num_enc_rings + 1) + 1;
140+
ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + i * (adev->vcn.num_enc_rings + 1) + 1;
148141
else
149142
ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 2 + 8 * i;
150143

0 commit comments

Comments
 (0)