[PATCH 14/9] drm: Kick start vblank interrupts at drm_vblank_on()

Matt Roper matthew.d.roper at intel.com
Fri Jun 20 11:29:01 PDT 2014


On Mon, Jun 02, 2014 at 11:15:51AM +0300, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> If the user is interested in getting accurate vblank sequence
> numbers all the time they may disable the vblank disable timer
> entirely. In that case it seems appropriate to kick start the
> vblank interrupts already from drm_vblank_on().
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/drm_irq.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 82a039a..6376d96 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -1126,9 +1126,12 @@ void drm_vblank_on(struct drm_device *dev, int crtc)
>  	vblank->last =
>  		(dev->driver->get_vblank_counter(dev, crtc) - 1) &
>  		dev->max_vblank_count;
> -
> -	/* re-enable interrupts if there's are users left */
> -	if (atomic_read(&vblank->refcount) != 0)
> +	/*
> +	 * re-enable interrupts if there are users left, or the
> +	 * user wishes vblank interrupts to be enabled all the time.
> +	 */
> +	if (atomic_read(&vblank->refcount) != 0 ||
> +	    (!dev->vblank_disable_immediate && drm_vblank_offdelay < 0))

As noted on patch 10, wouldn't it make sense for the user-provided
module parameter override the driver ability to disable immediately in
this case where they've specifically asked for "never disable?"

Otherwise, patches 12-14 are 

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

>  		WARN_ON(drm_vblank_enable(dev, crtc));
>  	spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
>  }
> -- 
> 1.8.5.5
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795


More information about the dri-devel mailing list