[{"id":20854,"web_url":"https://patchwork.libcamera.org/comment/20854/","msgid":"<163663471659.2258438.7923861356160003997@Monstersaurus>","date":"2021-11-11T12:45:16","subject":"Re: [libcamera-devel] [PATCH v3 02/14] ipu3: ipa: Report effective\n\tsensor controls with statistics to IPA","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jean-Michel Hautbois (2021-11-11 11:05:53)\n> From: Han-Lin Chen <hanlinchen@chromium.org>\n> \n> The Intel close sourced IPA requires the effective controls applied to\n> the sensor when the statistics are generated. Report effective sensor controls\n> with the statistics to IPA.\n> \n> Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> [Jean-Michel: Reword s/stastistics/statistics and move reset after IPA\n> start]\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/ipu3/frames.h | 4 ++++\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 9 +++++++++\n>  2 files changed, 13 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h\n> index 3ef7e445..614701e2 100644\n> --- a/src/libcamera/pipeline/ipu3/frames.h\n> +++ b/src/libcamera/pipeline/ipu3/frames.h\n> @@ -14,6 +14,8 @@\n>  \n>  #include <libcamera/base/signal.h>\n>  \n> +#include <libcamera/controls.h>\n> +\n>  namespace libcamera {\n>  \n>  class FrameBuffer;\n> @@ -34,6 +36,8 @@ public:\n>                 FrameBuffer *paramBuffer;\n>                 FrameBuffer *statBuffer;\n>  \n> +               ControlList effectiveSensorControls;\n> +\n>                 bool paramDequeued;\n>                 bool metadataProcessed;\n>         };\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 8816efc5..3fcfa777 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -767,6 +767,12 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis\n>         if (ret)\n>                 goto error;\n>  \n> +       /*\n> +        * Reset the delayed controls with the gain and exposure values set by\n> +        * the IPA.\n\nI still think this comment is saying something is happening which isn't.\n\nJust because this comment is in the RPi pipeline handler isn't an\nexcuse/reason to keep it here if it's not true.\n\nRPi calls the following in PipelineHandlerRPi::start()\n\t/* Start the IPA. */\n\tipa::RPi::StartConfig startConfig;\n\tdata->ipa_->start(controls ? *controls : ControlList{ controls::controls },\n\t\t\t  &startConfig);\n\n\t/* Apply any gain/exposure settings that the IPA may have passed back. */\n\tif (!startConfig.controls.empty())\n\t\tdata->setSensorControls(startConfig.controls);\n\nbefore calling delayed controls reset.\n\nIf we aren't doing that, then the comment simply doesn't make sense\nhere.\n\nRemoved or fixed...\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> +        */\n> +       data->delayedCtrls_->reset();\n> +\n>         /*\n>          * Start the ImgU video devices, buffers will be queued to the\n>          * ImgU output and viewfinder when requests will be queued.\n> @@ -1363,6 +1369,8 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)\n>         request->metadata().set(controls::SensorTimestamp,\n>                                 buffer->metadata().timestamp);\n>  \n> +       info->effectiveSensorControls = delayedCtrls_->get(buffer->metadata().sequence);\n> +\n>         if (request->findBuffer(&rawStream_))\n>                 pipe()->completeBuffer(request, buffer);\n>  \n> @@ -1419,6 +1427,7 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer)\n>         ev.frame = info->id;\n>         ev.bufferId = info->statBuffer->cookie();\n>         ev.frameTimestamp = request->metadata().get(controls::SensorTimestamp);\n> +       ev.sensorControls = info->effectiveSensorControls;\n>         ipa_->processEvent(ev);\n>  }\n>  \n> -- \n> 2.32.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 9FF45BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Nov 2021 12:45:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CA8B360361;\n\tThu, 11 Nov 2021 13:45:20 +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 C9E6F60345\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Nov 2021 13:45:19 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5953D556;\n\tThu, 11 Nov 2021 13:45:19 +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=\"bbqKF+Zd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636634719;\n\tbh=xAfKi7hxOY/LBu3WD15OlFrafGREgdldujXdFDCGEjs=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=bbqKF+ZdCUZ0RtzgbR3pbFkamrobONmDO7F8WpkNI6e90yvDMLIvM89o8b2hFlrPu\n\thglQaUAzCNekjngkMVUkTxEYORVl70mCX9HJWvtt3tZDkSHZ6pe5a+z0rHNzdvq+++\n\tQpTw0PiKZ8tlRgeJXR6oepPXkaXUYjemPBxnOli4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211111110605.105202-3-jeanmichel.hautbois@ideasonboard.com>","References":"<20211111110605.105202-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20211111110605.105202-3-jeanmichel.hautbois@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 11 Nov 2021 12:45:16 +0000","Message-ID":"<163663471659.2258438.7923861356160003997@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH v3 02/14] ipu3: ipa: Report effective\n\tsensor controls with statistics to IPA","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>"}}]