<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:#0563C1;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
p.msipheader251902e5, li.msipheader251902e5, div.msipheader251902e5
{mso-style-name:msipheader251902e5;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<p style="font-family:Arial;font-size:10pt;color:#317100;margin:15pt;" align="Left">
[AMD Public Use]<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="msipheader251902e5" style="margin:0in"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Hi Bhawanpreet,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">With the two patches, I still can’t see that dc_allow_idle_optimizations(struct dc *dc, bool allow) is called with allow = true after modprobe and startx.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Is there anything else missing?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt">Best Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Kenneth<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></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>Lakha, Bhawanpreet<br>
<b>Sent:</b> Friday, December 18, 2020 1:42 AM<br>
<b>To:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com><br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 2/2] drm/amd/display: enable idle optimizations for linux (MALL stutter)<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">[CAUTION: External Email] <o:p></o:p></p>
<div>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Actually, I will drop the guards and if we see issues related to this, we can block it.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Bhawan<o:p></o:p></span></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"> Lakha, Bhawanpreet <<a href="mailto:Bhawanpreet.Lakha@amd.com">Bhawanpreet.Lakha@amd.com</a>><br>
<b>Sent:</b> December 17, 2020 12:32 PM<br>
<b>To:</b> Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>>; Kazlauskas, Nicholas <<a href="mailto:Nicholas.Kazlauskas@amd.com">Nicholas.Kazlauskas@amd.com</a>><br>
<b>Cc:</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>Subject:</b> Re: [PATCH 2/2] drm/amd/display: enable idle optimizations for linux (MALL stutter)</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">I would but MALL is not fully validated so it might cause underflow issues if we keep it enabled by default. I can create a feature flag mask if that helps?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Bhawan<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>><br>
<b>Sent:</b> December 17, 2020 12:04 PM<br>
<b>To:</b> Lakha, Bhawanpreet <<a href="mailto:Bhawanpreet.Lakha@amd.com">Bhawanpreet.Lakha@amd.com</a>>; Kazlauskas, Nicholas <<a href="mailto:Nicholas.Kazlauskas@amd.com">Nicholas.Kazlauskas@amd.com</a>><br>
<b>Cc:</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>Subject:</b> Re: [PATCH 2/2] drm/amd/display: enable idle optimizations for linux (MALL stutter)</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Can we drop the Kconfig? With that, the series is:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Acked-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com">alexander.deucher@amd.com</a>><o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="x_x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Bhawanpreet Lakha <<a href="mailto:Bhawanpreet.Lakha@amd.com">Bhawanpreet.Lakha@amd.com</a>><br>
<b>Sent:</b> Thursday, December 17, 2020 11:54 AM<br>
<b>To:</b> Kazlauskas, Nicholas <<a href="mailto:Nicholas.Kazlauskas@amd.com">Nicholas.Kazlauskas@amd.com</a>>; Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>><br>
<b>Cc:</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>>; Lakha, Bhawanpreet <<a href="mailto:Bhawanpreet.Lakha@amd.com">Bhawanpreet.Lakha@amd.com</a>>;
Kazlauskas, Nicholas <<a href="mailto:Nicholas.Kazlauskas@amd.com">Nicholas.Kazlauskas@amd.com</a>><br>
<b>Subject:</b> [PATCH 2/2] drm/amd/display: enable idle optimizations for linux (MALL stutter)</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">[Why]<br>
We can only use this feature when the display is idle. When active vblank<br>
irq count is 0 we know all the displays are idle.<br>
<br>
[How]<br>
-Add a active vblank irq counter<br>
-Update the counter when we enable/disable vblank irq<br>
-if vblank irq count is 0 we can consider mall stutter<br>
<br>
Change-Id: Ib1e14a84ee2e8c6e057072128693449665012584<br>
Signed-off-by: Bhawanpreet Lakha <<a href="mailto:Bhawanpreet.Lakha@amd.com">Bhawanpreet.Lakha@amd.com</a>><br>
Acked-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com">alexander.deucher@amd.com</a>><br>
Reviewed-by: Nick Kazlauskas <<a href="mailto:Nicholas.Kazlauskas@amd.com">Nicholas.Kazlauskas@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/display/Kconfig | 6 +++++<br>
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 22 +++++++++++++++++++<br>
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 9 ++++++++<br>
drivers/gpu/drm/amd/display/dc/dc.h | 3 +++<br>
4 files changed, 40 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig<br>
index 797b5d4b43e5..2444e664c7ee 100644<br>
--- a/drivers/gpu/drm/amd/display/Kconfig<br>
+++ b/drivers/gpu/drm/amd/display/Kconfig<br>
@@ -23,6 +23,12 @@ config DRM_AMD_DC_HDCP<br>
help<br>
Choose this option if you want to support HDCP authentication.<br>
<br>
+config DRM_AMD_DC_MALL<br>
+ bool "Enable MALL support"<br>
+ depends on DRM_AMD_DC<br>
+ help<br>
+ Choose this option if you want to support MALL<br>
+<br>
config DRM_AMD_DC_SI<br>
bool "AMD DC support for Southern Islands ASICs"<br>
default n<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index a78ec16418b3..080f2a52cfed 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -5479,6 +5479,7 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)<br>
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);<br>
struct amdgpu_device *adev = drm_to_adev(crtc->dev);<br>
struct dm_crtc_state *acrtc_state = to_dm_crtc_state(crtc->state);<br>
+ struct amdgpu_display_manager *dm = &adev->dm;<br>
int rc = 0;<br>
<br>
if (enable) {<br>
@@ -5494,7 +5495,28 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)<br>
return rc;<br>
<br>
irq_source = IRQ_TYPE_VBLANK + acrtc->otg_inst;<br>
+#if defined(CONFIG_DRM_AMD_DC_MALL)<br>
+<br>
+ if (!dc_interrupt_set(adev->dm.dc, irq_source, enable))<br>
+ return -EBUSY;<br>
+<br>
+ mutex_lock(&dm->dc_lock);<br>
+<br>
+ if (enable)<br>
+ dm->active_vblank_irq_count++;<br>
+ else<br>
+ dm->active_vblank_irq_count--;<br>
+<br>
+ dc_allow_idle_optimizations(<br>
+ adev->dm.dc, dm->active_vblank_irq_count == 0 ? true : false);<br>
+<br>
+ DRM_DEBUG_DRIVER("Allow idle optimizations (MALL): %d\n", dm->active_vblank_irq_count == 0);<br>
+ mutex_unlock(&dm->dc_lock);<br>
+<br>
+ return 0;<br>
+#else<br>
return dc_interrupt_set(adev->dm.dc, irq_source, enable) ? 0 : -EBUSY;<br>
+#endif<br>
}<br>
<br>
static int dm_enable_vblank(struct drm_crtc *crtc)<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h<br>
index 251af783f6b1..cab44bbd2e35 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h<br>
@@ -336,6 +336,15 @@ struct amdgpu_display_manager {<br>
*/<br>
const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box;<br>
<br>
+#if defined(CONFIG_DRM_AMD_DC_MALL)<br>
+ /**<br>
+ * @active_vblank_irq_count<br>
+ *<br>
+ * number of currently active vblank irqs<br>
+ */<br>
+ uint32_t active_vblank_irq_count;<br>
+#endif<br>
+<br>
#ifdef CONFIG_DEBUG_FS<br>
/* set the crc calculation window*/<br>
struct drm_property *crc_win_x_start_property;<br>
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h<br>
index 33642566bcb2..9d245033eb3d 100644<br>
--- a/drivers/gpu/drm/amd/display/dc/dc.h<br>
+++ b/drivers/gpu/drm/amd/display/dc/dc.h<br>
@@ -504,6 +504,9 @@ struct dc_debug_options {<br>
bool dmcub_emulation;<br>
#if defined(CONFIG_DRM_AMD_DC_DCN)<br>
bool disable_idle_power_optimizations;<br>
+#endif<br>
+#ifdef CONFIG_DRM_AMD_DC_MALL<br>
+ unsigned int mall_size_override;<br>
#endif<br>
bool dmub_command_table; /* for testing only */<br>
struct dc_bw_validation_profile bw_val_profile;<br>
-- <br>
2.25.1<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>