]> git.hungrycats.org Git - linux/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 21:55:39 +0000 (13:55 -0800)
commit 9babd35ad72af631547c7ca294bc2e931cc40e58 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/radeon_drv.c

index db39ea36bf22fc396da63e5a157adf42e752e712..5fa8196c03e3ad7a4c184a767892fb1097faf735 100644 (file)
@@ -400,6 +400,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);
@@ -422,6 +425,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);