[{"id":37661,"web_url":"https://patchwork.libcamera.org/comment/37661/","msgid":"<75b549b3-8624-4dba-ab23-8c59865874b0@ideasonboard.com>","date":"2026-01-14T15:52:10","subject":"Re: [PATCH v3 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 01. 14. 12:58 keltezéssel, Stefan Klug írta:\n> Introduce a control to enable and disable LSC and replace the\n> draft android control. Having a map as in andoid doesn't give a benefit\n                                             android\n\n\n> as up to today no values apart from ON/OFF were ever implemented.\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 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/android/camera_capabilities.cpp  | 11 ++++-------\n>   src/libcamera/control_ids_core.yaml  |  9 +++++++++\n>   src/libcamera/control_ids_draft.yaml | 14 --------------\n>   3 files changed, 13 insertions(+), 21 deletions(-)\n> \n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index b161bc6b3ed68b7206e524762f8a941816812e45..9948868d3bd99a9cfb59a5d48a20ccc455a94964 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -1223,13 +1223,10 @@ int CameraCapabilities::initializeStaticMetadata()\n>   \t{\n>   \t\tstd::vector<uint8_t> data;\n>   \t\tdata.reserve(2);\n> -\t\tconst auto &infoMap = controlsInfo.find(&controls::draft::LensShadingMapMode);\n> -\t\tif (infoMap != controlsInfo.end()) {\n> -\t\t\tfor (const auto &value : infoMap->second.values())\n> -\t\t\t\tdata.push_back(value.get<int32_t>());\n> -\t\t} else {\n> -\t\t\tdata.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);\n> -\t\t}\n> +\t\tdata.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);\n> +\t\tconst auto &infoMap = controlsInfo.find(&controls::LensShadingCorrectionEnable);\n> +\t\tif (infoMap != controlsInfo.end())\n> +\t\t\tdata.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON);\n>   \t\tstaticMetadata_->addEntry(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES,\n>   \t\t\t\t\t  data);\n\nI am confused about the android parts. First, because the control is never set on a request or\nanything. Second, https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE says\n\n   Whether the camera device will output the lens shading map in output result metadata.\n   When set to ON, android.statistics.lensShadingMap will be provided in the output result metadata.\n\nso to me that suggests that it should control the presence of another metadata item. So mapping\nit to `LensShadingCorrectionEnable` does not seem entirely correct.\n\n\n>   \t}\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> +        This control is only available when there are valid lens shading\n> +        correction parameters available in the tuning file.\n> +\n>   ...\n> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..14026de46ad6de92cfd978e5c68c9944ce9987fa 100644\n> --- a/src/libcamera/control_ids_draft.yaml\n> +++ b/src/libcamera/control_ids_draft.yaml\n> @@ -110,20 +110,6 @@ controls:\n>          row and the start of exposure of the last row. Currently identical to\n>          ANDROID_SENSOR_ROLLING_SHUTTER_SKEW\n>   \n> -  - LensShadingMapMode:\n> -      type: int32_t\n> -      direction: inout\n> -      description: |\n> -       Control to report if the lens shading map is available. Currently\n> -       identical to ANDROID_STATISTICS_LENS_SHADING_MAP_MODE.\n> -      enum:\n> -        - name: LensShadingMapModeOff\n> -          value: 0\n> -          description: No lens shading map mode is available.\n> -        - name: LensShadingMapModeOn\n> -          value: 1\n> -          description: The lens shading map mode is available.\n> -\n>     - PipelineDepth:\n>         type: int32_t\n>         direction: out\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 B2FD4BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Jan 2026 15:52:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DCC2B61F9F;\n\tWed, 14 Jan 2026 16:52:18 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 27C7F61F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Jan 2026 16:52:17 +0100 (CET)","from [192.168.33.18] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DC9155C;\n\tWed, 14 Jan 2026 16:51:48 +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=\"u94BOsdP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768405909;\n\tbh=jSdj7z1lIy4qopH0dPuZ3FAWJ8ILZq61iWAQ28rmzrQ=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=u94BOsdPk/MW3zV0yyRHoHNvGlFduqwJ990+f+Pb2GJ9Cmxe9p/eymsOF6Lurd4EB\n\t3sRETQ9QosWMtrG/VfPsL3wE+8JeS+vsR/IImcsqmHF6OvtsL8lxznzCn0XuzmfwLh\n\t8Vw1OxfheiPa4j3WjPIH5hQwq1JD0rHJiXj6Vkr0=","Message-ID":"<75b549b3-8624-4dba-ab23-8c59865874b0@ideasonboard.com>","Date":"Wed, 14 Jan 2026 16:52:10 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo@jmondi.org>","References":"<20260114-sklug-lsc-resampling-v2-dev-v3-0-80cd24f4dd61@ideasonboard.com>\n\t<20260114-sklug-lsc-resampling-v2-dev-v3-14-80cd24f4dd61@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260114-sklug-lsc-resampling-v2-dev-v3-14-80cd24f4dd61@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":37696,"web_url":"https://patchwork.libcamera.org/comment/37696/","msgid":"<176857378125.5324.2917062090254774421@localhost>","date":"2026-01-16T14:29:41","subject":"Re: [PATCH v3 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Barnabás,\n + Jacopo,\n\n@Jacopo I added you because of an android question a bit further down.\n\nQuoting Barnabás Pőcze (2026-01-14 16:52:10)\n> 2026. 01. 14. 12:58 keltezéssel, Stefan Klug írta:\n> > Introduce a control to enable and disable LSC and replace the\n> > draft android control. Having a map as in andoid doesn't give a benefit\n>                                              android\n> \n> \n> > as up to today no values apart from ON/OFF were ever implemented.\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 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/android/camera_capabilities.cpp  | 11 ++++-------\n> >   src/libcamera/control_ids_core.yaml  |  9 +++++++++\n> >   src/libcamera/control_ids_draft.yaml | 14 --------------\n> >   3 files changed, 13 insertions(+), 21 deletions(-)\n> > \n> > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > index b161bc6b3ed68b7206e524762f8a941816812e45..9948868d3bd99a9cfb59a5d48a20ccc455a94964 100644\n> > --- a/src/android/camera_capabilities.cpp\n> > +++ b/src/android/camera_capabilities.cpp\n> > @@ -1223,13 +1223,10 @@ int CameraCapabilities::initializeStaticMetadata()\n> >       {\n> >               std::vector<uint8_t> data;\n> >               data.reserve(2);\n> > -             const auto &infoMap = controlsInfo.find(&controls::draft::LensShadingMapMode);\n> > -             if (infoMap != controlsInfo.end()) {\n> > -                     for (const auto &value : infoMap->second.values())\n> > -                             data.push_back(value.get<int32_t>());\n> > -             } else {\n> > -                     data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);\n> > -             }\n> > +             data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);\n> > +             const auto &infoMap = controlsInfo.find(&controls::LensShadingCorrectionEnable);\n> > +             if (infoMap != controlsInfo.end())\n> > +                     data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON);\n> >               staticMetadata_->addEntry(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES,\n> >                                         data);\n> \n> I am confused about the android parts. First, because the control is never set on a request or\n> anything. Second, https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE says\n> \n>    Whether the camera device will output the lens shading map in output result metadata.\n>    When set to ON, android.statistics.lensShadingMap will be provided in the output result metadata.\n> \n> so to me that suggests that it should control the presence of another metadata item. So mapping\n> it to `LensShadingCorrectionEnable` does not seem entirely correct.\n\nOh it might well be that I misunderstood something here. I didn't\ncompletely get the android code and so I basically did a best guess\neffort. The old code checks if the controlsInfo contains\ncontrols::draft::LensShadingMapMode and then adds all possible enum\nvalues (which could either be LensShadingMapModeOff or\nLensShadingMapModeOn) or it just adds\nANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF in case it can't find it in\nthe controlsInfo.. So I thought I'd do something similar and add\nANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON in case the control is\npresent which should be the same as adding LensShadingMapModeOn in the\nold version of the code. And the\nANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF can then be added\nunconditionally.\n\nBut overall it looks to me that LensShading was never fully implemented\non android. So maybe we can just drop the block?\n\nJacopo can you help here?\n\nBest regards,\nStefan\n\n\n> \n> \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> > +        This control is only available when there are valid lens shading\n> > +        correction parameters available in the tuning file.\n> > +\n> >   ...\n> > diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> > index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..14026de46ad6de92cfd978e5c68c9944ce9987fa 100644\n> > --- a/src/libcamera/control_ids_draft.yaml\n> > +++ b/src/libcamera/control_ids_draft.yaml\n> > @@ -110,20 +110,6 @@ controls:\n> >          row and the start of exposure of the last row. Currently identical to\n> >          ANDROID_SENSOR_ROLLING_SHUTTER_SKEW\n> >   \n> > -  - LensShadingMapMode:\n> > -      type: int32_t\n> > -      direction: inout\n> > -      description: |\n> > -       Control to report if the lens shading map is available. Currently\n> > -       identical to ANDROID_STATISTICS_LENS_SHADING_MAP_MODE.\n> > -      enum:\n> > -        - name: LensShadingMapModeOff\n> > -          value: 0\n> > -          description: No lens shading map mode is available.\n> > -        - name: LensShadingMapModeOn\n> > -          value: 1\n> > -          description: The lens shading map mode is available.\n> > -\n> >     - PipelineDepth:\n> >         type: int32_t\n> >         direction: out\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 E17ACBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Jan 2026 14:29:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9CA3461FBC;\n\tFri, 16 Jan 2026 15:29:45 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 38730615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Jan 2026 15:29:44 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:3f72:9503:f91a:e3d2])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id D65B94B3;\n\tFri, 16 Jan 2026 15:29: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=\"nzzn3aLT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768573755;\n\tbh=Rv8O0Jf+xSNZWFhnmU6LXxqWmBat7sKPHZbyWmaKKa8=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=nzzn3aLTtzHg8I+hMLYg80khzUsmwN2zvY+amtDA7k3W8WPmTGFmuvc4ftLxog2H2\n\t2xz/uH94yvovflWdXeJZXA79/I+aUxq7vgTCL9NXk4yuRsEidwbI0sg+TA3pyV2Rxz\n\tjiS654+8aOYgT/5ZH810apLLLtmMlvL5pRptCawc=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<75b549b3-8624-4dba-ab23-8c59865874b0@ideasonboard.com>","References":"<20260114-sklug-lsc-resampling-v2-dev-v3-0-80cd24f4dd61@ideasonboard.com>\n\t<20260114-sklug-lsc-resampling-v2-dev-v3-14-80cd24f4dd61@ideasonboard.com>\n\t<75b549b3-8624-4dba-ab23-8c59865874b0@ideasonboard.com>","Subject":"Re: [PATCH v3 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org, Jacopo Mondi <jacopo@jmondi.org>","Date":"Fri, 16 Jan 2026 15:29:41 +0100","Message-ID":"<176857378125.5324.2917062090254774421@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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":37701,"web_url":"https://patchwork.libcamera.org/comment/37701/","msgid":"<aWpkVAnhPx2pB46c@zed>","date":"2026-01-16T16:45:41","subject":"Re: [PATCH v3 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Stefan\n\nOn Fri, Jan 16, 2026 at 03:29:41PM +0100, Stefan Klug wrote:\n> Hi Barnabás,\n>  + Jacopo,\n>\n> @Jacopo I added you because of an android question a bit further down.\n>\n> Quoting Barnabás Pőcze (2026-01-14 16:52:10)\n> > 2026. 01. 14. 12:58 keltezéssel, Stefan Klug írta:\n> > > Introduce a control to enable and disable LSC and replace the\n> > > draft android control. Having a map as in andoid doesn't give a benefit\n> >                                              android\n> >\n> >\n> > > as up to today no values apart from ON/OFF were ever implemented.\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 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/android/camera_capabilities.cpp  | 11 ++++-------\n> > >   src/libcamera/control_ids_core.yaml  |  9 +++++++++\n> > >   src/libcamera/control_ids_draft.yaml | 14 --------------\n> > >   3 files changed, 13 insertions(+), 21 deletions(-)\n> > >\n> > > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > > index b161bc6b3ed68b7206e524762f8a941816812e45..9948868d3bd99a9cfb59a5d48a20ccc455a94964 100644\n> > > --- a/src/android/camera_capabilities.cpp\n> > > +++ b/src/android/camera_capabilities.cpp\n> > > @@ -1223,13 +1223,10 @@ int CameraCapabilities::initializeStaticMetadata()\n> > >       {\n> > >               std::vector<uint8_t> data;\n> > >               data.reserve(2);\n> > > -             const auto &infoMap = controlsInfo.find(&controls::draft::LensShadingMapMode);\n> > > -             if (infoMap != controlsInfo.end()) {\n> > > -                     for (const auto &value : infoMap->second.values())\n> > > -                             data.push_back(value.get<int32_t>());\n> > > -             } else {\n> > > -                     data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);\n> > > -             }\n> > > +             data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);\n> > > +             const auto &infoMap = controlsInfo.find(&controls::LensShadingCorrectionEnable);\n> > > +             if (infoMap != controlsInfo.end())\n> > > +                     data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON);\n> > >               staticMetadata_->addEntry(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES,\n> > >                                         data);\n> >\n> > I am confused about the android parts. First, because the control is never set on a request or\n> > anything. Second, https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE says\n> >\n> >    Whether the camera device will output the lens shading map in output result metadata.\n> >    When set to ON, android.statistics.lensShadingMap will be provided in the output result metadata.\n> >\n> > so to me that suggests that it should control the presence of another metadata item. So mapping\n> > it to `LensShadingCorrectionEnable` does not seem entirely correct.\n>\n> Oh it might well be that I misunderstood something here. I didn't\n> completely get the android code and so I basically did a best guess\n> effort. The old code checks if the controlsInfo contains\n> controls::draft::LensShadingMapMode and then adds all possible enum\n> values (which could either be LensShadingMapModeOff or\n> LensShadingMapModeOn) or it just adds\n> ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF in case it can't find it in\n> the controlsInfo.. So I thought I'd do something similar and add\n> ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON in case the control is\n> present which should be the same as adding LensShadingMapModeOn in the\n> old version of the code. And the\n> ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF can then be added\n> unconditionally.\n\nI have the same understanding that Barnabás has:\ncontrols::draft::LensShadingMapMode controls if the lens shading map\nis returned in metadata or not, not if lens shading should be\nperformed or not.\n\nIf I'm not mistaken, I think you can drop this patch and leave\ndrafts::LensShadingMapMode in place, they control two different things\nif I'm not mistaken.\n\n>\n> But overall it looks to me that LensShading was never fully implemented\n> on android. So maybe we can just drop the block?\n>\n> Jacopo can you help here?\n>\n> Best regards,\n> Stefan\n>\n>\n> >\n> >\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> > > +        This control is only available when there are valid lens shading\n> > > +        correction parameters available in the tuning file.\n> > > +\n> > >   ...\n> > > diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> > > index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..14026de46ad6de92cfd978e5c68c9944ce9987fa 100644\n> > > --- a/src/libcamera/control_ids_draft.yaml\n> > > +++ b/src/libcamera/control_ids_draft.yaml\n> > > @@ -110,20 +110,6 @@ controls:\n> > >          row and the start of exposure of the last row. Currently identical to\n> > >          ANDROID_SENSOR_ROLLING_SHUTTER_SKEW\n> > >\n> > > -  - LensShadingMapMode:\n> > > -      type: int32_t\n> > > -      direction: inout\n> > > -      description: |\n> > > -       Control to report if the lens shading map is available. Currently\n> > > -       identical to ANDROID_STATISTICS_LENS_SHADING_MAP_MODE.\n> > > -      enum:\n> > > -        - name: LensShadingMapModeOff\n> > > -          value: 0\n> > > -          description: No lens shading map mode is available.\n> > > -        - name: LensShadingMapModeOn\n> > > -          value: 1\n> > > -          description: The lens shading map mode is available.\n> > > -\n> > >     - PipelineDepth:\n> > >         type: int32_t\n> > >         direction: out\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 ABA71BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Jan 2026 16:45:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E5C0261FA3;\n\tFri, 16 Jan 2026 17:45:45 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7860F615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Jan 2026 17:45:44 +0100 (CET)","from ideasonboard.com (static.170.20.224.46.clients.your-server.de\n\t[46.224.20.170])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 881164B3;\n\tFri, 16 Jan 2026 17:45: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=\"IjZwJIP7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768581915;\n\tbh=UrmD9C6tqhWmWbhnxF4PUYyc/CSRE0FGLVqH6/zWnD8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=IjZwJIP7TUI2L/yTRCq5l78/FFlmvyEa99hUmTiH/WTrxEUQdkagMEC41ZrCU66mK\n\tM/uDvmDfjW/d4+iXM1ZtxmRsQNNi7MTp3CdsEAwhooZ90/QnK181diT7f6pibuAWow\n\t7IIC4EZdpy7wU/5dEy52thGzqkWttG77ZWy8jckE=","Date":"Fri, 16 Jan 2026 17:45:41 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org, Jacopo Mondi <jacopo@jmondi.org>","Subject":"Re: [PATCH v3 14/15] libcamera: control_ids: Introduce\n\tLensShadingCorrectionEnable","Message-ID":"<aWpkVAnhPx2pB46c@zed>","References":"<20260114-sklug-lsc-resampling-v2-dev-v3-0-80cd24f4dd61@ideasonboard.com>\n\t<20260114-sklug-lsc-resampling-v2-dev-v3-14-80cd24f4dd61@ideasonboard.com>\n\t<75b549b3-8624-4dba-ab23-8c59865874b0@ideasonboard.com>\n\t<176857378125.5324.2917062090254774421@localhost>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<176857378125.5324.2917062090254774421@localhost>","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>"}}]