AMD General

The series is
Reviewed-by: Michael Chen <[email protected]>
________________________________
From: Liang, Prike <[email protected]>
Sent: Thursday, July 9, 2026 2:58 AM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian 
<[email protected]>; Chen, Michael <[email protected]>; Liang, Prike 
<[email protected]>
Subject: [PATCH 6/6] drm/amdgpu/mes11: enable MES process/gang load from MES 
local mem

Enable the MES process/gang context load from MES local memory,
this will reduce the MES firmware and driver handshake latency.

Signed-off-by: Prike Liang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index c2129ea6614b..a85387122b11 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
@@ -1012,6 +1012,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes 
*mes)
         mes_set_hw_res_pkt.enable_reg_active_poll = 1;
         mes_set_hw_res_pkt.enable_level_process_quantum_check = 1;
         mes_set_hw_res_pkt.oversubscription_timer = 50;
+       mes_set_hw_res_pkt.use_rs64mem_for_proc_gang_ctx = 1;

         if (amdgpu_mes_log_enable) {
                 mes_set_hw_res_pkt.enable_mes_event_int_logging = 1;
@@ -1945,6 +1946,8 @@ static int mes_v11_0_hw_init(struct amdgpu_ip_block 
*ip_block)
         if (adev->mes.ring[0].sched.ready)
                 goto out;

+       adev->mes.use_rs64mem = true;
+
         if (!adev->enable_mes_kiq) {
                 if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
                         r = mes_v11_0_load_microcode(adev,
@@ -1964,11 +1967,12 @@ static int mes_v11_0_hw_init(struct amdgpu_ip_block 
*ip_block)

         /* Allocate GPU buffer for array size query results */
         r = amdgpu_mes_rs64mem_init(&adev->mes);
-       if (r)
+       if (r) {
                 dev_warn(adev->dev,
                          "RS64 local memory init failed (%d), "
                          "falling back to system memory path\n", r);
-
+               adev->mes.use_rs64mem = false;
+       }
         r = mes_v11_0_set_hw_resources(&adev->mes);

         if (r)
@@ -1985,6 +1989,7 @@ static int mes_v11_0_hw_init(struct amdgpu_ip_block 
*ip_block)
                                  "Failed to query ctx array sizes (%d), "
                                  "disabling RS64 local memory\n", r);
                         /* Continue without optimization - not fatal */
+                       adev->mes.use_rs64mem = false;
                 }
         }

--
2.34.1

Reply via email to