[Intel-gfx] [PATCH] drm/core: Add drm_accurate_vblank_count_and_time.
ville.syrjala at linux.intel.com
Wed Mar 30 13:45:57 UTC 2016
On Wed, Mar 30, 2016 at 03:41:26PM +0200, Maarten Lankhorst wrote:
> 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.
I don't see a problem. The scanout position is anyway used to fix up the
> This is why I call drm_vblank_count_and_time, and then interpolate as if update_vblank_count was called on the result.
More information about the Intel-gfx