[{"id":37002,"web_url":"https://patchwork.libcamera.org/comment/37002/","msgid":"<855xb39xt4.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-11-21T16:04:39","subject":"Re: [PATCH 21/22] libcamera: software_isp: lut: Make gamma from\n\tlut.cpp available in debayer params","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> Provide the gamma used in IPA to Bayer parameters. We will pass Gamma into\n> the shader via a uniform and can then tweak that value from outside at\n> will.\n\nI'm not sure what \"tweak that value from outside\" means exactly.  My\nsimple IPA refactoring RFC introduces a control for gamma and other\nchanges.  This patch is completely sufficient for the purpose of\nintroducing GPU ISP, the rest will be addressed in the refactoring\nseries once GPU ISP is merged.\n\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  include/libcamera/internal/software_isp/debayer_params.h | 5 +++++\n>  src/ipa/simple/algorithms/lut.cpp                        | 2 ++\n>  2 files changed, 7 insertions(+)\n>\n> diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\n> index 1a319833c..5f340a7a6 100644\n> --- a/include/libcamera/internal/software_isp/debayer_params.h\n> +++ b/include/libcamera/internal/software_isp/debayer_params.h\n> @@ -62,6 +62,11 @@ struct DebayerParams {\n>  \t * Per frame blacklevel gains calculated by the IPA\n>  \t */\n>  \tRGB<float> blackLevel;\t\t/**< Blacklevel gains for GPUISP */\n> +\n> +\t/*\n> +\t * Gamma value as provided by the IPA\n> +\t */\n\nSinge line comment enough?\n\n> +\tfloat gamma;\t\t\t/**< Gamma for GPUISP */\n\nExtra \"*<\".\n\nWith that fixed:\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n>  };\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\n> index 49482d711..ea5a86b20 100644\n> --- a/src/ipa/simple/algorithms/lut.cpp\n> +++ b/src/ipa/simple/algorithms/lut.cpp\n> @@ -147,6 +147,8 @@ void Lut::prepare(IPAContext &context,\n>  \t\t\tparams->gammaLut[i] = gammaTable[i / div];\n>  \t\t}\n>  \t}\n> +\n> +\tparams->gamma = context.configuration.gamma;\n>  }\n>  \n>  void Lut::process([[maybe_unused]] IPAContext &context,","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 1571DC3333\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 21 Nov 2025 16:04:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4588D60A80;\n\tFri, 21 Nov 2025 17:04:48 +0100 (CET)","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 6EEDE60805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Nov 2025 17:04:46 +0100 (CET)","from mail-wr1-f71.google.com (mail-wr1-f71.google.com\n\t[209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-690-51AT6GrLMpCpwZ2asd6EDg-1; Fri, 21 Nov 2025 11:04:43 -0500","by mail-wr1-f71.google.com with SMTP id\n\tffacd0b85a97d-429c5f1e9faso2609564f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Nov 2025 08:04:42 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-42cb7fd9061sm11699158f8f.41.2025.11.21.08.04.40\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 21 Nov 2025 08:04:40 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"GpURIxhK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1763741085;\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=zTPIu2hX/0m267FBRBmkXdLslpKbfE/VuBX4evljl+g=;\n\tb=GpURIxhKgdLgFoEc2tr5ZHlZivbQUxPT7SztBuctSf8HHnkZfL7lPo0foG1uvKUZToL7Ly\n\tm+x8C2tCi5UgxznKn4XhwQ3NL7SrvnCWBgd9EeWe1ZOckuZH/e+pfIkKzxF2YnAQDmskiM\n\t/Tjr7f8NBRfVZteaRdoT9bPx82kMb9c=","X-MC-Unique":"51AT6GrLMpCpwZ2asd6EDg-1","X-Mimecast-MFC-AGG-ID":"51AT6GrLMpCpwZ2asd6EDg_1763741082","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763741082; x=1764345882;\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=zTPIu2hX/0m267FBRBmkXdLslpKbfE/VuBX4evljl+g=;\n\tb=Ylis8D/qo5xxjfFD36FMEIvU0FWY3JDq9CadU8tp8aVRozqqWs7A/+albZxlqEvE3g\n\tUhiFpZL0M4IR/tE1T9/C43o0jXut4M6W0X7dDOSG7w7vlX6ORwv1JiU/QCrYCz6rdG4q\n\tMwqQCJc66BwfBRpDxe/stOzrnJYCGr2JThP95W7oYbNmC5L01k6wp1NCHf4Bg8Ifnmh9\n\t+oTgt86nXuB4s9TZLPzqfmtqf0GRCPewT6EaHbzKhBmt5+QKfIuz4y2QpvPMT8BWXdoA\n\tcdLrMF+17equFKcby0yQuE2M1iD9JpRdx3dpj8xDHOYuC3NlyWoM9eLea65XJxencSb4\n\tCGKg==","X-Gm-Message-State":"AOJu0Yy301kzyGmJnweJ36bZAMNDwI2NvNnwYd6qE9Dqhpm+Nmss9oJq\n\twU4jhUcIWIeDAE50/hsOABf9HivcL4QOvTT/LHxSOByCK2rA5us0tf+gM4ApI8TTXnsrGMwcpwP\n\thxzRMaOGx/u3az5pxBEJrcg9DjaAFbcp4pVZIkwBSqmKcNa8uWWgvGTsvUI0IIIE/IWU0ZimH4t\n\tI=","X-Gm-Gg":"ASbGncs0XWtjxwJoIenMEkxVXrfLaJXVzk1j78MTMpRh/foAzsm/ElRoSqKG6cYWKOd\n\twjFLa7HIj/PwC3SV88Q8M5TSBImKW9FhBeYe8JU6f9Ka4wYf2WsiHvCi3Jh6PidJ0gQVwWckO4q\n\th4Eq3Ffzjm/wF1PVAlUYz3TnSP468TLvrFtp6/oo9XgMQggMXO7WEjxW1kb8DlQ/7HiiolFYhwj\n\tkKoXLeQp1r5znh1PA2/6viMpFC+jmEqKHwIVUKB47NXJxBdl9Ubliq8SQoksmo4ZsiTT7RdQf+1\n\tFl2cX66FU04+S/p982sTJznUpm8Sj0AHtgZlj3r+gj6A9G9isg/eW/no7mRhW7iwZEC4MG1Gwe7\n\tH774cXcvwa0ixptfgNcyCvJYwLh+AcIYXvUo5m8IInB9V8qQxHlBNp4mDic6yAP4=","X-Received":["by 2002:a05:6000:61e:b0:429:c617:a32f with SMTP id\n\tffacd0b85a97d-42cc1d51a63mr2753119f8f.52.1763741081564; \n\tFri, 21 Nov 2025 08:04:41 -0800 (PST)","by 2002:a05:6000:61e:b0:429:c617:a32f with SMTP id\n\tffacd0b85a97d-42cc1d51a63mr2753087f8f.52.1763741081130; \n\tFri, 21 Nov 2025 08:04:41 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IG4HFpHrsFc/9bxJA5Uxmrv/2rDEwjPvS6yigCue8aA+2oi4s9ZdnR7iCx7tsQfC2nnuxsESw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz","Subject":"Re: [PATCH 21/22] libcamera: software_isp: lut: Make gamma from\n\tlut.cpp available in debayer params","In-Reply-To":"<20251120232019.3590-22-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Thu, 20 Nov 2025 23:20:18 +0000\")","References":"<20251120232019.3590-1-bryan.odonoghue@linaro.org>\n\t<20251120232019.3590-22-bryan.odonoghue@linaro.org>","Date":"Fri, 21 Nov 2025 17:04:39 +0100","Message-ID":"<855xb39xt4.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":"gqRIaisd2m5bLJ8K4-GO_xZ1fJTIOU_95Q8nygKt8JU_1763741082","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>"}}]