<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="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">+
uint64_t oversubscription_no_aggregated_en;</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
uint64_t is unnecessary here, 32bit or bool type here better.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<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)">With fixed, the patch is 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:20<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 3/3] drm/amdgpu: Update mes_v11_api_def.h</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Update MES API to support oversubscription without aggregated doorbell<br>
for usermode queues.<br>
<br>
Signed-off-by: Graham Sider <Graham.Sider@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 1 +<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 1 +<br>
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 3 +++<br>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 ++<br>
drivers/gpu/drm/amd/include/mes_v11_api_def.h | 4 +++-<br>
5 files changed, 10 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c<br>
index 2e86baa32c55..3d9a81a8fa1c 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c<br>
@@ -681,6 +681,7 @@ int amdgpu_mes_add_hw_queue(struct amdgpu_device *adev, int gang_id,<br>
queue_input.wptr_addr = qprops->wptr_gpu_addr;<br>
queue_input.queue_type = qprops->queue_type;<br>
queue_input.paging = qprops->paging;<br>
+ queue_input.oversubscription_no_aggregated_en = 0;<br>
<br>
r = adev->mes.funcs->add_hw_queue(&adev->mes, &queue_input);<br>
if (r) {<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h<br>
index aa06c8396ee0..26765a9946a9 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h<br>
@@ -207,6 +207,7 @@ struct mes_add_queue_input {<br>
uint32_t debug_vmid;<br>
uint64_t tba_addr;<br>
uint64_t tma_addr;<br>
+ uint64_t oversubscription_no_aggregated_en;<br>
};<br>
<br>
struct mes_remove_queue_input {<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 2a9ef308e71c..95a1394d3943 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c<br>
@@ -163,6 +163,8 @@ static int mes_v11_0_add_hw_queue(struct amdgpu_mes *mes,<br>
mes_add_queue_pkt.gws_size = input->gws_size;<br>
mes_add_queue_pkt.trap_handler_addr = input->tba_addr;<br>
mes_add_queue_pkt.tma_addr = input->tma_addr;<br>
+ mes_add_queue_pkt.oversubscription_no_aggregated_en =<br>
+ input->oversubscription_no_aggregated_en;<br>
<br>
mes_add_queue_pkt.api_status.api_completion_fence_addr =<br>
mes->ring.fence_drv.gpu_addr;<br>
@@ -341,6 +343,7 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes)<br>
mes_set_hw_res_pkt.disable_reset = 1;<br>
mes_set_hw_res_pkt.disable_mes_log = 1;<br>
mes_set_hw_res_pkt.use_different_vmid_compute = 1;<br>
+ mes_set_hw_res_pkt.oversubscription_timer = 50;<br>
<br>
mes_set_hw_res_pkt.api_status.api_completion_fence_addr =<br>
mes->ring.fence_drv.gpu_addr;<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c<br>
index d8de2fbdfc7d..762bc6059387 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c<br>
@@ -235,6 +235,8 @@ static int add_queue_mes(struct device_queue_manager *dqm, struct queue *q,<br>
} else<br>
queue_input.wptr_addr = (uint64_t)q->properties.write_ptr;<br>
<br>
+ queue_input.oversubscription_no_aggregated_en = 1;<br>
+<br>
queue_input.paging = false;<br>
queue_input.tba_addr = qpd->tba_addr;<br>
queue_input.tma_addr = qpd->tma_addr;<br>
diff --git a/drivers/gpu/drm/amd/include/mes_v11_api_def.h b/drivers/gpu/drm/amd/include/mes_v11_api_def.h<br>
index f9d02d7bdf77..95f0246eb045 100644<br>
--- a/drivers/gpu/drm/amd/include/mes_v11_api_def.h<br>
+++ b/drivers/gpu/drm/amd/include/mes_v11_api_def.h<br>
@@ -226,6 +226,7 @@ union MESAPI_SET_HW_RESOURCES {<br>
};<br>
uint32_t uint32_t_all;<br>
};<br>
+ uint32_t oversubscription_timer;<br>
};<br>
<br>
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];<br>
@@ -265,7 +266,8 @@ union MESAPI__ADD_QUEUE {<br>
uint32_t is_gang_suspended : 1;<br>
uint32_t is_tmz_queue : 1;<br>
uint32_t map_kiq_utility_queue : 1;<br>
- uint32_t reserved : 23;<br>
+ uint32_t oversubscription_no_aggregated_en : 1;<br>
+ uint32_t reserved : 22;<br>
};<br>
struct MES_API_STATUS api_status;<br>
uint64_t tma_addr;<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>