[{"id":39797,"web_url":"https://patchwork.libcamera.org/comment/39797/","msgid":"<178472359286.354018.6822382901906993840@ping.linuxembedded.co.uk>","date":"2026-07-22T12:33:12","subject":"Re: [PATCH 1/3] ipa: rpi: cam_helper: Add Mira220 cam helper","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2026-07-22 12:57:11)\n> AMS-OSRAM Mira220 is a global shutter sensor with a maximum\n> resolution of 1600x1400.\n> \n> This patch upports the Mira220 support available at\n> https://github.com/ams-OSRAM/libcamera.git at revision d7d5e17ec961\n> (\"update json files so they are truly mono\")\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/ipa/rpi/cam_helper/cam_helper_mira220.cpp | 61 +++++++++++++++++++++++++++\n>  src/ipa/rpi/cam_helper/meson.build            |  1 +\n>  2 files changed, 62 insertions(+)\n> \n> diff --git a/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp b/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp\n> new file mode 100644\n> index 000000000000..235546ccf7c5\n> --- /dev/null\n> +++ b/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp\n> @@ -0,0 +1,61 @@\n> +/* SPDX-License-Identifier: BSD-2-Clause */\n> +/*\n> + * Copyright (C) 2024, Raspberry Pi Ltd\n\nI expect that should be ams-osram ... I don't think RPi made this\nhelper.\n\n\nAside from that, I think this series should add the libipa camera sensor\nhelper and the camera sensor properties ?\n\n--\nKieran\n\n> + *\n> + * cam_helper_Mira220.cpp - camera information for Mira220 sensor\n> + */\n> +\n> +#include <assert.h>\n> +\n> +#include \"cam_helper.h\"\n> +\n> +using namespace RPiController;\n> +\n> +class CamHelperMira220 : public CamHelper\n> +{\n> +public:\n> +       CamHelperMira220();\n> +       uint32_t gainCode(double gain) const override;\n> +       double gain(uint32_t gainCode) const override;\n> +       unsigned int hideFramesModeSwitch() const override;\n> +\n> +private:\n> +       /*\n> +        * Smallest difference between the frame length and integration time,\n> +        * in units of lines.\n> +        */\n> +       static constexpr int frameIntegrationDiff = 4;\n> +};\n> +\n> +/*\n> + * Mira220 doesn't output metadata, so we have to use the delayed controls which\n> + * works by counting frames.\n> + */\n> +\n> +CamHelperMira220::CamHelperMira220()\n> +       : CamHelper({}, frameIntegrationDiff)\n> +{\n> +}\n> +\n> +uint32_t CamHelperMira220::gainCode(double gain) const\n> +{\n> +       return static_cast<uint32_t>(2048.0 - 2048.0 / gain);\n> +}\n> +\n> +double CamHelperMira220::gain(uint32_t gainCode) const\n> +{\n> +       return static_cast<double>(2048.0 / (2048 - gainCode));\n> +}\n> +\n> +unsigned int CamHelperMira220::hideFramesModeSwitch() const\n> +{\n> +       /* After a mode switch, we seem to get 1 bad frame. */\n> +       return 1;\n> +}\n> +\n> +static CamHelper *create()\n> +{\n> +       return new CamHelperMira220();\n> +}\n> +\n> +static RegisterCamHelper reg(\"mira220\", &create);\n> diff --git a/src/ipa/rpi/cam_helper/meson.build b/src/ipa/rpi/cam_helper/meson.build\n> index eabd55dce5a1..a8756a1a0226 100644\n> --- a/src/ipa/rpi/cam_helper/meson.build\n> +++ b/src/ipa/rpi/cam_helper/meson.build\n> @@ -12,6 +12,7 @@ rpi_ipa_cam_helper_sources = files([\n>      'cam_helper_imx519.cpp',\n>      'cam_helper_imx678.cpp',\n>      'cam_helper_imx708.cpp',\n> +    'cam_helper_mira220.cpp',\n>      'cam_helper_ov64a40.cpp',\n>      'cam_helper_ov7251.cpp',\n>      'cam_helper_ov9281.cpp',\n> \n> -- \n> 2.54.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 E9B58BDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 Jul 2026 12:33:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1FA8067EA6;\n\tWed, 22 Jul 2026 14:33:17 +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 A496067E8A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jul 2026 14:33:15 +0200 (CEST)","from monstersaurus.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 58B65447;\n\tWed, 22 Jul 2026 14:32: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=\"IWWi6igm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1784723535;\n\tbh=E9oloa3x8kwFFz40FN+NbzQ2hNTk0u3ObfAFH9tTIME=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=IWWi6igmhrBrij6F1ank1RvVnSJx/YeEuPm2e36/Hji9DEHZ9niXGSYPBTV/q9S6v\n\t9y+BCAj+EyQDJ0Md4o3odAsewIIJvRIX7jpswksi2RVa0Omtd2dnAiNH1i06RI0eqF\n\t5kXWcH85lguest/60J2AyfXvdCDK67tiqa3mJBrs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260722-mira220-v1-1-1006a4cbd2a8@ideasonboard.com>","References":"<20260722-mira220-v1-0-1006a4cbd2a8@ideasonboard.com>\n\t<20260722-mira220-v1-1-1006a4cbd2a8@ideasonboard.com>","Subject":"Re: [PATCH 1/3] ipa: rpi: cam_helper: Add Mira220 cam helper","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Philippe Baetens <philippebaetens@gmail.com>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 22 Jul 2026 13:33:12 +0100","Message-ID":"<178472359286.354018.6822382901906993840@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":39807,"web_url":"https://patchwork.libcamera.org/comment/39807/","msgid":"<20260723135521.GA763544@killaraus.ideasonboard.com>","date":"2026-07-23T13:55:21","subject":"Re: [PATCH 1/3] ipa: rpi: cam_helper: Add Mira220 cam helper","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Jul 22, 2026 at 01:33:12PM +0100, Kieran Bingham wrote:\n> Quoting Jacopo Mondi (2026-07-22 12:57:11)\n> > AMS-OSRAM Mira220 is a global shutter sensor with a maximum\n> > resolution of 1600x1400.\n> > \n> > This patch upports the Mira220 support available at\n> > https://github.com/ams-OSRAM/libcamera.git at revision d7d5e17ec961\n> > (\"update json files so they are truly mono\")\n> > \n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > ---\n> >  src/ipa/rpi/cam_helper/cam_helper_mira220.cpp | 61 +++++++++++++++++++++++++++\n> >  src/ipa/rpi/cam_helper/meson.build            |  1 +\n> >  2 files changed, 62 insertions(+)\n> > \n> > diff --git a/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp b/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp\n> > new file mode 100644\n> > index 000000000000..235546ccf7c5\n> > --- /dev/null\n> > +++ b/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp\n> > @@ -0,0 +1,61 @@\n> > +/* SPDX-License-Identifier: BSD-2-Clause */\n> > +/*\n> > + * Copyright (C) 2024, Raspberry Pi Ltd\n> \n> I expect that should be ams-osram ... I don't think RPi made this\n> helper.\n> \n> Aside from that, I think this series should add the libipa camera sensor\n> helper and the camera sensor properties ?\n> \n> > + *\n> > + * cam_helper_Mira220.cpp - camera information for Mira220 sensor\n> > + */\n> > +\n> > +#include <assert.h>\n> > +\n> > +#include \"cam_helper.h\"\n> > +\n> > +using namespace RPiController;\n> > +\n> > +class CamHelperMira220 : public CamHelper\n> > +{\n> > +public:\n> > +       CamHelperMira220();\n> > +       uint32_t gainCode(double gain) const override;\n> > +       double gain(uint32_t gainCode) const override;\n> > +       unsigned int hideFramesModeSwitch() const override;\n> > +\n> > +private:\n> > +       /*\n> > +        * Smallest difference between the frame length and integration time,\n> > +        * in units of lines.\n> > +        */\n> > +       static constexpr int frameIntegrationDiff = 4;\n> > +};\n> > +\n> > +/*\n> > + * Mira220 doesn't output metadata, so we have to use the delayed controls which\n> > + * works by counting frames.\n> > + */\n> > +\n> > +CamHelperMira220::CamHelperMira220()\n> > +       : CamHelper({}, frameIntegrationDiff)\n> > +{\n> > +}\n> > +\n> > +uint32_t CamHelperMira220::gainCode(double gain) const\n> > +{\n> > +       return static_cast<uint32_t>(2048.0 - 2048.0 / gain);\n> > +}\n> > +\n> > +double CamHelperMira220::gain(uint32_t gainCode) const\n> > +{\n> > +       return static_cast<double>(2048.0 / (2048 - gainCode));\n> > +}\n> > +\n> > +unsigned int CamHelperMira220::hideFramesModeSwitch() const\n> > +{\n> > +       /* After a mode switch, we seem to get 1 bad frame. */\n> > +       return 1;\n\nCould you confirm you've tested this, not just copied it from another\nhelper ?\n\n> > +}\n> > +\n> > +static CamHelper *create()\n> > +{\n> > +       return new CamHelperMira220();\n> > +}\n> > +\n> > +static RegisterCamHelper reg(\"mira220\", &create);\n> > diff --git a/src/ipa/rpi/cam_helper/meson.build b/src/ipa/rpi/cam_helper/meson.build\n> > index eabd55dce5a1..a8756a1a0226 100644\n> > --- a/src/ipa/rpi/cam_helper/meson.build\n> > +++ b/src/ipa/rpi/cam_helper/meson.build\n> > @@ -12,6 +12,7 @@ rpi_ipa_cam_helper_sources = files([\n> >      'cam_helper_imx519.cpp',\n> >      'cam_helper_imx678.cpp',\n> >      'cam_helper_imx708.cpp',\n> > +    'cam_helper_mira220.cpp',\n> >      'cam_helper_ov64a40.cpp',\n> >      'cam_helper_ov7251.cpp',\n> >      'cam_helper_ov9281.cpp',","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 2A3FABDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Jul 2026 13:55:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6654B67EB9;\n\tThu, 23 Jul 2026 15:55:25 +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 148D067E5C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Jul 2026 15:55:23 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-70f3-e800--a06.rev.dnainternet.fi\n\t[IPv6:2001:14ba:70f3:e800::a06])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CB43919C;\n\tThu, 23 Jul 2026 15:54:21 +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=\"Wec8xFi7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1784814862;\n\tbh=JtQiIXiv99PJcJJ/mfoekgJaEpmnA73lF0stilA3wgk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Wec8xFi7R0QiU7MsQ6rneTkEVlYrD5tySJW28ry5UPsNcG0pwajRPMlvNvUiTgYsp\n\t7dUWwmQ+3zJwUXg0EPPstzqE/33KCqFjHqtevu2RL1OmeeFL/SOlj0pRCDX0bDelsg\n\txcrn0n70T4TiqlOsrEjGwXaBUGGp0HQxvmzsRhP4=","Date":"Thu, 23 Jul 2026 16:55:21 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tPhilippe Baetens <philippebaetens@gmail.com>","Subject":"Re: [PATCH 1/3] ipa: rpi: cam_helper: Add Mira220 cam helper","Message-ID":"<20260723135521.GA763544@killaraus.ideasonboard.com>","References":"<20260722-mira220-v1-0-1006a4cbd2a8@ideasonboard.com>\n\t<20260722-mira220-v1-1-1006a4cbd2a8@ideasonboard.com>\n\t<178472359286.354018.6822382901906993840@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<178472359286.354018.6822382901906993840@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":39808,"web_url":"https://patchwork.libcamera.org/comment/39808/","msgid":"<amIuVldBAYuxbcT7@zed>","date":"2026-07-23T15:13:09","subject":"Re: [PATCH 1/3] ipa: rpi: cam_helper: Add Mira220 cam helper","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"On Thu, Jul 23, 2026 at 04:55:21PM +0300, Laurent Pinchart wrote:\n> On Wed, Jul 22, 2026 at 01:33:12PM +0100, Kieran Bingham wrote:\n> > Quoting Jacopo Mondi (2026-07-22 12:57:11)\n> > > AMS-OSRAM Mira220 is a global shutter sensor with a maximum\n> > > resolution of 1600x1400.\n> > >\n> > > This patch upports the Mira220 support available at\n> > > https://github.com/ams-OSRAM/libcamera.git at revision d7d5e17ec961\n> > > (\"update json files so they are truly mono\")\n> > >\n> > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > > ---\n> > >  src/ipa/rpi/cam_helper/cam_helper_mira220.cpp | 61 +++++++++++++++++++++++++++\n> > >  src/ipa/rpi/cam_helper/meson.build            |  1 +\n> > >  2 files changed, 62 insertions(+)\n> > >\n> > > diff --git a/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp b/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp\n> > > new file mode 100644\n> > > index 000000000000..235546ccf7c5\n> > > --- /dev/null\n> > > +++ b/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp\n> > > @@ -0,0 +1,61 @@\n> > > +/* SPDX-License-Identifier: BSD-2-Clause */\n> > > +/*\n> > > + * Copyright (C) 2024, Raspberry Pi Ltd\n> >\n> > I expect that should be ams-osram ... I don't think RPi made this\n> > helper.\n\nSurely not, it's probably a bad copy&paste.\n\nActually it's not only Copyright, I should attribute the patch to\nPhilippe as this file comes from multiple of his commits in their bsp\n\n> >\n> > Aside from that, I think this series should add the libipa camera sensor\n> > helper and the camera sensor properties ?\n> >\n\nI can't test other platforms them at the moment, I would prefer not to\nsend untested things ?\n\n> > > + *\n> > > + * cam_helper_Mira220.cpp - camera information for Mira220 sensor\n> > > + */\n> > > +\n> > > +#include <assert.h>\n> > > +\n> > > +#include \"cam_helper.h\"\n> > > +\n> > > +using namespace RPiController;\n> > > +\n> > > +class CamHelperMira220 : public CamHelper\n> > > +{\n> > > +public:\n> > > +       CamHelperMira220();\n> > > +       uint32_t gainCode(double gain) const override;\n> > > +       double gain(uint32_t gainCode) const override;\n> > > +       unsigned int hideFramesModeSwitch() const override;\n> > > +\n> > > +private:\n> > > +       /*\n> > > +        * Smallest difference between the frame length and integration time,\n> > > +        * in units of lines.\n> > > +        */\n> > > +       static constexpr int frameIntegrationDiff = 4;\n> > > +};\n> > > +\n> > > +/*\n> > > + * Mira220 doesn't output metadata, so we have to use the delayed controls which\n> > > + * works by counting frames.\n> > > + */\n> > > +\n> > > +CamHelperMira220::CamHelperMira220()\n> > > +       : CamHelper({}, frameIntegrationDiff)\n> > > +{\n> > > +}\n> > > +\n> > > +uint32_t CamHelperMira220::gainCode(double gain) const\n> > > +{\n> > > +       return static_cast<uint32_t>(2048.0 - 2048.0 / gain);\n> > > +}\n> > > +\n> > > +double CamHelperMira220::gain(uint32_t gainCode) const\n> > > +{\n> > > +       return static_cast<double>(2048.0 / (2048 - gainCode));\n> > > +}\n> > > +\n> > > +unsigned int CamHelperMira220::hideFramesModeSwitch() const\n> > > +{\n> > > +       /* After a mode switch, we seem to get 1 bad frame. */\n> > > +       return 1;\n>\n> Could you confirm you've tested this, not just copied it from another\n> helper ?\n>\n\nMaybe a question for Philippe, but as the sensor supports a single\nmode maybe this is not needed ?\n\nThanks\n  j\n\n> > > +}\n> > > +\n> > > +static CamHelper *create()\n> > > +{\n> > > +       return new CamHelperMira220();\n> > > +}\n> > > +\n> > > +static RegisterCamHelper reg(\"mira220\", &create);\n> > > diff --git a/src/ipa/rpi/cam_helper/meson.build b/src/ipa/rpi/cam_helper/meson.build\n> > > index eabd55dce5a1..a8756a1a0226 100644\n> > > --- a/src/ipa/rpi/cam_helper/meson.build\n> > > +++ b/src/ipa/rpi/cam_helper/meson.build\n> > > @@ -12,6 +12,7 @@ rpi_ipa_cam_helper_sources = files([\n> > >      'cam_helper_imx519.cpp',\n> > >      'cam_helper_imx678.cpp',\n> > >      'cam_helper_imx708.cpp',\n> > > +    'cam_helper_mira220.cpp',\n> > >      'cam_helper_ov64a40.cpp',\n> > >      'cam_helper_ov7251.cpp',\n> > >      'cam_helper_ov9281.cpp',\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 ECC38BDE4C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Jul 2026 15:13:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 52CD267EBA;\n\tThu, 23 Jul 2026 17:13:14 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BA6AB67E5C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Jul 2026 17:13:12 +0200 (CEST)","from ideasonboard.com (unknown [93.65.100.155])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5B1B319C;\n\tThu, 23 Jul 2026 17:12:11 +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=\"BzEjnYk/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1784819531;\n\tbh=CXec4hqMoKV358/DKqMrbUKVKvCXTGKPknFN+F/JhF4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=BzEjnYk/DOM5Hvk1GCOIjTf8yFTE22QsbpcZI7lEvrnctI5ubAKKx08GEFpCWXQpA\n\tssyPRZAydx/vjz1xlfF+h0M7+BMarg990hSl6lR8L3f42uwWVuxoBRQcnxdSG2WtcN\n\tNy0pcjz9yyE/KKdu6jr+DQnDSrzQgJVGX8U7WnVQ=","Date":"Thu, 23 Jul 2026 17:13:09 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>, \n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org, \n\tPhilippe Baetens <philippebaetens@gmail.com>","Subject":"Re: [PATCH 1/3] ipa: rpi: cam_helper: Add Mira220 cam helper","Message-ID":"<amIuVldBAYuxbcT7@zed>","References":"<20260722-mira220-v1-0-1006a4cbd2a8@ideasonboard.com>\n\t<20260722-mira220-v1-1-1006a4cbd2a8@ideasonboard.com>\n\t<178472359286.354018.6822382901906993840@ping.linuxembedded.co.uk>\n\t<20260723135521.GA763544@killaraus.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20260723135521.GA763544@killaraus.ideasonboard.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":39809,"web_url":"https://patchwork.libcamera.org/comment/39809/","msgid":"<20260723152733.GA767247@killaraus.ideasonboard.com>","date":"2026-07-23T15:27:33","subject":"Re: [PATCH 1/3] ipa: rpi: cam_helper: Add Mira220 cam helper","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Jul 23, 2026 at 05:13:09PM +0200, Jacopo Mondi wrote:\n> On Thu, Jul 23, 2026 at 04:55:21PM +0300, Laurent Pinchart wrote:\n> > On Wed, Jul 22, 2026 at 01:33:12PM +0100, Kieran Bingham wrote:\n> > > Quoting Jacopo Mondi (2026-07-22 12:57:11)\n> > > > AMS-OSRAM Mira220 is a global shutter sensor with a maximum\n> > > > resolution of 1600x1400.\n> > > >\n> > > > This patch upports the Mira220 support available at\n> > > > https://github.com/ams-OSRAM/libcamera.git at revision d7d5e17ec961\n> > > > (\"update json files so they are truly mono\")\n> > > >\n> > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > > > ---\n> > > >  src/ipa/rpi/cam_helper/cam_helper_mira220.cpp | 61 +++++++++++++++++++++++++++\n> > > >  src/ipa/rpi/cam_helper/meson.build            |  1 +\n> > > >  2 files changed, 62 insertions(+)\n> > > >\n> > > > diff --git a/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp b/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp\n> > > > new file mode 100644\n> > > > index 000000000000..235546ccf7c5\n> > > > --- /dev/null\n> > > > +++ b/src/ipa/rpi/cam_helper/cam_helper_mira220.cpp\n> > > > @@ -0,0 +1,61 @@\n> > > > +/* SPDX-License-Identifier: BSD-2-Clause */\n> > > > +/*\n> > > > + * Copyright (C) 2024, Raspberry Pi Ltd\n> > >\n> > > I expect that should be ams-osram ... I don't think RPi made this\n> > > helper.\n> \n> Surely not, it's probably a bad copy&paste.\n> \n> Actually it's not only Copyright, I should attribute the patch to\n> Philippe as this file comes from multiple of his commits in their bsp\n> \n> > >\n> > > Aside from that, I think this series should add the libipa camera sensor\n> > > helper and the camera sensor properties ?\n> > >\n> \n> I can't test other platforms them at the moment, I would prefer not to\n> send untested things ?\n\nWe require libipa helpers for all sensors libcamera supports. It's fine\nif you can't test it right now. \n\n> > > > + *\n> > > > + * cam_helper_Mira220.cpp - camera information for Mira220 sensor\n> > > > + */\n> > > > +\n> > > > +#include <assert.h>\n> > > > +\n> > > > +#include \"cam_helper.h\"\n> > > > +\n> > > > +using namespace RPiController;\n> > > > +\n> > > > +class CamHelperMira220 : public CamHelper\n> > > > +{\n> > > > +public:\n> > > > +       CamHelperMira220();\n> > > > +       uint32_t gainCode(double gain) const override;\n> > > > +       double gain(uint32_t gainCode) const override;\n> > > > +       unsigned int hideFramesModeSwitch() const override;\n> > > > +\n> > > > +private:\n> > > > +       /*\n> > > > +        * Smallest difference between the frame length and integration time,\n> > > > +        * in units of lines.\n> > > > +        */\n> > > > +       static constexpr int frameIntegrationDiff = 4;\n> > > > +};\n> > > > +\n> > > > +/*\n> > > > + * Mira220 doesn't output metadata, so we have to use the delayed controls which\n> > > > + * works by counting frames.\n> > > > + */\n> > > > +\n> > > > +CamHelperMira220::CamHelperMira220()\n> > > > +       : CamHelper({}, frameIntegrationDiff)\n> > > > +{\n> > > > +}\n> > > > +\n> > > > +uint32_t CamHelperMira220::gainCode(double gain) const\n> > > > +{\n> > > > +       return static_cast<uint32_t>(2048.0 - 2048.0 / gain);\n> > > > +}\n> > > > +\n> > > > +double CamHelperMira220::gain(uint32_t gainCode) const\n> > > > +{\n> > > > +       return static_cast<double>(2048.0 / (2048 - gainCode));\n> > > > +}\n> > > > +\n> > > > +unsigned int CamHelperMira220::hideFramesModeSwitch() const\n> > > > +{\n> > > > +       /* After a mode switch, we seem to get 1 bad frame. */\n> > > > +       return 1;\n> >\n> > Could you confirm you've tested this, not just copied it from another\n> > helper ?\n> \n> Maybe a question for Philippe, but as the sensor supports a single\n> mode maybe this is not needed ?\n\nUnless there's a known reason for hiding the first frame, I would prefer\ndropping this indeed.\n\n> > > > +}\n> > > > +\n> > > > +static CamHelper *create()\n> > > > +{\n> > > > +       return new CamHelperMira220();\n> > > > +}\n> > > > +\n> > > > +static RegisterCamHelper reg(\"mira220\", &create);\n> > > > diff --git a/src/ipa/rpi/cam_helper/meson.build b/src/ipa/rpi/cam_helper/meson.build\n> > > > index eabd55dce5a1..a8756a1a0226 100644\n> > > > --- a/src/ipa/rpi/cam_helper/meson.build\n> > > > +++ b/src/ipa/rpi/cam_helper/meson.build\n> > > > @@ -12,6 +12,7 @@ rpi_ipa_cam_helper_sources = files([\n> > > >      'cam_helper_imx519.cpp',\n> > > >      'cam_helper_imx678.cpp',\n> > > >      'cam_helper_imx708.cpp',\n> > > > +    'cam_helper_mira220.cpp',\n> > > >      'cam_helper_ov64a40.cpp',\n> > > >      'cam_helper_ov7251.cpp',\n> > > >      'cam_helper_ov9281.cpp',","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 B1E15BDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Jul 2026 15:27:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9316B67EBA;\n\tThu, 23 Jul 2026 17:27:36 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C38467E5C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Jul 2026 17:27:35 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-70f3-e800--a06.rev.dnainternet.fi\n\t[IPv6:2001:14ba:70f3:e800::a06])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A83E519C;\n\tThu, 23 Jul 2026 17:26:33 +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=\"nsvtdN7t\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1784820393;\n\tbh=Ijom0Qb5JSbEXXbQ51Cs5ZCoh5CLAB+PCXymmA+v6Ls=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=nsvtdN7tmCN6/U7fwGo4SFwOj9O8TbspUIwDfq2tcoWX3njLI7huSz/zKwovyhTMk\n\tT982cwX608AfkK72au4gXwUM4SPKXHrSU5mAaS31LZNemZcAZX1IGJ8uyfg8+MkhDf\n\toKhvZm+HY5strtApP/QYoRokhPfhKxmuZMqlA75M=","Date":"Thu, 23 Jul 2026 18:27:33 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tPhilippe Baetens <philippebaetens@gmail.com>","Subject":"Re: [PATCH 1/3] ipa: rpi: cam_helper: Add Mira220 cam helper","Message-ID":"<20260723152733.GA767247@killaraus.ideasonboard.com>","References":"<20260722-mira220-v1-0-1006a4cbd2a8@ideasonboard.com>\n\t<20260722-mira220-v1-1-1006a4cbd2a8@ideasonboard.com>\n\t<178472359286.354018.6822382901906993840@ping.linuxembedded.co.uk>\n\t<20260723135521.GA763544@killaraus.ideasonboard.com>\n\t<amIuVldBAYuxbcT7@zed>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<amIuVldBAYuxbcT7@zed>","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>"}}]