diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 89c484d8ac26..4ee702ac8907 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -866,13 +866,16 @@ static int nouveau_pmops_runtime_suspend(struct device *dev) | |||
866 | struct drm_device *drm_dev = pci_get_drvdata(pdev); | 866 | struct drm_device *drm_dev = pci_get_drvdata(pdev); |
867 | int ret; | 867 | int ret; |
868 | 868 | ||
869 | if (nouveau_runtime_pm == 0) | 869 | if (nouveau_runtime_pm == 0) { |
870 | return -EINVAL; | 870 | pm_runtime_forbid(dev); |
871 | return -EBUSY; | ||
872 | } | ||
871 | 873 | ||
872 | /* are we optimus enabled? */ | 874 | /* are we optimus enabled? */ |
873 | if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { | 875 | if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { |
874 | DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); | 876 | DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); |
875 | return -EINVAL; | 877 | pm_runtime_forbid(dev); |
878 | return -EBUSY; | ||
876 | } | 879 | } |
877 | 880 | ||
878 | nv_debug_level(SILENT); | 881 | nv_debug_level(SILENT); |
@@ -923,12 +926,15 @@ static int nouveau_pmops_runtime_idle(struct device *dev) | |||
923 | struct nouveau_drm *drm = nouveau_drm(drm_dev); | 926 | struct nouveau_drm *drm = nouveau_drm(drm_dev); |
924 | struct drm_crtc *crtc; | 927 | struct drm_crtc *crtc; |
925 | 928 | ||
926 | if (nouveau_runtime_pm == 0) | 929 | if (nouveau_runtime_pm == 0) { |
930 | pm_runtime_forbid(dev); | ||
927 | return -EBUSY; | 931 | return -EBUSY; |
932 | } | ||
928 | 933 | ||
929 | /* are we optimus enabled? */ | 934 | /* are we optimus enabled? */ |
930 | if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { | 935 | if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { |
931 | DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); | 936 | DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); |
937 | pm_runtime_forbid(dev); | ||
932 | return -EBUSY; | 938 | return -EBUSY; |
933 | } | 939 | } |
934 | 940 | ||