[{"id":39758,"web_url":"https://patchwork.libcamera.org/comment/39758/","msgid":"<e9b9a23c-4cc2-4a76-ba8b-973c71b8c19f@linaro.org>","date":"2026-07-20T10:32:25","subject":"Re: [RFC PATCH v8 4/6] libcamera: shaders: Add LSC support","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"content":"On 16/07/2026 23:25, Milan Zamazal wrote:\n> From: Xander Pronk <xander.c.pronk@gmail.com>\n> \n> Lens shading correction should be applied after black level\n> subtraction (in order to make the computations with meaningful values)\n> and before white balance (especially before white balance stats are\n> computed).\n> \n> Note that lens shading correction depends on temperature, which is\n> computed from the preceding, rather than current, frame (this is due to\n> how white balance is currently computed).\n> \n> The shaders are compiled on initialisation, while lens shading\n> correction can be enabled or disabled dynamically, using the\n> corresponding control.  The whole correction in the shader is wrapped by\n> a conditional macro to be able to disable it and all the related\n> overheads if Lsc algorithm is not enabled at all.\n> \n> If Lsc algorithm is enabled, the correction is always applied, whether\n> the given control is enabled or not.  If it is not, 1.0 multipliers are\n> expected to be provided.  This is because lens shading correction is\n> supposed to be rarely switched off using the runtime control when Lsc\n> algorithm is enabled, e.g. only for demoing or debugging purposes.\n> We prefer accepting the performance penalty of applying a no-op\n> correction in such cases rather than disturbing GPU computation in the\n> regular flow by introducing a runtime `if'.\n> \n> Co-developed-by: Rick ten Wolde <rick_libcamera@wolde.info>\n> Signed-off-by: Rick ten Wolde <rick_libcamera@wolde.info>\n> Signed-off-by: Xander Pronk <xander.c.pronk@gmail.com>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\nReviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>","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 4611BBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Jul 2026 10:32:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 38BD16614D;\n\tMon, 20 Jul 2026 12:32:29 +0200 (CEST)","from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com\n\t[IPv6:2a00:1450:4864:20::62c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4415A66122\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jul 2026 12:32:27 +0200 (CEST)","by mail-ej1-x62c.google.com with SMTP id\n\ta640c23a62f3a-c15c42a45adso560408766b.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jul 2026 03:32:27 -0700 (PDT)","from [192.168.0.101] ([109.77.26.223])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-c1705afecc3sm441519366b.24.2026.07.20.03.32.25\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 20 Jul 2026 03:32:26 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"hLeD5UNe\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1784543547; x=1785148347;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:content-type:in-reply-to:content-language\n\t:from:references:cc:to:subject:user-agent:mime-version:date\n\t:message-id:from:to:cc:subject:date:message-id:reply-to:content-type; \n\tbh=LuaMootXv51k/KlfNeBjcFfMmuODJTUqmqsAOHp5qsY=;\n\tb=hLeD5UNeLnRU8zZRrvX7f6AKbvLAlvX7xi/EIprIhjDCKA937RZvBEjv/yI9sKu3xZ\n\tNa+UxXomZJTIgFAan2SKKZG9xPgrrrou/s+IUqvZkR06Inc3+vgYcbb4xKcYihct4Fm+\n\tfKf37H/6df6K2gGPSOCVKxEwdta2Hljuu9D7/r8zUrPzOHf4mS/p2VTUXUuaEL8TfIa+\n\tuRZDnBNoEaQvNnQN75rcgB3E/+suEc+6xo0c9ezvZoThf8gRj9joU66Hs0pps6aT6Jnk\n\tF9hsko20Xlh2cWXsPMS34Evm6VI8I/UqLq3kG7HFV9LaNQbXOIFzxjIu8fLDBWdkVSug\n\tVNUA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1784543547; x=1785148347;\n\th=content-transfer-encoding:content-type:in-reply-to:content-language\n\t:from:references:cc:to:subject:user-agent:mime-version:date\n\t:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to:content-type;\n\tbh=LuaMootXv51k/KlfNeBjcFfMmuODJTUqmqsAOHp5qsY=;\n\tb=E3lJb71MGGL/V0HnGa898hrm+Gv9MNz6XspFezkPW258CtJEKz0/BZ/AV8dA1PwYTm\n\ttZiW1uuOY+cQTqreD1sM/uTiZap/y/jbqc8VkpA4IPGsCNgiGCDYKemm/x/Se9XIfTjv\n\t4XCIQ+Eg3H+MH3OzjwoA9G8WOPc4a6LSfNrDNEdnPD8+K1RDx/wYULFhnvXGBt/9uex/\n\t8C2PdnbNZHr3sE9moULMg5O2g5ZhPIf3q3HWsCLIuBHMpgmBNiuBbG1n//Rd02SUp5e6\n\tDykPBPQ2osCy9LtB8VGL2q5FuhXmWqsY6GoQoHuqv/MZxoXuI3m/RlEiBZlA6ryZhagL\n\tw7Cw==","X-Forwarded-Encrypted":"i=1;\n\tAHgh+RrloYmnnmoLMH+uI8JtaUW7esD9IBcRl+4BOs5M4tBCYR1+OlxKqc5b4TIffp9xrb4u9SXpyyJk4yJXlndURAo=@lists.libcamera.org","X-Gm-Message-State":"AOJu0Yy3P3Is2sgeOwFtdxzYdgrifE2g1mwiu7pbY+OfALadDqsiUXTA\n\t6U+7G//USIsW4A+UOhBHYTXLNBpL+LVcKrzCODDomBy7pUMWSsVeh2TRwAChsXjQFp8=","X-Gm-Gg":"AfdE7ckQtri8sxW4SbwskJZiHmCBZt9Ybmq4YPXzU0QjE4B0VShr45n8z/78CTYBnGh\n\tEkv/2az3E9LhmKh8AMhpHnSFi/7n3fm5RXITVI1Go/mi8kr59lFHQnVyxUPCrmLMS7uoxbygvqk\n\t3B3RySBd1fuGPWcvq5r3iKDDIFy/aggjyBBMb7/kl/yHT44IVZ6mqbLUfNckHJWbYAfrWRoCi44\n\tbr9Y8BBVeMLiRJbEpXHH5MRuYjvIoSnnASEGjiS5JqdD2WnXiV+ljOxD4ZYZHCEohXXHDTLfpeX\n\tHEdikxdedkRj2MKL+J//cVxhnkgQF7PBTj5gXxXZm8/ZEWt+snnYASmUo+mgzKjQUcM/1PoFbFo\n\tXiS3Jce7VsUEgfYWuLwXOp9RyF5kIe/JXVC9iacQawfeRcPVgA1Gcg7UsoLuYn2lDGgSK2Mtugq\n\tR/XXIzZskwgPNxiQ==","X-Received":"by 2002:a17:907:1c94:b0:c15:f55d:f0d8 with SMTP id\n\ta640c23a62f3a-c16b4002ab3mr537849766b.4.1784543546593; \n\tMon, 20 Jul 2026 03:32:26 -0700 (PDT)","Message-ID":"<e9b9a23c-4cc2-4a76-ba8b-973c71b8c19f@linaro.org>","Date":"Mon, 20 Jul 2026 11:32:25 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v8 4/6] libcamera: shaders: Add LSC support","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Xander Pronk <xander.c.pronk@gmail.com>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tRick ten Wolde <rick_libcamera@wolde.info>","References":"<20260716222515.251464-1-mzamazal@redhat.com>\n\t<QwF1J6t-9p1mBfKjJi9dRD5id2mGTjjGAFHnmsuh-iSe93K8xunCV4jYddmkFH_S1BBbRIsvyaZYJleTiPcH6g==@protonmail.internalid>\n\t<20260716222515.251464-5-mzamazal@redhat.com>","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Content-Language":"en-GB","In-Reply-To":"<20260716222515.251464-5-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}}]