]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <sasha.levin@oracle.com>
Tue, 9 Jun 2015 17:43:33 +0000 (13:43 -0400)
commit6128995725eb65d9b6971645b9b5e73e148aa549
treee15aeb5c9e9cacf36614e7ea65c5d8135afde687
parent6c6e8935df207f8af59b15d2b3344557ce4b5c2d
drm: Zero out invalid vblank timestamp in drm_update_vblank_count.

[ Upstream commit fdb68e09bbb1c981f24608d7022c7d93cc47b326 ]

Since commit 844b03f27739135fe1fed2fef06da0ffc4c7a081 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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/gpu/drm/drm_irq.c