drm/amdgpu: skip suspend/resume on DRM_SWITCH_POWER_DYNAMIC_OFF
authorAlex Deucher <alexander.deucher@amd.com>
Sat, 27 Aug 2016 16:57:20 +0000 (12:57 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 2 Sep 2016 14:34:45 +0000 (10:34 -0400)
Missed this case previously. No need to do anything if the
device is already off.  runtime pm will handle it.

Acked-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 c2459abb408dfa790e0ff4724371b6e9e20adab9..1aa0364d79617ac85c141a06d15eb8cb312e3791 100644 (file)
@@ -1839,7 +1839,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
 
        adev = dev->dev_private;
 
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF ||
+           dev->switch_power_state == DRM_SWITCH_POWER_DYNAMIC_OFF)
                return 0;
 
        drm_kms_helper_poll_disable(dev);
@@ -1920,7 +1921,8 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
        struct drm_crtc *crtc;
        int r;
 
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF ||
+           dev->switch_power_state == DRM_SWITCH_POWER_DYNAMIC_OFF)
                return 0;
 
        if (fbcon) {