drm/nouveau: restore cursors after restoring mode
authorMaxim Levitsky <maximlevitsky@gmail.com>
Sun, 9 Oct 2011 20:58:34 +0000 (22:58 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 21 Dec 2011 09:01:18 +0000 (19:01 +1000)
PDISP doesn't like it when disabled CRTCs are poked.

Fixes external output not coming to life when it has cursor on.
https://bugs.freedesktop.org/show_bug.cgi?id=41608

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_drv.c

index 1e1b4a47b700ac71caa988c0a6069b8681ea2b71..c033a0a4f2b219e2c06c5b4bfb638f305bf08fb2 100644 (file)
@@ -362,15 +362,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
 
        engine->display.init(dev);
 
-       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
-               struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
-               u32 offset = nv_crtc->cursor.nvbo->bo.offset;
-
-               nv_crtc->cursor.set_offset(nv_crtc, offset);
-               nv_crtc->cursor.set_pos(nv_crtc, nv_crtc->cursor_saved_x,
-                                                nv_crtc->cursor_saved_y);
-       }
-
        /* Force CLUT to get re-loaded during modeset */
        list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
                struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
@@ -386,6 +377,15 @@ nouveau_pci_resume(struct pci_dev *pdev)
 
        drm_helper_resume_force_mode(dev);
 
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+               struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
+               u32 offset = nv_crtc->cursor.nvbo->bo.offset;
+
+               nv_crtc->cursor.set_offset(nv_crtc, offset);
+               nv_crtc->cursor.set_pos(nv_crtc, nv_crtc->cursor_saved_x,
+                                                nv_crtc->cursor_saved_y);
+       }
+
        nouveau_fbcon_restore_accel(dev);
        drm_kms_helper_poll_enable(dev);
        return 0;