[{"id":37869,"web_url":"https://patchwork.libcamera.org/comment/37869/","msgid":"<176908559186.1693075.7676456119428531905@ping.linuxembedded.co.uk>","date":"2026-01-22T12:39:51","subject":"Re: [PATCH v5 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2026-01-20 12:26:19)\n> Introduce a LensShadingCorrectionEnable control to enable and disable\n> LSC. This is useful to assess the working and quality of the lens\n> shading correction at runtime as well as being able to disable the\n> correction in case it shall be done manually in post processing.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> ---\n> \n> Changes in v5:\n> - Readd this patch to have a separate patch for the control id\n> - Dropped android specific changes\n> \n> Changes in v2:\n> - Renamed LensShadingEnable to LensShadingCorrectionEnable\n> - Fixed android code to properly handle the boolean value\n> - Added \"only if tuned\" info sentence to the control description\n> ---\n>  src/libcamera/control_ids_core.yaml | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n> \n> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\n> index 8e99bd84825f6060dbc323be3f4b0cd6283e0942..ced98e4625bfba9165be4f93d1fd2756881a2d1b 100644\n> --- a/src/libcamera/control_ids_core.yaml\n> +++ b/src/libcamera/control_ids_core.yaml\n> @@ -1356,4 +1356,13 @@ controls:\n>          Enable or disable lens dewarping. This control is only available if lens\n>          dewarp parameters are configured in the tuning file.\n>  \n> +  - LensShadingCorrectionEnable:\n> +      type: bool\n> +      direction: inout\n> +      description: |\n> +        Enable or disable the lens shading algorithm.\n\nI'm curious if we should really call it the algorithm. But it's probably\nfine. It's literally enabling or disabling whether the correction is\napplied I think - not if the algorithm is enabled or disabled.\n\nBut maybe that's the same thing? Or could it be mis-interpreted that\nthis disable stops the algorithm from changing the LSC dependant upon\ncolour temperature perhaps.\n\n... Maybe, so I'd probably say \"Enable or disable the lens shading\ncorrection\"\n\nPerhaps expand that when disabled a flat / zero correction is applied?\nOr maybe that's implicit by saying no correction is applied.\n\nAnyway with that updated or not however you prefer:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> +\n> +        This control is only available when there are valid lens shading\n> +        correction parameters available in the tuning file.\n> +\n>  ...\n> \n> -- \n> 2.51.0\n>","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 09BAEBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Jan 2026 12:39:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4C6E161FC9;\n\tThu, 22 Jan 2026 13:39:56 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A12A061F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Jan 2026 13:39:54 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C8212324;\n\tThu, 22 Jan 2026 13:39:21 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"rjs/rrDL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769085561;\n\tbh=7E0ZAxMMe8RyM5ykfLE/xdVuRty/DDdoaOypHCl4Wao=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=rjs/rrDLwUCP3RNcbl/UEbY+Yk5bxelPyQF8CiZkm17M7LVVRqrR7ye6uC1V6zTS3\n\tvfPuwR1KpdvnRmKyNee1ANZW00cF5/EB71ypmbqWG39R2aATuRHQ3TdXaIQx0xsWjL\n\t+BSo8euO8H5LfEmH/rfy8IKspq0O24POwwH9b52A=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260120-sklug-lsc-resampling-v2-dev-v5-14-ef5cec7b299f@ideasonboard.com>","References":"<20260120-sklug-lsc-resampling-v2-dev-v5-0-ef5cec7b299f@ideasonboard.com>\n\t<20260120-sklug-lsc-resampling-v2-dev-v5-14-ef5cec7b299f@ideasonboard.com>","Subject":"Re: [PATCH v5 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tJacopo Mondi <jacopo@jmondi.org>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 22 Jan 2026 12:39:51 +0000","Message-ID":"<176908559186.1693075.7676456119428531905@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}},{"id":37987,"web_url":"https://patchwork.libcamera.org/comment/37987/","msgid":"<20260128113350.GE2558360@killaraus>","date":"2026-01-28T11:33:50","subject":"Re: [PATCH v5 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Jan 22, 2026 at 12:39:51PM +0000, Kieran Bingham wrote:\n> Quoting Stefan Klug (2026-01-20 12:26:19)\n> > Introduce a LensShadingCorrectionEnable control to enable and disable\n> > LSC. This is useful to assess the working and quality of the lens\n> > shading correction at runtime as well as being able to disable the\n> > correction in case it shall be done manually in post processing.\n\nI'm a bit dubious about the usefulness of applying LSC in\npost-processing, as the rest of the ISP pipeline will introduce image\nquality issues if the lens shading is not corrected first. Still, the\nfirst use case you list is valid, so I'm fine with the control.\n\n> > \n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > \n> > ---\n> > \n> > Changes in v5:\n> > - Readd this patch to have a separate patch for the control id\n> > - Dropped android specific changes\n> > \n> > Changes in v2:\n> > - Renamed LensShadingEnable to LensShadingCorrectionEnable\n> > - Fixed android code to properly handle the boolean value\n> > - Added \"only if tuned\" info sentence to the control description\n> > ---\n> >  src/libcamera/control_ids_core.yaml | 9 +++++++++\n> >  1 file changed, 9 insertions(+)\n> > \n> > diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\n> > index 8e99bd84825f6060dbc323be3f4b0cd6283e0942..ced98e4625bfba9165be4f93d1fd2756881a2d1b 100644\n> > --- a/src/libcamera/control_ids_core.yaml\n> > +++ b/src/libcamera/control_ids_core.yaml\n> > @@ -1356,4 +1356,13 @@ controls:\n> >          Enable or disable lens dewarping. This control is only available if lens\n> >          dewarp parameters are configured in the tuning file.\n> >  \n> > +  - LensShadingCorrectionEnable:\n> > +      type: bool\n> > +      direction: inout\n> > +      description: |\n> > +        Enable or disable the lens shading algorithm.\n> \n> I'm curious if we should really call it the algorithm. But it's probably\n> fine. It's literally enabling or disabling whether the correction is\n> applied I think - not if the algorithm is enabled or disabled.\n\nSome people call the ISP hardware processing blocks algorithms. I'm not\nsure I like that though.\n\n> \n> But maybe that's the same thing? Or could it be mis-interpreted that\n> this disable stops the algorithm from changing the LSC dependant upon\n> colour temperature perhaps.\n> \n> ... Maybe, so I'd probably say \"Enable or disable the lens shading\n> correction\"\n\nI would also write \"lens shading correction\" instead of \"lens shading\nalgorithm\".\n\n> \n> Perhaps expand that when disabled a flat / zero correction is applied?\n> Or maybe that's implicit by saying no correction is applied.\n\nI think it's implicit.\n\n> \n> Anyway with that updated or not however you prefer:\n> \n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > +\n> > +        This control is only available when there are valid lens shading\n> > +        correction parameters available in the tuning file.\n\nI'd drop this, as I don't think we should talk about the tuning file in\nthe control definitions. The tuning file is for integrators, the\ncontrols are for users.\n\nI see that the LensDewarpEnable control also mentions the same, I'd drop\nit there too.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> > +\n> >  ...\n> >","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 BFF23C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Jan 2026 11:33:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EFB9A61FC9;\n\tWed, 28 Jan 2026 12:33:53 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9EA5461FC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Jan 2026 12:33:52 +0100 (CET)","from pendragon.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 49A36C6F;\n\tWed, 28 Jan 2026 12:33:15 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"o3hj2mQb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769599995;\n\tbh=lFYDW996qZztfGYso8CRVBqPOAwP2YjnQTwfPoh0iss=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=o3hj2mQbB4aH6Rn1lYD0dhoJS6OWbdSaK/bpWzX8kmr2vBr31N9Rzq2ndQpW3ASC0\n\tRQ01FVLFA+3+9Ej/YUzlh7ZTalk1fyADFG3CU5dvsEkUjp/VP7Ct8MY8Z3CrtboXua\n\t11o1sSgPEODNd7SGBnZ3M/2umF73Xt2VKhlYV9X0=","Date":"Wed, 28 Jan 2026 13:33:50 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org, Jacopo Mondi <jacopo@jmondi.org>","Subject":"Re: [PATCH v5 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","Message-ID":"<20260128113350.GE2558360@killaraus>","References":"<20260120-sklug-lsc-resampling-v2-dev-v5-0-ef5cec7b299f@ideasonboard.com>\n\t<20260120-sklug-lsc-resampling-v2-dev-v5-14-ef5cec7b299f@ideasonboard.com>\n\t<176908559186.1693075.7676456119428531905@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<176908559186.1693075.7676456119428531905@ping.linuxembedded.co.uk>","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>"}}]