[Intel-gfx] [PATCH 3/3] drm: Peek at the current counter/timestamp for vblank queries

Chris Wilson chris at chris-wilson.co.uk
Wed Mar 15 21:44:51 UTC 2017


On Wed, Mar 15, 2017 at 11:06:32PM +0200, Ville Syrjälä wrote:
> > @@ -1608,6 +1619,21 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
> >  
> >  	vblank = &dev->vblank[pipe];
> >  
> > +	/* If the counter is currently enabled and accurate, short-circuit queries
> > +	 * to return the cached timestamp of the last vblank.
> > +	 */
> > +	if (dev->vblank_disable_immediate &&
> > +	    drm_wait_vblank_is_query(vblwait) &&
> > +	    vblank->enabled) {
> 
> Hmm. I'm wondering if this could give us something stale if we're just
> about to enable the vblank interrupt.
> 
> We seem to set enabled=true before we update the count/ts. So I'm 
> thinking we'd need to flip those around and make sure proper barriers
> are in place.

Yes, that is a valid concern.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list