From: Shirish S Date: Mon, 23 Jul 2018 09:41:51 +0000 (+0530) Subject: drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up X-Git-Tag: v4.19~298^2~21^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f8181733f6e5f8a4447f844efe4bdab5ed6a30e;p=platform%2Fkernel%2Flinux-rpi.git drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up 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 Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 61981d0..ec53d8f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -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; }