drm/amdgpu: Disable gfx off if VCN is busy
authorRex Zhu <Rex.Zhu@amd.com>
Fri, 27 Jul 2018 09:00:02 +0000 (17:00 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:09:53 +0000 (11:09 -0500)
this patch is a workaround for the gpu hang
at video begin/end time if gfx off is enabled.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

index fd654a4406db964da6611f6c2d3d9db1fb283519..76e59a6e8311c2fa98a21b925e7baf451927ec1d 100644 (file)
@@ -217,6 +217,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
        fences += amdgpu_fence_count_emitted(&adev->vcn.ring_jpeg);
 
        if (fences == 0) {
+               amdgpu_gfx_off_ctrl(adev, true);
                if (adev->pm.dpm_enabled)
                        amdgpu_dpm_enable_uvd(adev, false);
                else
@@ -233,6 +234,7 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
        bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work);
 
        if (set_clocks) {
+               amdgpu_gfx_off_ctrl(adev, false);
                if (adev->pm.dpm_enabled)
                        amdgpu_dpm_enable_uvd(adev, true);
                else