aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-03-02 11:47:29 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-03-09 13:03:19 -0500
commite64c952efb8e0c15ae82cec8e455ab4910690ef1 (patch)
tree02c5e48e7925e0cf8ff6e307279ef56d756a820f
parent92821c261d1f0ca250b7cff4e4bbcc58d8530f90 (diff)
drm/radeon: disable runtime pm on PX laptops without dGPU power control
Some PX laptops don't provide an ACPI method to control dGPU power. On those systems, the driver is responsible for handling the dGPU power state. Disable runtime PM on them until support for this is implemented. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
-rw-r--r--drivers/gpu/drm/radeon/radeon_atpx_handler.c8
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c8
2 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
index 56482e35d43e..fd8c4d317e60 100644
--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
@@ -62,6 +62,10 @@ bool radeon_has_atpx(void) {
62 return radeon_atpx_priv.atpx_detected; 62 return radeon_atpx_priv.atpx_detected;
63} 63}
64 64
65bool radeon_has_atpx_dgpu_power_cntl(void) {
66 return radeon_atpx_priv.atpx.functions.power_cntl;
67}
68
65/** 69/**
66 * radeon_atpx_call - call an ATPX method 70 * radeon_atpx_call - call an ATPX method
67 * 71 *
@@ -141,10 +145,6 @@ static void radeon_atpx_parse_functions(struct radeon_atpx_functions *f, u32 mas
141 */ 145 */
142static int radeon_atpx_validate(struct radeon_atpx *atpx) 146static int radeon_atpx_validate(struct radeon_atpx *atpx)
143{ 147{
144 /* make sure required functions are enabled */
145 /* dGPU power control is required */
146 atpx->functions.power_cntl = true;
147
148 if (atpx->functions.px_params) { 148 if (atpx->functions.px_params) {
149 union acpi_object *info; 149 union acpi_object *info;
150 struct atpx_px_params output; 150 struct atpx_px_params output;
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 902b59cebac5..4de23ae3a64b 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -103,6 +103,12 @@ static const char radeon_family_name[][16] = {
103 "LAST", 103 "LAST",
104}; 104};
105 105
106#if defined(CONFIG_VGA_SWITCHEROO)
107bool radeon_has_atpx_dgpu_power_cntl(void);
108#else
109static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
110#endif
111
106#define RADEON_PX_QUIRK_DISABLE_PX (1 << 0) 112#define RADEON_PX_QUIRK_DISABLE_PX (1 << 0)
107#define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1) 113#define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)
108 114
@@ -1433,7 +1439,7 @@ int radeon_device_init(struct radeon_device *rdev,
1433 * ignore it */ 1439 * ignore it */
1434 vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode); 1440 vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode);
1435 1441
1436 if (rdev->flags & RADEON_IS_PX) 1442 if ((rdev->flags & RADEON_IS_PX) && radeon_has_atpx_dgpu_power_cntl())
1437 runtime = true; 1443 runtime = true;
1438 vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime); 1444 vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime);
1439 if (runtime) 1445 if (runtime)