From patchwork Sat Jan 10 17:09:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 25707 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 97B05BE08B for ; Sat, 10 Jan 2026 17:10:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4EA6A61FA0; Sat, 10 Jan 2026 18:10:20 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="FMouCjkq"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E25D861A35 for ; Sat, 10 Jan 2026 18:10:18 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; t=1768065015; cv=none; d=zohomail.com; s=zohoarc; b=DpRfOWe6RzJofbBK7AgnEtZoyUW4u22s+GX27fY04afCy9hgK5H0Ce4c3xkg5qCuu/3vW1rb0vu/F7P3cX7ROa7xIrJthxZy7gnPGg+ZiBdBLoFBWeBNUshbxvIWjFFyhaiZHSkH/21jkwqJ2l6T4ZHwss0g6c5MZODbTj7xNUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768065015; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=bFFrq++5ofhqy9jPSw2PTaF8NtQ+WlvlI5/s/WvKYVw=; b=hHBiLut7Ok5k5o6p7V7RryuibA1vxIUgok5icLzGhHRP1NYSEShb4r+U5WMNhNNzWENl/thQsv782WzAqJNbbV06EgbcV+WO33gYFpl2ZQD7KGcdQDLeaWr75EVppO4MTwJRRoOrdoEXCqQNdCYVLIF4LhkUjc8NIAk6ER8dtP4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1768065015; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=bFFrq++5ofhqy9jPSw2PTaF8NtQ+WlvlI5/s/WvKYVw=; b=FMouCjkqh4F0qFzr/jfzli+MJhP0UD46BdXexuVNr68Eh8kiNQWBVuEkh7n76YiG Z9V4mPOj/iMsWRasF56xBQXih5lh4rJGUPWMj29SUZVSmqRSm1Odsipk0kNIM6TLkRI RCdSrRzgdFNsMPw5BqhwIvqiGu4ssxpnb7j3iJxA= Received: by mx.zohomail.com with SMTPS id 1768065013843292.75368789859726; Sat, 10 Jan 2026 09:10:13 -0800 (PST) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH 1/4] egl: Remove unused functions Date: Sat, 10 Jan 2026 18:09:24 +0100 Message-ID: <20260110170927.79918-2-robert.mader@collabora.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260110170927.79918-1-robert.mader@collabora.com> References: <20260110170927.79918-1-robert.mader@collabora.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" They are left-overs from older iterations of the GPU-ISP. Signed-off-by: Robert Mader Reviewed-by: Hans de Goede --- include/libcamera/internal/egl.h | 10 ---------- src/libcamera/egl.cpp | 10 ---------- src/libcamera/software_isp/debayer_egl.cpp | 2 -- 3 files changed, 22 deletions(-) diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index a92921123..7b810773c 100644 --- a/include/libcamera/internal/egl.h +++ b/include/libcamera/internal/egl.h @@ -64,15 +64,6 @@ public: glGenFramebuffers(1, &fbo_); } - /** - * \brief Construct an eGLImage with automatic stride calculation - */ - eGLImage(uint32_t width, uint32_t height, uint32_t bpp, GLenum texture_unit, uint32_t texture_unit_uniform_id) - : eGLImage(width, height, bpp, utils::alignUp(width * bpp / 8, 256), - texture_unit, texture_unit_uniform_id) - { - } - /** * \brief Destroy the eGLImage * @@ -108,7 +99,6 @@ public: ~eGL(); int initEGLContext(GBM *gbmContext); - void cleanUp(); int createInputDMABufTexture2D(eGLImage &eglImage, int fd); int createOutputDMABufTexture2D(eGLImage &eglImage, int fd); diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index 0544056bd..fcaf7c58f 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -349,16 +349,6 @@ fail: return -ENODEV; } -/** - * \brief Clean up EGL resources - * - * Destroys the EGL sync object. Must be called from the same thread - * that created the EGL context. - */ -void eGL::cleanUp() -{ -} - /** * \brief Make the EGL context current for the calling thread * diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index 8e0890323..1c13b72a5 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -615,8 +615,6 @@ void DebayerEGL::stop() if (programId_) glDeleteProgram(programId_); - - egl_.cleanUp(); } SizeRange DebayerEGL::sizes(PixelFormat inputFormat, const Size &inputSize) From patchwork Sat Jan 10 17:09:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 25708 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 30887BE08B for ; Sat, 10 Jan 2026 17:10:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DE07561FC1; Sat, 10 Jan 2026 18:10:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="hZkPXXV9"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C5F6B61A35 for ; Sat, 10 Jan 2026 18:10:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; t=1768065017; cv=none; d=zohomail.com; s=zohoarc; b=FaSdbPSCtYbRpHy8RgTuSqG8SyXThYRiesPCJX/FScHxqPK+pPASJ17XDBp4iJd0d+m/2kmoYacapLZhfned18lmcgHJNPO4TkBRrLFrcxOEyJJa1s0QlVouD/l3G3XUZDtruU2OGYXklSMs+xQK7Ewj32qNgmH2qGHp9uh/AhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768065017; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=6WGzZY50jt8+gkUXB/PX2OWCswi+UuC6PACD/tR+DIg=; b=Ug/L5D+LInsraVcLEKsrZnxCm2+lATo0PqCRWeiVv04mhw82OLx/4+gQWgfNX3Z1qH61Z3AXC1cfWcp+D2a4CZjbTYctNt6U5DuLflOAP+8GrFtG/DQ7nquxDeZZKtCfCcXescta6Ukn+fvsDMAWcq+uUYg12SZzCkgcJOwoZWE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1768065017; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=6WGzZY50jt8+gkUXB/PX2OWCswi+UuC6PACD/tR+DIg=; b=hZkPXXV9qOBXG54B2NB3yT5IOY5m3beWimF1mfxJBxxgEUJLPh8IleXD29B7L6v6 F63akY9jVpWoHY8pF+85guMj+spdWjqNP6L/p4xtynh/Jah3R33biRgEg8GDgjyu7EV X4IVNg5f+SjwaB5E5Lbmf6qfyY6E8CV7UimOztVE= Received: by mx.zohomail.com with SMTPS id 1768065016734439.5995581327402; Sat, 10 Jan 2026 09:10:16 -0800 (PST) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH 2/4] egl: Remove bpp variable Date: Sat, 10 Jan 2026 18:09:25 +0100 Message-ID: <20260110170927.79918-3-robert.mader@collabora.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260110170927.79918-1-robert.mader@collabora.com> References: <20260110170927.79918-1-robert.mader@collabora.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" It's unused and, in one case, was set wrongly. Signed-off-by: Robert Mader Reviewed-by: Hans de Goede --- include/libcamera/internal/egl.h | 6 ++---- src/libcamera/software_isp/debayer_egl.cpp | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index 7b810773c..21e2aa9df 100644 --- a/include/libcamera/internal/egl.h +++ b/include/libcamera/internal/egl.h @@ -49,14 +49,13 @@ public: * \brief Construct an eGLImage with explicit stride * \param[in] width Image width in pixels * \param[in] height Image height in pixels - * \param[in] bpp Bytes per pixel * \param[in] stride Row stride in bytes * \param[in] texture_unit OpenGL texture unit * \param[in] texture_unit_uniform_id Shader uniform ID */ - eGLImage(uint32_t width, uint32_t height, uint32_t bpp, uint32_t stride, GLenum texture_unit, uint32_t texture_unit_uniform_id) + eGLImage(uint32_t width, uint32_t height, uint32_t stride, GLenum texture_unit, uint32_t texture_unit_uniform_id) : width_(width), height_(height), stride_(stride), - framesize_(stride * height), bpp_(bpp), + framesize_(stride * height), texture_unit_uniform_id_(texture_unit_uniform_id), texture_unit_(texture_unit) { @@ -81,7 +80,6 @@ public: uint32_t stride_; /**< Row stride in bytes */ uint32_t offset_; /**< Buffer offset (reserved for future use) */ uint32_t framesize_; /**< Total frame size in bytes (stride * height) */ - uint32_t bpp_; /**< Bytes per pixel */ uint32_t texture_unit_uniform_id_; /**< Shader uniform id for texture unit */ GLenum texture_unit_; /**< Texture unit associated with this image eg (GL_TEXTURE0) */ GLuint texture_; /**< OpenGL texture object ID */ diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index 1c13b72a5..9693d7252 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -597,10 +597,10 @@ int DebayerEGL::start() LOG(Debayer, Debug) << "Available fragment shader texture units " << maxTextureImageUnits; /* Raw bayer input as texture */ - eglImageBayerIn_ = std::make_unique(width_, height_, 32, inputConfig_.stride, GL_TEXTURE0, 0); + eglImageBayerIn_ = std::make_unique(width_, height_, inputConfig_.stride, GL_TEXTURE0, 0); /* Texture we will render to */ - eglImageBayerOut_ = std::make_unique(outputSize_.width, outputSize_.height, 31, outputConfig_.stride, GL_TEXTURE1, 1); + eglImageBayerOut_ = std::make_unique(outputSize_.width, outputSize_.height, outputConfig_.stride, GL_TEXTURE1, 1); if (initBayerShaders(inputPixelFormat_, outputPixelFormat_)) return -EINVAL; From patchwork Sat Jan 10 17:09:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 25709 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id F353FBE08B for ; Sat, 10 Jan 2026 17:10:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A870D61FCA; Sat, 10 Jan 2026 18:10:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="HuZbtHo8"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E972C61FC2 for ; Sat, 10 Jan 2026 18:10:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; t=1768065019; cv=none; d=zohomail.com; s=zohoarc; b=g2dFo4QQqY0JG0fddepohtWXfQSNgZiezoZXu9qtPhhPViHWEQXaTgy+YVp3WMamnpXf4HgB4HbJvkLtBypzCFFnSsIb/q2dD2yprUel8uZkWVl5taqOlsT0JzEEyF7TJ1MHMzRUSXjahyI6GX1SCBgl6ZSh4WHyvPmU+QIwfL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768065019; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=976B+KmRCY27Lpe4T3uIOCpE6hUSRPjVj7pAFgQKouo=; b=WLOsSbiUxVCG0Zy07vDKVDgZ/L1tYxwTU62K7kUDhukZixxK90azm01/QO5jLrvxEJxSZLpvVEbTo+1BfX3YySR96hoHMKX5kh/vBACKx335i2lCYwuakhG1rQ024nljNW9G+KGc4sGfiSqIZMCRakUTDVfDSIA91rn+1iYOLOA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1768065019; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=976B+KmRCY27Lpe4T3uIOCpE6hUSRPjVj7pAFgQKouo=; b=HuZbtHo8+o9RtxPamA0Fj5dKNXThamiqjeIDSr9XPirGKkUtlBQw7g3lE0WNsUdX XXlE1rh8WKNTxdfoYlEBW7bujrulPso4i5TkMzA29abeVPa+JhDWy8zZfKe5TEogECu Q8AMiftEP44BRVOLm+zwVWTy40Ymn2/ll3CkAfrU= Received: by mx.zohomail.com with SMTPS id 1768065018849405.5492727494651; Sat, 10 Jan 2026 09:10:18 -0800 (PST) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH 3/4] egl: Remove duplicated logging of EGL version Date: Sat, 10 Jan 2026 18:09:26 +0100 Message-ID: <20260110170927.79918-4-robert.mader@collabora.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260110170927.79918-1-robert.mader@collabora.com> References: <20260110170927.79918-1-robert.mader@collabora.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The line above already prints it. Signed-off-by: Robert Mader Reviewed-by: Hans de Goede --- src/libcamera/egl.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index fcaf7c58f..0bd9a83be 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -305,7 +305,6 @@ int eGL::initEGLContext(GBM *gbmContext) } LOG(eGL, Info) << "EGL: version " << major << "." << minor; - LOG(eGL, Info) << "EGL: EGL_VERSION: " << eglQueryString(display_, EGL_VERSION); LOG(eGL, Info) << "EGL: EGL_VENDOR: " << eglQueryString(display_, EGL_VENDOR); LOG(eGL, Info) << "EGL: EGL_CLIENT_APIS: " << eglQueryString(display_, EGL_CLIENT_APIS); LOG(eGL, Info) << "EGL: EGL_EXTENSIONS: " << eglQueryString(display_, EGL_EXTENSIONS); From patchwork Sat Jan 10 17:09:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 25710 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 68CAFBE08B for ; Sat, 10 Jan 2026 17:10:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2C1AA61FBB; Sat, 10 Jan 2026 18:10:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="YvfLMXfJ"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 23F7361A35 for ; Sat, 10 Jan 2026 18:10:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; t=1768065023; cv=none; d=zohomail.com; s=zohoarc; b=CsmlddkAdB/kDyslrYTDHMar1e9+J3DpLfKWMl3TpOR6Z4Nk6oPOGWF1lbbdlEBL2tUE3o1NTSqRzZyXYyHmx69FZzC6d9SQfmWHR3ZWwB7blIyGcP/6482FWxzi2wtOIRs8ALAza8caeTbLdGFW1DDIyZWpzy2vI7kYYjRT1NU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768065023; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=v4Q+COl19zIZoqgfqqiXglwzoziFh++Fcz/pfsjQiJk=; b=L54nU4EyveK9oztddYanAfxJCW7LDx9RrL7ccf0UpIB1u85JnYYjN/eD+Kpe0uPrDXW2Xxt5/hon2zWXKzF0gE0VzjsCk3Z+JSbMK6YYrwYD2VIad2XVacA9DrwkevA+lcaBlVFX1atqGzAaC+tC/3YqpzkENa3In1x5YB8uc7o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1768065023; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=v4Q+COl19zIZoqgfqqiXglwzoziFh++Fcz/pfsjQiJk=; b=YvfLMXfJtc7958eCedh9dI//j8HHltnUagtLrV0V4P7KxF+recal3zoVfE7QSPqU fMEEscOvwJesmifW9CQo6Zz8BLyE7OdbMf/IKIMq19QjnZ87uUTjnaI73wVFrHCAGOy gfel/1/heHImdeHCoS0Gw2CgdD+K6apGPcxnI8e8= Received: by mx.zohomail.com with SMTPS id 17680650226261006.9399851149269; Sat, 10 Jan 2026 09:10:22 -0800 (PST) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH 4/4] egl: Detect and print GLES version Date: Sat, 10 Jan 2026 18:09:27 +0100 Message-ID: <20260110170927.79918-5-robert.mader@collabora.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260110170927.79918-1-robert.mader@collabora.com> References: <20260110170927.79918-1-robert.mader@collabora.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" It might come in handy to know whether 2.0 or e.g. 3.2 is used. Signed-off-by: Robert Mader --- include/libcamera/internal/egl.h | 1 + src/libcamera/egl.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index 21e2aa9df..f007f448a 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 0bd9a83be..0ffd008c7 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -288,6 +288,10 @@ int eGL::initEGLContext(GBM *gbmContext) EGLint major; EGLint minor; + const char *glVersion; + EGLint glMajor; + EGLint glMinor; + if (!eglBindAPI(EGL_OPENGL_ES_API)) { LOG(eGL, Error) << "API bind fail"; goto fail; @@ -327,6 +331,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; @@ -342,6 +352,13 @@ int eGL::initEGLContext(GBM *gbmContext) makeCurrent(); + glVersion = (const char *)glGetString(GL_VERSION); + if (glVersion && + sscanf(glVersion, "OpenGL ES %d.%d", &glMajor, &glMinor) == 2 && + glMajor > 0 && glMinor >= 0) { + LOG(eGL, Info) << "GLES: version: " << glMajor << "." << glMinor; + } + return 0; fail: