OSDN Git Service

drm/amdgpu: no need to ungate uvd/vce clock when fini.
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 24 Nov 2016 13:44:44 +0000 (21:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Dec 2016 23:08:31 +0000 (18:08 -0500)
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index fc790e5..d907411 100644 (file)
@@ -1470,20 +1470,26 @@ static int amdgpu_fini(struct amdgpu_device *adev)
                        amdgpu_wb_fini(adev);
                        amdgpu_vram_scratch_fini(adev);
                }
-               /* ungate blocks before hw fini so that we can shutdown the blocks safely */
-               r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,
-                                                                            AMD_CG_STATE_UNGATE);
-               if (r) {
-                       DRM_ERROR("set_clockgating_state(ungate) of IP block <%s> failed %d\n",
-                                 adev->ip_blocks[i].version->funcs->name, r);
-                       return r;
+
+               if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
+                       adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) {
+                       /* ungate blocks before hw fini so that we can shutdown the blocks safely */
+                       r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,
+                                                                                    AMD_CG_STATE_UNGATE);
+                       if (r) {
+                               DRM_ERROR("set_clockgating_state(ungate) of IP block <%s> failed %d\n",
+                                         adev->ip_blocks[i].version->funcs->name, r);
+                               return r;
+                       }
                }
+
                r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
                /* XXX handle errors */
                if (r) {
                        DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
                                  adev->ip_blocks[i].version->funcs->name, r);
                }
+
                adev->ip_blocks[i].status.hw = false;
        }