Merge tag 'drm-intel-next-2015-02-27' of git://anongit.freedesktop.org/drm-intel...
[cascardo/linux.git] / drivers / gpu / drm / drm_irq.c
index 65a45ce..c8a3447 100644 (file)
@@ -185,8 +185,15 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc)
                return;
        }
 
-       dev->driver->disable_vblank(dev, crtc);
-       vblank->enabled = false;
+       /*
+        * Only disable vblank interrupts if they're enabled. This avoids
+        * calling the ->disable_vblank() operation in atomic context with the
+        * hardware potentially runtime suspended.
+        */
+       if (vblank->enabled) {
+               dev->driver->disable_vblank(dev, crtc);
+               vblank->enabled = false;
+       }
 
        /* No further vblank irq's will be processed after
         * this point. Get current hardware vblank count and
@@ -1049,7 +1056,7 @@ EXPORT_SYMBOL(drm_vblank_get);
  * Acquire a reference count on vblank events to avoid having them disabled
  * while in use.
  *
- * This is the native kms version of drm_vblank_off().
+ * This is the native kms version of drm_vblank_get().
  *
  * Returns:
  * Zero on success, nonzero on failure.