{"id":27509,"url":"https://patchwork.libcamera.org/api/patches/27509/?format=json","web_url":"https://patchwork.libcamera.org/patch/27509/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260727064152.2161526-1-qi.hou@oss.nxp.com>","date":"2026-07-27T06:41:52","name":"[v2] libcamera: egl: Pass EGLDisplay to eGL constructor to avoid double init","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"9efbbe8cdd9611dc296edb71d281a591d8e8f5d5","submitter":{"id":455,"url":"https://patchwork.libcamera.org/api/people/455/?format=json","name":"Qi Hou (OSS)","email":"qi.hou@oss.nxp.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/27509/mbox/","series":[{"id":6084,"url":"https://patchwork.libcamera.org/api/series/6084/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=6084","date":"2026-07-27T06:41:52","name":"[v2] libcamera: egl: Pass EGLDisplay to eGL constructor to avoid double init","version":2,"mbox":"https://patchwork.libcamera.org/series/6084/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/27509/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/27509/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2F268C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Jul 2026 06:42:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A744E67F53;\n\tMon, 27 Jul 2026 08:42:05 +0200 (CEST)","from AM0PR83CU005.outbound.protection.outlook.com\n\t(mail-westeuropeazlp170100001.outbound.protection.outlook.com\n\t[IPv6:2a01:111:f403:c201::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4558867E5C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Jul 2026 08:42:03 +0200 (CEST)","from AM9PR04MB7556.eurprd04.prod.outlook.com\n\t(2603:10a6:20b:2df::11)\n\tby MI3PR04MB12659.eurprd04.prod.outlook.com (2603:10a6:290:80::18)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13;\n\tMon, 27 Jul 2026 06:42:01 +0000","from AM9PR04MB7556.eurprd04.prod.outlook.com\n\t([fe80::8599:94b0:43ea:32ed]) by\n\tAM9PR04MB7556.eurprd04.prod.outlook.com\n\t([fe80::8599:94b0:43ea:32ed%7]) with mapi id 15.21.0245.012;\n\tMon, 27 Jul 2026 06:42:01 +0000"],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=NXP1.onmicrosoft.com\n\theader.i=@NXP1.onmicrosoft.com header.b=\"E6MShwZ3\"; \n\tdkim-atps=neutral","dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=oss.nxp.com;"],"ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n\tb=zBVrQ0R4yHeAMnqxOfNz8QUocp0xssZttvvVY7Fx5DPWe9u9GbbapmmQpCGvzIF3E/sSS7+nP6a4FIityg4alNis/v9mHVhS1M64kjITGFxaqaqtoT/7WH4cb7eP4lMsUu/EzzqY45UAnXePjB+bJ7hGgDltKg+3cNDjIxxAqpBddmFCqf800OaHiWJgZ21CBAg9uoH1a8LKMmKE7QLWjEP3WYV7QLiMAAFew8zChklesrY/F/6Jccjqg+e+ENUKLvTwLH0LdzvXinvt6qSi9vUl4f3Ll/E/sgsfBCCKZjo1mTxrz6SsRoDlaFP9z7upTQXJV6epA2PDglnPLZQVGg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n\ts=arcselector10001;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n\tbh=fNstNEDLAmXTpCbIGemiGhK8Zjz9nZdx/91cBsDlQVw=;\n\tb=ba/JogmmXyuq6FxUn8eroFDDnTvCYOxhALJcsulvgHJSvn7EYRm7zXByI0pKvk2lXzXz5WepUCyqcx9ZvxV88Qiqfq3KZ69Cz2p/KC41focyBXMkOHq/fw72Nb/Ga3EMfSBdeXe2YOGjO9PdIiYNqtrTayVuV7SWhL1yMOIl8GKSqVdERcwnVZ8wa1mzDXj9cCaRfX3fu2dEALXVcbyLlHfnAWVcSQGAKUacGpxHTH6C6qQBedcgcD2kwZEJXvfbuWrB7qPjosc5ALTlq7MexJshHzyw070oEscck276vPcNBtPBwt4AZMLCOwlkaCQV4B4LNliWj97RM3vgSUGwaQ==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass\n\tsmtp.mailfrom=oss.nxp.com;\n\tdmarc=pass action=none header.from=oss.nxp.com; \n\tdkim=pass header.d=oss.nxp.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com;\n\ts=selector1-NXP1-onmicrosoft-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=fNstNEDLAmXTpCbIGemiGhK8Zjz9nZdx/91cBsDlQVw=;\n\tb=E6MShwZ3kCGc87JIUSzogddyQkUXy3zMjd2/99041MSKBqrMI7EGAGu5Wl46HegFa/6izacQomfZqkCgHW6/zLx5uuV1yE3KFygXyt5/BzlK7fX2JgB61VBZ/cMg44HXGrdJr071ruf+czm6X9f6uyonzQtIxPid0CtCcoAjDcm8xCW3dCTXc3lg1Ruti1J8ZWtz1u9U3wdYuM0IizXQ7iiwtzo1pbjicckS92vOC0aRFtNRjgim+ARTJ2RTIdeIc7grWwTg4X9lGMq4tUeRLECR+9sjgAISFbCQI5yVkLBpKDJrXsRR9oHOGMFMlq10XIBUhFOaRRjoOF3f4WIZyQ==","From":"qi.hou@oss.nxp.com","To":"libcamera-devel@lists.libcamera.org","Cc":"jared.hu@nxp.com,\n\tqi.hou@oss.nxp.com,\n\tjulien.vuillaumier@nxp.com","Subject":"[PATCH v2] libcamera: egl: Pass EGLDisplay to eGL constructor to\n\tavoid double init","Date":"Mon, 27 Jul 2026 15:41:52 +0900","Message-Id":"<20260727064152.2161526-1-qi.hou@oss.nxp.com>","X-Mailer":"git-send-email 2.34.1","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-ClientProxiedBy":"SEWP216CA0034.KORP216.PROD.OUTLOOK.COM\n\t(2603:1096:101:2b5::11) To AM9PR04MB7556.eurprd04.prod.outlook.com\n\t(2603:10a6:20b:2df::11)","MIME-Version":"1.0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"AM9PR04MB7556:EE_|MI3PR04MB12659:EE_","X-MS-Office365-Filtering-Correlation-Id":"fa3a58d4-2711-4c57-f094-08deebaa2986","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;\n\tARA:13230040|1800799024|23010399003|376014|19092799006|366016|11063799006|10067099003|56012099006|6133799003|18002099003|3023799007;","X-Microsoft-Antispam-Message-Info":"AGOu+txlNRuLQFaQyO6XqhKBDASuSxmYjTEbwlFMN9/Pp6FOEK39OwtB+vNvQeyyZm63naBQzOWbyzaPBMNk4ED3wvT/DeKCpZ7B+nWcs2P5DwCuKhN8YmoavJtdKWZIbp2pz4kY6FLgqQ9/2WW1gxuPuGcoye4CsYi4tqTuG+ejyxvbBG0yGQ1OiTPkRMj1Sv3er8z8VVojnsy7TPcu8kZ3tlkQV98wOYvz4Fk+M+aA6Q+xtuNyVmR1Zj17iv/2F+S/u5VJ1GK2/QDDh9XXC7IWt2jYqlQZSTvHBBFw1jdcxKZuTAijwAGZ6oJrHLV6lGcxgvSXF4/hoyhbdTjsQTrg/Uy5/6BrL38mA/MRHW5kTicil6Tv4UGDb64WD7Sjh9MKVUIDaROPidez/iPH7hTaqEaUP3qvFDlTPS3vRUig7XVIfTc4s/E+SWZD/YJSA35PjuS2hwRWi5j53Gf1P09NRMDJ8jyqUedQqf1KSDW9F/Ad7SgMnOggFhBYeinpDMjTWMzvnUzo/+LUJYKRqfrEPkZKL4M74K9N0v/4eEZ+JirZ2QV6J1WhY2pKGadycH/tvFLOGrbr9MWDGi6ubD6a4n6wEPvqsPW62T4fJLL+iD7VhAJ8vY52p3yPgeWc5QxfKDIoN+rRCCk2v6gBI0/PbtWk5IhneiFWZHxgZBs=","X-Forefront-Antispam-Report":"CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n\tIPV:NLI; SFV:NSPM; H:AM9PR04MB7556.eurprd04.prod.outlook.com; PTR:;\n\tCAT:NONE; \n\tSFS:(13230040)(1800799024)(23010399003)(376014)(19092799006)(366016)(11063799006)(10067099003)(56012099006)(6133799003)(18002099003)(3023799007);\n\tDIR:OUT; SFP:1101; ","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"1Z4pmrsrUnYdSxu1gOurBfBYl3TEMzidAlihowxXUFrwvplJmnJwml3WsNOISzLYgA4CMAZZHAz6lm2IlcW4ILbtZv4GK5vrPnUbCP2xq5HZIeYTAEfyUNAtQ0QgqJ9Vy4cVMDNxM5jyHb5GQo0mzj2/dvKPM8Vjx/oqvwqNPUNTz7tudT4mgpJO5QRfhi4c3mpFV7n/kdX9NNDeXL1ifCX/gL10ExarmrrfHkQPDaQ4qLGYXzRizhBd+gmJDse2iE443g4M2Ua0yUKxvzmhO7HrWCxVz7vKOCY58comRTghnVGkxlFTdfrFZurtbKMZbPvD/8dVvNiS2cgrl9PNlgUn7bMJgRO/ueTU86QRcCT6tstoPUFIY5EGstm9Rzlb+9zJCtprvoIseExOfkXDE+HzxSVZYSoaNIz2IOcAILN+Dhqbupie34YbjLM/BGRluv8FkCEKtnz4w+pFJUlHzP65X1oNETy56DrVCo0dli7KW9gBlk7vt7Tal+F7voPI4ajLFqevDvWhFbC/EWRowpbHiduDaTc/08pgg/yT6l+CcwZ315AhDvmiaVWvvANmPht9cYScK3IlaqsChJU8zQdVSrDK8eHgO21aSnAyPsYXWV/KuAoP8PQIs7yNWk0Fdi+7ElXkrzJUlP5e3mYlgciHJYu4iQlqRwgOdmgDrsPMxah57nXW5EFzQZR0yGdNEm6mycFZgVYVS2msGo2BNbpAhMo7UniG/o2WRls7lgu66QVlzq4pPp4TYOLCaClBeHuf2ykrWk51IEzBF9kZDzfu2ffJJCOwQIYbsG+1xRjqxUygt2LuGqVfPtEP0/p8mxqPvnGvjYL0uBU77FuSJl2zLevG12ur6pWQbsxmR6sZ4JId2IPrd5jYAGwW83b7QMqmdhm+ecuiLoIdkU+JmF3PL2Rftjyvq6r8vXq47avMIREm+fQQ9YbsJ8SEY5ji4EFTJn5NjIKaGxF2mTEtIwj0wsvHeTK7c8P7f62QubILs2tQ/21bz3ArXFP1r26aDLo8VsoVtDlJEBm8mqXppOiibv/Qe8zVuoqx/SSBhl5w/nGaP8ep6XiAnCc0Ur6bYQE0sdCJyWS6+nfsWZdigaK2xv+pSpHZ8Tk/dgtZzcLwCDeEhmGZK6Mx0p8HaZ9SaBnMVxcShq/ShmXGD0OrnfS4Ok+Adp1oPU+gD8V7rKbjvHa73XlddjtDEz+mNnDcTwy99xQ3rxAf9e6/9Qto3LFQafXskYpS6pPhruPeMRze1OsDeViY7cveNZkXxVUxrE5IPF5yWggyGnV8V+bjX+xuX9DgJEaa0qAFB75NWMwsnIyON47hldlL22bp1HaAmoRhYFBTXgQB036LQmVeHWS19ozS1T2iTNrJYS6Lrd6FIxYBp+9ksqVVlSW1OPLpSROjwCldMi1tL6jMXdupjw83tCfi3UsnEPfOTj8ad97sNMB/uBwGcMdV0KzeOHqAScX2eRW4C1Qs9uMg0XczPJJUe0QtqnpyY99bvMuutdgUIBqe6EjG26BmJNvCnovlLwNLlXAqXe9bP+mz792y9FjkcfX3TdCYhjdTQad9JpxFVg3GxEAqXxSp0TmytSTwFdwRJlssB8Yr723cNeaRaxSXJ5RVgFSPiEJgfnb4j+O96qTbc76V1ogqmmyEohO4SSzF/OVrx+Lm1dZELovCFEmwtNcqSmlmKebnGBKy1IXmS49WQA4YiPMyX268R/QlH1cgDNLwQqJcLv2Zp28IfoOVVjXJDnWIz1y73I3g4YA=","X-OriginatorOrg":"oss.nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"fa3a58d4-2711-4c57-f094-08deebaa2986","X-MS-Exchange-CrossTenant-AuthSource":"AM9PR04MB7556.eurprd04.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"27 Jul 2026 06:42:01.0526\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"PkKPSf3hhXEywO/jmZ0GX/BPQI+nb6Csbboo509bRulthUWwxOPUeCQ4hp98eAnP0LAUniykjA4VIT8z9utIq7rOe53W0O0eV/Jxbwu8g2I=","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"MI3PR04MB12659","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Qi Hou <qi.hou@nxp.com>\n\nisAvailable() previously called probeDisplay() to run a full EGL\ninitialisation sequence and then immediately terminated the display with\neglTerminate(). When SoftwareIsp subsequently created a DebayerEGL\ninstance, initEGLContext() would call probeDisplay() again, repeating\nthe full initialisation.\n\nFix this by reusing the display obtained during the availability check.\nprobeDisplay() is promoted to a public static method and isAvailable()\nis removed. The eGL constructor now takes the EGLDisplay as a parameter\nand stores it directly, so initEGLContext() no longer needs to call\nprobeDisplay(). DebayerEGL is updated to accept and forward the display\nto eGL, and SoftwareIsp calls eGL::probeDisplay() once, passing the\nresult straight to DebayerEGL when EGL is available.\n\nSigned-off-by: Qi Hou <qi.hou@nxp.com>\n---\n include/libcamera/internal/egl.h            |  5 ++-\n src/libcamera/egl.cpp                       | 38 +++++++--------------\n src/libcamera/software_isp/debayer_egl.cpp  |  5 +--\n src/libcamera/software_isp/debayer_egl.h    |  2 +-\n src/libcamera/software_isp/software_isp.cpp |  5 +--\n 5 files changed, 21 insertions(+), 34 deletions(-)","diff":"diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h\nindex 1e31d490b..7ef1ca0d9 100644\n--- a/include/libcamera/internal/egl.h\n+++ b/include/libcamera/internal/egl.h\n@@ -99,11 +99,11 @@ private:\n class eGL\n {\n public:\n-\teGL();\n+\teGL(EGLDisplay display);\n \t~eGL();\n \n \tint initEGLContext();\n-\tstatic bool isAvailable();\n+\tstatic EGLDisplay probeDisplay();\n \n \tint createInputDMABufTexture2D(eGLImage &eglImage, int fd);\n \tint createOutputDMABufTexture2D(eGLImage &eglImage, int fd);\n@@ -137,7 +137,6 @@ private:\n \tEGLContext context_ = EGL_NO_CONTEXT;\n \tEGLSurface surface_ = EGL_NO_SURFACE;\n \n-\tstatic EGLDisplay probeDisplay();\n \tint compileShader(int shaderType, GLuint &shaderId, Span<const unsigned char> shaderData,\n \t\t\t  Span<const std::string> shaderEnv);\n \ndiff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp\nindex 7ec7a654d..b5ed0e13a 100644\n--- a/src/libcamera/egl.cpp\n+++ b/src/libcamera/egl.cpp\n@@ -64,12 +64,15 @@ LOG_DEFINE_CATEGORY(eGL)\n \n /**\n  * \\brief Construct an EGL helper\n+ * \\param[in] display The EGL display to use\n  *\n  * Creates an eGL instance with uninitialised context. Call initEGLContext()\n- * to set up the EGL display, context, and load extension functions.\n+ * to set up the EGL context, and load extension functions.\n  */\n-eGL::eGL()\n+eGL::eGL(EGLDisplay display)\n+\t: display_(display)\n {\n+\tASSERT(display_ != EGL_NO_DISPLAY);\n }\n \n /**\n@@ -299,6 +302,13 @@ void eGL::createTexture2D(eGLImage &eglImage, void *data)\n \tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);\n }\n \n+/**\n+ * \\brief Try to create an EGL display for surfaceless rendering\n+ *\n+ * Tries to create an EGL display for surfaceless rendering.\n+ *\n+ * \\return A EGL display handle if successful, otherwise \\a EGL_NO_DISPLAY\n+ */\n EGLDisplay eGL::probeDisplay()\n {\n \tEGLDisplay display;\n@@ -325,24 +335,6 @@ EGLDisplay eGL::probeDisplay()\n \treturn display;\n }\n \n-/**\n- * \\brief Probe whether EGL surfaceless rendering is available\n- *\n- * Checks if an EGL surfaceless display can be obtained and initialised.\n- * The display is immediately terminated so that no resources are leaked.\n- *\n- * \\return True if EGL surfaceless rendering is available, false otherwise\n- */\n-bool eGL::isAvailable()\n-{\n-\tEGLDisplay display = probeDisplay();\n-\tif (display == EGL_NO_DISPLAY)\n-\t\treturn false;\n-\n-\teglTerminate(display);\n-\treturn true;\n-}\n-\n /**\n  * \\brief Update a 2D texture already created\n  * \\param[in,out] eglImage EGL image to associate with the texture\n@@ -403,12 +395,6 @@ int eGL::initEGLContext()\n \tEGLint numConfigs;\n \tEGLConfig config;\n \n-\tdisplay_ = probeDisplay();\n-\tif (display_ == EGL_NO_DISPLAY) {\n-\t\tLOG(eGL, Error) << \"Unable to probe display\";\n-\t\tgoto fail;\n-\t}\n-\n \tLOG(eGL, Info) << \"EGL: EGL_VERSION: \" << eglQueryString(display_, EGL_VERSION);\n \tLOG(eGL, Info) << \"EGL: EGL_VENDOR: \" << eglQueryString(display_, EGL_VENDOR);\n \tLOG(eGL, Info) << \"EGL: EGL_CLIENT_APIS: \" << eglQueryString(display_, EGL_CLIENT_APIS);\ndiff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\nindex dd2041219..20b478b1c 100644\n--- a/src/libcamera/software_isp/debayer_egl.cpp\n+++ b/src/libcamera/software_isp/debayer_egl.cpp\n@@ -40,9 +40,10 @@ namespace libcamera {\n  * \\brief Construct a DebayerEGL object\n  * \\param[in] stats Statistics processing object\n  * \\param[in] cm The camera manager\n+ * \\param[in] display The EGL display to use\n  */\n-DebayerEGL::DebayerEGL(std::unique_ptr<SwStatsCpu> stats, const CameraManager &cm)\n-\t: Debayer(cm), stats_(std::move(stats))\n+DebayerEGL::DebayerEGL(std::unique_ptr<SwStatsCpu> stats, const CameraManager &cm, EGLDisplay display)\n+\t: Debayer(cm), stats_(std::move(stats)), egl_(display)\n {\n }\n \ndiff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\nindex e613639f5..30e51a477 100644\n--- a/src/libcamera/software_isp/debayer_egl.h\n+++ b/src/libcamera/software_isp/debayer_egl.h\n@@ -40,7 +40,7 @@ class CameraManager;\n class DebayerEGL : public Debayer\n {\n public:\n-\tDebayerEGL(std::unique_ptr<SwStatsCpu> stats, const CameraManager &cm);\n+\tDebayerEGL(std::unique_ptr<SwStatsCpu> stats, const CameraManager &cm, EGLDisplay display);\n \t~DebayerEGL();\n \n \tint configure(const StreamConfiguration &inputCfg,\ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex c73a16ce0..c7165771c 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -120,8 +120,9 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n \t}\n \n \tif (!softISPMode || softISPMode == \"gpu\") {\n-\t\tif (eGL::isAvailable()) {\n-\t\t\tdebayer_ = std::make_unique<DebayerEGL>(std::move(stats), cm);\n+\t\tauto display = eGL::probeDisplay();\n+\t\tif (display != EGL_NO_DISPLAY) {\n+\t\t\tdebayer_ = std::make_unique<DebayerEGL>(std::move(stats), cm, display);\n \t\t} else {\n \t\t\tLOG(SoftwareIsp, Info)\n \t\t\t\t<< \"EGL not available, falling back to CPU debayer\";\n","prefixes":["v2"]}