[{"id":27494,"web_url":"https://patchwork.libcamera.org/comment/27494/","msgid":"<168864245882.811113.14838961415020554256@Monstersaurus>","date":"2023-07-06T11:20:58","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> The imx708 must drop a single frame on startup - but only when in HDR\n> mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> hideFramesModeSwitch() which currently unconditionally advertises to\n> drop one frame.\n> \n> Unfortunately there is no clear way to tell if the sensor is in the HDR\n> mode. So for now, look the resolution and framerate to deduce this.\n> \n> Additionally ensure we override hideFramesStartup() and return the same\n> number as hideFramesModeSwitch().\n> \n> Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n> Changes since v1:\n> - Fix a typo in the comparison statement.\n> ---\n>  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n>  1 file changed, 24 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> index 641ba18f4b9d..9bc0272dd4c1 100644\n> --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> @@ -21,6 +21,8 @@ using namespace RPiController;\n>  using namespace libcamera;\n>  using libcamera::utils::Duration;\n>  \n> +using namespace std::literals::chrono_literals;\n> +\n>  namespace libcamera {\n>  LOG_DECLARE_CATEGORY(IPARPI)\n>  }\n> @@ -56,7 +58,8 @@ public:\n>                        int &vblankDelay, int &hblankDelay) const override;\n>         bool sensorEmbeddedDataPresent() const override;\n>         double getModeSensitivity(const CameraMode &mode) const override;\n> -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> +       unsigned int hideFramesModeSwitch() const override;\n> +       unsigned int hideFramesStartup() const;\n>  \n>  private:\n>         /*\n> @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n>         return (mode.width > 2304) ? 1.0 : 2.0;\n>  }\n>  \n> +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> +{\n> +       /*\n> +        * We need to drop the first startup frame in HDR mode.\n> +        * Unfortunately the only way to currently determine if the sensor is in\n> +        * the HDR mode is to match with the resolution and framerate - the HDR\n> +        * mode only runs upto 30fps.\n\nPerhaps we should add a \n\n\t * \\todo: Revisit this when the HDR mode is handled by\n\t * libcamera.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> +        */\n> +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> +           mode_.minFrameDuration > 1.0s / 32)\n> +               return 1;\n> +       else\n> +               return 0;\n> +}\n> +\n> +unsigned int CamHelperImx708::hideFramesStartup() const\n> +{\n> +       return hideFramesModeSwitch();\n> +}\n> +\n>  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n>                                        Metadata &metadata) const\n>  {\n> -- \n> 2.34.1\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 9FF10C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 11:21:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 06531628BC;\n\tThu,  6 Jul 2023 13:21:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C2D8061E36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 13:21:01 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3AB8A7F3;\n\tThu,  6 Jul 2023 13:20:16 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688642464;\n\tbh=R7AEhzVJUDf/qYtN9o3UnQ470yAKylJ8PZd3pfFAJmA=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=093p6DgMiKQFsNe93tNOcG2Y+JsLRsJBWQQoEIYwE1GQPQJJIR1BqP+MgHbf4vFc8\n\tiawXCtpMgS1DoQHHC3wC+eImk9JqVqiIihDG75J1MnxsOz43bdFf2xlgOx8r+4HPkF\n\txZmqO/N4zt1KjLjdZxseHYNxoD4Tj3RgPEAzirB9b7a3GFDnI26ANmhB/Rydn814PW\n\tX+WcZVR8P7o/tCFkSr31p/mkK2vF193pJ5/GzScnPQ5b9wovcCiJQ1tisU1gcebKRV\n\tGUfQi07cehbJEZo8YmteWo4YOzDztd1Bw4fpgCoKR+A/daEM5lBClKxJsXVeB0OJSp\n\tADNQ/08cAO62g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688642416;\n\tbh=R7AEhzVJUDf/qYtN9o3UnQ470yAKylJ8PZd3pfFAJmA=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=pPH8V8+D16MbcqTo18SeDk7hwuqh42p2ffxNhpq4JEbqxtnzhEXlyPCgJEYNECAwD\n\tnYTp6WZTSceNBpfSe3kZpu1ko611YCrtTKQleDPAdBsmydlbFL2lQFhcHd9PXVdtHU\n\tPjY6J7hIJAQq5PqQVfBqjJ2glU7YK1piESHxHqj8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"pPH8V8+D\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230627130553.26940-1-naush@raspberrypi.com>","References":"<20230627130553.26940-1-naush@raspberrypi.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 06 Jul 2023 12:20:58 +0100","Message-ID":"<168864245882.811113.14838961415020554256@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27495,"web_url":"https://patchwork.libcamera.org/comment/27495/","msgid":"<168864354018.780480.15819215805524954388@Monstersaurus>","date":"2023-07-06T11:39:00","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Kieran Bingham (2023-07-06 12:20:58)\n> Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> > The imx708 must drop a single frame on startup - but only when in HDR\n> > mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> > hideFramesModeSwitch() which currently unconditionally advertises to\n> > drop one frame.\n> > \n> > Unfortunately there is no clear way to tell if the sensor is in the HDR\n> > mode. So for now, look the resolution and framerate to deduce this.\n> > \n> > Additionally ensure we override hideFramesStartup() and return the same\n> > number as hideFramesModeSwitch().\n> > \n> > Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > ---\n> > Changes since v1:\n> > - Fix a typo in the comparison statement.\n> > ---\n> >  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n> >  1 file changed, 24 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > index 641ba18f4b9d..9bc0272dd4c1 100644\n> > --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > @@ -21,6 +21,8 @@ using namespace RPiController;\n> >  using namespace libcamera;\n> >  using libcamera::utils::Duration;\n> >  \n> > +using namespace std::literals::chrono_literals;\n> > +\n> >  namespace libcamera {\n> >  LOG_DECLARE_CATEGORY(IPARPI)\n> >  }\n> > @@ -56,7 +58,8 @@ public:\n> >                        int &vblankDelay, int &hblankDelay) const override;\n> >         bool sensorEmbeddedDataPresent() const override;\n> >         double getModeSensitivity(const CameraMode &mode) const override;\n> > -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> > +       unsigned int hideFramesModeSwitch() const override;\n> > +       unsigned int hideFramesStartup() const;\n\n[84/123] Compiling C++ object src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o\nFAILED: src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o \nclang++-11 -Isrc/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p -Isrc/ipa/rpi/cam_helper -I../../../src/libcamera/src/ipa/rpi/cam_helper -Isrc/ipa/rpi -I../../../src/libcamera/src/ipa/rpi -Iinclude -I../../../src/libcamera/include -Iinclude/libcamera/ipa -Iinclude/libcamera -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++17 -O0 -g -Wextra-semi -Wthread-safety -Wshadow -include /home/kbingham/iob/libcamera/ci/integrator/builds/build-matrix/clang-11/config.h -Wno-c99-designator -fPIC -DLIBCAMERA_BASE_PRIVATE -MD -MQ src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o -MF src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o.d -o src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o -c ../../../src/libcamera/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n../../../src/libcamera/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp:62:15: error: 'hideFramesStartup' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]\n        unsigned int hideFramesStartup() const;\n                     ^\n../../../src/libcamera/src/ipa/rpi/cam_helper/cam_helper.h:98:23: note: overridden virtual function is here\n        virtual unsigned int hideFramesStartup() const;\n                             ^\n1 error generated.\n[85/123] Compiling C++ object src/android/libcamera-hal.so.p/jpeg_post_processor_jpeg.cpp.o\n\n\nI can fix this up just adding the override after const.\n\n--\nKieran\n\n\n\n> >  \n> >  private:\n> >         /*\n> > @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n> >         return (mode.width > 2304) ? 1.0 : 2.0;\n> >  }\n> >  \n> > +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> > +{\n> > +       /*\n> > +        * We need to drop the first startup frame in HDR mode.\n> > +        * Unfortunately the only way to currently determine if the sensor is in\n> > +        * the HDR mode is to match with the resolution and framerate - the HDR\n> > +        * mode only runs upto 30fps.\n> \n> Perhaps we should add a \n> \n>          * \\todo: Revisit this when the HDR mode is handled by\n>          * libcamera.\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > +        */\n> > +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> > +           mode_.minFrameDuration > 1.0s / 32)\n> > +               return 1;\n> > +       else\n> > +               return 0;\n> > +}\n> > +\n> > +unsigned int CamHelperImx708::hideFramesStartup() const\n> > +{\n> > +       return hideFramesModeSwitch();\n> > +}\n> > +\n> >  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n> >                                        Metadata &metadata) const\n> >  {\n> > -- \n> > 2.34.1\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 70AFBBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 11:39:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B8E57628C0;\n\tThu,  6 Jul 2023 13:39:03 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D43261E36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 13:39:02 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A71C7F3;\n\tThu,  6 Jul 2023 13:38:17 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688643543;\n\tbh=/UH2SiQyGQ6FeGmSLb0+eBwvkWXwgX4UgB6XkbiBUPM=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=dyfsD7vlzglaSjRqiQLz9c83f6d+1lCdhnJS6EtE2vNaQp+pVWevJh2gKMRIBbaf5\n\t/t0FQbqd/EadHWJ8wifGbSeWQR9vn6AdkQl1ZD22jVQZRoLX5vPe28LBya+nOYetKN\n\tPQuCRzECtPukUhJK0fk8dT4RtC+K78mxS5l9UY1VlDzqyP7wTwTo/5VS069RnM+JoV\n\t0y/18/SHW7LU6n0NK3BUrDQobsoiAmld6j2jArUQEGVYDks9MOYrXyGFC19RM0qm0C\n\t2eMgK4Hv1Ko4UTZhifnkyXPjJubzGZQXJSvXeF6EBAmqiqrJ/5P3MLbpFg4tyJg+L9\n\tOJS37fyV7+2Mw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688643497;\n\tbh=/UH2SiQyGQ6FeGmSLb0+eBwvkWXwgX4UgB6XkbiBUPM=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=vRDVSzcmxxJPzAvnAdczUqu72RIGbMEtRL014LvK/yqukLfFSaHbk5WwIWBWac49T\n\tn9dfELe4pqDnAA+pVjIQL4IDS8PuRSBDsWp53Po0EI+aaXlTSSv9sXY3MTor7eNyDd\n\tgaotF8CGiRGulO6hjeANrs2LrWJl6nZoPAE9+1y4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"vRDVSzcm\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<168864245882.811113.14838961415020554256@Monstersaurus>","References":"<20230627130553.26940-1-naush@raspberrypi.com>\n\t<168864245882.811113.14838961415020554256@Monstersaurus>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 06 Jul 2023 12:39:00 +0100","Message-ID":"<168864354018.780480.15819215805524954388@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27496,"web_url":"https://patchwork.libcamera.org/comment/27496/","msgid":"<CAEmqJPo_KhRMTBLNtZTEr+FMw5_GsKOR8wM-umTe_SG6m4RzWg@mail.gmail.com>","date":"2023-07-06T11:42:41","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Thu, 6 Jul 2023 at 12:39, Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Quoting Kieran Bingham (2023-07-06 12:20:58)\n> > Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> > > The imx708 must drop a single frame on startup - but only when in HDR\n> > > mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> > > hideFramesModeSwitch() which currently unconditionally advertises to\n> > > drop one frame.\n> > >\n> > > Unfortunately there is no clear way to tell if the sensor is in the HDR\n> > > mode. So for now, look the resolution and framerate to deduce this.\n> > >\n> > > Additionally ensure we override hideFramesStartup() and return the same\n> > > number as hideFramesModeSwitch().\n> > >\n> > > Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > > ---\n> > > Changes since v1:\n> > > - Fix a typo in the comparison statement.\n> > > ---\n> > >  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n> > >  1 file changed, 24 insertions(+), 1 deletion(-)\n> > >\n> > > diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > index 641ba18f4b9d..9bc0272dd4c1 100644\n> > > --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > @@ -21,6 +21,8 @@ using namespace RPiController;\n> > >  using namespace libcamera;\n> > >  using libcamera::utils::Duration;\n> > >\n> > > +using namespace std::literals::chrono_literals;\n> > > +\n> > >  namespace libcamera {\n> > >  LOG_DECLARE_CATEGORY(IPARPI)\n> > >  }\n> > > @@ -56,7 +58,8 @@ public:\n> > >                        int &vblankDelay, int &hblankDelay) const override;\n> > >         bool sensorEmbeddedDataPresent() const override;\n> > >         double getModeSensitivity(const CameraMode &mode) const override;\n> > > -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> > > +       unsigned int hideFramesModeSwitch() const override;\n> > > +       unsigned int hideFramesStartup() const;\n>\n> [84/123] Compiling C++ object src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o\n> FAILED: src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o\n> clang++-11 -Isrc/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p -Isrc/ipa/rpi/cam_helper -I../../../src/libcamera/src/ipa/rpi/cam_helper -Isrc/ipa/rpi -I../../../src/libcamera/src/ipa/rpi -Iinclude -I../../../src/libcamera/include -Iinclude/libcamera/ipa -Iinclude/libcamera -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++17 -O0 -g -Wextra-semi -Wthread-safety -Wshadow -include /home/kbingham/iob/libcamera/ci/integrator/builds/build-matrix/clang-11/config.h -Wno-c99-designator -fPIC -DLIBCAMERA_BASE_PRIVATE -MD -MQ src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o -MF src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o.d -o src/ipa/rpi/cam_helper/librpi_ipa_cam_helper.a.p/cam_helper_imx708.cpp.o -c ../../../src/libcamera/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> ../../../src/libcamera/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp:62:15: error: 'hideFramesStartup' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]\n>         unsigned int hideFramesStartup() const;\n>                      ^\n> ../../../src/libcamera/src/ipa/rpi/cam_helper/cam_helper.h:98:23: note: overridden virtual function is here\n>         virtual unsigned int hideFramesStartup() const;\n>                              ^\n> 1 error generated.\n> [85/123] Compiling C++ object src/android/libcamera-hal.so.p/jpeg_post_processor_jpeg.cpp.o\n>\n>\n> I can fix this up just adding the override after const.\n\nYes please - thank you!\n\nNaush\n\n>\n> --\n> Kieran\n>\n>\n>\n> > >\n> > >  private:\n> > >         /*\n> > > @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n> > >         return (mode.width > 2304) ? 1.0 : 2.0;\n> > >  }\n> > >\n> > > +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> > > +{\n> > > +       /*\n> > > +        * We need to drop the first startup frame in HDR mode.\n> > > +        * Unfortunately the only way to currently determine if the sensor is in\n> > > +        * the HDR mode is to match with the resolution and framerate - the HDR\n> > > +        * mode only runs upto 30fps.\n> >\n> > Perhaps we should add a\n> >\n> >          * \\todo: Revisit this when the HDR mode is handled by\n> >          * libcamera.\n> >\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >\n> > > +        */\n> > > +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> > > +           mode_.minFrameDuration > 1.0s / 32)\n> > > +               return 1;\n> > > +       else\n> > > +               return 0;\n> > > +}\n> > > +\n> > > +unsigned int CamHelperImx708::hideFramesStartup() const\n> > > +{\n> > > +       return hideFramesModeSwitch();\n> > > +}\n> > > +\n> > >  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n> > >                                        Metadata &metadata) const\n> > >  {\n> > > --\n> > > 2.34.1\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 638F6C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 11:43:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1FAF6628BE;\n\tThu,  6 Jul 2023 13:43:00 +0200 (CEST)","from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com\n\t[IPv6:2607:f8b0:4864:20::112b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A1AFD61E36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 13:42:58 +0200 (CEST)","by mail-yw1-x112b.google.com with SMTP id\n\t00721157ae682-5703d12ab9aso7497017b3.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 06 Jul 2023 04:42:58 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688643780;\n\tbh=5QFe6UBcs2piXER4bbtwkWE4fsZY0jF8QJhTSWjhbAc=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=mxqbTyhfLNLBGgt4MwDSCSX+lyr39UVCXvp05DZt8GJiuer1ySkexy9u7XKE7+zA4\n\tAiHRMi5DzBR8NZxWRHAosf3z7yHYUg10/gEXMkcUjEs9BVfmSHGYk0uMb1R2zMqo1U\n\t+trr7N7cpWlX5s8kAcdGlffh6FcCQkTZU7cLbcCiP3XOVYxw2/yNs5RYXj/pboMPxO\n\txSAhxmWO4eMcLfR2jRRlGXPrINZeeS+RYyw5g1GdaTG6nt9FtWbIFbFQ14I+nGnnoq\n\tSlfMSlmpz1OukSEJzqG9H2ZInPafNdHq3PWf0F309NwROLucjJofzVxECS6qWg2Lv3\n\t2dfWTTB0hS7qQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1688643777; x=1691235777;\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=Whvj2NJmzq4DgNlZmfWJB5moO/9b7bCog49flvKWLPc=;\n\tb=Jtqfh+VxrAsTeRwTtrhxnPGdznk89f7ymALza/nD16ueLZRinEt1qS3ZowJhqVlSC0\n\tfbwWlS2VomoE6m1IXjCA7YNKpW7m1nVXQxc4bi6G0IP2yRsLaeq1Cue9f+awhEsgJy9m\n\tXmnkrGlQ/sS9lqliJ81mTlzykK5UlpZZAS0zE2UGGPmDSbb+U5NNV81fnPTS1/5b7N6r\n\tSnm00/eMeQjLdv3J4pebgZkJDI4+y4Nm93Vhf0BtL62CreKlUFZ86vhBMxYFt2mim4mT\n\tuZwpL/0m1EoNM0ccQtxBJlSXr/riEhBtkkuQKY9aZik0t5zqnqqGnw8e9wypzdH0ExPA\n\tLfAA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Jtqfh+Vx\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1688643777; x=1691235777;\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=Whvj2NJmzq4DgNlZmfWJB5moO/9b7bCog49flvKWLPc=;\n\tb=fV8KXLH/09bANKZYZ6KycQvxhSnfo+k+QtGqkXMuuulD8HYdc5iLlIiDqWBThcQ2Pd\n\tCRK/NUVQJhuhWx2hCL61tvCC5YEUS6BvkcXCaWsE/zvCEUWAocL+8TyHUlfNpueoHv0G\n\t8iswqfJZKUvOaFjRXE0PsUYr215HSVHQFkR5M0CcUaG+qQlw7DPnHQL+1YvKYu9wE9zd\n\tGNrZIfiMtSZMZMfTrmDiyKN8Mj8gouygfn087Dk+PcFVlv/FlP/Sg/1BDjOgEJKwKO7w\n\tZ0si9/YTdAjCd89L4Za7D1mq0mleBkInkTHFW32dzp1e+jFDftB37r4UZ555C0cp0s7V\n\tV7GA==","X-Gm-Message-State":"ABy/qLaYfP/4MlTbdyydD1aGSuwUpXplbCa7GNig2xjUBI+LJLwjWLQC\n\tMxCdK/szQdKSOoco/Qq9JQn6Y8EDrXSiDjXfG9hegeWp8mMdkxyYBD80XA==","X-Google-Smtp-Source":"APBJJlFDo1NDld/XKbVo0dGJps1WgyuXDnr71rzT1XhjiCjK8qx7X1DrYOljIcuwnW6ruZKyhWOBrtt8zfAHfNQ+qys=","X-Received":"by 2002:a0d:f787:0:b0:573:280a:878 with SMTP id\n\th129-20020a0df787000000b00573280a0878mr1561888ywf.52.1688643777452;\n\tThu, 06 Jul 2023 04:42:57 -0700 (PDT)","MIME-Version":"1.0","References":"<20230627130553.26940-1-naush@raspberrypi.com>\n\t<168864245882.811113.14838961415020554256@Monstersaurus>\n\t<168864354018.780480.15819215805524954388@Monstersaurus>","In-Reply-To":"<168864354018.780480.15819215805524954388@Monstersaurus>","Date":"Thu, 6 Jul 2023 12:42:41 +0100","Message-ID":"<CAEmqJPo_KhRMTBLNtZTEr+FMw5_GsKOR8wM-umTe_SG6m4RzWg@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27497,"web_url":"https://patchwork.libcamera.org/comment/27497/","msgid":"<20230706120941.GB20921@pendragon.ideasonboard.com>","date":"2023-07-06T12:09:41","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Jul 06, 2023 at 12:20:58PM +0100, Kieran Bingham via libcamera-devel wrote:\n> Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> > The imx708 must drop a single frame on startup - but only when in HDR\n> > mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> > hideFramesModeSwitch() which currently unconditionally advertises to\n> > drop one frame.\n> > \n> > Unfortunately there is no clear way to tell if the sensor is in the HDR\n> > mode. So for now, look the resolution and framerate to deduce this.\n> > \n> > Additionally ensure we override hideFramesStartup() and return the same\n> > number as hideFramesModeSwitch().\n> > \n> > Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > ---\n> > Changes since v1:\n> > - Fix a typo in the comparison statement.\n> > ---\n> >  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n> >  1 file changed, 24 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > index 641ba18f4b9d..9bc0272dd4c1 100644\n> > --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > @@ -21,6 +21,8 @@ using namespace RPiController;\n> >  using namespace libcamera;\n> >  using libcamera::utils::Duration;\n> >  \n> > +using namespace std::literals::chrono_literals;\n> > +\n> >  namespace libcamera {\n> >  LOG_DECLARE_CATEGORY(IPARPI)\n> >  }\n> > @@ -56,7 +58,8 @@ public:\n> >                        int &vblankDelay, int &hblankDelay) const override;\n> >         bool sensorEmbeddedDataPresent() const override;\n> >         double getModeSensitivity(const CameraMode &mode) const override;\n> > -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> > +       unsigned int hideFramesModeSwitch() const override;\n> > +       unsigned int hideFramesStartup() const;\n> >  \n> >  private:\n> >         /*\n> > @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n> >         return (mode.width > 2304) ? 1.0 : 2.0;\n> >  }\n> >  \n> > +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> > +{\n> > +       /*\n> > +        * We need to drop the first startup frame in HDR mode.\n> > +        * Unfortunately the only way to currently determine if the sensor is in\n> > +        * the HDR mode is to match with the resolution and framerate - the HDR\n> > +        * mode only runs upto 30fps.\n> \n> Perhaps we should add a \n> \n> \t * \\todo: Revisit this when the HDR mode is handled by\n> \t * libcamera.\n\nHow will this issue be handled then ?\n\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > +        */\n> > +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> > +           mode_.minFrameDuration > 1.0s / 32)\n> > +               return 1;\n> > +       else\n> > +               return 0;\n> > +}\n> > +\n> > +unsigned int CamHelperImx708::hideFramesStartup() const\n> > +{\n> > +       return hideFramesModeSwitch();\n> > +}\n> > +\n> >  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n> >                                        Metadata &metadata) const\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 22CA7BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 12:09:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 831BF628BC;\n\tThu,  6 Jul 2023 14:09:43 +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 DEF0C61E36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 14:09:41 +0200 (CEST)","from pendragon.ideasonboard.com (85-160-25-222.reb.o2.cz\n\t[85.160.25.222])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 437EA6C8;\n\tThu,  6 Jul 2023 14:08:56 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688645383;\n\tbh=FiwX0WHEp8T/sl+84UBgfn2xFtptQk61LRQbSCwBUsM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=cxloaawaEwjGtE6fyzjCH5DR5Hev/OGZ8NFBdEy7+paYXw6sx4+F9GDaRsJcVmYVI\n\tS/KG7E40DZnORzhXyuj8Cq8Flrb8EzaWc5c+gYBBp4iG00MX0HJDXY2Zc857SJbu+E\n\tiL7r1SDVN84SCeOkh/CXmp/1rqvol6JA+wHogQqIVjaqes5kjhUGKMuEdMqsMFsyHq\n\tPxh00qx1OZG5lvVXWCR/2flqrCBhqmYs6Gl3yKk9dgKNhKSXZ4RGHH2RZoSjDG9EPD\n\tciAfidJk3OGWwMvIlqBBUdPPZLlTCapGUmvjW+2YiA1RaAYa5y64EcXF2Tf0Y92iFv\n\txAxjaXUFG/M9w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688645336;\n\tbh=FiwX0WHEp8T/sl+84UBgfn2xFtptQk61LRQbSCwBUsM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QXOgNBEoldZ8BI5cMaGQTWk6zXgFSojQCB1nHyE7jj5bmuZcb0UqIMrqoMTBkXO63\n\t+8JVhyY+3ASMh83aCkBdqBugNX8J3jfdeaYUoO2XEPCyR6yfkneIjlzFfNo02pz7HN\n\tJO06UiXP1k4pZVPd/X41U9XRv7VldiApV3LJxMJE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"QXOgNBEo\"; dkim-atps=neutral","Date":"Thu, 6 Jul 2023 15:09:41 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20230706120941.GB20921@pendragon.ideasonboard.com>","References":"<20230627130553.26940-1-naush@raspberrypi.com>\n\t<168864245882.811113.14838961415020554256@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<168864245882.811113.14838961415020554256@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27498,"web_url":"https://patchwork.libcamera.org/comment/27498/","msgid":"<168864596988.780480.157915163724499151@Monstersaurus>","date":"2023-07-06T12:19:29","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2023-07-06 13:09:41)\n> On Thu, Jul 06, 2023 at 12:20:58PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> > > The imx708 must drop a single frame on startup - but only when in HDR\n> > > mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> > > hideFramesModeSwitch() which currently unconditionally advertises to\n> > > drop one frame.\n> > > \n> > > Unfortunately there is no clear way to tell if the sensor is in the HDR\n> > > mode. So for now, look the resolution and framerate to deduce this.\n> > > \n> > > Additionally ensure we override hideFramesStartup() and return the same\n> > > number as hideFramesModeSwitch().\n> > > \n> > > Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > > ---\n> > > Changes since v1:\n> > > - Fix a typo in the comparison statement.\n> > > ---\n> > >  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n> > >  1 file changed, 24 insertions(+), 1 deletion(-)\n> > > \n> > > diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > index 641ba18f4b9d..9bc0272dd4c1 100644\n> > > --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > @@ -21,6 +21,8 @@ using namespace RPiController;\n> > >  using namespace libcamera;\n> > >  using libcamera::utils::Duration;\n> > >  \n> > > +using namespace std::literals::chrono_literals;\n> > > +\n> > >  namespace libcamera {\n> > >  LOG_DECLARE_CATEGORY(IPARPI)\n> > >  }\n> > > @@ -56,7 +58,8 @@ public:\n> > >                        int &vblankDelay, int &hblankDelay) const override;\n> > >         bool sensorEmbeddedDataPresent() const override;\n> > >         double getModeSensitivity(const CameraMode &mode) const override;\n> > > -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> > > +       unsigned int hideFramesModeSwitch() const override;\n> > > +       unsigned int hideFramesStartup() const;\n> > >  \n> > >  private:\n> > >         /*\n> > > @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n> > >         return (mode.width > 2304) ? 1.0 : 2.0;\n> > >  }\n> > >  \n> > > +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> > > +{\n> > > +       /*\n> > > +        * We need to drop the first startup frame in HDR mode.\n> > > +        * Unfortunately the only way to currently determine if the sensor is in\n> > > +        * the HDR mode is to match with the resolution and framerate - the HDR\n> > > +        * mode only runs upto 30fps.\n> > \n> > Perhaps we should add a \n> > \n> >        * \\todo: Revisit this when the HDR mode is handled by\n> >        * libcamera.\n> \n> How will this issue be handled then ?\n\nI don't know, that would be the action of the todo - but are you saying\n\"No don't ever bother revisiting this?\"\n\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> > > +        */\n> > > +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> > > +           mode_.minFrameDuration > 1.0s / 32)\n> > > +               return 1;\n> > > +       else\n> > > +               return 0;\n> > > +}\n> > > +\n> > > +unsigned int CamHelperImx708::hideFramesStartup() const\n> > > +{\n> > > +       return hideFramesModeSwitch();\n> > > +}\n> > > +\n> > >  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n> > >                                        Metadata &metadata) const\n> > >  {\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 5F4DDC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 12:19:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B7D05628C1;\n\tThu,  6 Jul 2023 14:19:34 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E982B628BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 14:19:32 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4F8226C8;\n\tThu,  6 Jul 2023 14:18:47 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688645974;\n\tbh=XzFT/D5n+ddSc4EU2huijevlnknEBGhCBWYiLOp5qJo=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=co58GLwPf7eGWtyn6CRko26rQM9hTIEcMtsV62BrRU+LgeDvdB9t4cpT0g5NRyekG\n\tCsS5j2BTWDtgfzikyvPa7N17Bwv64TjuF3SHtduV9p2Si6XfnkRhw9hi5W3+84FC1N\n\t9Y78pDBfrC9vjaeqBMamyPzhu8TAUFLTekAvqEVz8Txd5LBZeqVa8CausIegjrWFpU\n\tumCmRN8DhNLQMjX4wd8Ob08KX7QuqlTehxCJuBp0xzHpnPJfixG8d+Tl+puFNJ56++\n\t3hOvkp2TvfZtHSPKZYmVM2kxna6M/Wutu56d0r26VlbzTUNerCyBGvTuyXoYwxiNwX\n\tzw7V2sB93biLw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688645927;\n\tbh=XzFT/D5n+ddSc4EU2huijevlnknEBGhCBWYiLOp5qJo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=XPuLIxkQ3Xm9g9UuKIDJZ0HNVnR1pC2By+GfUSchUNvOJEHEfdyHWY7MaT4j8n/Fl\n\thmVsKWqvGRGZ3YDahTcoN9BiD50R78dJmFWI7XX3m9HkaM1+BKPv4qX4Nh9mOGv3UL\n\t7MRbQPOQETFbPczlFGtdDJ+vInNL1cgfejIFRK50="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"XPuLIxkQ\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230706120941.GB20921@pendragon.ideasonboard.com>","References":"<20230627130553.26940-1-naush@raspberrypi.com>\n\t<168864245882.811113.14838961415020554256@Monstersaurus>\n\t<20230706120941.GB20921@pendragon.ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Thu, 06 Jul 2023 13:19:29 +0100","Message-ID":"<168864596988.780480.157915163724499151@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27499,"web_url":"https://patchwork.libcamera.org/comment/27499/","msgid":"<20230706125322.GC20921@pendragon.ideasonboard.com>","date":"2023-07-06T12:53:22","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Jul 06, 2023 at 01:19:29PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2023-07-06 13:09:41)\n> > On Thu, Jul 06, 2023 at 12:20:58PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> > > > The imx708 must drop a single frame on startup - but only when in HDR\n> > > > mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> > > > hideFramesModeSwitch() which currently unconditionally advertises to\n> > > > drop one frame.\n> > > > \n> > > > Unfortunately there is no clear way to tell if the sensor is in the HDR\n> > > > mode. So for now, look the resolution and framerate to deduce this.\n> > > > \n> > > > Additionally ensure we override hideFramesStartup() and return the same\n> > > > number as hideFramesModeSwitch().\n> > > > \n> > > > Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> > > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > > > ---\n> > > > Changes since v1:\n> > > > - Fix a typo in the comparison statement.\n> > > > ---\n> > > >  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n> > > >  1 file changed, 24 insertions(+), 1 deletion(-)\n> > > > \n> > > > diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > index 641ba18f4b9d..9bc0272dd4c1 100644\n> > > > --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > @@ -21,6 +21,8 @@ using namespace RPiController;\n> > > >  using namespace libcamera;\n> > > >  using libcamera::utils::Duration;\n> > > >  \n> > > > +using namespace std::literals::chrono_literals;\n> > > > +\n> > > >  namespace libcamera {\n> > > >  LOG_DECLARE_CATEGORY(IPARPI)\n> > > >  }\n> > > > @@ -56,7 +58,8 @@ public:\n> > > >                        int &vblankDelay, int &hblankDelay) const override;\n> > > >         bool sensorEmbeddedDataPresent() const override;\n> > > >         double getModeSensitivity(const CameraMode &mode) const override;\n> > > > -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> > > > +       unsigned int hideFramesModeSwitch() const override;\n> > > > +       unsigned int hideFramesStartup() const;\n> > > >  \n> > > >  private:\n> > > >         /*\n> > > > @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n> > > >         return (mode.width > 2304) ? 1.0 : 2.0;\n> > > >  }\n> > > >  \n> > > > +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> > > > +{\n> > > > +       /*\n> > > > +        * We need to drop the first startup frame in HDR mode.\n> > > > +        * Unfortunately the only way to currently determine if the sensor is in\n> > > > +        * the HDR mode is to match with the resolution and framerate - the HDR\n> > > > +        * mode only runs upto 30fps.\n> > > \n> > > Perhaps we should add a \n> > > \n> > >        * \\todo: Revisit this when the HDR mode is handled by\n> > >        * libcamera.\n> > \n> > How will this issue be handled then ?\n> \n> I don't know, that would be the action of the todo - but are you saying\n> \"No don't ever bother revisiting this?\"\n\nIt was a question for Naush or David, I'd like to know if we have any\nidea on how we could handle this in the future, or if it's completely\nunknown.\n\n> > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > \n> > > > +        */\n> > > > +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> > > > +           mode_.minFrameDuration > 1.0s / 32)\n> > > > +               return 1;\n> > > > +       else\n> > > > +               return 0;\n> > > > +}\n> > > > +\n> > > > +unsigned int CamHelperImx708::hideFramesStartup() const\n> > > > +{\n> > > > +       return hideFramesModeSwitch();\n> > > > +}\n> > > > +\n> > > >  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n> > > >                                        Metadata &metadata) const\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 48FEFBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 12:53:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ACFBF628BC;\n\tThu,  6 Jul 2023 14:53:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 05C9661E36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 14:53:24 +0200 (CEST)","from pendragon.ideasonboard.com (85-160-25-222.reb.o2.cz\n\t[85.160.25.222])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 85A2E6C8;\n\tThu,  6 Jul 2023 14:52:37 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688648005;\n\tbh=kaKx3f76XN/Rl2tEEOkbhjJsKLIjdfIf+aUU4VjWUUY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=z+T00vbPa361lncBtQZolC+e1fQbuRe8sMDENKKh9l+AUGKhDMn/tmGlLwHCgd7vo\n\t78o6OrJAhjEMTiEAgh/SzKconyJOJjvnoE/vEVAHojhn8pSE62WZGcm/Muhmfe35la\n\tXO1eKml6aX2EAkM4pYDW3P9xoHbzeg9qS06+66eA6QzUb7II2yt+c7amYUd+ZKfK9d\n\t4+a0AU45ZgsJ/BjKnBcVLeeI9eviov8bV0MHcVn53N/l7+FBeDfSzckCs9eBCp9u3b\n\tRHisxLmc80/8ln3fX8QtPPWS6KxFnwVqJtSaW8kFSnr50EuBwNUhDMl5x/oI3LxTIV\n\t97LQVh6TIcqSg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688647958;\n\tbh=kaKx3f76XN/Rl2tEEOkbhjJsKLIjdfIf+aUU4VjWUUY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LbtGGXVifCWk9l0XISAgnJ3HScmTL8mivfHQ8NqEhUt59BEDHYOjg437K7g1FNEVk\n\tlSWlTMS6hEWOYt4QjSImsKSJdACcgvjT6SxGJs1oDqNn/slzkGt3rE77QssGAEokY/\n\t4SAIfCvP8bkm2DvFQPmDHV2qlz8xIYUbkb/Dmr18="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LbtGGXVi\"; dkim-atps=neutral","Date":"Thu, 6 Jul 2023 15:53:22 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20230706125322.GC20921@pendragon.ideasonboard.com>","References":"<20230627130553.26940-1-naush@raspberrypi.com>\n\t<168864245882.811113.14838961415020554256@Monstersaurus>\n\t<20230706120941.GB20921@pendragon.ideasonboard.com>\n\t<168864596988.780480.157915163724499151@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<168864596988.780480.157915163724499151@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27500,"web_url":"https://patchwork.libcamera.org/comment/27500/","msgid":"<CAEmqJPpCMJovSz8ZwW0gGJRM78VKWNQcRadZz_5bQt-eMKRqSg@mail.gmail.com>","date":"2023-07-06T13:07:05","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Thu, 6 Jul 2023 at 13:53, Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> On Thu, Jul 06, 2023 at 01:19:29PM +0100, Kieran Bingham wrote:\n> > Quoting Laurent Pinchart (2023-07-06 13:09:41)\n> > > On Thu, Jul 06, 2023 at 12:20:58PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > > Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> > > > > The imx708 must drop a single frame on startup - but only when in HDR\n> > > > > mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> > > > > hideFramesModeSwitch() which currently unconditionally advertises to\n> > > > > drop one frame.\n> > > > >\n> > > > > Unfortunately there is no clear way to tell if the sensor is in the HDR\n> > > > > mode. So for now, look the resolution and framerate to deduce this.\n> > > > >\n> > > > > Additionally ensure we override hideFramesStartup() and return the same\n> > > > > number as hideFramesModeSwitch().\n> > > > >\n> > > > > Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> > > > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > > > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > > > > ---\n> > > > > Changes since v1:\n> > > > > - Fix a typo in the comparison statement.\n> > > > > ---\n> > > > >  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n> > > > >  1 file changed, 24 insertions(+), 1 deletion(-)\n> > > > >\n> > > > > diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > index 641ba18f4b9d..9bc0272dd4c1 100644\n> > > > > --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > @@ -21,6 +21,8 @@ using namespace RPiController;\n> > > > >  using namespace libcamera;\n> > > > >  using libcamera::utils::Duration;\n> > > > >\n> > > > > +using namespace std::literals::chrono_literals;\n> > > > > +\n> > > > >  namespace libcamera {\n> > > > >  LOG_DECLARE_CATEGORY(IPARPI)\n> > > > >  }\n> > > > > @@ -56,7 +58,8 @@ public:\n> > > > >                        int &vblankDelay, int &hblankDelay) const override;\n> > > > >         bool sensorEmbeddedDataPresent() const override;\n> > > > >         double getModeSensitivity(const CameraMode &mode) const override;\n> > > > > -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> > > > > +       unsigned int hideFramesModeSwitch() const override;\n> > > > > +       unsigned int hideFramesStartup() const;\n> > > > >\n> > > > >  private:\n> > > > >         /*\n> > > > > @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n> > > > >         return (mode.width > 2304) ? 1.0 : 2.0;\n> > > > >  }\n> > > > >\n> > > > > +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> > > > > +{\n> > > > > +       /*\n> > > > > +        * We need to drop the first startup frame in HDR mode.\n> > > > > +        * Unfortunately the only way to currently determine if the sensor is in\n> > > > > +        * the HDR mode is to match with the resolution and framerate - the HDR\n> > > > > +        * mode only runs upto 30fps.\n> > > >\n> > > > Perhaps we should add a\n> > > >\n> > > >        * \\todo: Revisit this when the HDR mode is handled by\n> > > >        * libcamera.\n> > >\n> > > How will this issue be handled then ?\n> >\n> > I don't know, that would be the action of the todo - but are you saying\n> > \"No don't ever bother revisiting this?\"\n>\n> It was a question for Naush or David, I'd like to know if we have any\n> idea on how we could handle this in the future, or if it's completely\n> unknown.\n\nIMO sensor HDR would need to become part of the V4L2 API.\n\nThis might mean HDR is signalled as either a new pixel format (not\nvery neat), or a control value (mostly like today, also not very\nneat).\n\nIn any hypothetical rework of the kernel sensor API, HDR modes ought\nto become a part of the format/mode information, possibly as a\ndecoupled/modifier field?\n\nRegards,\nNaush\n\n\n\n>\n> > > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > >\n> > > > > +        */\n> > > > > +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> > > > > +           mode_.minFrameDuration > 1.0s / 32)\n> > > > > +               return 1;\n> > > > > +       else\n> > > > > +               return 0;\n> > > > > +}\n> > > > > +\n> > > > > +unsigned int CamHelperImx708::hideFramesStartup() const\n> > > > > +{\n> > > > > +       return hideFramesModeSwitch();\n> > > > > +}\n> > > > > +\n> > > > >  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n> > > > >                                        Metadata &metadata) const\n> > > > >  {\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 A11FEC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 13:07:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E959361E36;\n\tThu,  6 Jul 2023 15:07:23 +0200 (CEST)","from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com\n\t[IPv6:2607:f8b0:4864:20::1132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 55A5361E36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 15:07:22 +0200 (CEST)","by mail-yw1-x1132.google.com with SMTP id\n\t00721157ae682-5774335bb2aso9148187b3.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 06 Jul 2023 06:07:22 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688648843;\n\tbh=bFmyab5zCZStEYDAIDVrg36fJu3Gr9dtUxNRK+xZ5Xs=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Tph+zJRl/fiaKocCY9E8XPyV3Do+h7Y2Bi19sbFO/8X3Y6wFGORm9yo66gDP8qy1d\n\tKMo24DkgKXG/7D72yqzh5Tm/WSYXMhglkjEVS7FvS218sXjtMtBZA2kesjO29MqvIF\n\tXZ9J1cBMFnKX3SjfWndRGaVJOo3xbGRpVz5AJ2vX2LS4HikdtfeNSpdYZ07IU8Sxfa\n\tvTZwaSM2z7BcmriFjFyDyjJGGg8uiTI3tteO9QIxirUKM6JphgYlmFblxj4Rr2PO98\n\tJ2qoxgqMQv4kkTa+S3y+b/UMZEgczNHKdZQgZNmd4rOal+RSClQCXA2o6K7eTu/U0s\n\tEVHzUL6Ap3eUw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1688648841; x=1691240841;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=ZlU6IJ01eO2BV5CFWIh8D+J16qcMm132Nn+OxdZsL1Q=;\n\tb=BwANjWuoxEGRcAHyVNme7ETScY2K5ziAg7i8sKYdjA35pQXlYUGt6PysT+mpz/DTyD\n\tTugXZcPbHXeXa/d2p54I5OjECf8/qnxs8Lz2mDwm6G2obSY78fDbu3ewcLqgh54WVjd2\n\tUV1ixA4ywMrKQc1TFZChUzXSkAqCq5TJS5IRGU22Yi2qZNUcm9oo2KL6k/bEGA86TnIe\n\tgVP6OpuHE4RmvGibEGrgqTCHpczjVgTSKZzn3UTl3WOA1f0zKP+uCt6gJ6uYoms5i0Zt\n\tHc+T2uNagWoUVF3yOEvpB5pPRvv3HWlgX+dE60fVPFsOrPPEWyAXU+KQiDWVOzjvF+6I\n\tLJjA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"BwANjWuo\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1688648841; x=1691240841;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=ZlU6IJ01eO2BV5CFWIh8D+J16qcMm132Nn+OxdZsL1Q=;\n\tb=fFFrvN/OCsW8FILZI16XXfjFGeFZCr3EXzGAQKjZaibdtTIuih5JwpLFZa8NP+C/kL\n\tRw6OCw8INlmUp7TiZbf3EKno3xkU6eWRAcJUD/OB789TFKKcN5Siid3ZyOHIQA1Pr0TJ\n\tZQynUrNnmWb8mHOCT4Y031dxuvv/kiCOSyiZxwAwPQ/p1aQt8Sbtjk1tj49JUoKDK96m\n\tXyW+qVxEiGrE/SkOe7I8JUNH1ZKWZbFZ+0ilmC4pqSdjDbGb/r7PlhcHmmN4Xa1r52SW\n\trqxBzEs9CJgNoJCZBilVY2pcSKIi9LptTPaJnekPJdu5RAK3zOHywcLh5o94osTfl2Oe\n\tLghg==","X-Gm-Message-State":"ABy/qLY+Cr8dan2rgRBNpap/tvRLn1bHOPSidBVTUisNw68mglffaqXH\n\thkqJjD5DvTet6Z7Q1TJA9Nm4mwJbqfQR/P2gpcmyjssYfojw6weZm1994w==","X-Google-Smtp-Source":"APBJJlGVA0+JksVEh9MEIzUMLTyMaJcF/rNVuetFntbpFW8rES7M17Xm3Dmy8+MUE9QWgIvzuCuQmoAdukkggtzL6x8=","X-Received":"by 2002:a81:5a08:0:b0:565:3749:c24d with SMTP id\n\to8-20020a815a08000000b005653749c24dmr2105847ywb.14.1688648841128;\n\tThu, 06 Jul 2023 06:07:21 -0700 (PDT)","MIME-Version":"1.0","References":"<20230627130553.26940-1-naush@raspberrypi.com>\n\t<168864245882.811113.14838961415020554256@Monstersaurus>\n\t<20230706120941.GB20921@pendragon.ideasonboard.com>\n\t<168864596988.780480.157915163724499151@Monstersaurus>\n\t<20230706125322.GC20921@pendragon.ideasonboard.com>","In-Reply-To":"<20230706125322.GC20921@pendragon.ideasonboard.com>","Date":"Thu, 6 Jul 2023 14:07:05 +0100","Message-ID":"<CAEmqJPpCMJovSz8ZwW0gGJRM78VKWNQcRadZz_5bQt-eMKRqSg@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27501,"web_url":"https://patchwork.libcamera.org/comment/27501/","msgid":"<CAHW6GYKUJPtoH+f+hLg7WPdY+4xWd6W8-itF=76e-X-CUDtR2g@mail.gmail.com>","date":"2023-07-06T13:07:40","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"It would be nice if V4L2 could tell us this kind of mode-specific\ninformation, so that it might perhaps feature in the camera mode?\n\nDavid\n\nOn Thu, 6 Jul 2023 at 13:53, Laurent Pinchart via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> On Thu, Jul 06, 2023 at 01:19:29PM +0100, Kieran Bingham wrote:\n> > Quoting Laurent Pinchart (2023-07-06 13:09:41)\n> > > On Thu, Jul 06, 2023 at 12:20:58PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > > Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> > > > > The imx708 must drop a single frame on startup - but only when in HDR\n> > > > > mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> > > > > hideFramesModeSwitch() which currently unconditionally advertises to\n> > > > > drop one frame.\n> > > > >\n> > > > > Unfortunately there is no clear way to tell if the sensor is in the HDR\n> > > > > mode. So for now, look the resolution and framerate to deduce this.\n> > > > >\n> > > > > Additionally ensure we override hideFramesStartup() and return the same\n> > > > > number as hideFramesModeSwitch().\n> > > > >\n> > > > > Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> > > > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > > > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > > > > ---\n> > > > > Changes since v1:\n> > > > > - Fix a typo in the comparison statement.\n> > > > > ---\n> > > > >  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n> > > > >  1 file changed, 24 insertions(+), 1 deletion(-)\n> > > > >\n> > > > > diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > index 641ba18f4b9d..9bc0272dd4c1 100644\n> > > > > --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > @@ -21,6 +21,8 @@ using namespace RPiController;\n> > > > >  using namespace libcamera;\n> > > > >  using libcamera::utils::Duration;\n> > > > >\n> > > > > +using namespace std::literals::chrono_literals;\n> > > > > +\n> > > > >  namespace libcamera {\n> > > > >  LOG_DECLARE_CATEGORY(IPARPI)\n> > > > >  }\n> > > > > @@ -56,7 +58,8 @@ public:\n> > > > >                        int &vblankDelay, int &hblankDelay) const override;\n> > > > >         bool sensorEmbeddedDataPresent() const override;\n> > > > >         double getModeSensitivity(const CameraMode &mode) const override;\n> > > > > -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> > > > > +       unsigned int hideFramesModeSwitch() const override;\n> > > > > +       unsigned int hideFramesStartup() const;\n> > > > >\n> > > > >  private:\n> > > > >         /*\n> > > > > @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n> > > > >         return (mode.width > 2304) ? 1.0 : 2.0;\n> > > > >  }\n> > > > >\n> > > > > +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> > > > > +{\n> > > > > +       /*\n> > > > > +        * We need to drop the first startup frame in HDR mode.\n> > > > > +        * Unfortunately the only way to currently determine if the sensor is in\n> > > > > +        * the HDR mode is to match with the resolution and framerate - the HDR\n> > > > > +        * mode only runs upto 30fps.\n> > > >\n> > > > Perhaps we should add a\n> > > >\n> > > >        * \\todo: Revisit this when the HDR mode is handled by\n> > > >        * libcamera.\n> > >\n> > > How will this issue be handled then ?\n> >\n> > I don't know, that would be the action of the todo - but are you saying\n> > \"No don't ever bother revisiting this?\"\n>\n> It was a question for Naush or David, I'd like to know if we have any\n> idea on how we could handle this in the future, or if it's completely\n> unknown.\n>\n> > > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > >\n> > > > > +        */\n> > > > > +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> > > > > +           mode_.minFrameDuration > 1.0s / 32)\n> > > > > +               return 1;\n> > > > > +       else\n> > > > > +               return 0;\n> > > > > +}\n> > > > > +\n> > > > > +unsigned int CamHelperImx708::hideFramesStartup() const\n> > > > > +{\n> > > > > +       return hideFramesModeSwitch();\n> > > > > +}\n> > > > > +\n> > > > >  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n> > > > >                                        Metadata &metadata) const\n> > > > >  {\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 C6B68C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 13:07:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7D922628C1;\n\tThu,  6 Jul 2023 15:07:54 +0200 (CEST)","from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com\n\t[IPv6:2607:f8b0:4864:20::f2b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CE7AE61E36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 15:07:52 +0200 (CEST)","by mail-qv1-xf2b.google.com with SMTP id\n\t6a1803df08f44-635eb3a1d93so5504266d6.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 06 Jul 2023 06:07:52 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688648874;\n\tbh=HIwxNulSKogcU8CiXT0dsZlriS8qncvgmgWyc0FYNvY=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=teygouMvI0vdnZuwbLzKFKKDuxHxGxfvLBPp5ytHFgV1imHjvwd/Dvk9lwgPLmxqr\n\tTic3o+aMd7B14EUUUuPmQ2eR4yYfX4wJ7BqgTnGfK5eDDhJC11I/atJCk0pBwtWkzC\n\t1nf6U34Mhjll/uwErmHJHX3+OagCK/+Lc79O2pBJua+c+UrUBsrSYEftzndkPN3/l2\n\tDkBNk83EjoELKk0aQ1HaubcaaC/rDSSCu9vh+fFwlh3tfMwMZ34Nf6aUu5S0ZMuUsz\n\tF7T+AZyWqvIgTjP9jj/aJ9ZdmowWTUwSePOLlrUfTCjVq0Ay56tit8T45T4MP5kUi3\n\tP6U3r5NMKy3AA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1688648871; x=1691240871;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=aLGQ9vUBHVXt/+8dT9Njs6T0iiIYL0s+rqYz3H2gExM=;\n\tb=pY6Ac5I2n+fJR4JXS+O2aolqJpMYY90Z3HIBeJCLoQp/OA9oQeMoy5uzdNu2S2L4Yh\n\tKdcbrTS6sDFwdMkv7H+sXGnjhGqbAU3xLLafzw+i4dCvEV2FVkzUE3wc0BKR/aFKp16c\n\tJGoeEtJ5xu/xgEQY2eRKX3tH/T8kPPnGyVVCVXkQECvSaRHc9RtAd+3Z/xH0+r9qsxPM\n\ttdJR9Zd0WSKDVRa2jIIOb7bFoLMxp+QJaj3TbRoe+01aLtCsqLu0odp7rsnCea5iT6Jh\n\teCyR93/ELr/AJ84Dm0c7aZ3xCH4nYmREuZab2/Oa4YuqyLnZDMr/ps20KO1MlqxuZ+cq\n\tXauA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"pY6Ac5I2\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1688648871; x=1691240871;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=aLGQ9vUBHVXt/+8dT9Njs6T0iiIYL0s+rqYz3H2gExM=;\n\tb=eSIytPtHXXRcNbxXctqcnQccjThkU402vvT4zpKyIRh3CskWUoxn+bDMEwKi8U2nW+\n\tDGWfG3OLMk8bwun1op5Av/zIFdIprJSshtTR97AtXxXddsbSuA/4RXNqbaYjhAW2sBGu\n\touDv4vBjpwhz15YHC02N0wKncZ2y9uu051Q2Lzktdp4rFuSMgGol0gfMlv5DDQ23c0VY\n\tuvnT01FeQiyXQDm17Gypvb6B1Bb7bhcGZxhP+xgEk7cz3sKDrBvhPBRFvX5z0XeWgc0W\n\tEUVZZQU+Ucih14EVPazvlbuhtfozOESSKaGk8cKwe+zePWkgwqBxNiKdAOEjXCHC7QYh\n\t3h1Q==","X-Gm-Message-State":"ABy/qLYmc3yvjZVE3J4oLW2HgAzXZ4dVSvCbsDMqMZgAXsM5L8tmM+UE\n\tDjNgpSPHqfGsoOcfUShovUAZQSWG05/AKLsLglXmGfPzCze5xKaVYx9m5A==","X-Google-Smtp-Source":"APBJJlHNZ994xobc+mG1kPQrYZi+QeTgTLj2c1c28cQAKwXzUMr/R953zXytXRnJiNcAjyNXANwM6QdmOAD5f9V055E=","X-Received":"by 2002:a0c:ac4b:0:b0:621:680d:55bf with SMTP id\n\tm11-20020a0cac4b000000b00621680d55bfmr1576455qvb.22.1688648871666;\n\tThu, 06 Jul 2023 06:07:51 -0700 (PDT)","MIME-Version":"1.0","References":"<20230627130553.26940-1-naush@raspberrypi.com>\n\t<168864245882.811113.14838961415020554256@Monstersaurus>\n\t<20230706120941.GB20921@pendragon.ideasonboard.com>\n\t<168864596988.780480.157915163724499151@Monstersaurus>\n\t<20230706125322.GC20921@pendragon.ideasonboard.com>","In-Reply-To":"<20230706125322.GC20921@pendragon.ideasonboard.com>","Date":"Thu, 6 Jul 2023 14:07:40 +0100","Message-ID":"<CAHW6GYKUJPtoH+f+hLg7WPdY+4xWd6W8-itF=76e-X-CUDtR2g@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27502,"web_url":"https://patchwork.libcamera.org/comment/27502/","msgid":"<20230706150421.GE20921@pendragon.ideasonboard.com>","date":"2023-07-06T15:04:21","subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Jul 06, 2023 at 02:07:40PM +0100, David Plowman wrote:\n> It would be nice if V4L2 could tell us this kind of mode-specific\n> information, so that it might perhaps feature in the camera mode?\n\nIf my understanding is correct, the plan is to retrieve the information\nfrom the camera sensor configuration and make it available to the IPA\nmodule, probably storing it in the mode_ member variable. That looks\ngood to me.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> On Thu, 6 Jul 2023 at 13:53, Laurent Pinchart via libcamera-devel wrote:\n> > On Thu, Jul 06, 2023 at 01:19:29PM +0100, Kieran Bingham wrote:\n> > > Quoting Laurent Pinchart (2023-07-06 13:09:41)\n> > > > On Thu, Jul 06, 2023 at 12:20:58PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > > > Quoting Naushir Patuck via libcamera-devel (2023-06-27 14:05:53)\n> > > > > > The imx708 must drop a single frame on startup - but only when in HDR\n> > > > > > mode. Non-HDR modes do not need to drop frames. Fix the logic in\n> > > > > > hideFramesModeSwitch() which currently unconditionally advertises to\n> > > > > > drop one frame.\n> > > > > >\n> > > > > > Unfortunately there is no clear way to tell if the sensor is in the HDR\n> > > > > > mode. So for now, look the resolution and framerate to deduce this.\n> > > > > >\n> > > > > > Additionally ensure we override hideFramesStartup() and return the same\n> > > > > > number as hideFramesModeSwitch().\n> > > > > >\n> > > > > > Bug: https://github.com/raspberrypi/libcamera-apps/issues/524\n> > > > > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > > > > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > > > > > ---\n> > > > > > Changes since v1:\n> > > > > > - Fix a typo in the comparison statement.\n> > > > > > ---\n> > > > > >  src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n> > > > > >  1 file changed, 24 insertions(+), 1 deletion(-)\n> > > > > >\n> > > > > > diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > > index 641ba18f4b9d..9bc0272dd4c1 100644\n> > > > > > --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > > +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n> > > > > > @@ -21,6 +21,8 @@ using namespace RPiController;\n> > > > > >  using namespace libcamera;\n> > > > > >  using libcamera::utils::Duration;\n> > > > > >\n> > > > > > +using namespace std::literals::chrono_literals;\n> > > > > > +\n> > > > > >  namespace libcamera {\n> > > > > >  LOG_DECLARE_CATEGORY(IPARPI)\n> > > > > >  }\n> > > > > > @@ -56,7 +58,8 @@ public:\n> > > > > >                        int &vblankDelay, int &hblankDelay) const override;\n> > > > > >         bool sensorEmbeddedDataPresent() const override;\n> > > > > >         double getModeSensitivity(const CameraMode &mode) const override;\n> > > > > > -       unsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n> > > > > > +       unsigned int hideFramesModeSwitch() const override;\n> > > > > > +       unsigned int hideFramesStartup() const;\n> > > > > >\n> > > > > >  private:\n> > > > > >         /*\n> > > > > > @@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n> > > > > >         return (mode.width > 2304) ? 1.0 : 2.0;\n> > > > > >  }\n> > > > > >\n> > > > > > +unsigned int CamHelperImx708::hideFramesModeSwitch() const\n> > > > > > +{\n> > > > > > +       /*\n> > > > > > +        * We need to drop the first startup frame in HDR mode.\n> > > > > > +        * Unfortunately the only way to currently determine if the sensor is in\n> > > > > > +        * the HDR mode is to match with the resolution and framerate - the HDR\n> > > > > > +        * mode only runs upto 30fps.\n> > > > >\n> > > > > Perhaps we should add a\n> > > > >\n> > > > >        * \\todo: Revisit this when the HDR mode is handled by\n> > > > >        * libcamera.\n> > > >\n> > > > How will this issue be handled then ?\n> > >\n> > > I don't know, that would be the action of the todo - but are you saying\n> > > \"No don't ever bother revisiting this?\"\n> >\n> > It was a question for Naush or David, I'd like to know if we have any\n> > idea on how we could handle this in the future, or if it's completely\n> > unknown.\n> >\n> > > > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > > >\n> > > > > > +        */\n> > > > > > +       if (mode_.width == 2304 && mode_.height == 1296 &&\n> > > > > > +           mode_.minFrameDuration > 1.0s / 32)\n> > > > > > +               return 1;\n> > > > > > +       else\n> > > > > > +               return 0;\n> > > > > > +}\n> > > > > > +\n> > > > > > +unsigned int CamHelperImx708::hideFramesStartup() const\n> > > > > > +{\n> > > > > > +       return hideFramesModeSwitch();\n> > > > > > +}\n> > > > > > +\n> > > > > >  void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n> > > > > >                                        Metadata &metadata) const\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 6E90BBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jul 2023 15:04:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D439C628C2;\n\tThu,  6 Jul 2023 17:04:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E30B628BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jul 2023 17:04:25 +0200 (CEST)","from pendragon.ideasonboard.com (85-76-150-194-nat.elisa-mobile.fi\n\t[85.76.150.194])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 247E76C8;\n\tThu,  6 Jul 2023 17:03:37 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688655865;\n\tbh=6jTdM9ggA7lifWJhLKYzjpzp66eaeO6uhwPWZNwZkNk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=W0yIAQSaDqrrjRxvFCc2cWR8G3FhOPyzmj26ymfmEvGRcqs5JY2e3SNn7Dl382dFN\n\t+iNUAHUDt1uxRHDX7+0HxoKO+iqYjTlo/UT5YIjHsKGUIYbZ3YBv+qPy0DDQWI8Hri\n\tJHJ7+s0rPqUPurknma9/F7NdX7xt6N9AD4+A1SLcrTSUoNYdpg0eYy0tGmQqXdM6hV\n\t6nX9mPCVzG826q3EkKRKDLN1qPiSzeuNPaOn/GGcN65Qg+KgR/c/GSoqOX6sT4J5jz\n\tImWd/PNdLVKvYvp6m3UOLCc/1U7jwG57/QI8MuGnfJ0pA8qQ+w7DDJRVngG+Wv5QXq\n\t1fnUFjwHT7wUg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688655819;\n\tbh=6jTdM9ggA7lifWJhLKYzjpzp66eaeO6uhwPWZNwZkNk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gjpGau6aMJMFFDAVr9BPzoaEU8Ghee77kAw7DN7iromvT1xnP88ffe2MXgejBzLVW\n\titiskWN7A+KvLQHkOR3CMEheAomrR/yJ6I3qJTyLqKvzOYXbxcgqOMxdXwXTj4Mbb+\n\tv0KdMN/5jucUOuK3bMKQHvn5dSiOGzDvFQuW44ik="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"gjpGau6a\"; dkim-atps=neutral","Date":"Thu, 6 Jul 2023 18:04:21 +0300","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<20230706150421.GE20921@pendragon.ideasonboard.com>","References":"<20230627130553.26940-1-naush@raspberrypi.com>\n\t<168864245882.811113.14838961415020554256@Monstersaurus>\n\t<20230706120941.GB20921@pendragon.ideasonboard.com>\n\t<168864596988.780480.157915163724499151@Monstersaurus>\n\t<20230706125322.GC20921@pendragon.ideasonboard.com>\n\t<CAHW6GYKUJPtoH+f+hLg7WPdY+4xWd6W8-itF=76e-X-CUDtR2g@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAHW6GYKUJPtoH+f+hLg7WPdY+4xWd6W8-itF=76e-X-CUDtR2g@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch\n\tdrop frame count","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]