diff options
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 2aecd6dc2610..66ed3ea71440 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) | ||
| 38 | bool radeon_is_px(void); | ||
| 39 | #else | ||
| 40 | static 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); |
