summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_kms.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-03-08 15:12:48 +0100
committerAlex Deucher <alexander.deucher@amd.com>2017-03-29 23:53:33 -0400
commit78910246ddcf9359fbbad506f085ab83b39f876d (patch)
tree0137cb472489320c346ea7d7683877e3fcd39964 /drivers/gpu/drm/radeon/radeon_kms.c
parent82c6bd46bf8bc63a95e5b63b7d397812ee7e8b20 (diff)
downloadlinux-78910246ddcf9359fbbad506f085ab83b39f876d.tar.bz2
drm/radeon: Merge pre/postclose hooks
Again no apparent explanation for the split except hysterical raisins. Merging them also makes it a bit more obviuos what's going on wrt the runtime pm refdancing. Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c42
1 files changed, 14 insertions, 28 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 56f35c06742c..a32a62e03a44 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -691,13 +691,26 @@ out_suspend:
* @dev: drm dev pointer
* @file_priv: drm file
*
- * On device post close, tear down vm on cayman+ (all asics).
+ * On device close, tear down hyperz and cmask filps on r1xx-r5xx
+ * (all asics). And tear down vm on cayman+ (all asics).
*/
void radeon_driver_postclose_kms(struct drm_device *dev,
struct drm_file *file_priv)
{
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;
+ if (rdev->cmask_filp == file_priv)
+ rdev->cmask_filp = NULL;
+ mutex_unlock(&rdev->gem.mutex);
+
+ radeon_uvd_free_handles(rdev, file_priv);
+ radeon_vce_free_handles(rdev, file_priv);
+
/* new gpu have virtual address space support */
if (rdev->family >= CHIP_CAYMAN && file_priv->driver_priv) {
struct radeon_fpriv *fpriv = file_priv->driver_priv;
@@ -721,33 +734,6 @@ void radeon_driver_postclose_kms(struct drm_device *dev,
pm_runtime_put_autosuspend(dev->dev);
}
-/**
- * radeon_driver_preclose_kms - drm callback for pre close
- *
- * @dev: drm dev pointer
- * @file_priv: drm file
- *
- * On device pre close, tear down hyperz and cmask filps on r1xx-r5xx
- * (all asics).
- */
-void radeon_driver_preclose_kms(struct drm_device *dev,
- struct drm_file *file_priv)
-{
- 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;
- if (rdev->cmask_filp == file_priv)
- rdev->cmask_filp = NULL;
- mutex_unlock(&rdev->gem.mutex);
-
- radeon_uvd_free_handles(rdev, file_priv);
- radeon_vce_free_handles(rdev, file_priv);
-}
-
/*
* VBlank related functions.
*/