Skip to content

egl/wayland: Fail EGL surface creation if opaque format is unsupported

When using the EGL_EXT_present_opaque extension we create wayland buffers with the opaque variant of the surface format, while the underlying image is created with the normal surface format. However, there is no guarantee that the compositor supports that opaque format, or that we can use that format with all the modifiers of the surface format.

Since this is completely out of the control of the application, and the compositor will disconnect the client with an error if the format is not supported, this commit:

  1. Fails EGL surface creation if it determines that the opaque format cannot be used, either because it's not present at all, or because it shares no modifier with the non-opaque format.
  2. When creating the DRI image ensures that we use a modifier that's also supported by the opaque format.

The case that inspired this MR is an application creating an EGL surface with an ARGB1555 config and EGL_PRESENT_OPAQUE_EXT set to EGL_TRUE. It seems that XRGB1555 is not yet fully wired in some parts of Mesa, so the compositor doesn't support it (although the driver does). An an orthogonal improvement would be to properly wire this format where needed.

Edited by Alexandros Frantzis

Merge request reports