<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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Series is:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Evan Quan <evan.quan@amd.com><br>
<b>Sent:</b> Thursday, April 25, 2019 3:52 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Deucher, Alexander; Quan, Evan; Liu, Leo<br>
<b>Subject:</b> [PATCH 2/2] drm/amdgpu: power down the Vega20 VCE engine on request</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Power down the engine also along with disabling its DPM<br>
functionality.<br>
<br>
Change-Id: Ia0940b40d01da84269621d8a914c923fbf1b7da4<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
---<br>
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 13 ++++++++++++-<br>
 1 file changed, 12 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c<br>
index 7534eb628803..eb7002401587 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c<br>
@@ -3490,7 +3490,18 @@ static void vega20_power_gate_vce(struct pp_hwmgr *hwmgr, bool bgate)<br>
                 return ;<br>
 <br>
         data->vce_power_gated = bgate;<br>
-       vega20_enable_disable_vce_dpm(hwmgr, !bgate);<br>
+       if (bgate) {<br>
+               vega20_enable_disable_vce_dpm(hwmgr, !bgate);<br>
+               amdgpu_device_ip_set_powergating_state(hwmgr->adev,<br>
+                                               AMD_IP_BLOCK_TYPE_VCE,<br>
+                                               AMD_PG_STATE_GATE);<br>
+       } else {<br>
+               amdgpu_device_ip_set_powergating_state(hwmgr->adev,<br>
+                                               AMD_IP_BLOCK_TYPE_VCE,<br>
+                                               AMD_PG_STATE_UNGATE);<br>
+               vega20_enable_disable_vce_dpm(hwmgr, !bgate);<br>
+       }<br>
+<br>
 }<br>
 <br>
 static void vega20_power_gate_uvd(struct pp_hwmgr *hwmgr, bool bgate)<br>
-- <br>
2.21.0<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></div>
</span></font></div>
</body>
</html>