[v4,2/3] egl: Add workaround for Mesa <= 22.2
diff mbox series

Message ID 20260121090854.27483-2-robert.mader@collabora.com
State New
Headers show
Series
  • [v4,1/3] egl: Use the Mesa surfaceless platform instead of GBM
Related show

Commit Message

Robert Mader Jan. 21, 2026, 9:08 a.m. UTC
Older Mesa versions with EGL headers missing the change from
https://github.com/KhronosGroup/EGL-Registry/pull/130
pull in Xlib headers, causing build issues.

This notably happens on the Debian 11 CI image, which until now does not
build the shared EGL code due to missing GBM dependencies. That will
change in the following commit, thus include a workaround.

Suggested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Signed-off-by: Robert Mader <robert.mader@collabora.com>

---

Changes in v4:
 - Pulled this change into a dedicated commit
 - Fixed comment style
 - Fixed Mesa version in comment
---
 include/libcamera/internal/egl.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Laurent Pinchart Jan. 21, 2026, 10:18 a.m. UTC | #1
On Wed, Jan 21, 2026 at 10:08:53AM +0100, Robert Mader wrote:
> Older Mesa versions with EGL headers missing the change from
> https://github.com/KhronosGroup/EGL-Registry/pull/130
> pull in Xlib headers, causing build issues.
> 
> This notably happens on the Debian 11 CI image, which until now does not
> build the shared EGL code due to missing GBM dependencies. That will
> change in the following commit, thus include a workaround.
> 
> Suggested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Signed-off-by: Robert Mader <robert.mader@collabora.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> 
> Changes in v4:
>  - Pulled this change into a dedicated commit
>  - Fixed comment style
>  - Fixed Mesa version in comment
> ---
>  include/libcamera/internal/egl.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h
> index 630345ea7..8a2d96d7a 100644
> --- a/include/libcamera/internal/egl.h
> +++ b/include/libcamera/internal/egl.h
> @@ -16,6 +16,12 @@
>  #include <libcamera/base/span.h>
>  #include <libcamera/base/utils.h>
>  
> +/*
> + * Workaround for build issues on Mesa <= 22.2, see
> + * https://github.com/KhronosGroup/EGL-Registry/pull/130
> + */
> +#define EGL_NO_X11
> +
>  #define EGL_EGLEXT_PROTOTYPES
>  #include <EGL/egl.h>
>  #include <EGL/eglext.h>

Patch
diff mbox series

diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h
index 630345ea7..8a2d96d7a 100644
--- a/include/libcamera/internal/egl.h
+++ b/include/libcamera/internal/egl.h
@@ -16,6 +16,12 @@ 
 #include <libcamera/base/span.h>
 #include <libcamera/base/utils.h>
 
+/*
+ * Workaround for build issues on Mesa <= 22.2, see
+ * https://github.com/KhronosGroup/EGL-Registry/pull/130
+ */
+#define EGL_NO_X11
+
 #define EGL_EGLEXT_PROTOTYPES
 #include <EGL/egl.h>
 #include <EGL/eglext.h>