[PATCH 5/6] drm: Prevent vblank counter jumps with timestamp based update method.

Daniel Vetter daniel at ffwll.ch
Wed Feb 10 17:17:25 UTC 2016


On Wed, Feb 10, 2016 at 5:28 PM, Mario Kleiner
<mario.kleiner.de at gmail.com> wrote:
> There's another scenario where this zero-ts case can be hit. If the driver
> drm_vblank_init()'s - setting all timestamps to zero - and then code starts
> using vblanks (drm_vblank_get()) without drm_vblank_on beforehand, which is
> afaics the case with nouveau. Unless that's considered an error as well,
> we'd need to init the timestamps to something non-zero but harmless like 1
> usecs at drm_vblank_init() time?

Both legacy modeset helpers and atomic ones assume by default that you
start out with everything disabled. Pre-atomic drivers make that
happen by calling disable_unused_functions() to shut down anything the
bios has enabled. I think this can't happen.

For drivers that do take over bootloader display config they must call
vblank_on explicitly themselves, which i915 does.

> What makes sense as output here? DRM_WARN_ONCE?

I'd go with WARN_ON and tune it down if it's offensive. But WARN_ON
patch for 4.6 of course.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list