[PATCH weston] main: report presentation clock resolution

Pekka Paalanen ppaalanen at gmail.com
Fri Jun 17 08:29:46 UTC 2016


On Wed, 15 Jun 2016 14:28:09 +0200
Hardening <rdp.effort at gmail.com> wrote:

> Le 13/06/2016 13:34, Pekka Paalanen a écrit :
> > From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > 
> > For debugging weird timing issues. If your clock resolution is
> > unexpectedly e.g. 10 ms, you can be sure you will have strange timing
> > issues. This is almost certainly caused by kernel misconfiguration.
> > 
> > We rely on clock_getres() being available by the same thing that gets us
> > clock_gettime(), so that no new configure.ac check is needed.
> > 
> > Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > ---
> >  src/main.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/src/main.c b/src/main.c
> > index 193a845..28f6969 100644
> > --- a/src/main.c
> > +++ b/src/main.c
> > @@ -647,6 +647,7 @@ weston_compositor_log_capabilities(struct weston_compositor *compositor)
> >  {
> >  	unsigned i;
> >  	int yes;
> > +	struct timespec res;
> >  
> >  	weston_log("Compositor capabilities:\n");
> >  	for (i = 0; i < ARRAY_LENGTH(capability_strings); i++) {
> > @@ -659,6 +660,14 @@ weston_compositor_log_capabilities(struct weston_compositor *compositor)
> >  	weston_log_continue(STAMP_SPACE "presentation clock: %s, id %d\n",
> >  			    clock_name(compositor->presentation_clock),
> >  			    compositor->presentation_clock);
> > +
> > +	if (clock_getres(compositor->presentation_clock, &res) == 0)
> > +		weston_log_continue(STAMP_SPACE
> > +				"presentation clock resolution: %d.%09ld s\n",
> > +				(int)res.tv_sec, res.tv_nsec);
> > +	else
> > +		weston_log_continue(STAMP_SPACE
> > +				"presentation clock resolution: N/A\n");
> >  }
> >  
> >  static void
> >   
> Reviewed-By: David Fort <contact at hardening-consulting.com>
> 

pushed:
   e77f8ad..be112d4  master -> master


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160617/270abc9f/attachment.sig>


More information about the wayland-devel mailing list