<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"><span>Reviewed-by: Evan Quan <evan.quan@amd.com></span><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 Rex Zhu <rex.zhu@amd.com><br>
<b>Sent:</b> Sunday, July 29, 2018 7:35:49 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH 3/4] drm/amdgpu: gfx ip ctrl gfx off via amdgpu_gfx_off_ctrl</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">use amdgpu_gfx_off_ctrl function so driver can arbitrate<br>
whether the gfx ip can be power off or power on.<br>
<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++----<br>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 6 ++----<br>
2 files changed, 4 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index 9f8e267..d861bfc 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -1828,8 +1828,7 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)<br>
adev->ip_blocks[i].version->funcs->name, r);<br>
return r;<br>
}<br>
- if (adev->powerplay.pp_funcs->set_powergating_by_smu)<br>
- amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, false);<br>
+ amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_GFX, false);<br>
r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);<br>
/* XXX handle errors */<br>
if (r) {<br>
@@ -2013,8 +2012,7 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)<br>
}<br>
<br>
/* call smu to disable gfx off feature first when suspend */<br>
- if (adev->powerplay.pp_funcs->set_powergating_by_smu)<br>
- amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, false);<br>
+ amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_GFX, false);<br>
<br>
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {<br>
if (!adev->ip_blocks[i].status.valid)<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
index ef00d14..c3d8030 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
@@ -3783,13 +3783,11 @@ static int gfx_v9_0_set_powergating_state(void *handle,<br>
gfx_v9_0_update_gfx_mg_power_gating(adev, enable);<br>
<br>
/* set gfx off through smu */<br>
- if (enable && adev->powerplay.pp_funcs->set_powergating_by_smu)<br>
- amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, true);<br>
+ amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_GFX, true);<br>
break;<br>
case CHIP_VEGA12:<br>
/* set gfx off through smu */<br>
- if (enable && adev->powerplay.pp_funcs->set_powergating_by_smu)<br>
- amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, true);<br>
+ amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_GFX, true);<br>
break;<br>
default:<br>
break;<br>
-- <br>
1.9.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>