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

Daniel Vetter daniel at ffwll.ch
Fri Aug 12 17:11:57 UTC 2016


On Fri, Aug 12, 2016 at 11:04:38AM +0200, Lucas Stach wrote:
> 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 at pengutronix.de>

I think this needs a Fixes: line + Cc: of the people who broke things?
-Daniel

> ---
>  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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list