]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Zero out invalid vblank timestamp in drm_update_vblank_count.
authorMario Kleiner <mario.kleiner.de@gmail.com>
Tue, 7 Apr 2015 04:31:09 +0000 (06:31 +0200)
committerDave Airlie <airlied@redhat.com>
Sun, 10 May 2015 20:02:38 +0000 (06:02 +1000)
commit220a5fab94f29407d2c8c43f3ddbf9d7b043e7a5
tree7d49633f919c23ac86b8f49d9c20845a2eab5975
parent1ba3b02c3435b753ee5a675c9459fca165bcc0c5
drm: Zero out invalid vblank timestamp in drm_update_vblank_count.

Since commit 720f186b7a2b2c070ab877c8e9ee183b210db674 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.17, 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.

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