Skip to content

Commit fc4981b

Browse files
Lang Yualexdeucher
authored andcommitted
drm/amdgpu/vpe: correct queue stop programing
Otherwise IB test would fail during GPU reset. Signed-off-by: Lang Yu <[email protected]> Reviewed-by: Yifan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 210aa66 commit fc4981b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,21 @@ static int vpe_v6_1_ring_start(struct amdgpu_vpe *vpe)
205205
static int vpe_v_6_1_ring_stop(struct amdgpu_vpe *vpe)
206206
{
207207
struct amdgpu_device *adev = vpe->ring.adev;
208-
uint32_t rb_cntl, ib_cntl;
208+
uint32_t queue_reset;
209+
int ret;
209210

210-
rb_cntl = RREG32(vpe_get_reg_offset(vpe, 0, regVPEC_QUEUE0_RB_CNTL));
211-
rb_cntl = REG_SET_FIELD(rb_cntl, VPEC_QUEUE0_RB_CNTL, RB_ENABLE, 0);
212-
WREG32(vpe_get_reg_offset(vpe, 0, regVPEC_QUEUE0_RB_CNTL), rb_cntl);
211+
queue_reset = RREG32(vpe_get_reg_offset(vpe, 0, regVPEC_QUEUE_RESET_REQ));
212+
queue_reset = REG_SET_FIELD(queue_reset, VPEC_QUEUE_RESET_REQ, QUEUE0_RESET, 1);
213+
WREG32(vpe_get_reg_offset(vpe, 0, regVPEC_QUEUE_RESET_REQ), queue_reset);
213214

214-
ib_cntl = RREG32(vpe_get_reg_offset(vpe, 0, regVPEC_QUEUE0_IB_CNTL));
215-
ib_cntl = REG_SET_FIELD(ib_cntl, VPEC_QUEUE0_IB_CNTL, IB_ENABLE, 0);
216-
WREG32(vpe_get_reg_offset(vpe, 0, regVPEC_QUEUE0_IB_CNTL), ib_cntl);
215+
ret = SOC15_WAIT_ON_RREG(VPE, 0, regVPEC_QUEUE_RESET_REQ, 0,
216+
VPEC_QUEUE_RESET_REQ__QUEUE0_RESET_MASK);
217+
if (ret)
218+
dev_err(adev->dev, "VPE queue reset failed\n");
217219

218220
vpe->ring.sched.ready = false;
219221

220-
return 0;
222+
return ret;
221223
}
222224

223225
static int vpe_v6_1_set_trap_irq_state(struct amdgpu_device *adev,

0 commit comments

Comments
 (0)