[PATCH] drm/amdkfd: Add SDMA queue quantum support for GFX12

Kasiviswanathan, Harish Harish.Kasiviswanathan at amd.com
Fri Sep 20 20:53:58 UTC 2024


[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Sreekant Somasekharan
Sent: Friday, September 20, 2024 12:14 PM
To: amd-gfx at lists.freedesktop.org
Cc: Somasekharan, Sreekant <Sreekant.Somasekharan at amd.com>
Subject: [PATCH] drm/amdkfd: Add SDMA queue quantum support for GFX12

program SDMAx_QUEUEx_SCHEDULE_CNTL for context switch due to
quantum in KFD for GFX12.

Signed-off-by: Sreekant Somasekharan <sreekant.somasekharan at amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c
index d163d92a692f..2b72d5b4949b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c
@@ -341,6 +341,10 @@ static void update_mqd_sdma(struct mqd_manager *mm, void *mqd,
        m->sdmax_rlcx_doorbell_offset =
                q->doorbell_off << SDMA0_QUEUE0_DOORBELL_OFFSET__OFFSET__SHIFT;

+       m->sdmax_rlcx_sched_cntl = (amdgpu_sdma_phase_quantum
+               << SDMA0_QUEUE0_SCHEDULE_CNTL__CONTEXT_QUANTUM__SHIFT)
+                & SDMA0_QUEUE0_SCHEDULE_CNTL__CONTEXT_QUANTUM_MASK;
+
        m->sdma_engine_id = q->sdma_engine_id;
        m->sdma_queue_id = q->sdma_queue_id;

--
2.34.1



More information about the amd-gfx mailing list