drm/radeon/runpm: don't runtime suspend non-PX cards
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 24 Jan 2014 19:59:42 +0000 (14:59 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Jan 2014 20:23:03 +0000 (15:23 -0500)
Prevent runtime suspend of non-PX GPUs.  Runtime suspend is
not what we want in those cases.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/radeon/radeon_drv.c

index 1235a78fbba15716d9987b3cb645120fca6bc30d..ec8c388eec176e8c36e343ff4182634d3708bc84 100644 (file)
@@ -405,6 +405,9 @@ static int radeon_pmops_runtime_suspend(struct device *dev)
        if (radeon_runtime_pm == 0)
                return -EINVAL;
 
+       if (radeon_runtime_pm == -1 && !radeon_is_px())
+               return -EINVAL;
+
        drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
        drm_kms_helper_poll_disable(drm_dev);
        vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF);
@@ -427,6 +430,9 @@ static int radeon_pmops_runtime_resume(struct device *dev)
        if (radeon_runtime_pm == 0)
                return -EINVAL;
 
+       if (radeon_runtime_pm == -1 && !radeon_is_px())
+               return -EINVAL;
+
        drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
 
        pci_set_power_state(pdev, PCI_D0);