From patchwork Mon Jul 6 22:22:40 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: 27254 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 7069FC3308 for ; Mon, 6 Jul 2026 22:23:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0BFA466056; Tue, 7 Jul 2026 00:23:00 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="zgRpm7+z"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B5B0B6604D for ; Tue, 7 Jul 2026 00:22:57 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-47de0093c42so1610832f8f.3 for ; Mon, 06 Jul 2026 15:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783376577; x=1783981377; 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:content-type; bh=s3J/NrfJsMXq4eaqAQimcvyIokeKF2MgvnNr4M7DXMo=; b=zgRpm7+zwetMaazuYHbLWQoElIuVqI6ivjc0Y2IeaRgzZ8q7CGImQlvhO+r6B4Ovgy HBJ0/5ZqbPuqSQdZks6vAxSUSKc3MSDDm8Va0gSu7ftCTeatJnL4FtBdDpPrHqpIhrgw Ofl9xD/TEDOG8MMFeTVyuR0etMErq3uunec57Na1milvc9hOBVh8fczvQBXDSudGGTyU y8UpSheas46QdN4cjwVmzGNn2Fp0L5AVWhbRv8cpop2dkkX9JXZrhRoylAQtogiWXwI5 zkGnhCB/ySu5+VvJOibP/X10687aPANfd4ZwnqUXrpo2G/JHIXTlWaoQOtpDAWuFLdcz lJyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783376577; x=1783981377; 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:content-type; bh=s3J/NrfJsMXq4eaqAQimcvyIokeKF2MgvnNr4M7DXMo=; b=ZfuF1HhgqtEAEJWG+zLXcQzYvBongDalthZpaFqjqXFt2taDRndIvaJidQMyT29UzL 2hVk7jk/rw868hafNEbDO+ty8sWDVTSa+10WTUvxFGaQQdbLi80DY1y5eoqNBPSzzKFI uoqiiPqUmTtfDSPkq3NjFQ8yAMUqA507cBwGDHGz4CKa7Wk9L5wfQ3IXVxNGeiq5q6hr C/5oLoFk0C3VFYiGb9Wmbs1dhKfLi/BdGwjz7FcnsodG5g4UY+nmFutD4hdRP/QHwJ3K jGO52YJAQIUIBHQsn1ft+sPahBFqPXBZeRGvvpO/rSpauCnLJPfMTvcu8F8q1/qlHfoD e94w== X-Gm-Message-State: AOJu0Yyr7aodW1O1vOFZ7tKuWmQGmEiwigXaycsOG09SnPd5J/fUMYS4 Xb1lb+XuUzxLRZ2MOmvr8YLcSJ+4RMkZ8ItzOUiPoPEharajnstA+dGToDF0x9wCZ6CXrWaA2CI eCrgP X-Gm-Gg: AfdE7cnY46BvmcBT8d5goABu9hbwhtOq4H/U8SqG0+UQWVeyN8eTWx3H6VK6cVJqYKk 7biKYMlblrhL2Vb+euxTwF2mvnMqWcbAjo36r0bo8JEwTrf4ngp0p6E0Au/PVMA31DDuVe6m1D5 2EQKkWhwQIPKhTzVfaD9fMkEMSePr0oYHbJp6jm1VSBhY89fAyicv/duR83WB9IjQNBBuLLEh0L JduXwbC1YdKqp5uFQ17hcRw5EuEMkwUV7q5JpNpJdmfLDqpIwXUUJj7jjw4kjZXa1bcE7MnAyLB snIWJ/69nKA7us2DgDtB1owusI7oDz7OtLyRN1nqz7YAl7PFf/DjXaQ8jJQacnBuru8dYhb+veD Llymg+Euv/n3ExnRD5sBu+s+6LTzky34nKMC8ob1+phBPIAOB5Q0iwnjp01rtUUz1NR5IX1AY7i gXNpn/dN436sUVEcI3Kk2fTEWoosl8 X-Received: by 2002:adf:f9cd:0:b0:474:9991:60d0 with SMTP id ffacd0b85a97d-47de6689bc8mr1669724f8f.12.1783376577296; Mon, 06 Jul 2026 15:22:57 -0700 (PDT) Received: from inspiron14p-linux ([109.77.44.220]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039ad21sm27916413f8f.20.2026.07.06.15.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 15:22:56 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz, Robert Mader , Milan Zamazal Subject: [PATCH v6 1/6] libcamera: software_isp: debayer_egl: Pass eglImage as parameter to setShaderVariables Date: Mon, 6 Jul 2026 23:22:40 +0100 Message-ID: <20260706222245.247396-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260706222245.247396-1-bryan.odonoghue@linaro.org> References: <20260706222245.247396-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 Reviewed-by: Milan Zamazal Signed-off-by: Bryan O'Donoghue --- 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 56545816e..c3a7b7952 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -388,7 +388,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 @@ -444,7 +444,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: @@ -533,7 +533,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 */