drm/radeon: handle runtime pm in drm pre/post close

Close was not handled correctly.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Alex Deucher 2016-08-31 17:23:31 -04:00
parent d6bda7b4b4
commit 9b96b63fed
1 changed files with 4 additions and 0 deletions

View File

@ -718,6 +718,8 @@ void radeon_driver_postclose_kms(struct drm_device *dev,
kfree(fpriv); kfree(fpriv);
file_priv->driver_priv = NULL; 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; struct radeon_device *rdev = dev->dev_private;
pm_runtime_get_sync(dev->dev);
mutex_lock(&rdev->gem.mutex); mutex_lock(&rdev->gem.mutex);
if (rdev->hyperz_filp == file_priv) if (rdev->hyperz_filp == file_priv)
rdev->hyperz_filp = NULL; rdev->hyperz_filp = NULL;