From patchwork Thu Nov 26 11:03:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Remy Alipoursafari X-Patchwork-Id: 29093 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 2515CBDE17 for ; Thu, 26 Nov 2026 11:05:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2A10C6AA20; Thu, 26 Nov 2026 12:05:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="XjkeZcVj"; dkim-atps=neutral Received: from sender6-pp-f112.zoho.com (sender6-pp-f112.zoho.com [165.173.180.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 80F2C6AA15 for ; Thu, 26 Nov 2026 12:05:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; t=1795691104; cv=none; d=zohomail.com; s=zohoarc; b=Cj7bf0YYkNzxoG3M9cUQvQECsXnxfGlUDPAw5bWV6L9euSlAV96dQGpb5gzH+BY22jYLZkOZIEtxYziUkVW5mPZXHYuOnhZOhGOWkMfkEtBceWiJ0Z+XM1MTQitzk7hTZ6uKaadzKancA6CyuOcbNCFXrYTw5TtYCE0+DK+49rM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795691104; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=IlkrgwFG4/PL/2hbt7QrmI9CP7Ae4sGukvsdQCh7geo=; b=Xpjf7UkHRQIdolJPI3dQqJ0H2BaZILkU2oqSutX45XDgP8zSut0u3iuvIuFB+UacG2cm3SpxDSDGch7dcVAxmEC+SbMaCXJhxitle/1DQwBk6KRVNnskTExPjJCBdoJBf1pq3yMhWYIz4GdknGN+sNtzEMPj7rH5qy7iWX0/6BU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=remy.alipoursafari@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=XjkeZcVjR+IeP8XNO56e5GDpBwX2JdG0wXHut2LnaIxEgI/0ZMJRs3fHJnBnaDdE3RhKazf2gGZOD64BbkIQxeHXWqMun+WYkvhz+lM09SIo968odCkGnvFBbeJG7JWjFaGsQSacwQmDlj2+k9FxoNuZOF/su8MFG5s3XfawuWM=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=IlkrgwFG4/PL/2hbt7QrmI9CP7Ae4sGukvsdQCh7geo=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1795691102636524.8262358664242; Thu, 26 Nov 2026 03:05:02 -0800 (PST) From: Remy Alipoursafari To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Lo=C3=AFc_Molinari?= , Robert Mader , Remy Alipoursafari Subject: [PATCH 2/6] libcamera: egl: Ensure required extensions are supported Date: Fri, 27 Nov 2026 00:03:40 +1300 Message-ID: <20261126110422.362455-3-remy.alipoursafari@collabora.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261126110422.362455-1-remy.alipoursafari@collabora.com> References: <20261126110422.362455-1-remy.alipoursafari@collabora.com> MIME-Version: 1.0 X-ZohoMailClient: External 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" 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 Signed-off-by: Remy Alipoursafari Reviewed-by: Robert Mader --- src/libcamera/egl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index 8bc70b7d..f88fb7c4 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -460,6 +460,19 @@ int eGL::initEGLContext() goto fail; } +#define CHECK_EXTENSION(name, func) ({ \ + if (!func(name)) { \ + LOG(eGL, Error) << name << " not supported"; \ + resetEGLContext(); \ + goto fail; \ + } \ +}) +#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"); + return 0; fail: