[{"id":31334,"web_url":"https://patchwork.libcamera.org/comment/31334/","msgid":"<172718208907.3726802.6740889124360735396@ping.linuxembedded.co.uk>","date":"2024-09-24T12:48:09","subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"In $SUBJECT - I think you mean 'properties' not 'proprietary'\n\nBut as for the commit message, the subject should say what this patch is\nfor. libcamera has no knowledge of what a 'ciri' is.\n\nLets keep it to the details of the image sensor.\n\nQuoting Harvey Yang (2024-09-24 09:26:10)\n> gc05a2 is the first sensor used by ciri.\n\nI don't think that's relevant to libcamera.\n\nPlease describe what the gc05a2 is instead.\n\n> \n> Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> Co-developed-by: Xing Gu <xinggu@chromium.org>\n> Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\n> Co-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n> ---\n>  src/ipa/libipa/camera_sensor_helper.cpp         | 17 +++++++++++++++++\n>  .../sensor/camera_sensor_properties.cpp         |  7 +++++++\n>  2 files changed, 24 insertions(+)\n> \n> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> index ffc7c1d7..cd7d12d6 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> @@ -519,6 +519,23 @@ private:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"ar0521\", CameraSensorHelperAr0521)\n>  \n> +class CameraSensorHelperGc05a2 : public CameraSensorHelper\n> +{\n> +public:\n> +       uint32_t gainCode(double gain) const override\n> +       {\n> +               uint32_t aeGain = std::clamp((uint32_t)gain, kAeBaseGain_, kStep_ * kAeBaseGain_);\n> +               return aeGain * 0x400 / kAeBaseGain_;\n> +       }\n> +\n> +       // `double gain(uint32_t gainCode)` will not be used.\n\nSo don't add it ?\n\nBut how do you mean \"won't be used\" - you mean ... you won't use it? or\nit can't be used?\n\nHow do we correctly determine the gain *used* from a configured gain\ncode?\n\nI suspect ... the gain() function should be implemented if the\ngainCode() function is implemented. Otherwise callers on the helper will\nget inconsistent results.\n\n\n\n\n> +\n> +private:\n> +       static constexpr uint32_t kStep_ = 16;\n> +       static constexpr uint32_t kAeBaseGain_ = 1024;\n> +};\n> +REGISTER_CAMERA_SENSOR_HELPER(\"gc05a2\", CameraSensorHelperGc05a2)\n> +\n>  class CameraSensorHelperImx219 : public CameraSensorHelper\n>  {\n>  public:\n> diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp\n> index 4e5217ab..3e1bd85e 100644\n> --- a/src/libcamera/sensor/camera_sensor_properties.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_properties.cpp\n> @@ -70,6 +70,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen\n>                                 { controls::draft::TestPatternModeColorBarsFadeToGray, 3 },\n>                         },\n>                 } },\n> +               { \"gc05a2\", {\n> +                       .unitCellSize = { 1120, 1120 },\n> +                       .testPatternModes = {\n> +                               { controls::draft::TestPatternModeOff, 0 },\n> +                               { controls::draft::TestPatternModeColorBars, 1 },\n> +                       },\n> +               } },\n>                 { \"hi846\", {\n>                         .unitCellSize = { 1120, 1120 },\n>                         .testPatternModes = {\n> -- \n> 2.46.0.792.g87dc391469-goog\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 A7D0BC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Sep 2024 12:48:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DE6F46350F;\n\tTue, 24 Sep 2024 14:48:13 +0200 (CEST)","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 CBD3D63500\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Sep 2024 14:48:11 +0200 (CEST)","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 E3CA1594;\n\tTue, 24 Sep 2024 14:46:44 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"U7dX8jmI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727182005;\n\tbh=LGzgCDg4lfPCYDYSOxMmpay79g3VVeQXc8vXPbN1tzg=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=U7dX8jmI61VLgwFQdXhIOlf2fmmjPBkI0t4xFF+qug9X3Lh/D9Kn0wE0lm2jodQzi\n\tA/Chbw0zpX+wo+0wHiqJwJpWhzkJc3pT09IpiB31rJfShj+jqrs8lZipvprtN5DYK2\n\toxMHLRaifdRQAgICu5J3eRfeCcQTz5zy9EfyQcv0=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240924090051.1617040-2-chenghaoyang@google.com>","References":"<20240924090051.1617040-1-chenghaoyang@google.com>\n\t<20240924090051.1617040-2-chenghaoyang@google.com>","Subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Harvey Yang <chenghaoyang@google.com>,\n\tHan-Lin Chen <hanlinchen@chromium.org>, Xing Gu <xinggu@chromium.org>,\n\tYudhistira Erlandinata <yerlandinata@chromium.org>,\n\tHarvey Yang <chenghaoyang@chromium.org>","To":"Harvey Yang <chenghaoyang@chromium.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 24 Sep 2024 13:48:09 +0100","Message-ID":"<172718208907.3726802.6740889124360735396@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":31338,"web_url":"https://patchwork.libcamera.org/comment/31338/","msgid":"<20240924131910.GA20255@pendragon.ideasonboard.com>","date":"2024-09-24T13:19:10","subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Sep 24, 2024 at 01:48:09PM +0100, Kieran Bingham wrote:\n> In $SUBJECT - I think you mean 'properties' not 'proprietary'\n> \n> But as for the commit message, the subject should say what this patch is\n> for. libcamera has no knowledge of what a 'ciri' is.\n> \n> Lets keep it to the details of the image sensor.\n> \n> Quoting Harvey Yang (2024-09-24 09:26:10)\n> > gc05a2 is the first sensor used by ciri.\n> \n> I don't think that's relevant to libcamera.\n> \n> Please describe what the gc05a2 is instead.\n> \n> > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > Co-developed-by: Xing Gu <xinggu@chromium.org>\n> > Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\n> > Co-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n> > ---\n> >  src/ipa/libipa/camera_sensor_helper.cpp         | 17 +++++++++++++++++\n> >  .../sensor/camera_sensor_properties.cpp         |  7 +++++++\n> >  2 files changed, 24 insertions(+)\n> > \n> > diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> > index ffc7c1d7..cd7d12d6 100644\n> > --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> > +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> > @@ -519,6 +519,23 @@ private:\n> >  };\n> >  REGISTER_CAMERA_SENSOR_HELPER(\"ar0521\", CameraSensorHelperAr0521)\n> >  \n> > +class CameraSensorHelperGc05a2 : public CameraSensorHelper\n> > +{\n> > +public:\n> > +       uint32_t gainCode(double gain) const override\n> > +       {\n> > +               uint32_t aeGain = std::clamp((uint32_t)gain, kAeBaseGain_, kStep_ * kAeBaseGain_);\n\nThis doesn't seem right. 'gain' is expressed as a real number, with 1.0\ncorresponding to a x1 gain.\n\n> > +               return aeGain * 0x400 / kAeBaseGain_;\n\nIf the gain model is linear, you should be able to express it with the\nstandard gain model, without needing to override gain() and gainCode().\n\n> > +       }\n> > +\n> > +       // `double gain(uint32_t gainCode)` will not be used.\n> \n> So don't add it ?\n> \n> But how do you mean \"won't be used\" - you mean ... you won't use it? or\n> it can't be used?\n> \n> How do we correctly determine the gain *used* from a configured gain\n> code?\n> \n> I suspect ... the gain() function should be implemented if the\n> gainCode() function is implemented. Otherwise callers on the helper will\n> get inconsistent results.\n\nYes, even if libipa isn't used by the MTK IPA, proper support for the\nsensor needs to be implemented. Same for patch 2/2 in the series.\n\n> > +\n> > +private:\n> > +       static constexpr uint32_t kStep_ = 16;\n> > +       static constexpr uint32_t kAeBaseGain_ = 1024;\n> > +};\n> > +REGISTER_CAMERA_SENSOR_HELPER(\"gc05a2\", CameraSensorHelperGc05a2)\n> > +\n> >  class CameraSensorHelperImx219 : public CameraSensorHelper\n> >  {\n> >  public:\n> > diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp\n> > index 4e5217ab..3e1bd85e 100644\n> > --- a/src/libcamera/sensor/camera_sensor_properties.cpp\n> > +++ b/src/libcamera/sensor/camera_sensor_properties.cpp\n> > @@ -70,6 +70,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen\n> >                                 { controls::draft::TestPatternModeColorBarsFadeToGray, 3 },\n> >                         },\n> >                 } },\n> > +               { \"gc05a2\", {\n> > +                       .unitCellSize = { 1120, 1120 },\n> > +                       .testPatternModes = {\n> > +                               { controls::draft::TestPatternModeOff, 0 },\n> > +                               { controls::draft::TestPatternModeColorBars, 1 },\n> > +                       },\n> > +               } },\n> >                 { \"hi846\", {\n> >                         .unitCellSize = { 1120, 1120 },\n> >                         .testPatternModes = {","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 897E7C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Sep 2024 13:19:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 676196350F;\n\tTue, 24 Sep 2024 15:19:44 +0200 (CEST)","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 D1F9263500\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Sep 2024 15:19:42 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6FA8C827;\n\tTue, 24 Sep 2024 15:18:15 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"dhVyTCan\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727183895;\n\tbh=iV5N9FZy2H7ZmwP4TX+w8x5aAszD7JlKLSsJvPtHxRc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=dhVyTCanBAQ+vSJUPUyuk5tzs5K25h0jyOrO21ZOnqzGce8nWA+U+299We7aQUfx/\n\tdtR3JLDaiGWxf+4K2WCoxiUYEqh/mpm1eWyq+9Mv8u6JvQKvxJRuxy95BAvf/GyX9B\n\tdsK+lVJFnmWDLioZYEodhQXTrJjBrf3efpTKzYKA=","Date":"Tue, 24 Sep 2024 16:19:10 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Harvey Yang <chenghaoyang@chromium.org>,\n\tlibcamera-devel@lists.libcamera.org,\n\tHarvey Yang <chenghaoyang@google.com>, \n\tHan-Lin Chen <hanlinchen@chromium.org>, Xing Gu <xinggu@chromium.org>,\n\tYudhistira Erlandinata <yerlandinata@chromium.org>","Subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","Message-ID":"<20240924131910.GA20255@pendragon.ideasonboard.com>","References":"<20240924090051.1617040-1-chenghaoyang@google.com>\n\t<20240924090051.1617040-2-chenghaoyang@google.com>\n\t<172718208907.3726802.6740889124360735396@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<172718208907.3726802.6740889124360735396@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>"}},{"id":32069,"web_url":"https://patchwork.libcamera.org/comment/32069/","msgid":"<CAEB1ahuqK1wT62WFvMFAxaO+u2KahbURta+imqG+DqoZ9ZKjOA@mail.gmail.com>","date":"2024-11-08T06:50:33","subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/people/117/","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"content":"Hi Kieran and Laurent,\n\nOn Tue, Sep 24, 2024 at 9:19 PM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> On Tue, Sep 24, 2024 at 01:48:09PM +0100, Kieran Bingham wrote:\n> > In $SUBJECT - I think you mean 'properties' not 'proprietary'\n> >\n> > But as for the commit message, the subject should say what this patch is\n> > for. libcamera has no knowledge of what a 'ciri' is.\n> >\n> > Lets keep it to the details of the image sensor.\n> >\n> > Quoting Harvey Yang (2024-09-24 09:26:10)\n> > > gc05a2 is the first sensor used by ciri.\n> >\n> > I don't think that's relevant to libcamera.\n> >\n> > Please describe what the gc05a2 is instead.\n> >\n> > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > Co-developed-by: Xing Gu <xinggu@chromium.org>\n> > > Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\n> > > Co-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n> > > ---\n> > >  src/ipa/libipa/camera_sensor_helper.cpp         | 17 +++++++++++++++++\n> > >  .../sensor/camera_sensor_properties.cpp         |  7 +++++++\n> > >  2 files changed, 24 insertions(+)\n> > >\n> > > diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> > > index ffc7c1d7..cd7d12d6 100644\n> > > --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> > > +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> > > @@ -519,6 +519,23 @@ private:\n> > >  };\n> > >  REGISTER_CAMERA_SENSOR_HELPER(\"ar0521\", CameraSensorHelperAr0521)\n> > >\n> > > +class CameraSensorHelperGc05a2 : public CameraSensorHelper\n> > > +{\n> > > +public:\n> > > +       uint32_t gainCode(double gain) const override\n> > > +       {\n> > > +               uint32_t aeGain = std::clamp((uint32_t)gain, kAeBaseGain_, kStep_ * kAeBaseGain_);\n>\n> This doesn't seem right. 'gain' is expressed as a real number, with 1.0\n> corresponding to a x1 gain.\n>\n> > > +               return aeGain * 0x400 / kAeBaseGain_;\n>\n> If the gain model is linear, you should be able to express it with the\n> standard gain model, without needing to override gain() and gainCode().\n>\n> > > +       }\n> > > +\n> > > +       // `double gain(uint32_t gainCode)` will not be used.\n> >\n> > So don't add it ?\n> >\n> > But how do you mean \"won't be used\" - you mean ... you won't use it? or\n> > it can't be used?\n> >\n> > How do we correctly determine the gain *used* from a configured gain\n> > code?\n\nIIUC, If a configured ae gain is set, IIUC for per-frame control use cases,\nin mtkisp7, we feed this information to the IPA proprietary library, which\ncalculates the corresponding gainCode for v4l2 camera sensor.\n\nWe don't have the use case to calculate the ae gain from a configured gain\ncode. I've seen other pipeline handlers using this function to calculate the\nstatic metadata `controls::AnalogueGain` though. Is this the only use case?\n\n> >\n> > I suspect ... the gain() function should be implemented if the\n> > gainCode() function is implemented. Otherwise callers on the helper will\n> > get inconsistent results.\n>\n> Yes, even if libipa isn't used by the MTK IPA, proper support for the\n> sensor needs to be implemented. Same for patch 2/2 in the series.\n\nI've been contacting MTK's team, while they're quite inconsistent with\nthemselves and very slow to response...\n\nPreviously the conversion is done in their proprietary algorithms, and\nwe directly use the results in the IPA.\n\nTherefore, we might not end up using these functions even if we finally\ndig out MTK's algorithm.\nFor per-frame control use cases though, it might simplify the task flows,\nas we probably could calculate the gain code ourselves without waiting\nfor IPA proprietary algorithm.\n\nLet's wait for MTK's response for now...\n\nBR,\nHarvey\n\n>\n> > > +\n> > > +private:\n> > > +       static constexpr uint32_t kStep_ = 16;\n> > > +       static constexpr uint32_t kAeBaseGain_ = 1024;\n> > > +};\n> > > +REGISTER_CAMERA_SENSOR_HELPER(\"gc05a2\", CameraSensorHelperGc05a2)\n> > > +\n> > >  class CameraSensorHelperImx219 : public CameraSensorHelper\n> > >  {\n> > >  public:\n> > > diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > index 4e5217ab..3e1bd85e 100644\n> > > --- a/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > +++ b/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > @@ -70,6 +70,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen\n> > >                                 { controls::draft::TestPatternModeColorBarsFadeToGray, 3 },\n> > >                         },\n> > >                 } },\n> > > +               { \"gc05a2\", {\n> > > +                       .unitCellSize = { 1120, 1120 },\n> > > +                       .testPatternModes = {\n> > > +                               { controls::draft::TestPatternModeOff, 0 },\n> > > +                               { controls::draft::TestPatternModeColorBars, 1 },\n> > > +                       },\n> > > +               } },\n> > >                 { \"hi846\", {\n> > >                         .unitCellSize = { 1120, 1120 },\n> > >                         .testPatternModes = {\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 3589BC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Nov 2024 06:50:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1AB9265486;\n\tFri,  8 Nov 2024 07:50:48 +0100 (CET)","from mail-lj1-x236.google.com (mail-lj1-x236.google.com\n\t[IPv6:2a00:1450:4864:20::236])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DC1E760589\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Nov 2024 07:50:45 +0100 (CET)","by mail-lj1-x236.google.com with SMTP id\n\t38308e7fff4ca-2fb58980711so16836761fa.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 07 Nov 2024 22:50:45 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"Sa1ftk8N\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1731048645; x=1731653445;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=sXiIE+XsGu7oMCnqfzMZ0gS7h3d8slTJtHvRD+MQNrQ=;\n\tb=Sa1ftk8Nt75S4PlrONjE8SvdZvFxETHV6eKmA4vNEKHxvcSqv2Q9UPTZeAloj1swdY\n\tTxrTtrsCBWLnF23PvKw8/B7oKCa7Jfy/HwzmphoCZ4YpGyK3vez8CLZWqZIEQfHpLbCZ\n\tgDzRozKVKEIi4/DP2IIz0JfNwEpMvd0I5TEw4=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1731048645; x=1731653445;\n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=sXiIE+XsGu7oMCnqfzMZ0gS7h3d8slTJtHvRD+MQNrQ=;\n\tb=gTbn9fZ5KN4ugUpByIzkuKZoULPOhe0O4tmTGV+5QWXyuRhWsUSNJ4fyJhwETynKw9\n\tfcOUwrgZ4w1/938FHbRmurxvylXF1tD98r8BCoNybRW3c8AcxB7HKG4sl3sNINF3aFpt\n\ttsLj/HfL2CvMECWSW8YO0rdWcLYLX+l9qSyWaF0MFYh+wC3wuBilFQV99yzMm7t/ccuV\n\t1DTPZ0UKi4xc1L9B9OFdH6VJ6OEaJTskMkKXqBEn0u9eOS9ofFuivQjRpVa5OwkTbGs+\n\tQp19jNfyuSvPSndN0u7ztiEF3A6LK7REGnU3nYYstiqJqH0B36fGi5ZSi/K14qL0Z7XW\n\tRvxg==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCW4nmBnNbxPbAHmIk2+SCeFVvW3LLvRdVWL99cVlFaq2FLS8j2864kh1Y+rdYFsL7TaMZePr16N7MVO7auUnao=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YwK5CDIJ5m261gaZiqXu+mJyL1oKO4yyAa4D3e2vHi/hYlboSh4\n\tftQhsVldGeSwRid/Y/VWiYP5gm3FtuqQ8xXPKYt/dDZeQZqAVTBTgMCW2rsRHSj2eRM27c+lzNL\n\tJ7/cVTwqpxVktE6MB4eRFdEeGBeHxYYWpTDEl","X-Google-Smtp-Source":"AGHT+IF6EIoVAh6yK+GuQ7OpXCrnWwLkeWbmeDi4ggmB2p1WTHq/hKcUzZc0PjT8LSs8Mo/CWFMAYw87xqe5QiEvIOA=","X-Received":"by 2002:a2e:a541:0:b0:2fa:c8d1:224 with SMTP id\n\t38308e7fff4ca-2ff20152518mr7058121fa.2.1731048644809; Thu, 07 Nov 2024\n\t22:50:44 -0800 (PST)","MIME-Version":"1.0","References":"<20240924090051.1617040-1-chenghaoyang@google.com>\n\t<20240924090051.1617040-2-chenghaoyang@google.com>\n\t<172718208907.3726802.6740889124360735396@ping.linuxembedded.co.uk>\n\t<20240924131910.GA20255@pendragon.ideasonboard.com>","In-Reply-To":"<20240924131910.GA20255@pendragon.ideasonboard.com>","From":"Cheng-Hao Yang <chenghaoyang@chromium.org>","Date":"Fri, 8 Nov 2024 14:50:33 +0800","Message-ID":"<CAEB1ahuqK1wT62WFvMFAxaO+u2KahbURta+imqG+DqoZ9ZKjOA@mail.gmail.com>","Subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org, \n\tHarvey Yang <chenghaoyang@google.com>,\n\tHan-Lin Chen <hanlinchen@chromium.org>, Xing Gu <xinggu@chromium.org>,\n\tYudhistira Erlandinata <yerlandinata@chromium.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","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":32073,"web_url":"https://patchwork.libcamera.org/comment/32073/","msgid":"<20241108103412.GH32614@pendragon.ideasonboard.com>","date":"2024-11-08T10:34:12","subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Harbey,\n\nOn Fri, Nov 08, 2024 at 02:50:33PM +0800, Cheng-Hao Yang wrote:\n> On Tue, Sep 24, 2024 at 9:19 PM Laurent Pinchart wrote:\n> > On Tue, Sep 24, 2024 at 01:48:09PM +0100, Kieran Bingham wrote:\n> > > In $SUBJECT - I think you mean 'properties' not 'proprietary'\n> > >\n> > > But as for the commit message, the subject should say what this patch is\n> > > for. libcamera has no knowledge of what a 'ciri' is.\n> > >\n> > > Lets keep it to the details of the image sensor.\n> > >\n> > > Quoting Harvey Yang (2024-09-24 09:26:10)\n> > > > gc05a2 is the first sensor used by ciri.\n> > >\n> > > I don't think that's relevant to libcamera.\n> > >\n> > > Please describe what the gc05a2 is instead.\n> > >\n> > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > Co-developed-by: Xing Gu <xinggu@chromium.org>\n> > > > Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\n> > > > Co-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n> > > > ---\n> > > >  src/ipa/libipa/camera_sensor_helper.cpp         | 17 +++++++++++++++++\n> > > >  .../sensor/camera_sensor_properties.cpp         |  7 +++++++\n> > > >  2 files changed, 24 insertions(+)\n> > > >\n> > > > diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> > > > index ffc7c1d7..cd7d12d6 100644\n> > > > --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> > > > +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> > > > @@ -519,6 +519,23 @@ private:\n> > > >  };\n> > > >  REGISTER_CAMERA_SENSOR_HELPER(\"ar0521\", CameraSensorHelperAr0521)\n> > > >\n> > > > +class CameraSensorHelperGc05a2 : public CameraSensorHelper\n> > > > +{\n> > > > +public:\n> > > > +       uint32_t gainCode(double gain) const override\n> > > > +       {\n> > > > +               uint32_t aeGain = std::clamp((uint32_t)gain, kAeBaseGain_, kStep_ * kAeBaseGain_);\n> >\n> > This doesn't seem right. 'gain' is expressed as a real number, with 1.0\n> > corresponding to a x1 gain.\n> >\n> > > > +               return aeGain * 0x400 / kAeBaseGain_;\n> >\n> > If the gain model is linear, you should be able to express it with the\n> > standard gain model, without needing to override gain() and gainCode().\n> >\n> > > > +       }\n> > > > +\n> > > > +       // `double gain(uint32_t gainCode)` will not be used.\n> > >\n> > > So don't add it ?\n> > >\n> > > But how do you mean \"won't be used\" - you mean ... you won't use it? or\n> > > it can't be used?\n> > >\n> > > How do we correctly determine the gain *used* from a configured gain\n> > > code?\n> \n> IIUC, If a configured ae gain is set, IIUC for per-frame control use cases,\n> in mtkisp7, we feed this information to the IPA proprietary library, which\n> calculates the corresponding gainCode for v4l2 camera sensor.\n> \n> We don't have the use case to calculate the ae gain from a configured gain\n> code. I've seen other pipeline handlers using this function to calculate the\n> static metadata `controls::AnalogueGain` though. Is this the only use case?\n\nIt's used in open-source IPA modules. To merge support for a new sensor\nor a new platform, a fully open source implementation is required. There\nwill need to be an open-source mtkisp7 IPA module that implements AGC,\nso you will need this.\n\n> > > I suspect ... the gain() function should be implemented if the\n> > > gainCode() function is implemented. Otherwise callers on the helper will\n> > > get inconsistent results.\n> >\n> > Yes, even if libipa isn't used by the MTK IPA, proper support for the\n> > sensor needs to be implemented. Same for patch 2/2 in the series.\n> \n> I've been contacting MTK's team, while they're quite inconsistent with\n> themselves and very slow to response...\n> \n> Previously the conversion is done in their proprietary algorithms, and\n> we directly use the results in the IPA.\n> \n> Therefore, we might not end up using these functions even if we finally\n> dig out MTK's algorithm.\n> For per-frame control use cases though, it might simplify the task flows,\n> as we probably could calculate the gain code ourselves without waiting\n> for IPA proprietary algorithm.\n> \n> Let's wait for MTK's response for now...\n> \n> > > > +\n> > > > +private:\n> > > > +       static constexpr uint32_t kStep_ = 16;\n> > > > +       static constexpr uint32_t kAeBaseGain_ = 1024;\n> > > > +};\n> > > > +REGISTER_CAMERA_SENSOR_HELPER(\"gc05a2\", CameraSensorHelperGc05a2)\n> > > > +\n> > > >  class CameraSensorHelperImx219 : public CameraSensorHelper\n> > > >  {\n> > > >  public:\n> > > > diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > > index 4e5217ab..3e1bd85e 100644\n> > > > --- a/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > > +++ b/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > > @@ -70,6 +70,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen\n> > > >                                 { controls::draft::TestPatternModeColorBarsFadeToGray, 3 },\n> > > >                         },\n> > > >                 } },\n> > > > +               { \"gc05a2\", {\n> > > > +                       .unitCellSize = { 1120, 1120 },\n> > > > +                       .testPatternModes = {\n> > > > +                               { controls::draft::TestPatternModeOff, 0 },\n> > > > +                               { controls::draft::TestPatternModeColorBars, 1 },\n> > > > +                       },\n> > > > +               } },\n> > > >                 { \"hi846\", {\n> > > >                         .unitCellSize = { 1120, 1120 },\n> > > >                         .testPatternModes = {","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 BDB4DC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Nov 2024 10:34:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1894665496;\n\tFri,  8 Nov 2024 11:34:21 +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 BB02060589\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Nov 2024 11:34:19 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BC0F37E9;\n\tFri,  8 Nov 2024 11:34:09 +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=\"C4UchyVP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731062050;\n\tbh=tJNKnHZe/Ze5p0wBdXWugofgdAUSx6Y394zlA4R/aEA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=C4UchyVPVX2/6h0sw1wY4mJcdMY2Vk48UH8OkVWH2gR/hhwI3buggKQfAekHH+B3b\n\tmEL7sZG/cx2zJFk7dIIuSmKFe6muh5KoUK1/Lwm4p0AwuCpt4mnCHdErNW+38CCqA4\n\tVbTC2c14+Zut3xQOZb2UvbRd5HkD/RqWbvi0yg2M=","Date":"Fri, 8 Nov 2024 12:34:12 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Cheng-Hao Yang <chenghaoyang@chromium.org>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tHarvey Yang <chenghaoyang@google.com>, \n\tHan-Lin Chen <hanlinchen@chromium.org>, Xing Gu <xinggu@chromium.org>,\n\tYudhistira Erlandinata <yerlandinata@chromium.org>","Subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","Message-ID":"<20241108103412.GH32614@pendragon.ideasonboard.com>","References":"<20240924090051.1617040-1-chenghaoyang@google.com>\n\t<20240924090051.1617040-2-chenghaoyang@google.com>\n\t<172718208907.3726802.6740889124360735396@ping.linuxembedded.co.uk>\n\t<20240924131910.GA20255@pendragon.ideasonboard.com>\n\t<CAEB1ahuqK1wT62WFvMFAxaO+u2KahbURta+imqG+DqoZ9ZKjOA@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<CAEB1ahuqK1wT62WFvMFAxaO+u2KahbURta+imqG+DqoZ9ZKjOA@mail.gmail.com>","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":32249,"web_url":"https://patchwork.libcamera.org/comment/32249/","msgid":"<CAEB1ahtD7ctVs8=gphdRCgzS+941sf0FYiia6nkiu+AXubP_zg@mail.gmail.com>","date":"2024-11-19T07:41:13","subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/people/117/","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"content":"Hi Kieran and Laurent,\n\nOn Fri, Nov 8, 2024 at 6:34 PM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi Harbey,\n>\n> On Fri, Nov 08, 2024 at 02:50:33PM +0800, Cheng-Hao Yang wrote:\n> > On Tue, Sep 24, 2024 at 9:19 PM Laurent Pinchart wrote:\n> > > On Tue, Sep 24, 2024 at 01:48:09PM +0100, Kieran Bingham wrote:\n> > > > In $SUBJECT - I think you mean 'properties' not 'proprietary'\n> > > >\n> > > > But as for the commit message, the subject should say what this patch is\n> > > > for. libcamera has no knowledge of what a 'ciri' is.\n\nUpdated. Please check again.\n\n> > > >\n> > > > Lets keep it to the details of the image sensor.\n> > > >\n> > > > Quoting Harvey Yang (2024-09-24 09:26:10)\n> > > > > gc05a2 is the first sensor used by ciri.\n> > > >\n> > > > I don't think that's relevant to libcamera.\n> > > >\n> > > > Please describe what the gc05a2 is instead.\n\nUpdated. Please check again.\n\n> > > >\n> > > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > > Co-developed-by: Xing Gu <xinggu@chromium.org>\n> > > > > Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\n> > > > > Co-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n> > > > > ---\n> > > > >  src/ipa/libipa/camera_sensor_helper.cpp         | 17 +++++++++++++++++\n> > > > >  .../sensor/camera_sensor_properties.cpp         |  7 +++++++\n> > > > >  2 files changed, 24 insertions(+)\n> > > > >\n> > > > > diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> > > > > index ffc7c1d7..cd7d12d6 100644\n> > > > > --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> > > > > +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> > > > > @@ -519,6 +519,23 @@ private:\n> > > > >  };\n> > > > >  REGISTER_CAMERA_SENSOR_HELPER(\"ar0521\", CameraSensorHelperAr0521)\n> > > > >\n> > > > > +class CameraSensorHelperGc05a2 : public CameraSensorHelper\n> > > > > +{\n> > > > > +public:\n> > > > > +       uint32_t gainCode(double gain) const override\n> > > > > +       {\n> > > > > +               uint32_t aeGain = std::clamp((uint32_t)gain, kAeBaseGain_, kStep_ * kAeBaseGain_);\n> > >\n> > > This doesn't seem right. 'gain' is expressed as a real number, with 1.0\n> > > corresponding to a x1 gain.\n> > >\n> > > > > +               return aeGain * 0x400 / kAeBaseGain_;\n> > >\n> > > If the gain model is linear, you should be able to express it with the\n> > > standard gain model, without needing to override gain() and gainCode().\n> > >\n> > > > > +       }\n> > > > > +\n> > > > > +       // `double gain(uint32_t gainCode)` will not be used.\n> > > >\n> > > > So don't add it ?\n> > > >\n> > > > But how do you mean \"won't be used\" - you mean ... you won't use it? or\n> > > > it can't be used?\n> > > >\n> > > > How do we correctly determine the gain *used* from a configured gain\n> > > > code?\n> >\n> > IIUC, If a configured ae gain is set, IIUC for per-frame control use cases,\n> > in mtkisp7, we feed this information to the IPA proprietary library, which\n> > calculates the corresponding gainCode for v4l2 camera sensor.\n> >\n> > We don't have the use case to calculate the ae gain from a configured gain\n> > code. I've seen other pipeline handlers using this function to calculate the\n> > static metadata `controls::AnalogueGain` though. Is this the only use case?\n>\n> It's used in open-source IPA modules. To merge support for a new sensor\n> or a new platform, a fully open source implementation is required. There\n> will need to be an open-source mtkisp7 IPA module that implements AGC,\n> so you will need this.\n\nGot it. I got replies from MediaTek that include the conversion algorithms.\nAdded in the new version.\n\nBR,\nHarvey\n\n>\n> > > > I suspect ... the gain() function should be implemented if the\n> > > > gainCode() function is implemented. Otherwise callers on the helper will\n> > > > get inconsistent results.\n> > >\n> > > Yes, even if libipa isn't used by the MTK IPA, proper support for the\n> > > sensor needs to be implemented. Same for patch 2/2 in the series.\n> >\n> > I've been contacting MTK's team, while they're quite inconsistent with\n> > themselves and very slow to response...\n> >\n> > Previously the conversion is done in their proprietary algorithms, and\n> > we directly use the results in the IPA.\n> >\n> > Therefore, we might not end up using these functions even if we finally\n> > dig out MTK's algorithm.\n> > For per-frame control use cases though, it might simplify the task flows,\n> > as we probably could calculate the gain code ourselves without waiting\n> > for IPA proprietary algorithm.\n> >\n> > Let's wait for MTK's response for now...\n> >\n> > > > > +\n> > > > > +private:\n> > > > > +       static constexpr uint32_t kStep_ = 16;\n> > > > > +       static constexpr uint32_t kAeBaseGain_ = 1024;\n> > > > > +};\n> > > > > +REGISTER_CAMERA_SENSOR_HELPER(\"gc05a2\", CameraSensorHelperGc05a2)\n> > > > > +\n> > > > >  class CameraSensorHelperImx219 : public CameraSensorHelper\n> > > > >  {\n> > > > >  public:\n> > > > > diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > > > index 4e5217ab..3e1bd85e 100644\n> > > > > --- a/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > > > +++ b/src/libcamera/sensor/camera_sensor_properties.cpp\n> > > > > @@ -70,6 +70,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen\n> > > > >                                 { controls::draft::TestPatternModeColorBarsFadeToGray, 3 },\n> > > > >                         },\n> > > > >                 } },\n> > > > > +               { \"gc05a2\", {\n> > > > > +                       .unitCellSize = { 1120, 1120 },\n> > > > > +                       .testPatternModes = {\n> > > > > +                               { controls::draft::TestPatternModeOff, 0 },\n> > > > > +                               { controls::draft::TestPatternModeColorBars, 1 },\n> > > > > +                       },\n> > > > > +               } },\n> > > > >                 { \"hi846\", {\n> > > > >                         .unitCellSize = { 1120, 1120 },\n> > > > >                         .testPatternModes = {\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 97C20C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Nov 2024 07:41:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E0DBE6590C;\n\tTue, 19 Nov 2024 08:41:26 +0100 (CET)","from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com\n\t[IPv6:2a00:1450:4864:20::22b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F267658FD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 08:41:25 +0100 (CET)","by mail-lj1-x22b.google.com with SMTP id\n\t38308e7fff4ca-2fb4fa17044so25897161fa.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Nov 2024 23:41:25 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"VquD3tLP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1732002084; x=1732606884;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=Cxj1Z4rxHZHgT/k0C7gedVPGs34Z37wuzwwG1svq/bs=;\n\tb=VquD3tLPe0ABGiYTJ1yOPXKfRoPMhw1z424T8t/2EeckJ6vB/1sq+VSGZqYci09SBV\n\tvuQ20I2oOFVUx5ZYRy/tRJG4giYRqnGMH6+fc8kVCJndyxMqtC5Nbxp/DdXIbf8XBiAi\n\tsHVNF2hEaFRq83rUQRUf9eZXqim7xpJID9psU=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1732002084; x=1732606884;\n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=Cxj1Z4rxHZHgT/k0C7gedVPGs34Z37wuzwwG1svq/bs=;\n\tb=rE6Jht2wj7JRm7MPzIT4xN+ogu7jLYhPts4R2tI0HKYBRh02L6td5AS+6AR0P4wO5y\n\tY5Pm5kD+DYR/jukNmCDeDQz3KK+M4mMZmnfFPTxZOa5TcQG95zmbJXOf4dpmH7KogLdf\n\tPnatJ1WNXHetfIwf7/ms+so9eXN8U+Xtc9CzuzYJysobaLgWR44yNgMqsmTIqQY9Xrk2\n\tr0I7n/gZxUCsSbIlWLGKovPeJpC8NOYg7YZyiJJrV5YTHy+ZX73JemzinRfzGU38KRH5\n\t6eQ0JPTLy5SQPOhaNV+KWdgMZfTIF1Zw4XbqFyoycakGNsfAmCoymboRbNGYWqbvgLI3\n\tZXZg==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCVXmwlYvaE5pIjO++He+FFAloGNnizNGJkxiPDQ/8iNzfOt0xAHCjr+5T6kVFLVpmA4UuSagIhOGkJONCyvbTk=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YzSuOlo//lBg8Stfqvp+ttlAkuqJ2Bxx2XhrwSPd+8X+tlQwvZ7\n\tyHxMTWH4YbTfh0x4/gxycWSnddq/vqybCqdlnNwbPHNysVvovqybltjxyfc+0paKvNudFV9+N1w\n\ts8KiMz19oXMtyQYkpRJlnGRcY8JHsNLfkaRZw","X-Google-Smtp-Source":"AGHT+IH5TBH2IbW7jNmcjjNzSqbdftpMkZn92CwiT1xTXh0l0Ctud1rNkOWwQtf5tVYNGHrD/k1JPXsyLCL5QvRFSmo=","X-Received":"by 2002:a2e:a984:0:b0:2fa:cac0:2a14 with SMTP id\n\t38308e7fff4ca-2ff6064e137mr59123461fa.11.1732002084439;\n\tMon, 18 Nov 2024 23:41:24 -0800 (PST)","MIME-Version":"1.0","References":"<20240924090051.1617040-1-chenghaoyang@google.com>\n\t<20240924090051.1617040-2-chenghaoyang@google.com>\n\t<172718208907.3726802.6740889124360735396@ping.linuxembedded.co.uk>\n\t<20240924131910.GA20255@pendragon.ideasonboard.com>\n\t<CAEB1ahuqK1wT62WFvMFAxaO+u2KahbURta+imqG+DqoZ9ZKjOA@mail.gmail.com>\n\t<20241108103412.GH32614@pendragon.ideasonboard.com>","In-Reply-To":"<20241108103412.GH32614@pendragon.ideasonboard.com>","From":"Cheng-Hao Yang <chenghaoyang@chromium.org>","Date":"Tue, 19 Nov 2024 15:41:13 +0800","Message-ID":"<CAEB1ahtD7ctVs8=gphdRCgzS+941sf0FYiia6nkiu+AXubP_zg@mail.gmail.com>","Subject":"Re: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary\n\tfor ciri","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org, \n\tHarvey Yang <chenghaoyang@google.com>,\n\tHan-Lin Chen <hanlinchen@chromium.org>, Xing Gu <xinggu@chromium.org>,\n\tYudhistira Erlandinata <yerlandinata@chromium.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","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>"}}]