drm/amdgpu: handle runtime pm in drm pre/post close
authorAlex Deucher <alexander.deucher@amd.com>
Sat, 27 Aug 2016 16:27:24 +0000 (12:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 2 Sep 2016 14:34:48 +0000 (10:34 -0400)
Close was not handled correctly.

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

index cc4ae11033328c7e985f48315fdbaeb482e89cf2..c2c7fb140338061f77cc3d2560e2f99f46e37346 100644 (file)
@@ -601,6 +601,9 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
 
        kfree(fpriv);
        file_priv->driver_priv = NULL;
+
+       pm_runtime_mark_last_busy(dev->dev);
+       pm_runtime_put_autosuspend(dev->dev);
 }
 
 /**
@@ -615,6 +618,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
 void amdgpu_driver_preclose_kms(struct drm_device *dev,
                                struct drm_file *file_priv)
 {
+       pm_runtime_get_sync(dev->dev);
 }
 
 /*