Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10784fe

Browse files
haohuialexdeucher
authored andcommitted
drm/amdgpu/gfx10: rework KIQ programming
Make sure the queue is not longer active before programming the kiq EOP registers. Signed-off-by: Haohui Mai <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8420355 commit 10784fe

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6956,20 +6956,6 @@ static int gfx_v10_0_kiq_init_register(struct amdgpu_ring *ring)
69566956
/* disable wptr polling */
69576957
WREG32_FIELD15(GC, 0, CP_PQ_WPTR_POLL_CNTL, EN, 0);
69586958

6959-
/* write the EOP addr */
6960-
WREG32_SOC15(GC, 0, mmCP_HQD_EOP_BASE_ADDR,
6961-
mqd->cp_hqd_eop_base_addr_lo);
6962-
WREG32_SOC15(GC, 0, mmCP_HQD_EOP_BASE_ADDR_HI,
6963-
mqd->cp_hqd_eop_base_addr_hi);
6964-
6965-
/* set the EOP size, register value is 2^(EOP_SIZE+1) dwords */
6966-
WREG32_SOC15(GC, 0, mmCP_HQD_EOP_CONTROL,
6967-
mqd->cp_hqd_eop_control);
6968-
6969-
/* enable doorbell? */
6970-
WREG32_SOC15(GC, 0, mmCP_HQD_PQ_DOORBELL_CONTROL,
6971-
mqd->cp_hqd_pq_doorbell_control);
6972-
69736959
/* disable the queue if it's active */
69746960
if (RREG32_SOC15(GC, 0, mmCP_HQD_ACTIVE) & 1) {
69756961
WREG32_SOC15(GC, 0, mmCP_HQD_DEQUEUE_REQUEST, 1);
@@ -6988,6 +6974,19 @@ static int gfx_v10_0_kiq_init_register(struct amdgpu_ring *ring)
69886974
mqd->cp_hqd_pq_wptr_hi);
69896975
}
69906976

6977+
/* disable doorbells */
6978+
WREG32_SOC15(GC, 0, mmCP_HQD_PQ_DOORBELL_CONTROL, 0);
6979+
6980+
/* write the EOP addr */
6981+
WREG32_SOC15(GC, 0, mmCP_HQD_EOP_BASE_ADDR,
6982+
mqd->cp_hqd_eop_base_addr_lo);
6983+
WREG32_SOC15(GC, 0, mmCP_HQD_EOP_BASE_ADDR_HI,
6984+
mqd->cp_hqd_eop_base_addr_hi);
6985+
6986+
/* set the EOP size, register value is 2^(EOP_SIZE+1) dwords */
6987+
WREG32_SOC15(GC, 0, mmCP_HQD_EOP_CONTROL,
6988+
mqd->cp_hqd_eop_control);
6989+
69916990
/* set the pointer to the MQD */
69926991
WREG32_SOC15(GC, 0, mmCP_MQD_BASE_ADDR,
69936992
mqd->cp_mqd_base_addr_lo);

0 commit comments

Comments
 (0)