From patchwork Wed Jun 24 08:58:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 27034 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 0ACD2C3308 for ; Wed, 24 Jun 2026 08:59:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AB16D658A6; Wed, 24 Jun 2026 10:59:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="vpSEMMCB"; dkim-atps=neutral Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5EDE365881 for ; Wed, 24 Jun 2026 10:59:06 +0200 (CEST) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-49258ac7294so5342045e9.0 for ; Wed, 24 Jun 2026 01:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782291546; x=1782896346; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nRwCPeGqJXiXkiIP/SKGTBYoNGqKiysO7kBIfJxUMRk=; b=vpSEMMCBMr6HXaY+g33V7PF5PDeULohpEDuurDh96uEyRlb1FDijlNhmbP/kZYFs+L Yi84o2hCI2M2Oz6MOoy7RfXcPwQ3XMf4N6G50g3+bl3xXHIihFOiZfzD+x8uNvPwYqA8 9bOm42BXkXxs7I+ZW248zxZoU53E9zCARPnhJq7MhHF6FC18ugHIDx6Lr5yz2AT6HBv8 h7gbLVk6AM3NG98pB3RAhcizZ+JAURCDGFbcHeNCbBUfLRNR1r1miBI3FOD3CNVB1MYm 8oUYzRtMyAIL/encVL+ObcvYND+5GWCAdPiPff3GfBBT9E881cqnt7Qz1dxqwGp3MWCj H3OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782291546; x=1782896346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nRwCPeGqJXiXkiIP/SKGTBYoNGqKiysO7kBIfJxUMRk=; b=I2fDzgEtLlSPp8SkSSjzn0acrH79XvT1iaZUEz8hfgm38f55/qpSWbpT7Djp4qG2VM od1BcfUO3e1eMCDZBnf2YFToyCYP3TZ/DRYtG7984N4qTjM7PcnGYkfHKpbRuy5rhwrE YOo1RaaYh7rfiyBVlGjCXTsFURyegTL/hMhKAOXGFFDyxlhZ1LJgvHZYGlnlzBFLmRPs 9sZY9NietQeL1H4rbPtvCkxf+0wHZQVZuddyvt7g9iqmDzPh2HnT+bWU95fR9H++Ilu2 LTIrSCOq3LiQFhF+0MuP3Z4FQWZ7HMK74j9LulM7DlO7Hwsag7S45gHPCM7zhocHff1j Qptg== X-Gm-Message-State: AOJu0Yw4zEhWNblmJTPSpYYezBHZV/dWlMN/HFAvp+szHkF0UrF6IW0n zNEWKT5fwkb0LTK9R/eKhBLQ+jsHPe45KaYSWy42dnMxWPXSGrsQEQScidh1K1M/6zBizydCxys yWd2zwoQ= X-Gm-Gg: AfdE7cmD61pIFhfuo6xUHvH26Kx5OpjKNg1xTYer2EuAJpzUEuJzQLpZQe1u1KT8Q+u aLfPuc+B7Up319CoGdx52vT8rpeKHbo4UnICW/MPxK/kMldo9KNbxhlia6jBtZYQC5C2W6nymEJ xKBjxLfw3ubdLrjDDymrwIS0mdsItud2dck8UbnER+/Ahg7gi1YOw9HbbPkHLfaTqkLGFB+wq0M AMz0TweaeR/j/GIO50oz+JRiarJzn2c2U88s7iYtGOnJHRuZ22B3VBqcqp3G5WKeE5jl9miziuc h8jzj57ZBVPBfOF91tjYgR+mrwoflEXutOEosfD0llXE7uMzSoLGNIVaNgI6UEu4I9xzhrydg40 95E+N1nNw43xekHDhhriFndOCcqNV+WwVE6wllAEYDc6EuO178/E0mwt+wa4tpB/blRhZ3fbC9E CVswh2ni/J5QUTm1iTMBHKb51ZBlMYc1cqeFE4kpA= X-Received: by 2002:a05:600c:3f07:b0:490:c024:2eba with SMTP id 5b1f17b1804b1-49260872b71mr31522885e9.22.1782291545875; Wed, 24 Jun 2026 01:59:05 -0700 (PDT) Received: from inspiron14p-linux ([109.76.100.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49261063d6esm25128375e9.2.2026.06.24.01.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2026 01:59:05 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH 08/10] libcamera: software_isp: debayer_egl: Pass eglImage as parameter to setShaderVariables Date: Wed, 24 Jun 2026 09:58:47 +0100 Message-ID: <20260624085849.873784-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260624085849.873784-1-bryan.odonoghue@linaro.org> References: <20260624085849.873784-1-bryan.odonoghue@linaro.org> 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" We will create a cache of textures and eGLImages which means the value assigned to the shader texture unit will come from one of those now cached eGLImage objects. Pass eGLImage as a parameter to facilitate future differentiation. Signed-off-by: Bryan O'Donoghue Reviewed-by: Robert Mader --- src/libcamera/software_isp/debayer_egl.cpp | 6 +++--- src/libcamera/software_isp/debayer_egl.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index cdceacf96..f6b7b11e1 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -397,7 +397,7 @@ uint32_t DebayerEGL::preferredInputStride(const PixelFormat &inputFormat, const return info.stride(size.width, 0, 256); } -void DebayerEGL::setShaderVariableValues(const DebayerParams ¶ms) +void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerParams ¶ms) { /* * Raw Bayer 8-bit, and packed raw Bayer 10-bit/12-bit formats @@ -453,7 +453,7 @@ void DebayerEGL::setShaderVariableValues(const DebayerParams ¶ms) * To simultaneously sample multiple textures we need to use multiple * texture units */ - glUniform1i(textureUniformBayerDataIn_, eglImageBayerIn_->texture_unit_uniform_id_); + glUniform1i(textureUniformBayerDataIn_, eglImageIn.texture_unit_uniform_id_); /* * These values are: @@ -542,7 +542,7 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, const Debaye /* Generate the output render framebuffer as render to texture */ egl_.createOutputDMABufTexture2D(*eglImageBayerOut_, output->planes()[0].fd.get()); - setShaderVariableValues(params); + setShaderVariableValues(*eglImageBayerIn_, params); glViewport(0, 0, width_, height_); glClear(GL_COLOR_BUFFER_BIT); glDrawArrays(GL_TRIANGLE_FAN, 0, DEBAYER_OPENGL_COORDS); diff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h index 4c7c86472..348d7305b 100644 --- a/src/libcamera/software_isp/debayer_egl.h +++ b/src/libcamera/software_isp/debayer_egl.h @@ -65,7 +65,7 @@ private: static int getOutputConfig(PixelFormat outputFormat, DebayerOutputConfig &config); int initBayerShaders(PixelFormat inputFormat, PixelFormat outputFormat); int getShaderVariableLocations(); - void setShaderVariableValues(const DebayerParams ¶ms); + void setShaderVariableValues(eGLImage &eGLImageIn, const DebayerParams ¶ms); int debayerGPU(FrameBuffer *input, FrameBuffer *output, const DebayerParams ¶ms, std::optional *mappedInputBuffer, std::optional *inputBufferDmaSyncer); /* Shader program identifiers */