Skip to content

Commit

Permalink
drm/nouveau: fix suspend/resume when in headless mode
Browse files Browse the repository at this point in the history
Backport of fixes from upstream commit:
9430738

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ben Skeggs authored and Greg Kroah-Hartman committed Nov 5, 2012
1 parent 783250d commit 83dc215
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions drivers/gpu/drm/nouveau/nouveau_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state)
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
return 0;

NV_INFO(dev, "Disabling display...\n");
nouveau_display_fini(dev);
if (dev->mode_config.num_crtc) {
NV_INFO(dev, "Disabling display...\n");
nouveau_display_fini(dev);

NV_INFO(dev, "Disabling fbcon...\n");
nouveau_fbcon_set_suspend(dev, 1);
NV_INFO(dev, "Disabling fbcon...\n");
nouveau_fbcon_set_suspend(dev, 1);
}

NV_INFO(dev, "Unpinning framebuffer(s)...\n");
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
Expand Down Expand Up @@ -359,10 +361,12 @@ nouveau_pci_resume(struct pci_dev *pdev)
NV_ERROR(dev, "Could not pin/map cursor.\n");
}

nouveau_fbcon_set_suspend(dev, 0);
nouveau_fbcon_zfill_all(dev);
if (dev->mode_config.num_crtc) {
nouveau_fbcon_set_suspend(dev, 0);
nouveau_fbcon_zfill_all(dev);

nouveau_display_init(dev);
nouveau_display_init(dev);
}

/* Force CLUT to get re-loaded during modeset */
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
Expand Down

0 comments on commit 83dc215

Please sign in to comment.