aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 61ab94799660..7147b87c5e5d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -510,13 +510,13 @@ nouveau_drm_remove(struct pci_dev *pdev)
510} 510}
511 511
512static int 512static int
513nouveau_do_suspend(struct drm_device *dev) 513nouveau_do_suspend(struct drm_device *dev, bool runtime)
514{ 514{
515 struct nouveau_drm *drm = nouveau_drm(dev); 515 struct nouveau_drm *drm = nouveau_drm(dev);
516 struct nouveau_cli *cli; 516 struct nouveau_cli *cli;
517 int ret; 517 int ret;
518 518
519 if (dev->mode_config.num_crtc) { 519 if (dev->mode_config.num_crtc && !runtime) {
520 NV_INFO(drm, "suspending display...\n"); 520 NV_INFO(drm, "suspending display...\n");
521 ret = nouveau_display_suspend(dev); 521 ret = nouveau_display_suspend(dev);
522 if (ret) 522 if (ret)
@@ -590,7 +590,7 @@ int nouveau_pmops_suspend(struct device *dev)
590 if (drm_dev->mode_config.num_crtc) 590 if (drm_dev->mode_config.num_crtc)
591 nouveau_fbcon_set_suspend(drm_dev, 1); 591 nouveau_fbcon_set_suspend(drm_dev, 1);
592 592
593 ret = nouveau_do_suspend(drm_dev); 593 ret = nouveau_do_suspend(drm_dev, false);
594 if (ret) 594 if (ret)
595 return ret; 595 return ret;
596 596
@@ -670,7 +670,7 @@ static int nouveau_pmops_freeze(struct device *dev)
670 if (drm_dev->mode_config.num_crtc) 670 if (drm_dev->mode_config.num_crtc)
671 nouveau_fbcon_set_suspend(drm_dev, 1); 671 nouveau_fbcon_set_suspend(drm_dev, 1);
672 672
673 ret = nouveau_do_suspend(drm_dev); 673 ret = nouveau_do_suspend(drm_dev, false);
674 return ret; 674 return ret;
675} 675}
676 676
@@ -904,7 +904,7 @@ static int nouveau_pmops_runtime_suspend(struct device *dev)
904 drm_kms_helper_poll_disable(drm_dev); 904 drm_kms_helper_poll_disable(drm_dev);
905 vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); 905 vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF);
906 nouveau_switcheroo_optimus_dsm(); 906 nouveau_switcheroo_optimus_dsm();
907 ret = nouveau_do_suspend(drm_dev); 907 ret = nouveau_do_suspend(drm_dev, true);
908 pci_save_state(pdev); 908 pci_save_state(pdev);
909 pci_disable_device(pdev); 909 pci_disable_device(pdev);
910 pci_set_power_state(pdev, PCI_D3cold); 910 pci_set_power_state(pdev, PCI_D3cold);
@@ -930,8 +930,6 @@ static int nouveau_pmops_runtime_resume(struct device *dev)
930 pci_set_master(pdev); 930 pci_set_master(pdev);
931 931
932 ret = nouveau_do_resume(drm_dev); 932 ret = nouveau_do_resume(drm_dev);
933 if (drm_dev->mode_config.num_crtc)
934 nouveau_display_resume(drm_dev);
935 drm_kms_helper_poll_enable(drm_dev); 933 drm_kms_helper_poll_enable(drm_dev);
936 /* do magic */ 934 /* do magic */
937 nv_mask(device, 0x88488, (1 << 25), (1 << 25)); 935 nv_mask(device, 0x88488, (1 << 25), (1 << 25));