<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:#317100;margin:15pt;" align="Left">
[AMD Public Use]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Would it be better to put this code into amdgpu_gfx_off_ctrl()? Then we'll handle this in all cases where we disable gfx off.</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);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<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> Tianci Yin <tianci.yin@amd.com><br>
<b>Sent:</b> Tuesday, July 28, 2020 3:04 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Tuikov, Luben <Luben.Tuikov@amd.com>; 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>; Chen, Guchun <Guchun.Chen@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Yin, Tianci (Rico) <Tianci.Yin@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit(v2)</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: "Tianci.Yin" <tianci.yin@amd.com><br>
<br>
On Navi1x, the SPM golden settings will be lost after GFXOFF enter/exit,<br>
reconfigure the golden settings after GFXOFF exit.<br>
<br>
Change-Id: I9358ba9c65f241c36f8a35916170b19535148ee9<br>
Reviewed-by: Feifei Xu <Feifei Xu@amd.com><br>
Signed-off-by: Tianci.Yin <tianci.yin@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 19 +++++++++++++++----<br>
1 file changed, 15 insertions(+), 4 deletions(-)<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..41487123c207 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>
@@ -1318,12 +1319,22 @@ static int smu_enable_umd_pstate(void *handle,<br>
if (*level & profile_mode_mask) {<br>
smu_dpm_ctx->saved_dpm_level = smu_dpm_ctx->dpm_level;<br>
smu_dpm_ctx->enable_umd_pstate = true;<br>
- amdgpu_device_ip_set_powergating_state(smu->adev,<br>
+ amdgpu_device_ip_set_powergating_state(adev,<br>
AMD_IP_BLOCK_TYPE_GFX,<br>
AMD_PG_STATE_UNGATE);<br>
- amdgpu_device_ip_set_clockgating_state(smu->adev,<br>
+ amdgpu_device_ip_set_clockgating_state(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>
+ amdgpu_gfx_init_spm_golden(adev);<br>
+ } else<br>
+ dev_warn(adev->dev,"Callback init_spm_golden is NULL\n");<br>
+ }<br>
}<br>
} else {<br>
/* exit umd pstate, restore level, enable gfx cg*/<br>
@@ -1331,10 +1342,10 @@ static int smu_enable_umd_pstate(void *handle,<br>
if (*level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT)<br>
*level = smu_dpm_ctx->saved_dpm_level;<br>
smu_dpm_ctx->enable_umd_pstate = false;<br>
- amdgpu_device_ip_set_clockgating_state(smu->adev,<br>
+ amdgpu_device_ip_set_clockgating_state(adev,<br>
AMD_IP_BLOCK_TYPE_GFX,<br>
AMD_CG_STATE_GATE);<br>
- amdgpu_device_ip_set_powergating_state(smu->adev,<br>
+ amdgpu_device_ip_set_powergating_state(adev,<br>
AMD_IP_BLOCK_TYPE_GFX,<br>
AMD_PG_STATE_GATE);<br>
}<br>
-- <br>
2.17.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>