Wayland client library thread safety

Pekka Paalanen ppaalanen at gmail.com
Wed Apr 25 22:50:16 PDT 2012

On Wed, 25 Apr 2012 12:58:59 -0700
Bill Spitzak <spitzak at gmail.com> wrote:

> Pekka Paalanen wrote:
> > There was some talk about an alternative implementation: to let
> > eglSwapBuffers never block, instead block when a rendering operation is
> > about to use a buffer that should have already been made available by
> > swapBuffers, but didn't actually happen yet. The DRM architecture
> > should allow this. I wonder if this idea was forgotten or deemed to
> > have problems...
> I think the problem is that this would have to be tested for in 
> virtually every EGL call, which may not be great for speed.

Nah, it should be almost free to do, the DRM command submission for all
the major drivers AFAIK already uses fencing, and adding one more fence
should be peanuts. In other words, it's not any EGL or GL library
blocking on API entry points, it would be the DRM ioctl and the calling
infrastrucure that submits work to the GPU. It might even be
implemented already, glXSwapBuffers and eglSwapBuffers for X already
work, maybe we are just missing hooking it up. But that's going to
speculation on my part, since I haven't looked at what happens on X.

Also, I cannot tell how it would interact with the swap control
extensions. Maybe that makes it harder than it first seems.


More information about the wayland-devel mailing list