[Mesa-dev] [PATCH 17/19] glx: Replace DRI2SwapBuffers() custom protocol with XCB.

Oliver McFadden oliver.mcfadden at linux.intel.com
Sun Sep 30 23:07:41 PDT 2012


On Fri, Sep 28, 2012 at 04:12:28PM -0700, Chad Versace wrote:
> > +       swap_buffers_cookie =
> > +          xcb_dri2_swap_buffers_unchecked(c, pdraw->xDrawable,
> > +                                          target_msc_hi, target_msc_lo,
> > +                                          divisor_hi, divisor_lo,
> > +                                          remainder_hi, remainder_lo);
> > +       /* Immediately wait on the swapbuffers reply.  If we didn't, we'd have
> > +        * to do so some time before reusing a (non-pageflipped) backbuffer.
> > +        * Otherwise, the new rendering could get ahead of the X Server's
> > +        * dispatch of the swapbuffer and you'd display garbage.
> > +        *
> > +        * We use XSync() first to reap the invalidate events through the event
> > +        * filter, to ensure that the next drawing doesn't use an invalidated
> > +        * buffer.
> > +        */
> > +       XSync(pdraw->psc->dpy, False);
> > +       swap_buffers_reply =
> > +          xcb_dri2_swap_buffers_reply(c, swap_buffers_cookie, NULL);
> > +       ret = merge_counter(swap_buffers_reply->swap_hi,
> > +                           swap_buffers_reply->swap_lo);
> > +       free(swap_buffers_reply);
> 
> Will this sync harm performance for artificial benchmarks? I'm asking because
> this hunk reminds me of Oliver's comments that Dante was slower on EGL than GLX
> perhaps due to extra X roundtrips.

When I forced the vblank_mode to 0 on EGL, by using eglSwapInterval(dpy,
0) since vblank_mode environment variable/driconf won't actually work
with the current master, I would receive _roughly_ the same
performance...  EGL was about 3 fps slower.  This is greater than the
margin of error.

I haven't yet had time to run Dante through a timedemo series
with/without this patch set, however:

> 
> Anyway, roll-our-own-X-protocol needs to die.

Agreed.

> Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

-- 
Oliver McFadden.


More information about the mesa-dev mailing list