[Mesa-dev] GBM Surface
Kristian Høgsberg
krh at bitplanet.net
Tue Mar 27 12:08:26 PDT 2012
Hi,
Here's a patch series from Ander to implement a new gbm feature: gbm
surface. The gbm library is useful for allocating surface for scanout
and rendering, but the application needs to create EGLImages for the
gbm bos and then renderbuffers and then render using an FBO. On top
of that, we have to rely on the (awkward) surfaceless extension to
make it all work. So gbm surface gives us a few things:
1) Independent from KMS. The API could be a lot simpler if we just
could say "EGL surface on this KMS crtc", we didn't want to tie it
to KMS for a few reasons: we need to be able to pageflip to gbm bos
from different sources (wayland clients); without the kms
integration we can do headless EGL; gbm is usable with OpenWF as
well; and finally, we may be able to implement the wayland egl
backend in terms of gbm surface, which will greatly simplify that.
2) Go through eglSwapBuffers as a end-of-frame indicator. This is
mainly to cover our back on architectures that require explicit
synchronization between multiple queues, or for deferred rendering
architectures that relies on eglSwapBuffers to trigger the actual
rendering.
3) Let the EGL implementation manage number of buffers (double or
triple buffer decision etc)
4) Provide a native window type for EGL on GBM. We avoid the
surfaceless extension.
5) Reduce boilerplate code for applications using GBM, EGL and KMS.
Here's how the eglkms.c example looks converted to gbm surface.
http://cgit.freedesktop.org/~krh/mesa-demos/diff/src/egl/opengl/eglkms.c?id=1c78c24366c24786eff3e08132754f7876539e57
thanks,
Kristian
More information about the mesa-dev
mailing list