]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/radeon: disable runtime pm on PX laptops without dGPU power control
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Mar 2016 16:47:29 +0000 (11:47 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 18 Apr 2016 12:49:26 +0000 (08:49 -0400)
[ Upstream commit e64c952efb8e0c15ae82cec8e455ab4910690ef1 ]

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
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/gpu/drm/radeon/radeon_atpx_handler.c
drivers/gpu/drm/radeon/radeon_device.c

index 8bc7d0bbd3c80a94529cea79bf4f078d7951a87a..1523cf94bcdc6d151b4cf67c40ea5339f62464c1 100644 (file)
@@ -62,6 +62,10 @@ bool radeon_has_atpx(void) {
        return radeon_atpx_priv.atpx_detected;
 }
 
+bool radeon_has_atpx_dgpu_power_cntl(void) {
+       return radeon_atpx_priv.atpx.functions.power_cntl;
+}
+
 /**
  * radeon_atpx_call - call an ATPX method
  *
@@ -141,10 +145,6 @@ static void radeon_atpx_parse_functions(struct radeon_atpx_functions *f, u32 mas
  */
 static int radeon_atpx_validate(struct radeon_atpx *atpx)
 {
-       /* make sure required functions are enabled */
-       /* dGPU power control is required */
-       atpx->functions.power_cntl = true;
-
        if (atpx->functions.px_params) {
                union acpi_object *info;
                struct atpx_px_params output;
index 5d54ab0fbe2bdfd50262de4a2c8101c66c825231..eb5f88aa76abd6cae30b65269179b8d150d49bcd 100644 (file)
@@ -103,6 +103,12 @@ static const char radeon_family_name[][16] = {
        "LAST",
 };
 
+#if defined(CONFIG_VGA_SWITCHEROO)
+bool radeon_has_atpx_dgpu_power_cntl(void);
+#else
+static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
+#endif
+
 #define RADEON_PX_QUIRK_DISABLE_PX  (1 << 0)
 #define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)
 
@@ -1395,7 +1401,7 @@ int radeon_device_init(struct radeon_device *rdev,
         * ignore it */
        vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode);
 
-       if (rdev->flags & RADEON_IS_PX)
+       if ((rdev->flags & RADEON_IS_PX) && radeon_has_atpx_dgpu_power_cntl())
                runtime = true;
        vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime);
        if (runtime)