[Intel-gfx] [PATCH 11/11] drm: Fix vblank timestamp races

Daniel Vetter daniel at ffwll.ch
Tue Sep 22 04:31:09 PDT 2015


On Tue, Sep 22, 2015 at 01:15:01PM +0200, Maarten Lankhorst wrote:
> Op 22-09-15 om 11:10 schreef Daniel Vetter:
> > On Mon, Sep 14, 2015 at 10:43:52PM +0300, ville.syrjala at linux.intel.com wrote:
> >> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >>
> >> The vblank timestamp ringbuffer only has two entries, so if the
> >> vblank->count is incremented by an even number readers may end up seeing
> >> the new vblank timestamp alongside the old vblank counter value.
> >>
> >> Fix the problem by storing the vblank counter in a ringbuffer as well,
> >> and always increment the ringbuffer "slot" by one when storing a new
> >> timestamp+counter pair.
> >>
> >> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Imo if we bother with this we might as well just switch over to using
> > full-blown seqlocks. They internally use a two-stage update which means
> > race-free even with just one copy of the data we protect. Also more
> > standardized to boot.
> >
> > Series looks good otherwise, I'll wait for Maarten to r-b it and then pull
> > it in.
> >
> R-b for 1-10.

Merged to drm-misc, thanks.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list