drm/radeon: handle runtime pm in drm pre/post close
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 31 Aug 2016 21:23:31 +0000 (17:23 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 2 Sep 2016 14:34:49 +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/radeon/radeon_kms.c

index 0aa8eacd77cabef74d40a3044f2ab02a4ca99291..4388ddeec8d243928cbff7ecedbdfd5a78f80023 100644 (file)
@@ -718,6 +718,8 @@ void radeon_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);
 }
 
 /**
@@ -734,6 +736,8 @@ void radeon_driver_preclose_kms(struct drm_device *dev,
 {
        struct radeon_device *rdev = dev->dev_private;
 
+       pm_runtime_get_sync(dev->dev);
+
        mutex_lock(&rdev->gem.mutex);
        if (rdev->hyperz_filp == file_priv)
                rdev->hyperz_filp = NULL;