From: Ville Syrjälä Date: Wed, 6 Aug 2014 11:49:49 +0000 (+0300) Subject: drm: Avoid random vblank counter jumps if the hardware counter has been reset X-Git-Tag: fixes-against-v3.18-rc2~73^2~39^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8ad028cc033f75fc479ca1c30e2ea4ba56e5269;p=pandora-kernel.git drm: Avoid random vblank counter jumps if the hardware counter has been reset When drm_vblank_on() is called the hardware vblank counter may have been reset, so we can't trust that the old values sampled prior to drm_vblank_off() have anything to do with the new values. So update the .last count in drm_vblank_on() to make the first drm_vblank_enable() consider that as the reference point. This will correct the user space visible counter to account for the time between drm_vblank_on() and the first drm_vblank_enable() calls. For extra safety subtract one from the .last count in drm_vblank_on() to make sure that user space will never see the same counter value before and after modeset. Reviewed-by: Matt Roper Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä Signed-off-by: Daniel Vetter --- Reading git-diff-tree failed