<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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">This patch fails on the very first resume as below:<o:p></o:p></p>
<p class="MsoNormal">[   53.632732] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   54.653212] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   55.673692] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   56.694203] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   57.714683] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   58.735164] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   59.755643] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   60.776124] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   61.796608] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   62.817092] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, trying to reset the ECPU!!!<o:p></o:p></p>
<p class="MsoNormal">[   62.837108] [drm:vce_v3_0_set_powergating_state] *ERROR* VCE not responding, giving up!!!<o:p></o:p></p>
<p class="MsoNormal">[   62.837112] Power gating vce_v3_0 failed<o:p></o:p></p>
<p class="MsoNormal">[   62.837118] [drm:amdgpu_device_ip_suspend_phase1] *ERROR* set_powergating_state(gate) of IP block <vce_v3_0> failed -110<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I believe there is some more work left to be done with it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Shirish S<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>Deucher, Alexander<br>
<b>Sent:</b> Tuesday, October 16, 2018 9:44 AM<br>
<b>To:</b> Zhu, Rex <Rex.Zhu@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: Poweroff uvd/vce/vcn/acp block if they were disabled by user<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="divtagdefaultwrapper">
<p><span style="font-size:12.0pt;color:black">Reviewed-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="3" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of Rex Zhu <<a href="mailto:Rex.Zhu@amd.com">Rex.Zhu@amd.com</a>><br>
<b>Sent:</b> Tuesday, October 16, 2018 1:33:46 AM<br>
<b>To:</b> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>; Deucher, Alexander<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH] drm/amdgpu: Poweroff uvd/vce/vcn/acp block if they were disabled by user</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">If user disable uvd/vce/vcn/acp blocks via module<br>
parameter ip_block_mask,<br>
driver power off thoser blocks to save power.<br>
<br>
Signed-off-by: Rex Zhu <<a href="mailto:Rex.Zhu@amd.com">Rex.Zhu@amd.com</a>><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 +++++++++++++++++++<br>
 1 file changed, 19 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index 1e4dd09..3ffee08 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -1774,6 +1774,24 @@ static int amdgpu_device_set_pg_state(struct amdgpu_device *adev, enum amd_power<br>
 <br>
         for (j = 0; j < adev->num_ip_blocks; j++) {<br>
                 i = state == AMD_PG_STATE_GATE ? j : adev->num_ip_blocks - j - 1;<br>
+<br>
+               /* try to power off VCE/UVD/VCN/ACP if they were disabled by user */<br>
+               if ((adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_UVD ||<br>
+                   adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_VCE ||<br>
+                   adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_VCN ||<br>
+                   adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_ACP) &&<br>
+                   adev->ip_blocks[i].version->funcs->set_powergating_state) {<br>
+                       if (!adev->ip_blocks[i].status.valid) {<br>
+                               r = adev->ip_blocks[i].version->funcs->set_powergating_state((void *)adev,<br>
+                                                                                       state);<br>
+                               if (r) {<br>
+                                       DRM_ERROR("set_powergating_state(gate) of IP block <%s> failed %d\n",<br>
+                                         adev->ip_blocks[i].version->funcs->name, r);<br>
+                                       return r;<br>
+                               }<br>
+                       }<br>
+               }<br>
+<br>
                 if (!adev->ip_blocks[i].status.late_initialized)<br>
                         continue;<br>
                 /* skip CG for VCE/UVD, it's handled specially */<br>
@@ -1791,6 +1809,7 @@ static int amdgpu_device_set_pg_state(struct amdgpu_device *adev, enum amd_power<br>
                         }<br>
                 }<br>
         }<br>
+<br>
         return 0;<br>
 }<br>
 <br>
-- <br>
1.9.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>