drm/amdkfd: Set SDMA_QUEUEx_IB_CNTL/SWITCH_INSIDE_IB

When submitting MQD to CP, set SDMA_QUEUEx_IB_CNTL/SWITCH_INSIDE_IB bit
    so it'll allow SDMA preemption if there is a massive command buffer of
    long-running SDMA commands.

Signed-off-by: Gang Ba <Gang.Ba@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Gang Ba 2025-07-24 09:20:08 -04:00 committed by Alex Deucher
parent a2a7e75020
commit 16592e7591
2 changed files with 12 additions and 0 deletions

View File

@ -351,6 +351,12 @@ static void update_mqd_sdma(struct mqd_manager *mm, void *mqd,
m->sdmax_rlcx_dummy_reg = SDMA_RLC_DUMMY_DEFAULT;
/* Allow context switch so we don't cross-process starve with a massive
* command buffer of long-running SDMA commands
* sdmax_rlcx_ib_cntl represent SDMA_QUEUE0_IB_CNTL register
*/
m->sdmax_rlcx_ib_cntl |= SDMA0_QUEUE0_IB_CNTL__SWITCH_INSIDE_IB_MASK;
q->is_active = QUEUE_IS_ACTIVE(*q);
}

View File

@ -363,6 +363,12 @@ static void update_mqd_sdma(struct mqd_manager *mm, void *mqd,
m->sdmax_rlcx_dummy_reg = SDMA_RLC_DUMMY_DEFAULT;
/* Allow context switch so we don't cross-process starve with a massive
* command buffer of long-running SDMA commands
* sdmax_rlcx_ib_cntl represent SDMA_QUEUE0_IB_CNTL register
*/
m->sdmax_rlcx_ib_cntl |= SDMA0_SDMA_QUEUE0_IB_CNTL__SWITCH_INSIDE_IB_MASK;
q->is_active = QUEUE_IS_ACTIVE(*q);
}