drm: Don't zero vblank timestamps from the irq handler
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 30 Sep 2015 16:21:34 +0000 (19:21 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 1 Oct 2015 07:49:09 +0000 (09:49 +0200)
commitfa4270d8e0257b4b76f11baa2866f4313d29aaf5
treee399401c06e81ec14fa51713c9563a6bc4366a54
parent8fa884dc355ffd0caa964a284a530bf747df5c77
drm: Don't zero vblank timestamps from the irq handler

If we couldn't get a high precisions vblank timestamp, we currently
store a zeroed timestamp instead and assume the next vblank irq to
get us something better. This makes sense when trying to update the
timestamp from eg. vblank enable. But if we do this from the vblank
irq we will never get a vblank timestamp unless we high precision
timestamps are available and succeeded. This break weston for instance
on drivers lacking high precision timestamps.

To fix this, zero the timestamp only when not called from vbl irq.
When called from the irq, we still want the timestamp, even if not
perfect.

This fixes a regression from
4dfd64862ff852df drm: Use vblank timestamps to guesstimate how many vblanks were missed

Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Reported-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_irq.c