[PATCH weston] compositor: warn about insane repaint delay

Bryce Harrington bryce at osg.samsung.com
Thu Mar 19 11:16:33 PDT 2015


On Thu, Mar 19, 2015 at 08:13:42AM -0500, Derek Foreman wrote:
> Reviewed-By: Derek Foreman <derekf at osg.samsung.com>
> 
> On 19/03/15 05:33 AM, Pekka Paalanen wrote:
> > From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > 
> > Make the sanity check more explicit and log a warning if it happens.
> > 
> > Small negative values are ok because it just means the compositor is
> > lagging behind, or more likely the user specified a too long repaint
> > window.
> > 
> > Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Reviewed-by: Bryce Harrington <b.harrington at samsung.com>
> > ---
> >  src/compositor.c | 14 ++++++++++++--
> >  1 file changed, 12 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/compositor.c b/src/compositor.c
> > index 3f6aa7d..be2309a 100644
> > --- a/src/compositor.c
> > +++ b/src/compositor.c
> > @@ -2412,8 +2412,18 @@ weston_output_finish_frame(struct weston_output *output,
> >  	msec = (refresh_nsec - timespec_to_nsec(&gone)) / 1000000; /* floor */
> >  	msec -= compositor->repaint_msec;
> >  
> > -	/* Also sanity check. */
> > -	if (msec < 1 || msec > 1000)
> > +	if (msec < -1000 || msec > 1000) {
> > +		static bool warned;
> > +
> > +		if (!warned)
> > +			weston_log("Warning: computed repaint delay is "
> > +				   "insane: %d msec\n", msec);
> > +		warned = true;
> > +
> > +		msec = 0;
> > +	}
> > +
> > +	if (msec < 1)
> >  		output_repaint_timer_handler(output);
> >  	else
> >  		wl_event_source_timer_update(output->repaint_timer, msec);
> > 
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list