[{"id":39464,"web_url":"https://patchwork.libcamera.org/comment/39464/","msgid":"<85se69jxj6.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-06-26T12:28:45","subject":"Re: [PATCH v3 1/8] libcamera: software_isp: debayer_egl: Pass\n\teglImage as parameter to setShaderVariables","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> We will create a cache of textures and eGLImages which means the value\n> assigned to the shader texture unit will come from one of those now cached\n> eGLImage objects.\n>\n> Pass eGLImage as a parameter to facilitate future differentiation.\n>\n> Reviewed-by: Robert Mader <robert.mader@collabora.com>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n>  src/libcamera/software_isp/debayer_egl.cpp | 6 +++---\n>  src/libcamera/software_isp/debayer_egl.h   | 2 +-\n>  2 files changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\n> index 0ec2a98cf..14eeb9a29 100644\n> --- a/src/libcamera/software_isp/debayer_egl.cpp\n> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n> @@ -397,7 +397,7 @@ uint32_t DebayerEGL::preferredInputStride(const PixelFormat &inputFormat, const\n>  \treturn info.stride(size.width, 0, 256);\n>  }\n>  \n> -void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n> +void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerParams &params)\n>  {\n>  \t/*\n>  \t * Raw Bayer 8-bit, and packed raw Bayer 10-bit/12-bit formats\n> @@ -453,7 +453,7 @@ void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n>  \t * To simultaneously sample multiple textures we need to use multiple\n>  \t * texture units\n>  \t */\n> -\tglUniform1i(textureUniformBayerDataIn_, eglImageBayerIn_->texture_unit_uniform_id_);\n> +\tglUniform1i(textureUniformBayerDataIn_, eglImageIn.texture_unit_uniform_id_);\n>  \n>  \t/*\n>  \t * These values are:\n> @@ -542,7 +542,7 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, const Debaye\n>  \t/* Generate the output render framebuffer as render to texture */\n>  \tegl_.createOutputDMABufTexture2D(*eglImageBayerOut_, output->planes()[0].fd.get());\n>  \n> -\tsetShaderVariableValues(params);\n> +\tsetShaderVariableValues(*eglImageBayerIn_, params);\n>  \tglViewport(0, 0, width_, height_);\n>  \tglClear(GL_COLOR_BUFFER_BIT);\n>  \tglDrawArrays(GL_TRIANGLE_FAN, 0, DEBAYER_OPENGL_COORDS);\n> diff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\n> index 4c7c86472..348d7305b 100644\n> --- a/src/libcamera/software_isp/debayer_egl.h\n> +++ b/src/libcamera/software_isp/debayer_egl.h\n> @@ -65,7 +65,7 @@ private:\n>  \tstatic int getOutputConfig(PixelFormat outputFormat, DebayerOutputConfig &config);\n>  \tint initBayerShaders(PixelFormat inputFormat, PixelFormat outputFormat);\n>  \tint getShaderVariableLocations();\n> -\tvoid setShaderVariableValues(const DebayerParams &params);\n> +\tvoid setShaderVariableValues(eGLImage &eGLImageIn, const DebayerParams &params);\n>  \tint debayerGPU(FrameBuffer *input, FrameBuffer *output, const DebayerParams &params, std::optional<MappedFrameBuffer> *mappedInputBuffer, std::optional<DmaSyncer> *inputBufferDmaSyncer);\n>  \n>  \t/* Shader program identifiers */","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 E6E0DC3264\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Jun 2026 12:28:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8BECD65EDE;\n\tFri, 26 Jun 2026 14:28:52 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AC235658FA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2026 14:28:50 +0200 (CEST)","from mail-wr1-f70.google.com (mail-wr1-f70.google.com\n\t[209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-130-URjvqpWsPKiDwByLXzq8LQ-1; Fri, 26 Jun 2026 08:28:48 -0400","by mail-wr1-f70.google.com with SMTP id\n\tffacd0b85a97d-46fb9079a04so68580f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2026 05:28:48 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-4.net.vodafone.cz. [77.48.47.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-46c2279b85csm23002095f8f.28.2026.06.26.05.28.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 26 Jun 2026 05:28:46 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"dm+sw8Ag\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1782476929;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=om2sGaBLRDsaVZnmjEJ8EZdzVpg1qvDrTPoGyj783T8=;\n\tb=dm+sw8AgOoIjoUOn1StX8c0rBKH4usbqBv25lbGo2ZE0L+uaZ+fEZI9P/TbQKKKU+F13s7\n\tDSQlla7GULEm/4agaveH3u1STz87rWcqbbTqHd9sSo7BGxNYj26AjNKiJzcXuucNV9t129\n\t5FI+gl1xqwhzSJ3Uhmd+zNRiY++9lA4=","X-MC-Unique":"URjvqpWsPKiDwByLXzq8LQ-1","X-Mimecast-MFC-AGG-ID":"URjvqpWsPKiDwByLXzq8LQ_1782476927","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1782476927; x=1783081727;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=om2sGaBLRDsaVZnmjEJ8EZdzVpg1qvDrTPoGyj783T8=;\n\tb=du2gPh7+S4Z6v0CbhPa338nQFly+K756XvKGh6HrDYsVF8twOoetOvbCrHzhSZjMZr\n\t9N+hb6Q6f0QN9BSJtGJELmC9cviHB9IUIJJqEWu5+uFtnU4R32ceYoq2aO8z3iqkrsZG\n\tyFz6zR0NAbd+d22wx3Jjht6LwI8RUUQvpOPKLOIm8/kmVVYAbWE4oahNkgztbGH+SRlI\n\tFrtiDDkyqWhWeQoEeywRn0SSm6mae8Z+TfAydJNTuu1YRlREWL/pH7J5H8DbIuAzZ3Dx\n\tDFaNI4qEPyoRiq6GUWDkVOl4thCHI25k7sQTDjhGPASQGxnWjG7xupVUDptEdY+8y+YQ\n\tkogg==","X-Gm-Message-State":"AOJu0YwDykG/tiGxuGfQFVDoh9+p8jfHRY6pyKRZR2gvqd8ZlJ5gq6/W\n\tz/Wh5zHO6grp/7acmUHUrOBLxUuKohKD6HoGpm8P7xjOLsV6ygWVxe+n+A0/XfqVnu5Wr1HM6PV\n\tXxuzvwyzz2elEX10t3pZGZb9YX3zQN3D+ZzkzqwGG5L1BwsQHWWTBShxBk7/NvRjMVpF8ERbc/S\n\tE=","X-Gm-Gg":"AfdE7cmR+WSvTc20bxwgdvbce9zKcOr3yxosSVJ1FdoIVZfd6Q8D4QSFXDrbDO1AEdZ\n\trSmtMjawv2WH3ZLhFjXpYyvuSLC9VIwuJAfSSdXAwOKd0epbCByx8/HtwImBV2m+QUcmrBTuIpb\n\taoQRSNKYfu/0B1EDCUx1ViL7fDPrqfKM5/9JvMREFwcx1cErHOoyXuZNde3wB33UaZhUBeTbPy6\n\thaI1/zWAK5jaINZkgedW6Rs1jkXOLvuU0+8u6qYNHpG14yPOCmzMc0oMArKmEaa4eM4dSusp9pD\n\tsAAJ99cnvhXMNSymTDo9qgN29LGJdW9Mvgbybd7LO46LXJnJYNmS7oMOVtj0M/rd90GXDdUhnSd\n\tfGHfjE9Linjk/BH/3YjHw8rHI49jydojX7XOdcL/j0V1tCbyzcAyYWQ8kKgaaL6qR","X-Received":["by 2002:a05:6000:12c5:b0:460:3b5d:43b6 with SMTP id\n\tffacd0b85a97d-46fb87d3a70mr718205f8f.31.1782476927004; \n\tFri, 26 Jun 2026 05:28:47 -0700 (PDT)","by 2002:a05:6000:12c5:b0:460:3b5d:43b6 with SMTP id\n\tffacd0b85a97d-46fb87d3a70mr718170f8f.31.1782476926612; \n\tFri, 26 Jun 2026 05:28:46 -0700 (PDT)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz,  Robert Mader\n\t<robert.mader@collabora.com>","Subject":"Re: [PATCH v3 1/8] libcamera: software_isp: debayer_egl: Pass\n\teglImage as parameter to setShaderVariables","In-Reply-To":"<20260626113325.3218045-2-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Fri, 26 Jun 2026 12:33:18 +0100\")","References":"<20260626113325.3218045-1-bryan.odonoghue@linaro.org>\n\t<20260626113325.3218045-2-bryan.odonoghue@linaro.org>","Date":"Fri, 26 Jun 2026 14:28:45 +0200","Message-ID":"<85se69jxj6.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"I40LeeV5CuE_AUOoCwtA_u5osi24F72UwE1VO0mYAK4_1782476927","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]