<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 14 (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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","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"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Maybe add a comment to that effect.  With that added,  this patch is:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> StDenis, Tom
<br>
<b>Sent:</b> Wednesday, August 03, 2016 12:31 PM<br>
<b>To:</b> Deucher, Alexander; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 2/6] drm/amd/amdgpu: Fix VCE CG order and resume defaults<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="divtagdefaultwrapper">
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">The logic is a bit confusing at first.  "gated" means that SW CG is enabled not that the clocks are turned off.  When I sampled the registers in the original configuration
 the clocks were reading 100% when the core was active.  It would read 0% when idle but only because power was gated.<o:p></o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">With the logic the way it is when the core is active I see many of the clocks throttle as they should.<o:p></o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Tom<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div>
<div>
<div class="MsoNormal" align="center" style="text-align:center;background:white">
<span style="font-family:"Calibri","sans-serif";color:black">
<hr size="2" width="98%" align="center">
</span></div>
<div id="x_divRplyFwdMsg">
<p class="MsoNormal" style="background:white"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"> Deucher, Alexander<br>
<b>Sent:</b> Wednesday, August 3, 2016 12:28<br>
<b>To:</b> 'Tom St Denis'; <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Cc:</b> StDenis, Tom<br>
<b>Subject:</b> RE: [PATCH 2/6] drm/amd/amdgpu: Fix VCE CG order and resume defaults</span><span style="font-family:"Calibri","sans-serif";color:black">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"> <o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:black">> -----Original Message-----<br>
> From: amd-gfx [<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">mailto:amd-gfx-bounces@lists.freedesktop.org</a>] On Behalf<br>
> Of Tom St Denis<br>
> Sent: Wednesday, August 03, 2016 11:52 AM<br>
> To: <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> Cc: StDenis, Tom<br>
> Subject: [PATCH 2/6] drm/amd/amdgpu: Fix VCE CG order and resume<br>
> defaults<br>
> <br>
> CG was being enabled in reverse sense from dpm/powerplay.<br>
> Also fix the default CLK_EN signal to enable all of the blocks.<br>
> <br>
> Signed-off-by: Tom St Denis <<a href="mailto:tom.stdenis@amd.com">tom.stdenis@amd.com</a>><br>
> ---<br>
>  drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 6 +++---<br>
>  1 file changed, 3 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c<br>
> b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c<br>
> index 26fb606e2d3e..93604bb78257 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c<br>
> @@ -130,7 +130,7 @@ static void vce_v3_0_set_vce_sw_clock_gating(struct<br>
> amdgpu_device *adev,<br>
>        /* Set Override to disable Clock Gating */<br>
>        vce_v3_0_override_vce_clock_gating(adev, true);<br>
> <br>
> -     if (!gated) {<br>
> +     if (gated) {<br>
>                /* Force CLOCK ON for VCE_CLOCK_GATING_B,<br>
>                 * {*_FORCE_ON, *_FORCE_OFF} = {1, 0}<br>
<br>
This doesn't make sense to me unless I'm mis-understanding the specific CG feature.  Forcing the clocks on, implies ungating, not gating.  In this case if forcing the clocks on part of the fw controlled clockgating configuration?  If so, please add a comment
 to that effect in the function.<br>
<br>
Alex<br>
<br>
>                 * VREG can be FORCE ON or set to Dynamic, but can't be OFF<br>
> @@ -153,7 +153,7 @@ static void vce_v3_0_set_vce_sw_clock_gating(struct<br>
> amdgpu_device *adev,<br>
>                /* set VCE_UENC_CLOCK_GATING_2 */<br>
>                tmp = data = RREG32(mmVCE_UENC_CLOCK_GATING_2);<br>
>                data |= 0x2;<br>
> -             data &= ~0x2;<br>
> +             data &= ~0x00010000;<br>
>                if (tmp != data)<br>
>                        WREG32(mmVCE_UENC_CLOCK_GATING_2, data);<br>
> <br>
> @@ -538,7 +538,7 @@ static void vce_v3_0_mc_resume(struct<br>
> amdgpu_device *adev, int idx)<br>
>        WREG32_P(mmVCE_CLOCK_GATING_A, 0, ~(1 << 16));<br>
>        WREG32_P(mmVCE_UENC_CLOCK_GATING, 0x1FF000,<br>
> ~0xFF9FF000);<br>
>        WREG32_P(mmVCE_UENC_REG_CLOCK_GATING, 0x3F, ~0x3F);<br>
> -     WREG32(mmVCE_CLOCK_GATING_B, 0xf7);<br>
> +     WREG32(mmVCE_CLOCK_GATING_B, 0x1FF);<br>
> <br>
>        WREG32(mmVCE_LMI_CTRL, 0x00398000);<br>
>        WREG32_P(mmVCE_LMI_CACHE_CTRL, 0x0, ~0x1);<br>
> --<br>
> 2.9.2<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></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>