| Message ID | 20261204031914.117401-3-me@coolgi.dev |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
On 04/12/2026 03:18, Remy Alipoursafari wrote: > From: Remy Alipoursafari <remy.alipoursafari@collabora.com> > > Ensures that the EGL context supports EGL_EXT_image_dma_buf_import, and > the OpenGL ES context supports GL_OES_EGL_image. > > Signed-off-by: Loïc Molinari <loic.molinari@collabora.com> > Signed-off-by: Remy Alipoursafari <remy.alipoursafari@collabora.com> > Reviewed-by: Robert Mader <robert.mader@collabora.com> > --- > src/libcamera/egl.cpp | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp > index 70f293b7..1a0b6c37 100644 > --- a/src/libcamera/egl.cpp > +++ b/src/libcamera/egl.cpp > @@ -467,6 +467,18 @@ int eGL::initEGLContext() > return -ENODEV; > } > > +#define CHECK_EXTENSION(name, func) ({ \ > + if (!func(name)) { \ > + LOG(eGL, Error) << name << " not supported"; \ > + return -ENODEV; \ > + } \ > +}) > +#define CHECK_EGL_EXTENSION(name) CHECK_EXTENSION(name, hasEGLExtension); > +#define CHECK_GLES_EXTENSION(name) CHECK_EXTENSION(name, hasGLESExtension); > + > + CHECK_EGL_EXTENSION("EGL_EXT_image_dma_buf_import"); > + CHECK_GLES_EXTENSION("GL_OES_EGL_image"); > + > contextGuard.release(); > > return 0; > -- > 2.56.1 Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index 70f293b7..1a0b6c37 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -467,6 +467,18 @@ int eGL::initEGLContext() return -ENODEV; } +#define CHECK_EXTENSION(name, func) ({ \ + if (!func(name)) { \ + LOG(eGL, Error) << name << " not supported"; \ + return -ENODEV; \ + } \ +}) +#define CHECK_EGL_EXTENSION(name) CHECK_EXTENSION(name, hasEGLExtension); +#define CHECK_GLES_EXTENSION(name) CHECK_EXTENSION(name, hasGLESExtension); + + CHECK_EGL_EXTENSION("EGL_EXT_image_dma_buf_import"); + CHECK_GLES_EXTENSION("GL_OES_EGL_image"); + contextGuard.release(); return 0;