From patchwork Mon Jul 6 11:01:14 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: 27238 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 4FD9AC330F for ; Mon, 6 Jul 2026 11:01:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8D84966021; Mon, 6 Jul 2026 13:01:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="f6/P395r"; dkim-atps=neutral Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DF3C4658E0 for ; Mon, 6 Jul 2026 13:01:31 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-47122683cf3so1815216f8f.0 for ; Mon, 06 Jul 2026 04:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783335691; x=1783940491; 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=s3J/NrfJsMXq4eaqAQimcvyIokeKF2MgvnNr4M7DXMo=; b=f6/P395ryGRD827SoUjiJICy0gjHgBhMxYsGzPIgDh93nIIKAgA9k8H1pXHlc0hOFK ciyBSi1XfCXs+N9BO4ij5HE05Fw07B7zAVssDv2ZhPLlqE/VvDjg4EC13QCxqCNihmxW o+f0RET8IuNLWaPKi7y7r5/zY9wzB8t/Qkw/rmWa4SAyTlLtxt1Kg3m28ZdSa+kN1l+v mASCzc6lKJaqHI7ZOt52iKXxaeckfB6pBa1kflf34gQ8+Ibg8R45D01fbweyavCYe4fh t31euJL9egDs9pmLwMZSgb4hjKR7OivDkK1e5BI3Bhv3wq3Plm8as80rbwo1Z6tfLdyj V4mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783335691; x=1783940491; 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=s3J/NrfJsMXq4eaqAQimcvyIokeKF2MgvnNr4M7DXMo=; b=AViIcL+pkoJNj7EAF810io/JFbllG6T/tSTdAiqVbf6aTc1VS82vmrXr/TJzf3rV4y WjsN4EimKVmiZf/kudpORPugOfCo1Lx1dTYzvGD/q4QLiUM3elDFZQFo7TPJJTaieajc lbgzNBXZM9yExqcCBHnKXnOxITsEv8J/Y2QtUzd6vzt5HFlts7Ptc62I7p6YvhbblvDZ IZChoRBc9h7SRTGtwOTP5TFURMPS89PWlQM+z4iE2RuEbjJ6HQ/t7zRLxYvXeTbieQOJ G5NgYVmaq6Cf6Ykuw3637PSODDS5Vj8/bQKBnmJTmd5IaV+gbl9A+ZM6nnQCkBE/34ir faxQ== X-Gm-Message-State: AOJu0YzFZvJXrVoenqY9B6sWi2amGDxBFIsSXo7t0lYiiJ9g2zt1oUrA pVD4YrnVZ14wyf79uhInAEmDdTE09/K4Y+HUg/1Kinw513BIcu6fx9Asrw/eDaAgG0DqlbgO5Di FwGnr X-Gm-Gg: AfdE7cme4sneSMHiAIds83uA/AdObm35ngpK3MxoGOOaatt0CK80tLw7uTotpfIICCK RBYHGU3ZkOz210jHLyNVrWUEZz0tpe52naCC3bmLVQnaBuYVT7bV/Qvim7RbvkwNa0VgwPb/bWT v8uzOM1YHnYGolNz2NHQyekCfgMSezBb/e0a5CohnEgEx4gvzu/Z34oHo6/NI8sM8NmU862Nbd/ Ip3zP1ozuO/mATASX91Dg2A7aRlLstkeoOUdwTocece2vwEcXXC0Igu9xMF0dSEmsNpgYySvZm+ 97ueLf3/5eb74WePga1Qjy4oK375+d9dckBESKoMrIcLQrYcFzmTngzv1WvU9a0kz1VEiJmNcvR ogZ3dPNsamQJSSC6dr7vYma3jnsfSMSswgoXeu106VzzmfmAeRVT8KeLFVXHe7AAYKSd/e27Hvy ZszBFl1JSRYCbtEUreMbOl48RE2/48 X-Received: by 2002:a5d:6f13:0:b0:475:f0f0:9ef0 with SMTP id ffacd0b85a97d-47aaee4cf42mr10114815f8f.53.1783335691319; Mon, 06 Jul 2026 04:01:31 -0700 (PDT) Received: from inspiron14p-linux ([109.77.44.220]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0960634sm25190846f8f.26.2026.07.06.04.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 04:01:30 -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 v4 1/7] libcamera: software_isp: debayer_egl: Pass eglImage as parameter to setShaderVariables Date: Mon, 6 Jul 2026 12:01:14 +0100 Message-ID: <20260706110120.2509826-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260706110120.2509826-1-bryan.odonoghue@linaro.org> References: <20260706110120.2509826-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 */