From patchwork Fri Jun 26 11:33:18 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: 27048 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 CE158C3301 for ; Fri, 26 Jun 2026 11:33:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9FBD2658FE; Fri, 26 Jun 2026 13:33:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="c6gVsJjA"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4B908658F4 for ; Fri, 26 Jun 2026 13:33:38 +0200 (CEST) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-49249707788so7531815e9.2 for ; Fri, 26 Jun 2026 04:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782473618; x=1783078418; 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=AIHm6rbPGluS8yMRW43DSurymjR5fEjks6iSsfrj5Vg=; b=c6gVsJjAmjWJxCJq4IAs4H5ipXrfS28VEl7VKtFeqWzd7YKTBpOkobQ5TuW5//NGtF tQPafbq235f6DBIokt4+Q6n2gJeBX8DlU8O5PgtjbBVu8rWT2tK5H8yRPf/tv46z1Tab 0oCE893puIbu8l1CDZ5XHd/RIFbmizYYhK2rruIXLgPS/8yYRNBg255mln1jJldFD0AE F3zi2jpnaycZ519SpullhnpzN+46+XNv0TFTD12E5osTPXf62pFkdjGlYCE/Bf8Rfj85 XZZs5zTqSVD4A7a2gVgu4yewYlz55goZmSJFzSqxQgwWGxcqSzYcshYnv5GB5mP+3s12 oOdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782473618; x=1783078418; 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=AIHm6rbPGluS8yMRW43DSurymjR5fEjks6iSsfrj5Vg=; b=VMd50i7WORGk1C0HHPAXeK+Sh/mhculJqtjE1hXr/yKChK1MLYwtsKXhjTOj/YWTXE MRFAyr/RneIZIcCxdGNxDB2FyjU65hG1AZ6rfq+OHIsnOQKcOKMeiDEqtJQ2AO7Zk3xr cpZv6Rd1c1yh7guojtM6j6/D0yzjgJdYcp01eaSRJ6wQO/JpbAyUdB7GC0lSqHrRKOye EhdYFTvzn1+uMaWDwCXI+IdQqZLD2Pe17JsZa+sfGzRtSCVQ2yZkjoyWQokwvHb5h4B0 BoorzNvX4VfwaoV0g7WX0odt1lzEvagUU8kKZHh1SCvCthzj/aR88QE7IYDugJhvZ7IN yXnw== X-Gm-Message-State: AOJu0Yw9ucmWIDsQGD1ecweMKmXFgqcyLiMRAXoOUwR8bfntbHRGHZLO F0YN+n/G/ywWhmbacunS6dbsMDzKO2E3PbPAeTeEbHYag1A42HgINPyOaoJhgRWvUFuQyiKCTs4 ObI2Tu8Q= X-Gm-Gg: AfdE7cnONMN18EL3VB4sZc8anuYwnKASnpw2cZieH8yhge3xZi+vWHXwoNrCfaXej4A b7Qqb3Ek3Dmb0MdX08xYv2Bu6+8W4/lysVOIAiLwc6Xp9P4ahrDAqwGUOBTd9DXXPTZ7qUA1FjE h3W+qwPiG1o3xuj7/dSORJinXhNbhFW+wy9HFFBXlzZAR79C7vEjXKGJp1n2QJ5kS2sZ8gLyATc KSvUJYd0XOz6DP/HpzKLxh+rEDiOWXkw+s3gixDWSL9Ouy5NRFphGMxdq752agZB/OSzPzyzCOi pXOmkR/E2OfopVgmOy8t2r5Hk7WRF1EDOd8SM6HTEtKQzKKcJ4UD55QKpP/VDT9C4xa1rwG0VKl 0+rENRakDMIVrfAD8Paj5ei4rWqcm/M8jGp4tOHR5JpcfA0yDt5kM249CswFO6e+sGK0uSj2STa xRqNUTPQWFS1OsDpUx47hJQPQFMQ== X-Received: by 2002:a05:600c:4e0b:b0:490:44eb:c1ea with SMTP id 5b1f17b1804b1-4926fc78e30mr6165485e9.24.1782473617839; Fri, 26 Jun 2026 04:33:37 -0700 (PDT) Received: from inspiron14p-linux ([109.76.78.98]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268fe31b0sm79265985e9.4.2026.06.26.04.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 04:33:36 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz, Robert Mader Subject: [PATCH v3 1/8] libcamera: software_isp: debayer_egl: Pass eglImage as parameter to setShaderVariables Date: Fri, 26 Jun 2026 12:33:18 +0100 Message-ID: <20260626113325.3218045-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260626113325.3218045-1-bryan.odonoghue@linaro.org> References: <20260626113325.3218045-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. Reviewed-by: Robert Mader Signed-off-by: Bryan O'Donoghue Reviewed-by: Milan Zamazal --- 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 0ec2a98cf..14eeb9a29 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 */