diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 3e49342a20e6..0cc47f12d995 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -35,9 +35,9 @@ | |||
35 | #include <linux/pm_runtime.h> | 35 | #include <linux/pm_runtime.h> |
36 | 36 | ||
37 | #if defined(CONFIG_VGA_SWITCHEROO) | 37 | #if defined(CONFIG_VGA_SWITCHEROO) |
38 | bool radeon_is_px(void); | 38 | bool radeon_has_atpx(void); |
39 | #else | 39 | #else |
40 | static inline bool radeon_is_px(void) { return false; } | 40 | static inline bool radeon_has_atpx(void) { return false; } |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | /** | 43 | /** |
@@ -107,6 +107,11 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) | |||
107 | flags |= RADEON_IS_PCI; | 107 | flags |= RADEON_IS_PCI; |
108 | } | 108 | } |
109 | 109 | ||
110 | if ((radeon_runtime_pm != 0) && | ||
111 | radeon_has_atpx() && | ||
112 | ((flags & RADEON_IS_IGP) == 0)) | ||
113 | flags |= RADEON_IS_PX; | ||
114 | |||
110 | /* radeon_device_init should report only fatal error | 115 | /* radeon_device_init should report only fatal error |
111 | * like memory allocation failure or iomapping failure, | 116 | * like memory allocation failure or iomapping failure, |
112 | * or memory manager initialization failure, it must | 117 | * or memory manager initialization failure, it must |
@@ -137,8 +142,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) | |||
137 | "Error during ACPI methods call\n"); | 142 | "Error during ACPI methods call\n"); |
138 | } | 143 | } |
139 | 144 | ||
140 | if ((radeon_runtime_pm == 1) || | 145 | if (radeon_is_px(dev)) { |
141 | ((radeon_runtime_pm == -1) && radeon_is_px())) { | ||
142 | pm_runtime_use_autosuspend(dev->dev); | 146 | pm_runtime_use_autosuspend(dev->dev); |
143 | pm_runtime_set_autosuspend_delay(dev->dev, 5000); | 147 | pm_runtime_set_autosuspend_delay(dev->dev, 5000); |
144 | pm_runtime_set_active(dev->dev); | 148 | pm_runtime_set_active(dev->dev); |
@@ -568,12 +572,17 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) | |||
568 | } | 572 | } |
569 | 573 | ||
570 | r = radeon_vm_init(rdev, &fpriv->vm); | 574 | r = radeon_vm_init(rdev, &fpriv->vm); |
571 | if (r) | 575 | if (r) { |
576 | kfree(fpriv); | ||
572 | return r; | 577 | return r; |
578 | } | ||
573 | 579 | ||
574 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); | 580 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); |
575 | if (r) | 581 | if (r) { |
582 | radeon_vm_fini(rdev, &fpriv->vm); | ||
583 | kfree(fpriv); | ||
576 | return r; | 584 | return r; |
585 | } | ||
577 | 586 | ||
578 | /* map the ib pool buffer read only into | 587 | /* map the ib pool buffer read only into |
579 | * virtual address space */ | 588 | * virtual address space */ |