]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Zero out invalid vblank timestamp in drm_update_vblank_count. (v2)
authorMario Kleiner <mario.kleiner.de@gmail.com>
Mon, 4 May 2015 04:29:46 +0000 (06:29 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 4 May 2015 09:13:23 +0000 (11:13 +0200)
commit4db9c3706c770e2e5ab72c4c795eb5c36810b6b4
tree7ced8c595cf86dcb24622e9f6a9faf12c8339a19
parent60191488be51b5b54296acaf229dc517645fec91
drm: Zero out invalid vblank timestamp in drm_update_vblank_count. (v2)

Since commit e513af78370115b42571297b0610d10807340329 we make
sure that after vblank irq off, we return the last valid
(vblank count, vblank timestamp) pair to clients, e.g., during
modesets, which is good.

An overlooked side effect of that commit for kms drivers without
support for precise vblank timestamping is that at vblank irq
enable, when we update the vblank counter from the hw counter, we
can't update the corresponding vblank timestamp, so now we have a
totally mismatched timestamp for the new count to confuse clients.

Restore old client visible behaviour from before Linux 3.18, but
zero out the timestamp at vblank counter update (instead of disable
as in original implementation) if we can't generate a meaningful
timestamp immediately for the new vblank counter. This will fix
this regression, so callers know they need to retry again later
if they need a valid timestamp, but at the same time preserves
the improvements made in the commit mentioned above.

v2: Rebased on top of Daniel Vetter's fixup and documentation
    patch for timestamp updates. Drop request for stable kernel
    backport as this would be more difficult, unless the original
    patch would get applied to stable kernels.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_irq.c