[AMD Public Use]

Please check one comment inline.

Regards,
Guchun

-----Original Message-----
From: Tianci Yin <tianci....@amd.com> 
Sent: Friday, August 7, 2020 10:37 AM
To: amd-gfx@lists.freedesktop.org
Cc: Tuikov, Luben <luben.tui...@amd.com>; Deucher, Alexander 
<alexander.deuc...@amd.com>; Zhang, Hawking <hawking.zh...@amd.com>; Xu, Feifei 
<feifei...@amd.com>; Hesik, Christopher <christopher.he...@amd.com>; Swamy, 
Manjunatha <manjunatha.sw...@amd.com>; Quan, Evan <evan.q...@amd.com>; Chen, 
Guchun <guchun.c...@amd.com>; Feng, Kenneth <kenneth.f...@amd.com>; Yin, Tianci 
(Rico) <tianci....@amd.com>
Subject: [PATCH 2/2] drm/amdgpu: reconfigure spm golden settings on Navi1x 
after GFXOFF exit(v3)

From: "Tianci.Yin" <tianci....@amd.com>

On Navi1x, the SPM golden settings are lost after GFXOFF enter/exit, so 
reconfigure the golden settings after GFXOFF exit.

Change-Id: I9358ba9c65f241c36f8a35916170b19535148ee9
Signed-off-by: Tianci.Yin <tianci....@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 8eff0173360d..9e133fd0372d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -571,8 +571,14 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool 
enable)
        if (enable && !adev->gfx.gfx_off_state && !adev->gfx.gfx_off_req_count) 
{
                schedule_delayed_work(&adev->gfx.gfx_off_delay_work, 
GFX_OFF_DELAY_ENABLE);
        } else if (!enable && adev->gfx.gfx_off_state) {
-               if (!amdgpu_dpm_set_powergating_by_smu(adev, 
AMD_IP_BLOCK_TYPE_GFX, false))
+               if (!amdgpu_dpm_set_powergating_by_smu(adev, 
AMD_IP_BLOCK_TYPE_GFX, 
+false)) {
                        adev->gfx.gfx_off_state = false;
+
+                       if (adev->gfx.funcs->init_spm_golden) {
+                               dev_dbg(adev->dev, "GFXOFF is disabled, re-init 
SPM golden settings\n");
+                               amdgpu_gfx_init_spm_golden(adev);
[Guchun] Since we have the function pointer check, why here we use another 
function for execution? init_spm_golden is one guard to indicate spm 
availability on navi1x ASICs?

+                       }
+               }
        }
 
        mutex_unlock(&adev->gfx.gfx_off_mutex);
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to