<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">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks very much Lunben and Guchun!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Rico<br>
</div>
<div id="appendonsend"></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> Tuikov, Luben <Luben.Tuikov@amd.com><br>
<b>Sent:</b> Wednesday, July 29, 2020 2:44<br>
<b>To:</b> Yin, Tianci (Rico) <Tianci.Yin@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Xu, Feifei <Feifei.Xu@amd.com>; Hesik, Christopher <Christopher.Hesik@amd.com>; Swamy, Manjunatha <Manjunatha.Swamy@amd.com>; Quan, Evan <Evan.Quan@amd.com>;
Feng, Kenneth <Kenneth.Feng@amd.com><br>
<b>Subject:</b> Re: [PATCH 2/2] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 2020-07-28 1:27 a.m., Tianci Yin wrote:<br>
> From: "Tianci.Yin" <tianci.yin@amd.com><br>
> <br>
> On Navi1x, the SPM golden settings will be lost after GFXOFF enter/exit,<br>
<br>
" are lost "<br>
<br>
> reconfigure the golden settings after GFXOFF exit.<br>
<br>
" so reconfigure ..."<br>
<br>
> <br>
> Change-Id: I9358ba9c65f241c36f8a35916170b19535148ee9<br>
> Signed-off-by: Tianci.Yin <tianci.yin@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 11 +++++++++++<br>
> 1 file changed, 11 insertions(+)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
> index 55463e7a11e2..5da0436d41e0 100644<br>
> --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
> +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
> @@ -1309,6 +1309,7 @@ static int smu_enable_umd_pstate(void *handle,<br>
> <br>
> struct smu_context *smu = (struct smu_context*)(handle);<br>
> struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);<br>
> + struct amdgpu_device *adev = smu->adev;<br>
> <br>
> if (!smu->is_apu && !smu_dpm_ctx->dpm_context)<br>
> return -EINVAL;<br>
> @@ -1324,6 +1325,16 @@ static int smu_enable_umd_pstate(void *handle,<br>
> amdgpu_device_ip_set_clockgating_state(smu->adev,<br>
> AMD_IP_BLOCK_TYPE_GFX,<br>
> AMD_CG_STATE_UNGATE);<br>
> +<br>
> + if (adev->asic_type >= CHIP_NAVI10 &&<br>
> + adev->asic_type <= CHIP_NAVI12 &&<br>
> + (adev->pm.pp_feature & PP_GFXOFF_MASK)) {<br>
> + if (adev->gfx.funcs->init_spm_golden) {<br>
> + dev_dbg(adev->dev,"GFXOFF exited, re-init SPM golden settings\n");<br>
<br>
Space after comma is required.<br>
<br>
> + amdgpu_gfx_init_spm_golden(adev);<br>
> + } else<br>
> + dev_warn(adev->dev,"Callback init_spm_golden is NULL\n");<br>
<br>
Space after comma is required.<br>
<br>
Please add braces to the single statement of the "else". The reason for this<br>
is that it complements the braces of the "if ( ) {" of the multi-line statement<br>
and closes the block. "checkpatch" calls it "unbalanced braces".<br>
<br>
With these three fixed, this patch is<br>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com><br>
<br>
Regards,<br>
Luben<br>
<br>
> + }<br>
> }<br>
> } else {<br>
> /* exit umd pstate, restore level, enable gfx cg*/<br>
> <br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>