[PATCH] drm/core: Add drm_accurate_vblank_count_and_time.
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Wed Mar 30 13:41:26 UTC 2016
Op 30-03-16 om 15:13 schreef Ville Syrjälä:
> On Tue, Mar 29, 2016 at 03:38:55PM +0200, Maarten Lankhorst wrote:
>> This function is useful for gen2 intel devices which have no frame
>> counter, but need a way to determine the current vblank count without
>> racing with the vblank interrupt handler.
>>
>> intel_pipe_update_start checks if no vblank interrupt will occur
>> during vblank evasion, but cannot check whether the vblank handler has
>> run to completion. This function uses the timestamps to determine
>> when the last vblank has happened, and interpolates from there.
> Didn't really read it in detail, but on a glance it seems too
> complicated to me. All we should really need is something like this:
>
> drm_vblank_get();
> drm_update_vblank_count();
> accurate = drm_vblank_count();
>
Updating from non vblank irq context might cause the vblank clock to drift, or at least contend the vblank lock.
This is why I call drm_vblank_count_and_time, and then interpolate as if update_vblank_count was called on the result.
~Maarten
More information about the dri-devel
mailing list