<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">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">We just check that as a way see whether we are using AZ audio (and gpu driver should control ACP power) or i2s audio (and acp driver controls power). In the former case, there is no structure allocated.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Alex<br>
</p>
</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 Zhu, Rex <Rex.Zhu@amd.com><br>
<b>Sent:</b> Friday, July 20, 2018 6:31:50 AM<br>
<b>To:</b> Alex Deucher<br>
<b>Cc:</b> amd-gfx list<br>
<b>Subject:</b> Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ</font>
<div> </div>
</div>
<meta content="text/html; charset=us-ascii">
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hi Alex,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I am Ok with the patch in v2.</p>
<p style="margin-top:0; margin-bottom:0">just one question,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div>+ if (!adev->acp.acp_cell)<br>
+ amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true);</div>
<p></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Do we need to check <span>adev->acp.acp_cell</span> before poweron/off ACP?</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Best Regards</p>
<p style="margin-top:0; margin-bottom:0">Rex<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Alex Deucher <alexdeucher@gmail.com><br>
<b>Sent:</b> Friday, July 20, 2018 12:53:37 AM<br>
<b>To:</b> Zhu, Rex<br>
<b>Cc:</b> amd-gfx list<br>
<b>Subject:</b> Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div dir="ltr"><br>
<div class="x_x_gmail_extra">
<div class="x_x_gmail_quote">On Thu, Jul 19, 2018 at 11:14 AM, Zhu, Rex <span dir="ltr">
<<a href="mailto:Rex.Zhu@amd.com" target="_blank">Rex.Zhu@amd.com</a>></span> wrote:<br>
<blockquote class="x_x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_x_m_-5529052118359428029divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<span class="">
<p style="margin-top:0; margin-bottom:0"><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:14.6667px">>We also need to power it back
up in hw_fini and suspend and then power</span><br style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:14.6667px">
<span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:14.6667px">>it back down in resume.</span><br>
</p>
<div><br>
</div>
</span>Yes, this logic will be added in acp block.
<div>In this patch, we only power down acp when it was not used and have no inpact wen s3.</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>But I think when the asic comes out of S3/S4, the ACP block will be powered up again so it will have to be powered down again to avoid using power after resume. So if the platform uses AZ rather than ACP, we need to handle that case and to power ACP back
up on hw_fini() in case the driver gets reloaded. S4 works similarly. Something like the attached patch.<br>
</div>
<div><br>
</div>
<div>Alex<br>
</div>
<div><br>
</div>
<div> </div>
<blockquote class="x_x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_x_m_-5529052118359428029divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<div><br>
</div>
<div>Best Regards</div>
<div>Rex<br>
<br>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block; width:98%">
<div id="x_x_m_-5529052118359428029divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Alex Deucher <<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>><br>
<b>Sent:</b> Thursday, July 19, 2018 9:56 PM<br>
<b>To:</b> Zhu, Rex<br>
<b>Cc:</b> amd-gfx list<br>
<b>Subject:</b> Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ</font>
<div> </div>
</div>
<div class="x_x_m_-5529052118359428029BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_x_m_-5529052118359428029PlainText">
<div>
<div class="x_x_h5">On Thu, Jul 19, 2018 at 4:46 AM, Rex Zhu <<a href="mailto:rex.zhu@amd.com" target="_blank">rex.zhu@amd.com</a>> wrote:<br>
> if board uses AZ rather than ACP, we power down acp<br>
> through smu to save power.<br>
><br>
<br>
We also need to power it back up in hw_fini and suspend and then power<br>
it back down in resume.<br>
<br>
Alex<br>
<br>
> Signed-off-by: Rex Zhu <<a href="mailto:Rex.Zhu@amd.com" target="_blank">Rex.Zhu@amd.com</a>><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_acp.c | 8 +++++---<br>
> 1 file changed, 5 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_acp.c<br>
> index 71efcf3..4e18a88 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_acp.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/<wbr>amdgpu_acp.c<br>
> @@ -35,6 +35,7 @@<br>
><br>
> #include "acp_gfx_if.h"<br>
><br>
> +<br>
> #define ACP_TILE_ON_MASK <wbr> 0x03<br>
> #define ACP_TILE_OFF_MASK <wbr> 0x02<br>
> #define ACP_TILE_ON_RETAIN_REG_MASK <wbr> 0x1f<br>
> @@ -289,11 +290,12 @@ static int acp_hw_init(void *handle)<br>
> r = amd_acp_hw_init(adev->acp.cgs_<wbr>device,<br>
> ip_block->version->major, ip_block->version->minor);<br>
> /* -ENODEV means board uses AZ rather than ACP */<br>
> - if (r == -ENODEV)<br>
> + if (r == -ENODEV) {<br>
> + amdgpu_dpm_set_powergating_by_<wbr>smu(adev, AMD_IP_BLOCK_TYPE_ACP, true);<br>
> return 0;<br>
> - else if (r)<br>
> + } else if (r) {<br>
> return r;<br>
> -<br>
> + }<br>
> if (adev->rmmio_size == 0 || adev->rmmio_size < 0x5289)<br>
> return -EINVAL;<br>
><br>
> --<br>
> 1.9.1<br>
><br>
> ______________________________<wbr>_________________<br>
> amd-gfx mailing list<br>
> <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="x_x_m_-5529052118359428029LPlnk998837" class="x_x_m_-5529052118359428029OWAAutoLink" target="_blank">
https://lists.freedesktop.org/<wbr>mailman/listinfo/amd-gfx</a> </div>
</div>
<div id="x_x_m_-5529052118359428029LPBorder_GT_15320131028380.702754859637317" style="margin-bottom:20px; overflow:auto; width:100%; text-indent:0px">
<table id="x_x_m_-5529052118359428029LPContainer_15320131028280.1025073489385282" cellspacing="0" style="width:90%; background-color:rgb(255,255,255); overflow:auto; padding-top:20px; padding-bottom:20px; margin-top:20px; border-top:1px dotted rgb(200,200,200); border-bottom:1px dotted rgb(200,200,200)">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td id="x_x_m_-5529052118359428029TextCell_15320131028320.9917042135546368" colspan="2" style="vertical-align:top; padding:0px; display:table-cell">
<div id="x_x_m_-5529052118359428029LPRemovePreviewContainer_15320131028320.024263722967099">
</div>
<div id="x_x_m_-5529052118359428029LPTitle_15320131028320.9687962596936737" style="color:rgb(0,120,215); font-weight:normal; font-size:21px; font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; line-height:21px">
<a id="x_x_m_-5529052118359428029LPUrlAnchor_15320131028340.4538000273988081" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" target="_blank" style="text-decoration:none">amd-gfx Info Page - freedesktop.org</a></div>
<div id="x_x_m_-5529052118359428029LPMetadata_15320131028350.13229109652970839" style="margin:10px 0px 16px; color:rgb(102,102,102); font-weight:normal; font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:14px; line-height:14px">
<a href="http://lists.freedesktop.org" target="_blank">lists.freedesktop.org</a></div>
<div id="x_x_m_-5529052118359428029LPDescription_15320131028370.6585869579202912" style="display:block; color:rgb(102,102,102); font-weight:normal; font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:14px; line-height:20px; max-height:100px; overflow:hidden">
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all
<a href="http://freedesktop.org" target="_blank">freedesktop.org</a> lists is subject to our Code of Conduct.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
</div>
</span></font></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>