Skip to content

Rewrite EGLConfig handling

Pekka Paalanen requested to merge pq/weston:mr/eglconfig-rewrite into master

This is a by-product of me working on #278 (closed), a step towards getting pbuffer eglconfigs properly.

I happened to notice https://patchwork.freedesktop.org/patch/246458/?series=47633&rev=4 and this series should supersede that patch. We are using a single GL context for all outputs plus a dummy pbuffer (if necessary). Without certain EGL extensions, the GL context is tied to a specific EGLConfig which means that all outputs will essentially need to have the same pixel format. Until now, we have been relying on luck to get all this right.

This series should make it all much more robust. If we really need to use the same EGLConfig everywhere, now we will actually attempt exactly that, instead of hoping that eglChooseConfig() would come up with the same config again.

This also introduces a new file libweston/renderer-gl/egl-glue.c to avoid growing gl-renderer.c even larger in the future.

For internal API, DRM pixel format codes are chosen as the common language over all of GBM, Wayland and X11 EGL platforms. As only GBM uses the DRM pixel formats for the native visual ID, the other platforms will do a fuzzy EGLConfig matching only: the number and depth of color channels needs to match the DRM format, but the channel order does not.

This series does not allow to pick a X11 visual for the X11-backend that would have an alpha channel in the window, meaning that the Weston windows on X11 will be always opaque. That is no different from before, we have always created X11 windows opaque in the X11-backend.

Depends on:

Merge request reports