[PATCH 5/7] compositor-drm: Gracefully handle vblank and flip invalid timestamps

Daniel Vetter daniel at ffwll.ch
Tue Mar 22 08:50:27 UTC 2016


On Tue, Mar 22, 2016 at 08:47:12AM +0000, Daniel Stone wrote:
> Hi Miguel,
> 
> On 21 March 2016 at 16:37, Miguel A. Vico <mvicomoya at nvidia.com> wrote:
> > Instant query for vblank timestamp may always fail, resulting in
> > never scheduling a full repaint in drm_output_start_repaint_loop().
> >
> > Additionally, timestamp provided in page_flip_handler() may also be
> > invalid.
> >
> > [...]
> >
> > @@ -869,6 +878,15 @@ page_flip_handler(int fd, unsigned int frame,
> >         else if (!output->vblank_pending) {
> >                 ts.tv_sec = sec;
> >                 ts.tv_nsec = usec * 1000;
> > +
> > +               /* Zero timestamp means failure to get valid timestamp, so immediately
> > +                * finish frame */
> > +               if (ts.tv_sec == 0 && ts.tv_nsec == 0) {
> > +                       weston_compositor_read_presentation_clock(output->base.compositor,
> > +                                                                 &ts);
> > +                       flags = WP_PRESENTATION_FEEDBACK_INVALID;
> > +               }
> > +
> >                 weston_output_finish_frame(&output->base, &ts, flags);
> >
> >                 /* We can't call this from frame_notify, because the output's
> 
> This is odd. Instant queries failing is fine, but in which
> circumstances can you fail to return a valid timestamp in a pageflip
> event ... ? I don't know of any other kernel driver which does this -
> at the very least, if you don't have a hardware timestamp, then you
> log the time in your kernel driver which handles the hardware event
> (e.g. softirq handler), and use that instead.

nouveau bugs iirc. Yes, should never happen, it's a bug in the kernel
driver that iirc Mario recently tracked down. nouveau somehow started the
vblank machinery before the pipe was up, or something like that.

So yeah happens, I'm not sure we want to let kernel drivers get away with
plain broken behavior forever. I'm leaning towards nack, pls fix the
kernel driver. And maybe make sure the corresponding igt pass ;-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the wayland-devel mailing list