<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal">ping<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org>
<b>On Behalf Of </b>Liu, Shaoyun<br>
<b>Sent:</b> Monday, March 25, 2024 8:51 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu : Add mes_log_enable to control mes log feature<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:5.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">[AMD Official Use Only - General]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p style="margin:5.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">[AMD Official Use Only - General]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Ping<o:p></o:p></p>
</div>
</div>
<div id="ms-outlook-mobile-signature">
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Get <a href="https://aka.ms/o0ukef">Outlook for iOS</a><o:p></o:p></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Liu, Shaoyun <<a href="mailto:Shaoyun.Liu@amd.com">Shaoyun.Liu@amd.com</a>><br>
<b>Sent:</b> Friday, March 22, 2024 2:00:21 PM<br>
<b>To:</b> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a> <<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>><br>
<b>Cc:</b> Liu, Shaoyun <<a href="mailto:Shaoyun.Liu@amd.com">Shaoyun.Liu@amd.com</a>><br>
<b>Subject:</b> [PATCH] drm/amdgpu : Add mes_log_enable to control mes log feature</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">The MES log might slow down the performance for extra step of log the data,<br>
disable it by default and introduce a parameter can enable it when necessary<br>
<br>
Signed-off-by: shaoyunl <<a href="mailto:shaoyun.liu@amd.com">shaoyun.liu@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 ++++++++++<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 5 ++++-<br>
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 7 +++++--<br>
4 files changed, 20 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
index 9c62552bec34..b3b84647207e 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
@@ -210,6 +210,7 @@ extern int amdgpu_async_gfx_ring;<br>
extern int amdgpu_mcbp;<br>
extern int amdgpu_discovery;<br>
extern int amdgpu_mes;<br>
+extern int amdgpu_mes_log_enable;<br>
extern int amdgpu_mes_kiq;<br>
extern int amdgpu_noretry;<br>
extern int amdgpu_force_asic_type;<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index 80b9642f2bc4..e4277298cf1a 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -195,6 +195,7 @@ int amdgpu_async_gfx_ring = 1;<br>
int amdgpu_mcbp = -1;<br>
int amdgpu_discovery = -1;<br>
int amdgpu_mes;<br>
+int amdgpu_mes_log_enable = 0;<br>
int amdgpu_mes_kiq;<br>
int amdgpu_noretry = -1;<br>
int amdgpu_force_asic_type = -1;<br>
@@ -667,6 +668,15 @@ MODULE_PARM_DESC(mes,<br>
"Enable Micro Engine Scheduler (0 = disabled (default), 1 = enabled)");<br>
module_param_named(mes, amdgpu_mes, int, 0444);<br>
<br>
+/**<br>
+ * DOC: mes_log_enable (int)<br>
+ * Enable Micro Engine Scheduler log. This is used to enable/disable MES internal log.<br>
+ * (0 = disabled (default), 1 = enabled)<br>
+ */<br>
+MODULE_PARM_DESC(mes_log_enable,<br>
+ "Enable Micro Engine Scheduler log (0 = disabled (default), 1 = enabled)");<br>
+module_param_named(mes_log_enable, amdgpu_mes_log_enable, int, 0444);<br>
+<br>
/**<br>
* DOC: mes_kiq (int)<br>
* Enable Micro Engine Scheduler KIQ. This is a new engine pipe for kiq.<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c<br>
index 78dfd027dc99..9ace848e174c 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c<br>
@@ -100,6 +100,9 @@ static int amdgpu_mes_event_log_init(struct amdgpu_device *adev)<br>
{<br>
int r;<br>
<br>
+ if (!amdgpu_mes_log_enable)<br>
+ return 0;<br>
+<br>
r = amdgpu_bo_create_kernel(adev, PAGE_SIZE, PAGE_SIZE,<br>
AMDGPU_GEM_DOMAIN_GTT,<br>
&adev->mes.event_log_gpu_obj,<br>
@@ -1561,7 +1564,7 @@ void amdgpu_debugfs_mes_event_log_init(struct amdgpu_device *adev)<br>
#if defined(CONFIG_DEBUG_FS)<br>
struct drm_minor *minor = adev_to_drm(adev)->primary;<br>
struct dentry *root = minor->debugfs_root;<br>
- if (adev->enable_mes)<br>
+ if (adev->enable_mes && amdgpu_mes_log_enable)<br>
debugfs_create_file("amdgpu_mes_event_log", 0444, root,<br>
adev, &amdgpu_debugfs_mes_event_log_fops);<br>
<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 072c478665ad..63f281a9984d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c<br>
@@ -411,8 +411,11 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes)<br>
mes_set_hw_res_pkt.enable_reg_active_poll = 1;<br>
mes_set_hw_res_pkt.enable_level_process_quantum_check = 1;<br>
mes_set_hw_res_pkt.oversubscription_timer = 50;<br>
- mes_set_hw_res_pkt.enable_mes_event_int_logging = 1;<br>
- mes_set_hw_res_pkt.event_intr_history_gpu_mc_ptr = mes->event_log_gpu_addr;<br>
+ if (amdgpu_mes_log_enable) {<br>
+ mes_set_hw_res_pkt.enable_mes_event_int_logging = 1;<br>
+ mes_set_hw_res_pkt.event_intr_history_gpu_mc_ptr =<br>
+ mes->event_log_gpu_addr;<br>
+ }<br>
<br>
return mes_v11_0_submit_pkt_and_poll_completion(mes,<br>
&mes_set_hw_res_pkt, sizeof(mes_set_hw_res_pkt),<br>
-- <br>
2.34.1<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>