Blob Blame History Raw
From: Shirish S <shirish.s@amd.com>
Date: Mon, 23 Jul 2018 15:11:51 +0530
Subject: drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 5f8181733f6e5f8a4447f844efe4bdab5ed6a30e
Patch-mainline: v4.19-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

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>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2701,6 +2701,9 @@ int amdgpu_device_suspend(struct drm_dev
 
 	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);
@@ -2766,9 +2769,6 @@ int amdgpu_device_suspend(struct drm_dev
 			DRM_ERROR("amdgpu asic reset failed\n");
 	}
 
-	if (fbcon)
-		amdgpu_fbdev_set_suspend(adev, 1);
-
 	return 0;
 }