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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 37b1deacb5b1..6f1dfac17507 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -33,6 +33,13 @@
33#include <linux/vga_switcheroo.h> 33#include <linux/vga_switcheroo.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/pm_runtime.h> 35#include <linux/pm_runtime.h>
36
37#if defined(CONFIG_VGA_SWITCHEROO)
38bool radeon_is_px(void);
39#else
40static inline bool radeon_is_px(void) { return false; }
41#endif
42
36/** 43/**
37 * radeon_driver_unload_kms - Main unload function for KMS. 44 * radeon_driver_unload_kms - Main unload function for KMS.
38 * 45 *
@@ -130,7 +137,8 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
130 "Error during ACPI methods call\n"); 137 "Error during ACPI methods call\n");
131 } 138 }
132 139
133 if (radeon_runtime_pm != 0) { 140 if ((radeon_runtime_pm == 1) ||
141 ((radeon_runtime_pm == -1) && radeon_is_px())) {
134 pm_runtime_use_autosuspend(dev->dev); 142 pm_runtime_use_autosuspend(dev->dev);
135 pm_runtime_set_autosuspend_delay(dev->dev, 5000); 143 pm_runtime_set_autosuspend_delay(dev->dev, 5000);
136 pm_runtime_set_active(dev->dev); 144 pm_runtime_set_active(dev->dev);
@@ -567,6 +575,10 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
567 if (r) 575 if (r)
568 return r; 576 return r;
569 577
578 r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
579 if (r)
580 return r;
581
570 /* map the ib pool buffer read only into 582 /* map the ib pool buffer read only into
571 * virtual address space */ 583 * virtual address space */
572 bo_va = radeon_vm_bo_add(rdev, &fpriv->vm, 584 bo_va = radeon_vm_bo_add(rdev, &fpriv->vm,