[{"id":14807,"web_url":"https://patchwork.libcamera.org/comment/14807/","msgid":"<YBCz+DSYgVt3Ap0C@pendragon.ideasonboard.com>","date":"2021-01-27T00:29:44","subject":"Re: [libcamera-devel] [PATCH v2 4/4] pipeline: raspberrypi: Add\n\tnotion of immediate write to StaggeredCtrl","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Sun, Jan 24, 2021 at 02:05:06PM +0000, Naushir Patuck wrote:\n> If an exposure time change adjusts the vblanking limits, and we write\n> both VBLANK and EXPOSURE controls as a set, the latter may fail if the\n> value is outside of the limits calculated by the old VBLANK value. This\n> is a limitation in V4L2 and cannot be fixed by writing VBLANK before\n> EXPOSURE.\n> \n> The workaround here is to have the StaggeredCtrl mark the\n> VBLANK control as \"immediate write\", which then write VBLANK separately\n> from (and ahead of) any other controls. This way, the sensor driver will\n> update the EXPOSURE control with new limits before the new values is\n> presented, and will thus be seen as valid.\n> \n> StaggeredCtrl is due to be deprecated and replaced by DelayedCtrl, so\n> this change serves more a working proof-of-concept on the workaround,\n> and not much care has been taken to provide a nice new API for applying\n> this immediate write flag to the control. A similar workaround must be\n> available to DelayedCtrl eventually.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/ipa/raspberrypi/raspberrypi.cpp           |  5 ++-\n>  .../pipeline/raspberrypi/raspberrypi.cpp      | 11 ++++--\n>  .../pipeline/raspberrypi/staggered_ctrl.cpp   | 39 ++++++++++++++-----\n>  .../pipeline/raspberrypi/staggered_ctrl.h     |  3 +-\n>  4 files changed, 43 insertions(+), 15 deletions(-)\n> \n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 75c9e404dcc1..fefca32ce187 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -1040,8 +1040,9 @@ void IPARPi::applyAGC(const struct AgcStatus *agcStatus, ControlList &ctrls)\n>  \n>  \t/*\n>  \t * Due to the behavior of V4L2, the current value of VBLANK could clip the\n> -\t * exposure time without us knowing. The next time though this function should\n> -\t * clip exposure correctly.\n> +\t * exposure time without us knowing. We get around this by ensuring the\n> +\t * staggered write component submits VBLANK separately from, and before the\n> +\t * EXPOSURE control.\n>  \t */\n>  \tctrls.set(V4L2_CID_VBLANK, vblanking);\n>  \tctrls.set(V4L2_CID_EXPOSURE, exposureLines);\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 524cc960dd37..1485999ad2a0 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1229,12 +1229,17 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>  \t\t/*\n>  \t\t * Setup our staggered control writer with the sensor default\n>  \t\t * gain and exposure delays.\n> +\t\t *\n> +\t\t * VBLANK must be flagged as \"immediate write\" to allow it to\n> +\t\t * be set immediately instead of being batched with all other\n> +\t\t * controls. This is needed so that any update to the EXPOSURE\n> +\t\t * control will be validated based on the new VBLANK control value.\n>  \t\t */\n>  \t\tif (!staggeredCtrl_) {\n>  \t\t\tstaggeredCtrl_.init(unicam_[Unicam::Image].dev(),\n> -\t\t\t\t\t    { { V4L2_CID_ANALOGUE_GAIN, result.data[resultIdx++] },\n> -\t\t\t\t\t      { V4L2_CID_EXPOSURE, result.data[resultIdx++] },\n> -\t\t\t\t\t      { V4L2_CID_VBLANK, result.data[resultIdx++] } });\n> +\t\t\t\t\t    { { V4L2_CID_ANALOGUE_GAIN, result.data[resultIdx++], false },\n> +\t\t\t\t\t      { V4L2_CID_EXPOSURE, result.data[resultIdx++], false },\n> +\t\t\t\t\t      { V4L2_CID_VBLANK, result.data[resultIdx++], true } });\n>  \t\t\tsensorMetadata_ = result.data[resultIdx++];\n>  \t\t}\n>  \t}\n> diff --git a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n> index 62605c0fceee..07f8c95d4f2c 100644\n> --- a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n> @@ -22,21 +22,29 @@ LOG_DEFINE_CATEGORY(RPI_S_W)\n>  namespace RPi {\n>  \n>  void StaggeredCtrl::init(V4L2VideoDevice *dev,\n> -\t  std::initializer_list<std::pair<const uint32_t, uint8_t>> delayList)\n> +\t\t\t std::initializer_list<std::tuple<uint32_t, uint8_t, bool>> delayList)\n\nIt could make sense to define a struct type to group the three\nparameters.\n\n>  {\n>  \tstd::lock_guard<std::mutex> lock(lock_);\n>  \n>  \tdev_ = dev;\n> -\tdelay_ = delayList;\n> +\tdelay_.clear();\n>  \tctrl_.clear();\n>  \n> -\t/* Find the largest delay across all controls. */\n>  \tmaxDelay_ = 0;\n> -\tfor (auto const &p : delay_) {\n> +\tfor (auto const &c : delayList) {\n> +\t\tuint32_t id = std::get<0>(c);\n> +\t\tuint8_t delay = std::get<1>(c);\n> +\t\tbool immediateWrite = std::get<2>(c);\n> +\n> +\t\tdelay_[id] = delay;\n> +\t\timmediateWrite_[id] = immediateWrite;\n\n\"immediate write\" isn't a great name, as the control isn't written\nimmediately, it's still delayed.\n\n> +\n>  \t\tLOG(RPI_S_W, Info) << \"Init ctrl \"\n> -\t\t\t\t   << utils::hex(p.first) << \" with delay \"\n> -\t\t\t\t   << static_cast<int>(p.second);\n> -\t\tmaxDelay_ = std::max(maxDelay_, p.second);\n> +\t\t\t\t   << utils::hex(id) << \" with delay \"\n> +\t\t\t\t   << static_cast<int>(delay);\n> +\n> +\t\t/* Find the largest delay across all controls. */\n> +\t\tmaxDelay_ = std::max(maxDelay_, delay);\n>  \t}\n>  \n>  \tinit_ = true;\n> @@ -121,8 +129,21 @@ int StaggeredCtrl::write()\n>  \t\tint index = std::max<int>(0, setCount_ - delayDiff);\n>  \n>  \t\tif (p.second[index].updated) {\n> -\t\t\t/* We need to write this value out. */\n> -\t\t\tcontrols.set(p.first, p.second[index].value);\n> +\t\t\tif (immediateWrite_[p.first]) {\n> +\t\t\t\t/*\n> +\t\t\t\t * This control must be written now, it could\n> +\t\t\t\t * affect validity of the other controls.\n> +\t\t\t\t */\n> +\t\t\t\tControlList immediate(dev_->controls());\n> +\t\t\t\timmediate.set(p.first, p.second[index].value);\n> +\t\t\t\tdev_->setControls(&immediate);\n> +\t\t\t} else {\n> +\t\t\t\t/*\n> +\t\t\t\t * Batch up the list of controls and write them\n> +\t\t\t\t * at the end of the function.\n> +\t\t\t\t */\n> +\t\t\t\tcontrols.set(p.first, p.second[index].value);\n> +\t\t\t}\n>  \t\t\tp.second[index].updated = false;\n>  \t\t\tLOG(RPI_S_W, Debug) << \"Writing ctrl \"\n>  \t\t\t\t\t    << utils::hex(p.first) << \" to \"\n> diff --git a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n> index 382fa31a6853..7c920c3a13c7 100644\n> --- a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n> +++ b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n> @@ -34,7 +34,7 @@ public:\n>  \t}\n>  \n>  \tvoid init(V4L2VideoDevice *dev,\n> -\t\t  std::initializer_list<std::pair<const uint32_t, uint8_t>> delayList);\n> +\t\t  std::initializer_list<std::tuple<uint32_t, uint8_t, bool>> delayList);\n>  \tvoid reset();\n>  \n>  \tvoid get(std::unordered_map<uint32_t, int32_t> &ctrl, uint8_t offset = 0);\n> @@ -85,6 +85,7 @@ private:\n>  \tuint8_t maxDelay_;\n>  \tV4L2VideoDevice *dev_;\n>  \tstd::unordered_map<uint32_t, uint8_t> delay_;\n> +\tstd::unordered_map<uint32_t, bool> immediateWrite_;\n\nShould we store both the delay and the immediate write flag in a single\nmap ?\n\nOtherwise this looks fine. We could possibly solve these issues as part\nof the DelayedControls work. I'll let Niklas discuss his preference.\n\n>  \tstd::unordered_map<uint32_t, CircularArray> ctrl_;\n>  \tstd::mutex lock_;\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 00B0CBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jan 2021 00:30:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 084566833B;\n\tWed, 27 Jan 2021 01:30:06 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 41D08682D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jan 2021 01:30:04 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A45B72C1;\n\tWed, 27 Jan 2021 01:30:03 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pKIiaoAS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1611707403;\n\tbh=milhe6f9FoN8Id/kINl0NMYFMB+7gEtUmTEMeP7cadQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pKIiaoAS6egKn5tJOFTgThA9a2Rt2/WGeOMOP5iliCZm/ZWlDY4DnU8Kh2iIDQOKq\n\tHltsocXc2iIFPdzQmm9GQvrG38jB1v94lqWMzI7tMfZbdzLF6DSrnPDJELeB/r2A5I\n\twSuCz8zbwNqhhMIIH/Dk9Hs73ANmBOHWKL6LUShY=","Date":"Wed, 27 Jan 2021 02:29:44 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YBCz+DSYgVt3Ap0C@pendragon.ideasonboard.com>","References":"<20210124140506.786503-1-naush@raspberrypi.com>\n\t<20210124140506.786503-4-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210124140506.786503-4-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v2 4/4] pipeline: raspberrypi: Add\n\tnotion of immediate write to StaggeredCtrl","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":14816,"web_url":"https://patchwork.libcamera.org/comment/14816/","msgid":"<CAEmqJPrPoWXJrVWBVsk8q6bZ=uaxeYAoQm45PUuorjcbdttNqA@mail.gmail.com>","date":"2021-01-27T09:17:43","subject":"Re: [libcamera-devel] [PATCH v2 4/4] pipeline: raspberrypi: Add\n\tnotion of immediate write to StaggeredCtrl","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Laurent,\n\nThank you for your review feedback.  Sending again, as I forgot to\nreply-all.\n\nOn Wed, 27 Jan 2021 at 00:30, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Naush,\n>\n> Thank you for the patch.\n>\n> On Sun, Jan 24, 2021 at 02:05:06PM +0000, Naushir Patuck wrote:\n> > If an exposure time change adjusts the vblanking limits, and we write\n> > both VBLANK and EXPOSURE controls as a set, the latter may fail if the\n> > value is outside of the limits calculated by the old VBLANK value. This\n> > is a limitation in V4L2 and cannot be fixed by writing VBLANK before\n> > EXPOSURE.\n> >\n> > The workaround here is to have the StaggeredCtrl mark the\n> > VBLANK control as \"immediate write\", which then write VBLANK separately\n> > from (and ahead of) any other controls. This way, the sensor driver will\n> > update the EXPOSURE control with new limits before the new values is\n> > presented, and will thus be seen as valid.\n> >\n> > StaggeredCtrl is due to be deprecated and replaced by DelayedCtrl, so\n> > this change serves more a working proof-of-concept on the workaround,\n> > and not much care has been taken to provide a nice new API for applying\n> > this immediate write flag to the control. A similar workaround must be\n> > available to DelayedCtrl eventually.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  src/ipa/raspberrypi/raspberrypi.cpp           |  5 ++-\n> >  .../pipeline/raspberrypi/raspberrypi.cpp      | 11 ++++--\n> >  .../pipeline/raspberrypi/staggered_ctrl.cpp   | 39 ++++++++++++++-----\n> >  .../pipeline/raspberrypi/staggered_ctrl.h     |  3 +-\n> >  4 files changed, 43 insertions(+), 15 deletions(-)\n> >\n> > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp\n> b/src/ipa/raspberrypi/raspberrypi.cpp\n> > index 75c9e404dcc1..fefca32ce187 100644\n> > --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> > +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> > @@ -1040,8 +1040,9 @@ void IPARPi::applyAGC(const struct AgcStatus\n> *agcStatus, ControlList &ctrls)\n> >\n> >       /*\n> >        * Due to the behavior of V4L2, the current value of VBLANK could\n> clip the\n> > -      * exposure time without us knowing. The next time though this\n> function should\n> > -      * clip exposure correctly.\n> > +      * exposure time without us knowing. We get around this by\n> ensuring the\n> > +      * staggered write component submits VBLANK separately from, and\n> before the\n> > +      * EXPOSURE control.\n> >        */\n> >       ctrls.set(V4L2_CID_VBLANK, vblanking);\n> >       ctrls.set(V4L2_CID_EXPOSURE, exposureLines);\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index 524cc960dd37..1485999ad2a0 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -1229,12 +1229,17 @@ int RPiCameraData::configureIPA(const\n> CameraConfiguration *config)\n> >               /*\n> >                * Setup our staggered control writer with the sensor\n> default\n> >                * gain and exposure delays.\n> > +              *\n> > +              * VBLANK must be flagged as \"immediate write\" to allow it\n> to\n> > +              * be set immediately instead of being batched with all\n> other\n> > +              * controls. This is needed so that any update to the\n> EXPOSURE\n> > +              * control will be validated based on the new VBLANK\n> control value.\n> >                */\n> >               if (!staggeredCtrl_) {\n> >                       staggeredCtrl_.init(unicam_[Unicam::Image].dev(),\n> > -                                         { { V4L2_CID_ANALOGUE_GAIN,\n> result.data[resultIdx++] },\n> > -                                           { V4L2_CID_EXPOSURE,\n> result.data[resultIdx++] },\n> > -                                           { V4L2_CID_VBLANK,\n> result.data[resultIdx++] } });\n> > +                                         { { V4L2_CID_ANALOGUE_GAIN,\n> result.data[resultIdx++], false },\n> > +                                           { V4L2_CID_EXPOSURE,\n> result.data[resultIdx++], false },\n> > +                                           { V4L2_CID_VBLANK,\n> result.data[resultIdx++], true } });\n> >                       sensorMetadata_ = result.data[resultIdx++];\n> >               }\n> >       }\n> > diff --git a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n> b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n> > index 62605c0fceee..07f8c95d4f2c 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp\n> > @@ -22,21 +22,29 @@ LOG_DEFINE_CATEGORY(RPI_S_W)\n> >  namespace RPi {\n> >\n> >  void StaggeredCtrl::init(V4L2VideoDevice *dev,\n> > -       std::initializer_list<std::pair<const uint32_t, uint8_t>>\n> delayList)\n> > +                      std::initializer_list<std::tuple<uint32_t,\n> uint8_t, bool>> delayList)\n>\n> It could make sense to define a struct type to group the three\n> parameters.\n>\n\nAgree, I will fix this.  I was going for the easiest/quickest possible\nthing here, as this will all be deprecated shortly.\n\n\n>\n> >  {\n> >       std::lock_guard<std::mutex> lock(lock_);\n> >\n> >       dev_ = dev;\n> > -     delay_ = delayList;\n> > +     delay_.clear();\n> >       ctrl_.clear();\n> >\n> > -     /* Find the largest delay across all controls. */\n> >       maxDelay_ = 0;\n> > -     for (auto const &p : delay_) {\n> > +     for (auto const &c : delayList) {\n> > +             uint32_t id = std::get<0>(c);\n> > +             uint8_t delay = std::get<1>(c);\n> > +             bool immediateWrite = std::get<2>(c);\n> > +\n> > +             delay_[id] = delay;\n> > +             immediateWrite_[id] = immediateWrite;\n>\n> \"immediate write\" isn't a great name, as the control isn't written\n> immediately, it's still delayed.\n>\n\nHow about \"priority controls\" to signify they must be written ahead of the\nbatch?\n\n\n>\n> > +\n> >               LOG(RPI_S_W, Info) << \"Init ctrl \"\n> > -                                << utils::hex(p.first) << \" with delay \"\n> > -                                << static_cast<int>(p.second);\n> > -             maxDelay_ = std::max(maxDelay_, p.second);\n> > +                                << utils::hex(id) << \" with delay \"\n> > +                                << static_cast<int>(delay);\n> > +\n> > +             /* Find the largest delay across all controls. */\n> > +             maxDelay_ = std::max(maxDelay_, delay);\n> >       }\n> >\n> >       init_ = true;\n> > @@ -121,8 +129,21 @@ int StaggeredCtrl::write()\n> >               int index = std::max<int>(0, setCount_ - delayDiff);\n> >\n> >               if (p.second[index].updated) {\n> > -                     /* We need to write this value out. */\n> > -                     controls.set(p.first, p.second[index].value);\n> > +                     if (immediateWrite_[p.first]) {\n> > +                             /*\n> > +                              * This control must be written now, it\n> could\n> > +                              * affect validity of the other controls.\n> > +                              */\n> > +                             ControlList immediate(dev_->controls());\n> > +                             immediate.set(p.first,\n> p.second[index].value);\n> > +                             dev_->setControls(&immediate);\n> > +                     } else {\n> > +                             /*\n> > +                              * Batch up the list of controls and write\n> them\n> > +                              * at the end of the function.\n> > +                              */\n> > +                             controls.set(p.first,\n> p.second[index].value);\n> > +                     }\n> >                       p.second[index].updated = false;\n> >                       LOG(RPI_S_W, Debug) << \"Writing ctrl \"\n> >                                           << utils::hex(p.first) << \" to\n> \"\n> > diff --git a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n> b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n> > index 382fa31a6853..7c920c3a13c7 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n> > +++ b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.h\n> > @@ -34,7 +34,7 @@ public:\n> >       }\n> >\n> >       void init(V4L2VideoDevice *dev,\n> > -               std::initializer_list<std::pair<const uint32_t,\n> uint8_t>> delayList);\n> > +               std::initializer_list<std::tuple<uint32_t, uint8_t,\n> bool>> delayList);\n> >       void reset();\n> >\n> >       void get(std::unordered_map<uint32_t, int32_t> &ctrl, uint8_t\n> offset = 0);\n> > @@ -85,6 +85,7 @@ private:\n> >       uint8_t maxDelay_;\n> >       V4L2VideoDevice *dev_;\n> >       std::unordered_map<uint32_t, uint8_t> delay_;\n> > +     std::unordered_map<uint32_t, bool> immediateWrite_;\n>\n> Should we store both the delay and the immediate write flag in a single\n> map ?\n>\n\nIf we use a structure to group things in the constructor, this can change\nto a structure as well.  We can then store both in a single map.\n\n\n>\n> Otherwise this looks fine. We could possibly solve these issues as part\n> of the DelayedControls work. I'll let Niklas discuss his preference.\n>\n\nYes, as I mentioned in the cover letter, DelayedControls does not\nnecessarily need this functionality on day 1.  This change is more of an\noutline as to how we can get around the problem.\n\nRegards,\nNaush\n\n\n>\n> >       std::unordered_map<uint32_t, CircularArray> ctrl_;\n> >       std::mutex lock_;\n> >  };\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\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 DD3CCC0F2B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jan 2021 09:18:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 65B896834C;\n\tWed, 27 Jan 2021 10:18:01 +0100 (CET)","from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com\n\t[IPv6:2a00:1450:4864:20::12b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 946AB68341\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jan 2021 10:18:00 +0100 (CET)","by mail-lf1-x12b.google.com with SMTP id a12so1680657lfb.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jan 2021 01:18:00 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"ODACfU7+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=LfcphmQ59RTXjD0kAPG7BR+2G1Eq2xYAt4FXT/7apQ0=;\n\tb=ODACfU7+FVvfi/OtWfp9HVJ9E6+3lJL13E58EDW4nOLlFANFf//pMBno+yVSt1IHCv\n\tFbSYkKS03gE8/XtQvTM8s/XklRpWc1rR8Uzelo9BcHxGKRDmcGhlxZnazDrKv3W72KTa\n\tW/7yMyEgl9sHVyiOmG5UWDqWGo/zdmOcqoV1xFqtBExaI1xs7OQqho5de4crlbd502Kv\n\tvj8runEtY8JfSdMcFcU+tAWmqfDhrs/IsOQfAmUXvqryZIVdzIYQdFDaifCvMnbz0jfk\n\txVzExtZfxrH1ImF/huR9uvzDP2Ipso5853J7HLjUYPsSb6B+zDeXo0rWLNgnUmfqj/Bq\n\tKSSQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=LfcphmQ59RTXjD0kAPG7BR+2G1Eq2xYAt4FXT/7apQ0=;\n\tb=KlUd7JHwx2rBV5icVVlt4ltgjEXmxiZxSjj8nU0QyHPlllsFquGi6AI8fNi8ijxQPD\n\tNgGFbo/ek8/xmwfgW02eiMz0SmKI7NKMn5cttSGlH05KyRGE+KEpzwhFRmOh9FFXCNSP\n\tw8lQwv3zu7jLrvg6nD743xYC945GetORvHGZOSSARMAlSYJbAAOgitdjTwWjzaTn4RF0\n\tWIzbYWxrrExtFCoAqmm2ZtQunXGv0Tw9fVumlkHXzX16q9I7Wuu03F3XSaNiRQNc7P9M\n\tdNZieg8cN7RA7r8ySNWXe8jDfM3pgCkW8TDUTm9q51br5vII+T5kZQNaJ7Vz3DA+GhNg\n\tp/+w==","X-Gm-Message-State":"AOAM533WUk2RL6NA5AXwUwMO7TBfLKC7xSqHDoFJum6WwT3cciIxYf9T\n\tMAQ9tIPOE9j3PxKmhPpLPo+Y6DdR3bCtSDCMB+Vy569ibuMH+5fR","X-Google-Smtp-Source":"ABdhPJyPYfswWxzDp/sI/OR78cyon8eTMo1xAB2DezqlPJloiLT16mpd3jG7m8Nl9fGMa1B+/d0kkdY0QTvWLcahm8s=","X-Received":"by 2002:a19:8805:: with SMTP id k5mr4489679lfd.567.1611739079914;\n\tWed, 27 Jan 2021 01:17:59 -0800 (PST)","MIME-Version":"1.0","References":"<20210124140506.786503-1-naush@raspberrypi.com>\n\t<20210124140506.786503-4-naush@raspberrypi.com>\n\t<YBCz+DSYgVt3Ap0C@pendragon.ideasonboard.com>","In-Reply-To":"<YBCz+DSYgVt3Ap0C@pendragon.ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Wed, 27 Jan 2021 09:17:43 +0000","Message-ID":"<CAEmqJPrPoWXJrVWBVsk8q6bZ=uaxeYAoQm45PUuorjcbdttNqA@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 4/4] pipeline: raspberrypi: Add\n\tnotion of immediate write to StaggeredCtrl","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"multipart/mixed;\n\tboundary=\"===============5083426372948487956==\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]