[{"id":33030,"web_url":"https://patchwork.libcamera.org/comment/33030/","msgid":"<20250112220040.GA21994@pendragon.ideasonboard.com>","date":"2025-01-12T22:00:40","subject":"Re: [RFC PATCH 5/7] pipeline: rkisp1: Apply initial controls","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Stefan,\n\nThank you for the patch.\n\nOn Fri, Dec 20, 2024 at 05:26:51PM +0100, Stefan Klug wrote:\n> Controls passed to Camera::start() are not handled at the moment.\n> Implement that by issuing a dummy queueRequest() to initialize the frame\n> context and then returning the controls synchronously to the caller. In\n> the pipeline the controls get passed to the sensor before the call to\n> stremOn() to ensure the controls are applied right away. Passing the\n\ns/stremOn/streamOn/\n\n> controls to the pipeline using the setSensorControls signal is not\n> appropriate because it is asynchronous and would reach the sensor too\n> late (initial controls need to be applied before the sensor starts and\n> before delayed controls initializes it's start condition.)\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>  include/libcamera/ipa/rkisp1.mojom       |  7 ++++++-\n>  src/ipa/rkisp1/rkisp1.cpp                | 15 ++++++++++-----\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 11 +++++++++--\n>  3 files changed, 25 insertions(+), 8 deletions(-)\n> \n> diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom\n> index 043ad27ea199..86eae55cd530 100644\n> --- a/include/libcamera/ipa/rkisp1.mojom\n> +++ b/include/libcamera/ipa/rkisp1.mojom\n> @@ -14,13 +14,18 @@ struct IPAConfigInfo {\n>  \tuint32 paramFormat;\n>  };\n>  \n> +struct StartResult {\n> +\tlibcamera.ControlList controls;\n> +\tint32 code;\n> +};\n> +\n>  interface IPARkISP1Interface {\n>  \tinit(libcamera.IPASettings settings,\n>  \t     uint32 hwRevision,\n>  \t     libcamera.IPACameraSensorInfo sensorInfo,\n>  \t     libcamera.ControlInfoMap sensorControls)\n>  \t\t=> (int32 ret, libcamera.ControlInfoMap ipaControls);\n> -\tstart() => (int32 ret);\n> +\tstart(libcamera.ControlList controls) => (StartResult result);\n>  \tstop();\n>  \n>  \tconfigure(IPAConfigInfo configInfo,\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 45a539a61fb1..799fe0846635 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -55,7 +55,7 @@ public:\n>  \t\t const IPACameraSensorInfo &sensorInfo,\n>  \t\t const ControlInfoMap &sensorControls,\n>  \t\t ControlInfoMap *ipaControls) override;\n> -\tint start() override;\n> +\tvoid start(const ControlList &controls, StartResult *result) override;\n>  \tvoid stop() override;\n>  \n>  \tint configure(const IPAConfigInfo &ipaConfig,\n> @@ -209,12 +209,17 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,\n>  \treturn 0;\n>  }\n>  \n> -int IPARkISP1::start()\n> +void IPARkISP1::start(const ControlList &controls, StartResult *result)\n>  {\n> -\tControlList ctrls = getSensorControls(0);\n> -\tsetSensorControls.emit(0, ctrls);\n> +\t/*\n> +\t * \\todo: This feels a bit counter intuitive, as the queueRequest() for frame\n> +\t * 0 will be called again when the actual request for frame 0 get's\n> +\t * queued.\n> +\t */\n\ns/todo:/todo/\n\nIt's more than counterintuitive, I think it's an important design\nproblem. I'm OK with this dirty hack for now, but I think it should be\naddressed sooner than later. Can you word the \\todo comment a bit\nstronger ?\n\n> +\tqueueRequest(0, controls);\n>  \n> -\treturn 0;\n> +\tresult->controls = getSensorControls(0);\n> +\tresult->code = 0;\n>  }\n>  \n>  void IPARkISP1::stop()\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 71a07c6027b9..ee6ed1b9c84a 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -1086,13 +1086,20 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] const ControlL\n>  \t\treturn ret;\n>  \tactions += [&]() { freeBuffers(camera); };\n>  \n> -\tret = data->ipa_->start();\n> -\tif (ret) {\n> +\tControlList ctrls;\n> +\tif (!!controls)\n> +\t\tctrls = *controls;\n> +\n> +\tipa::rkisp1::StartResult res;\n> +\tdata->ipa_->start(ctrls, &res);\n> +\tif (res.code) {\n>  \t\tLOG(RkISP1, Error)\n>  \t\t\t<< \"Failed to start IPA \" << camera->id();\n>  \t\treturn ret;\n>  \t}\n>  \tactions += [&]() { data->ipa_->stop(); };\n> +\tdata->sensor_->setControls(&res.controls);\n> +\tdata->delayedCtrls_->reset();\n\nResetting the delayed controls seems to be an important bug fix. It\nshould be mentioned in the commit message, or better split to a separate\ncommit.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \n>  \tdata->frame_ = 0;\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id DB9FAC32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 12 Jan 2025 22:00:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BE7F684E0;\n\tSun, 12 Jan 2025 23:00:46 +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 4F1A961882\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 12 Jan 2025 23:00:44 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1B42B8CC;\n\tSun, 12 Jan 2025 22:59:48 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"evPTtClb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1736719188;\n\tbh=stxdIb6A+pNG26QYmV7oVTQ42EfezwQ2sOp/1aRn/ks=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=evPTtClbo5qjsw5L0yosIGs7bC/Hk9KG1e9X/cwO3JG1Ht2oJi6Z0TECm+G3iTpTU\n\tY69UeKmttvJHN/NaZRdEdBbc3dk09JyCSuIxw458pIPKRg9abo6yMTr0kFFrjulNwp\n\tCKf8grt6CW4zRmw+AiWZUxBS64s4njVVvBvqMJqg=","Date":"Mon, 13 Jan 2025 00:00:40 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH 5/7] pipeline: rkisp1: Apply initial controls","Message-ID":"<20250112220040.GA21994@pendragon.ideasonboard.com>","References":"<20241220162724.756494-1-stefan.klug@ideasonboard.com>\n\t<20241220162724.756494-6-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241220162724.756494-6-stefan.klug@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":33046,"web_url":"https://patchwork.libcamera.org/comment/33046/","msgid":"<173677173338.1594000.1761294541624735830@ping.linuxembedded.co.uk>","date":"2025-01-13T12:35:33","subject":"Re: [RFC PATCH 5/7] pipeline: rkisp1: Apply initial controls","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2025-01-12 22:00:40)\n> Hi Stefan,\n> \n> Thank you for the patch.\n> \n> On Fri, Dec 20, 2024 at 05:26:51PM +0100, Stefan Klug wrote:\n> > Controls passed to Camera::start() are not handled at the moment.\n> > Implement that by issuing a dummy queueRequest() to initialize the frame\n> > context and then returning the controls synchronously to the caller. In\n> > the pipeline the controls get passed to the sensor before the call to\n> > stremOn() to ensure the controls are applied right away. Passing the\n> \n> s/stremOn/streamOn/\n> \n> > controls to the pipeline using the setSensorControls signal is not\n> > appropriate because it is asynchronous and would reach the sensor too\n> > late (initial controls need to be applied before the sensor starts and\n> > before delayed controls initializes it's start condition.)\n> > \n> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > ---\n> >  include/libcamera/ipa/rkisp1.mojom       |  7 ++++++-\n> >  src/ipa/rkisp1/rkisp1.cpp                | 15 ++++++++++-----\n> >  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 11 +++++++++--\n> >  3 files changed, 25 insertions(+), 8 deletions(-)\n> > \n> > diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom\n> > index 043ad27ea199..86eae55cd530 100644\n> > --- a/include/libcamera/ipa/rkisp1.mojom\n> > +++ b/include/libcamera/ipa/rkisp1.mojom\n> > @@ -14,13 +14,18 @@ struct IPAConfigInfo {\n> >       uint32 paramFormat;\n> >  };\n> >  \n> > +struct StartResult {\n> > +     libcamera.ControlList controls;\n> > +     int32 code;\n> > +};\n> > +\n> >  interface IPARkISP1Interface {\n> >       init(libcamera.IPASettings settings,\n> >            uint32 hwRevision,\n> >            libcamera.IPACameraSensorInfo sensorInfo,\n> >            libcamera.ControlInfoMap sensorControls)\n> >               => (int32 ret, libcamera.ControlInfoMap ipaControls);\n> > -     start() => (int32 ret);\n> > +     start(libcamera.ControlList controls) => (StartResult result);\n> >       stop();\n> >  \n> >       configure(IPAConfigInfo configInfo,\n> > diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> > index 45a539a61fb1..799fe0846635 100644\n> > --- a/src/ipa/rkisp1/rkisp1.cpp\n> > +++ b/src/ipa/rkisp1/rkisp1.cpp\n> > @@ -55,7 +55,7 @@ public:\n> >                const IPACameraSensorInfo &sensorInfo,\n> >                const ControlInfoMap &sensorControls,\n> >                ControlInfoMap *ipaControls) override;\n> > -     int start() override;\n> > +     void start(const ControlList &controls, StartResult *result) override;\n> >       void stop() override;\n> >  \n> >       int configure(const IPAConfigInfo &ipaConfig,\n> > @@ -209,12 +209,17 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,\n> >       return 0;\n> >  }\n> >  \n> > -int IPARkISP1::start()\n> > +void IPARkISP1::start(const ControlList &controls, StartResult *result)\n> >  {\n> > -     ControlList ctrls = getSensorControls(0);\n> > -     setSensorControls.emit(0, ctrls);\n> > +     /*\n> > +      * \\todo: This feels a bit counter intuitive, as the queueRequest() for frame\n> > +      * 0 will be called again when the actual request for frame 0 get's\n> > +      * queued.\n> > +      */\n> \n> s/todo:/todo/\n> \n> It's more than counterintuitive, I think it's an important design\n> problem. I'm OK with this dirty hack for now, but I think it should be\n> addressed sooner than later. Can you word the \\todo comment a bit\n> stronger ?\n> \n> > +     queueRequest(0, controls);\n\nThis means we call IPARkISP1::queueRequest(0, ...) twice,\nwhich means we call \n\tIPAFrameContext &frameContext = context_.frameContexts.alloc(0);\n\ntwice. Does that result in a double allocation? Or is it ok ?\n\nI followed it through myself, and it seems it's fine, as it only obtains\nthe 0'th element from the circular queue, but it will call\ninit(frameContext, frame) and re-zero that framecontext, erasing any\ncontrols you might have put in there from this start list.\n\nI think that's ok - but best to be aware of it. Possibly even with a\ncomment saying that the controls will not be maintained in the frame\ncontext queue...\n\n\n\n> >  \n> > -     return 0;\n> > +     result->controls = getSensorControls(0);\n> > +     result->code = 0;\n> >  }\n> >  \n> >  void IPARkISP1::stop()\n> > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > index 71a07c6027b9..ee6ed1b9c84a 100644\n> > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > @@ -1086,13 +1086,20 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] const ControlL\n> >               return ret;\n> >       actions += [&]() { freeBuffers(camera); };\n> >  \n> > -     ret = data->ipa_->start();\n> > -     if (ret) {\n> > +     ControlList ctrls;\n> > +     if (!!controls)\n> > +             ctrls = *controls;\n> > +\n> > +     ipa::rkisp1::StartResult res;\n> > +     data->ipa_->start(ctrls, &res);\n> > +     if (res.code) {\n> >               LOG(RkISP1, Error)\n> >                       << \"Failed to start IPA \" << camera->id();\n> >               return ret;\n> >       }\n> >       actions += [&]() { data->ipa_->stop(); };\n> > +     data->sensor_->setControls(&res.controls);\n> > +     data->delayedCtrls_->reset();\n> \n> Resetting the delayed controls seems to be an important bug fix. It\n> should be mentioned in the commit message, or better split to a separate\n> commit.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> >  \n> >       data->frame_ = 0;\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 48DFEC326C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Jan 2025 12:35:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3B2626851C;\n\tMon, 13 Jan 2025 13:35:38 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D4147684E7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jan 2025 13:35:36 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D7050788;\n\tMon, 13 Jan 2025 13:34:39 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"QUKOyHOB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1736771679;\n\tbh=HAdfHY7s73od7ot2nveDdoyZvQPJzuJmIRWk5QHc6d8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=QUKOyHOBQTkHCZ/lhDqezRvUN/bRMLb2kluyXIjey9iVbpWwR5iNJpID2LsqZY2JE\n\t8USYt+VOYfgRcTQywdZwj7mKqLqit4GC/Q+RyDmWnRAAs1CjkOyBqVUmxwdvPRP3gN\n\tDDUMGEg3ZxsMRS371VRheyyGTIpV/alMcP1JTdbw=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250112220040.GA21994@pendragon.ideasonboard.com>","References":"<20241220162724.756494-1-stefan.klug@ideasonboard.com>\n\t<20241220162724.756494-6-stefan.klug@ideasonboard.com>\n\t<20250112220040.GA21994@pendragon.ideasonboard.com>","Subject":"Re: [RFC PATCH 5/7] pipeline: rkisp1: Apply initial controls","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","Date":"Mon, 13 Jan 2025 12:35:33 +0000","Message-ID":"<173677173338.1594000.1761294541624735830@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":33407,"web_url":"https://patchwork.libcamera.org/comment/33407/","msgid":"<Z7bs76gEXQpUohQI@pyrite.rasen.tech>","date":"2025-02-20T08:50:55","subject":"Re: [RFC PATCH 5/7] pipeline: rkisp1: Apply initial controls","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Fri, Dec 20, 2024 at 05:26:51PM +0100, Stefan Klug wrote:\n> Controls passed to Camera::start() are not handled at the moment.\n> Implement that by issuing a dummy queueRequest() to initialize the frame\n> context and then returning the controls synchronously to the caller. In\n> the pipeline the controls get passed to the sensor before the call to\n> stremOn() to ensure the controls are applied right away. Passing the\n> controls to the pipeline using the setSensorControls signal is not\n> appropriate because it is asynchronous and would reach the sensor too\n> late (initial controls need to be applied before the sensor starts and\n> before delayed controls initializes it's start condition.)\n\ns/it's/its/\n\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  include/libcamera/ipa/rkisp1.mojom       |  7 ++++++-\n>  src/ipa/rkisp1/rkisp1.cpp                | 15 ++++++++++-----\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 11 +++++++++--\n>  3 files changed, 25 insertions(+), 8 deletions(-)\n> \n> diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom\n> index 043ad27ea199..86eae55cd530 100644\n> --- a/include/libcamera/ipa/rkisp1.mojom\n> +++ b/include/libcamera/ipa/rkisp1.mojom\n> @@ -14,13 +14,18 @@ struct IPAConfigInfo {\n>  \tuint32 paramFormat;\n>  };\n>  \n> +struct StartResult {\n> +\tlibcamera.ControlList controls;\n> +\tint32 code;\n> +};\n> +\n>  interface IPARkISP1Interface {\n>  \tinit(libcamera.IPASettings settings,\n>  \t     uint32 hwRevision,\n>  \t     libcamera.IPACameraSensorInfo sensorInfo,\n>  \t     libcamera.ControlInfoMap sensorControls)\n>  \t\t=> (int32 ret, libcamera.ControlInfoMap ipaControls);\n> -\tstart() => (int32 ret);\n> +\tstart(libcamera.ControlList controls) => (StartResult result);\n>  \tstop();\n>  \n>  \tconfigure(IPAConfigInfo configInfo,\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 45a539a61fb1..799fe0846635 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -55,7 +55,7 @@ public:\n>  \t\t const IPACameraSensorInfo &sensorInfo,\n>  \t\t const ControlInfoMap &sensorControls,\n>  \t\t ControlInfoMap *ipaControls) override;\n> -\tint start() override;\n> +\tvoid start(const ControlList &controls, StartResult *result) override;\n>  \tvoid stop() override;\n>  \n>  \tint configure(const IPAConfigInfo &ipaConfig,\n> @@ -209,12 +209,17 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,\n>  \treturn 0;\n>  }\n>  \n> -int IPARkISP1::start()\n> +void IPARkISP1::start(const ControlList &controls, StartResult *result)\n>  {\n> -\tControlList ctrls = getSensorControls(0);\n> -\tsetSensorControls.emit(0, ctrls);\n> +\t/*\n> +\t * \\todo: This feels a bit counter intuitive, as the queueRequest() for frame\n> +\t * 0 will be called again when the actual request for frame 0 get's\n> +\t * queued.\n> +\t */\n> +\tqueueRequest(0, controls);\n>  \n> -\treturn 0;\n> +\tresult->controls = getSensorControls(0);\n> +\tresult->code = 0;\n>  }\n>  \n>  void IPARkISP1::stop()\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 71a07c6027b9..ee6ed1b9c84a 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -1086,13 +1086,20 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] const ControlL\n>  \t\treturn ret;\n>  \tactions += [&]() { freeBuffers(camera); };\n>  \n> -\tret = data->ipa_->start();\n> -\tif (ret) {\n> +\tControlList ctrls;\n> +\tif (!!controls)\n> +\t\tctrls = *controls;\n> +\n> +\tipa::rkisp1::StartResult res;\n> +\tdata->ipa_->start(ctrls, &res);\n> +\tif (res.code) {\n>  \t\tLOG(RkISP1, Error)\n>  \t\t\t<< \"Failed to start IPA \" << camera->id();\n>  \t\treturn ret;\n>  \t}\n>  \tactions += [&]() { data->ipa_->stop(); };\n> +\tdata->sensor_->setControls(&res.controls);\n> +\tdata->delayedCtrls_->reset();\n>  \n>  \tdata->frame_ = 0;\n>  \n> -- \n> 2.43.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3D816BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Feb 2025 08:51:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ED84A6869C;\n\tThu, 20 Feb 2025 09:51:03 +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 AB21668692\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Feb 2025 09:51:02 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:4292:75df:25cd:1836])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 58A14526;\n\tThu, 20 Feb 2025 09:49:38 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"YEx6CJ8H\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1740041379;\n\tbh=dN1HclM3JCGVBON94mo0OKzBYwuBQt4N4FAu/iAnSp8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YEx6CJ8H49aFkN1YTl2+cBUclvAdX2zrjcMQw0qGR6wmNjjOfnEeldFCMKJCjQYXk\n\tcVI2wC/Ue5vvecqCA9bmeiMeU3EtdrkKay0crGQiKBUP8AUclArBoko9qVqeQJ1gR9\n\tl1TLHiLiAOzOJWUM/gyX2W+D9RpfllgWLzliil7M=","Date":"Thu, 20 Feb 2025 17:50:55 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH 5/7] pipeline: rkisp1: Apply initial controls","Message-ID":"<Z7bs76gEXQpUohQI@pyrite.rasen.tech>","References":"<20241220162724.756494-1-stefan.klug@ideasonboard.com>\n\t<20241220162724.756494-6-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20241220162724.756494-6-stefan.klug@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]