drm/nv04/disp: disable vblank interrupts when disabling display
authorBen Skeggs <bskeggs@redhat.com>
Tue, 22 Nov 2011 03:59:30 +0000 (13:59 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 24 May 2012 06:32:01 +0000 (16:32 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_hw.c
drivers/gpu/drm/nouveau/nv04_display.c

index ba896e54b799bfd43b92291358234197c4cd56b3..b87ad3bd7739cb9a0ad69ec01730761ed9708638 100644 (file)
@@ -1018,11 +1018,6 @@ nv_load_state_ext(struct drm_device *dev, int head,
        }
 
        NVWriteCRTC(dev, head, NV_PCRTC_START, regp->fb_start);
-
-       /* Enable vblank interrupts. */
-       NVWriteCRTC(dev, head, NV_PCRTC_INTR_EN_0,
-                   (dev->vblank_enabled[head] ? 1 : 0));
-       NVWriteCRTC(dev, head, NV_PCRTC_INTR_0, NV_PCRTC_INTR_0_VBLANK);
 }
 
 static void
index 7047d37e8dab4634d4a016de9126a140641e4ddf..44488e3a257d409ec05474192a11e866340a01ea 100644 (file)
@@ -98,6 +98,13 @@ nv04_display_early_init(struct drm_device *dev)
                NVSetOwner(dev, 0);
        }
 
+       /* ensure vblank interrupts are off, they can't be enabled until
+        * drm_vblank has been initialised
+        */
+       NVWriteCRTC(dev, 0, NV_PCRTC_INTR_EN_0, 0);
+       if (nv_two_heads(dev))
+               NVWriteCRTC(dev, 1, NV_PCRTC_INTR_EN_0, 0);
+
        return 0;
 }
 
@@ -246,6 +253,10 @@ nv04_display_init(struct drm_device *dev)
 void
 nv04_display_fini(struct drm_device *dev)
 {
+       /* disable vblank interrupts */
+       NVWriteCRTC(dev, 0, NV_PCRTC_INTR_EN_0, 0);
+       if (nv_two_heads(dev))
+               NVWriteCRTC(dev, 1, NV_PCRTC_INTR_EN_0, 0);
 }
 
 static void