Skip to contentSkip to conversation

drm/amdgpu: Use atomic function to disable crtcs with dc enabled

PATCH In review [email protected] 2 participants 2 messages Mar 14, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Use atomic function to disable crtcs with dc enabled

From: Mikita Lipski <[email protected]>

This change fixes the deadlock when unloading the driver with displays connected.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -3
index 65584f6..b4911911 100644
@@ -2081,9 +2081,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_fbdev_fini(adev);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1521049901-481-1-git-send-email-mikita.lipski-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Andrey

Quoted 20 lines · On 03/14/2018 01:51 PM, [email protected] wrote:

From: Mikita Lipski <[email protected]>

This change fixes the deadlock when unloading the driver with displays connected.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
index 65584f6..b4911911 100644
@@ -2081,9 +2081,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);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c void amdgpu_device_fini(struct amdgpu_device *adev) · line 2092

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -1
-
+	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_fbdev_fini(adev);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx