drm: vblank: Fix vblank timestamp update
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 29 Jun 2017 12:37:20 +0000 (15:37 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 29 Jun 2017 12:40:47 +0000 (14:40 +0200)
Commit 3fcdcb270936 ("drm/vblank: Switch to bool in_vblank_irq in
get_vblank_timestamp") inverted a condition by mistake that resulted in
vblank timestamps always being 0 on hardware without a vblank counter.
Fix it.

Fixes: 3fcdcb270936 ("drm/vblank: Switch to bool in_vblank_irq in get_vblank_timestamp")
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170629123720.27173-1-laurent.pinchart+renesas@ideasonboard.com
drivers/gpu/drm/drm_vblank.c

index 463e4d81fb0ddb9807b84d1039288795c4842187..e9f33cd805dd6bfaa746800d2d67e53ec578ae18 100644 (file)
@@ -242,7 +242,7 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
         * Otherwise reinitialize delayed at next vblank interrupt and assign 0
         * for now, to mark the vblanktimestamp as invalid.
         */
-       if (!rc && in_vblank_irq)
+       if (!rc && !in_vblank_irq)
                t_vblank = (struct timeval) {0, 0};
 
        store_vblank(dev, pipe, diff, &t_vblank, cur_vblank);