[Intel-gfx] [PATCH 11/11] drm: Fix vblank timestamp races
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Tue Sep 22 04:15:01 PDT 2015
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.
More information about the Intel-gfx
mailing list