[PATCH] drm: don't warn unconditionally in drm_vblank_cleanup about enabled vblanks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On drivers without immediate vblank disabling drm_vblank_cleanup() may be
called before the delayed vblank disable timer has fired. Instead of spitting
out a warning unconditionally in this case, run the vblank disable function
immediately.

Only warn if vblanks are still enabled and there was no timer pending to
disable them.

Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
---
 drivers/gpu/drm/drm_irq.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 77f357b2c386..e6eb5024341d 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -335,10 +335,15 @@ void drm_vblank_cleanup(struct drm_device *dev)
 	for (pipe = 0; pipe < dev->num_crtcs; pipe++) {
 		struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
-		WARN_ON(vblank->enabled &&
-			drm_core_check_feature(dev, DRIVER_MODESET));
-
-		del_timer_sync(&vblank->disable_timer);
+		if (del_timer_sync(&vblank->disable_timer))
+			/*
+			 * If we deactivated a pending timer, make sure to
+			 * disable the vblank now.
+			 */
+			vblank_disable_fn((unsigned long)vblank);
+		else
+			WARN_ON(vblank->enabled &&
+				drm_core_check_feature(dev, DRIVER_MODESET));
 	}
 
 	kfree(dev->vblank);
-- 
2.8.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux