From 6725ea8edd7957c52b957ef4d534fcafd78f3532 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 12 Jan 2026 11:37:40 +0100 Subject: [PATCH] egl: Print GLES version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It might come in handy to know whether 2.0 or e.g. 3.2 is used. Signed-off-by: Robert Mader Reviewed-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Bryan O'Donoghue Tested-by: Hans de Goede # Thinkpad X1 Carbon G13 IPU7 ov08x40 Tested-by: Milan Zamazal # TI AM69 Signed-off-by: Kieran Bingham --- include/libcamera/internal/egl.h | 1 + src/libcamera/egl.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index 21e2aa9d..f007f448 100644 --- a/include/libcamera/internal/egl.h +++ b/include/libcamera/internal/egl.h @@ -136,5 +136,6 @@ private: PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR; PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR; + PFNGLGETSTRINGPROC glGetString; }; } //namespace libcamera diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index a8852527..da563ee0 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -325,6 +325,12 @@ int eGL::initEGLContext(GBM *gbmContext) goto fail; } + glGetString = (PFNGLGETSTRINGPROC)eglGetProcAddress("glGetString"); + if (!glGetString) { + LOG(eGL, Error) << "glGetString not found"; + goto fail; + } + if (eglChooseConfig(display_, configAttribs, &config, 1, &numConfigs) != EGL_TRUE) { LOG(eGL, Error) << "eglChooseConfig fail"; goto fail; @@ -340,6 +346,8 @@ int eGL::initEGLContext(GBM *gbmContext) makeCurrent(); + LOG(eGL, Info) << "EGL: GL_VERSION: " << glGetString(GL_VERSION); + return 0; fail: