Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282623
b: refs/heads/master
c: cf41d53
h: refs/heads/master
i:
  282621: a4da2d9
  282619: 54bd915
  282615: 12e4356
  282607: fb65e9f
  282591: 770a13c
  282559: 6f9c302
  282495: d5d2e7a
  282367: 77eaa2a
  282111: 05dd57c
  281599: 76c2e7f
  280575: cd71a68
  278527: 60182f3
v: v3
  • Loading branch information
Ben Skeggs committed Dec 21, 2011
1 parent f3b9f4c commit 7b721a8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a44e4997c5fee8e1da1589ff57e0bd1c53f03ce
refs/heads/master: cf41d53bf5b95d77673b185cc3b20ae3257f79e2
22 changes: 6 additions & 16 deletions trunk/drivers/gpu/drm/nouveau/nouveau_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state)

drm_kms_helper_poll_disable(dev);

NV_INFO(dev, "Disabling fbcon acceleration...\n");
nouveau_fbcon_save_disable_accel(dev);
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 @@ -248,10 +248,6 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state)
pci_set_power_state(pdev, PCI_D3hot);
}

console_lock();
nouveau_fbcon_set_suspend(dev, 1);
console_unlock();
nouveau_fbcon_restore_accel(dev);
return 0;

out_abort:
Expand All @@ -277,8 +273,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
return 0;

nouveau_fbcon_save_disable_accel(dev);

NV_INFO(dev, "We're back, enabling device...\n");
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
Expand Down Expand Up @@ -360,7 +354,11 @@ 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);

engine->display.init(dev);
drm_kms_helper_poll_enable(dev);

/* Force CLUT to get re-loaded during modeset */
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
Expand All @@ -369,12 +367,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
nv_crtc->lut.depth = 0;
}

console_lock();
nouveau_fbcon_set_suspend(dev, 0);
console_unlock();

nouveau_fbcon_zfill_all(dev);

drm_helper_resume_force_mode(dev);

list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
Expand All @@ -386,8 +378,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
nv_crtc->cursor_saved_y);
}

nouveau_fbcon_restore_accel(dev);
drm_kms_helper_poll_enable(dev);
return 0;
}

Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/screen_info.h>
#include <linux/vga_switcheroo.h>
#include <linux/console.h>

#include "drmP.h"
#include "drm.h"
Expand Down Expand Up @@ -548,7 +549,13 @@ void nouveau_fbcon_restore_accel(struct drm_device *dev)
void nouveau_fbcon_set_suspend(struct drm_device *dev, int state)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
console_lock();
if (state == 0)
nouveau_fbcon_save_disable_accel(dev);
fb_set_suspend(dev_priv->nfbdev->helper.fbdev, state);
if (state == 1)
nouveau_fbcon_restore_accel(dev);
console_unlock();
}

void nouveau_fbcon_zfill_all(struct drm_device *dev)
Expand Down

0 comments on commit 7b721a8

Please sign in to comment.