aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_kms.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 56f35c06742c..4761f27f2ca2 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -115,7 +115,8 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
if ((radeon_runtime_pm != 0) &&
radeon_has_atpx() &&
- ((flags & RADEON_IS_IGP) == 0))
+ ((flags & RADEON_IS_IGP) == 0) &&
+ !pci_is_thunderbolt_attached(dev->pdev))
flags |= RADEON_IS_PX;
/* radeon_device_init should report only fatal error
@@ -691,13 +692,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 +735,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.
*/