<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:50 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH 4/4] drm/amdgpu: Disable gfx off if VCN is busy</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">this patch is a workaround for the gpu hang<br>
at video end time if play video with gfx off enabled.<br>
<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 ++<br>
 1 file changed, 2 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c<br>
index 798648a..d68039f 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c<br>
@@ -214,6 +214,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)<br>
         fences += amdgpu_fence_count_emitted(&adev->vcn.ring_jpeg);<br>
 <br>
         if (fences == 0) {<br>
+               amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_VCN, true);<br>
                 if (adev->pm.dpm_enabled)<br>
                         amdgpu_dpm_enable_uvd(adev, false);<br>
                 else<br>
@@ -230,6 +231,7 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)<br>
         bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work);<br>
 <br>
         if (set_clocks) {<br>
+               amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_VCN, false);<br>
                 if (adev->pm.dpm_enabled)<br>
                         amdgpu_dpm_enable_uvd(adev, true);<br>
                 else<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>