<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="margin:0px;font-size:12pt;color:black !important;background-color:rgb(255, 255, 255)">Reviewed-by: Jack Xiao <Jack.Xiao@amd.com></span>
<div style="margin:0px;font-size:12pt;color:black !important;background-color:rgb(255, 255, 255)">
<br>
</div>
<div style="margin:0px;font-size:12pt;color:black !important;background-color:rgb(255, 255, 255)">
Regards,</div>
<span style="margin:0px;font-size:12pt;color:black !important;background-color:rgb(255, 255, 255)">Jack</span><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Graham Sider <Graham.Sider@amd.com><br>
<b>Sent:</b> Monday, 13 June 2022 23:19<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Joshi, Mukul <Mukul.Joshi@amd.com>; Kuehling, Felix <Felix.Kuehling@amd.com>; Sider, Graham <Graham.Sider@amd.com>; Yang, Philip <Philip.Yang@amd.com><br>
<b>Subject:</b> [PATCH v3 1/3] drm/amdgpu: Fetch MES scheduler/KIQ versions</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Store MES scheduler and MES KIQ version numbers in amdgpu_mes for GFX11.<br>
<br>
Signed-off-by: Graham Sider <Graham.Sider@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 3 +++<br>
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 12 ++++++++++++<br>
2 files changed, 15 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h<br>
index 92ddee5e33db..aa06c8396ee0 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h<br>
@@ -64,6 +64,9 @@ struct amdgpu_mes {<br>
<br>
spinlock_t queue_id_lock;<br>
<br>
+ uint32_t sched_version;<br>
+ uint32_t kiq_version;<br>
+<br>
uint32_t total_max_queue;<br>
uint32_t doorbell_id_offset;<br>
uint32_t max_doorbell_slices;<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c<br>
index e4eb87689f7f..2a9ef308e71c 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c<br>
@@ -890,6 +890,18 @@ static int mes_v11_0_queue_init(struct amdgpu_device *adev,<br>
mes_v11_0_queue_init_register(ring);<br>
}<br>
<br>
+ /* get MES scheduler/KIQ versions */<br>
+ mutex_lock(&adev->srbm_mutex);<br>
+ soc21_grbm_select(adev, 3, pipe, 0, 0);<br>
+<br>
+ if (pipe == AMDGPU_MES_SCHED_PIPE)<br>
+ adev->mes.sched_version = RREG32_SOC15(GC, 0, regCP_MES_GP3_LO);<br>
+ else if (pipe == AMDGPU_MES_KIQ_PIPE && adev->enable_mes_kiq)<br>
+ adev->mes.kiq_version = RREG32_SOC15(GC, 0, regCP_MES_GP3_LO);<br>
+<br>
+ soc21_grbm_select(adev, 0, 0, 0, 0);<br>
+ mutex_unlock(&adev->srbm_mutex);<br>
+<br>
return 0;<br>
}<br>
<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>