drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up
authorShirish S <shirish.s@amd.com>
Mon, 23 Jul 2018 09:41:51 +0000 (15:11 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 24 Jul 2018 20:14:54 +0000 (15:14 -0500)
This patch moves amdgpu_fbdev_set_suspend() to the beginning
of suspend sequence.

This is to ensure fbcon does not to write to the VRAM
after GPU is powerd down.

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 61981d0701b51bd3e5297b90ed98ddaca51fbbcd..ec53d8f96d063967c7cefbb298ce891e00e567ad 100644 (file)
@@ -2702,6 +2702,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
 
        drm_kms_helper_poll_disable(dev);
 
+       if (fbcon)
+               amdgpu_fbdev_set_suspend(adev, 1);
+
        if (!amdgpu_device_has_dc_support(adev)) {
                /* turn off display hw */
                drm_modeset_lock_all(dev);
@@ -2767,9 +2770,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
                        DRM_ERROR("amdgpu asic reset failed\n");
        }
 
-       if (fbcon)
-               amdgpu_fbdev_set_suspend(adev, 1);
-
        return 0;
 }