drm/amdgpu: Use atomic function to disable crtcs with dc enabled
authorMikita Lipski <mikita.lipski@amd.com>
Wed, 14 Mar 2018 17:41:29 +0000 (13:41 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Mar 2018 04:43:42 +0000 (23:43 -0500)
This change fixes the deadlock when unloading the driver with displays
connected.

Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index beabb90e595af5b02a1f7c1e4350293a4715b147..cdf7a6cde60330773db452cd7f2a621e2c328ac4 100644 (file)
@@ -2446,9 +2446,12 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
 
        DRM_INFO("amdgpu: finishing device.\n");
        adev->shutdown = true;
-       if (adev->mode_info.mode_config_initialized)
-               drm_crtc_force_disable_all(adev->ddev);
-
+       if (adev->mode_info.mode_config_initialized){
+               if (!amdgpu_device_has_dc_support(adev))
+                       drm_crtc_force_disable_all(adev->ddev);
+               else
+                       drm_atomic_helper_shutdown(adev->ddev);
+       }
        amdgpu_ib_pool_fini(adev);
        amdgpu_fence_driver_fini(adev);
        amdgpu_pm_sysfs_fini(adev);