[{"id":32386,"web_url":"https://patchwork.libcamera.org/comment/32386/","msgid":"<173263633496.1605529.11868542264721598287@ping.linuxembedded.co.uk>","date":"2024-11-26T15:52:14","subject":"Re: [PATCH v5 2/2] libcamera: pipelines: Draw control delays from\n\tCameraSensor properties","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Daniel Scally (2024-11-26 15:12:03)\n> Rather than hard coding default delays for control values in the\n> pipeline handlers, pick up the ones defined in the CameraSensor\n> properties.\n> \n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n> Changes in v5:\n> \n>         - Fixed the includes in each pipeline (remove property_ids.h, added\n>           camera_sensor_properties.h)\n> \n> Changes in v4:\n> \n>         - Used the struct reference rather than values directly\n> \n> Changes in v3:\n> \n>         - Fixed some broken alignment \n> \n> Changes in v2:\n> \n>         - Switched to use the new getSensorDelays() function\n> \n>  src/libcamera/pipeline/ipu3/ipu3.cpp     | 11 ++++-------\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 11 ++++-------\n>  src/libcamera/pipeline/simple/simple.cpp |  6 ++++--\n>  3 files changed, 12 insertions(+), 16 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 0069d5e2..e31e3879 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -28,6 +28,7 @@\n>  #include \"libcamera/internal/camera.h\"\n>  #include \"libcamera/internal/camera_lens.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n>  #include \"libcamera/internal/framebuffer.h\"\n> @@ -1077,14 +1078,10 @@ int PipelineHandlerIPU3::registerCameras()\n>                 if (ret)\n>                         continue;\n>  \n> -               /*\n> -                * \\todo Read delay values from the sensor itself or from a\n> -                * a sensor database. For now use generic values taken from\n> -                * the Raspberry Pi and listed as 'generic values'.\n> -                */\n> +               const CameraSensorProperties::SensorDelays &delays = cio2->sensor()->sensorDelays();\n>                 std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n> -                       { V4L2_CID_ANALOGUE_GAIN, { 1, false } },\n> -                       { V4L2_CID_EXPOSURE, { 2, false } },\n> +                       { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n> +                       { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>                 };\n>  \n>                 data->delayedCtrls_ =\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 6c6d711f..908724e2 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -34,6 +34,7 @@\n>  \n>  #include \"libcamera/internal/camera.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>  #include \"libcamera/internal/converter/converter_v4l2_m2m.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n> @@ -1239,14 +1240,10 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>         /* Initialize the camera properties. */\n>         data->properties_ = data->sensor_->properties();\n>  \n> -       /*\n> -        * \\todo Read delay values from the sensor itself or from a\n> -        * a sensor database. For now use generic values taken from\n> -        * the Raspberry Pi and listed as generic values.\n> -        */\n> +       const CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();\n>         std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n> -               { V4L2_CID_ANALOGUE_GAIN, { 1, false } },\n> -               { V4L2_CID_EXPOSURE, { 2, false } },\n> +               { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n> +               { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>         };\n>  \n>         data->delayedCtrls_ =\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 41fdf84c..dae9f31f 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -31,6 +31,7 @@\n>  \n>  #include \"libcamera/internal/camera.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>  #include \"libcamera/internal/converter.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n> @@ -1290,9 +1291,10 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>         if (outputCfgs.empty())\n>                 return 0;\n>  \n> +       const CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();\n>         std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n> -               { V4L2_CID_ANALOGUE_GAIN, { 2, false } },\n> -               { V4L2_CID_EXPOSURE, { 2, false } },\n> +               { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n> +               { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>         };\n>         data->delayedCtrls_ =\n>                 std::make_unique<DelayedControls>(data->sensor_->device(),\n> -- \n> 2.30.2\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 80A9DC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Nov 2024 15:52:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A531B65FCD;\n\tTue, 26 Nov 2024 16:52:19 +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 5110865F9E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Nov 2024 16:52:18 +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 B08A96BE;\n\tTue, 26 Nov 2024 16:51:55 +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=\"gGPmWYNA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732636315;\n\tbh=50gzJFewqYiq5ilwTHk9Ier+W9ehmSRtlCZjgdaAW6Y=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=gGPmWYNAN2XsFzOl2PP9vQywchFnPXuGCfVoMZTTm9Et0nduwdzRivrEsdeb6TKSy\n\tjo6tFIzMK1L6+l5J2GpiVoqsjTNUvf1diwvA70T6hTJT00TLGLhZHZ4bmflvU7JWWp\n\tQ/qiIwW9nA7UCV3QlNwt4mgxswyTNno/T5uYKoUk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241126151203.108407-3-dan.scally@ideasonboard.com>","References":"<20241126151203.108407-1-dan.scally@ideasonboard.com>\n\t<20241126151203.108407-3-dan.scally@ideasonboard.com>","Subject":"Re: [PATCH v5 2/2] libcamera: pipelines: Draw control delays from\n\tCameraSensor properties","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"mike.rudenko@gmail.com, Daniel Scally <dan.scally@ideasonboard.com>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 26 Nov 2024 15:52:14 +0000","Message-ID":"<173263633496.1605529.11868542264721598287@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":32403,"web_url":"https://patchwork.libcamera.org/comment/32403/","msgid":"<20241127070159.GS5461@pendragon.ideasonboard.com>","date":"2024-11-27T07:01:59","subject":"Re: [PATCH v5 2/2] libcamera: pipelines: Draw control delays from\n\tCameraSensor properties","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Nov 26, 2024 at 03:12:03PM +0000, Daniel Scally wrote:\n> Rather than hard coding default delays for control values in the\n> pipeline handlers, pick up the ones defined in the CameraSensor\n> properties.\n> \n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nAny chance we could do the same for the Raspberry Pi pipeline handler,\nand drop the delays from its IPA module (in a separate patch of course)\n?\n\n> ---\n> Changes in v5:\n> \n> \t- Fixed the includes in each pipeline (remove property_ids.h, added\n> \t  camera_sensor_properties.h)\n> \n> Changes in v4:\n> \n> \t- Used the struct reference rather than values directly\n> \n> Changes in v3:\n> \n> \t- Fixed some broken alignment \n> \n> Changes in v2:\n> \n> \t- Switched to use the new getSensorDelays() function\n> \n>  src/libcamera/pipeline/ipu3/ipu3.cpp     | 11 ++++-------\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 11 ++++-------\n>  src/libcamera/pipeline/simple/simple.cpp |  6 ++++--\n>  3 files changed, 12 insertions(+), 16 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 0069d5e2..e31e3879 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -28,6 +28,7 @@\n>  #include \"libcamera/internal/camera.h\"\n>  #include \"libcamera/internal/camera_lens.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n>  #include \"libcamera/internal/framebuffer.h\"\n> @@ -1077,14 +1078,10 @@ int PipelineHandlerIPU3::registerCameras()\n>  \t\tif (ret)\n>  \t\t\tcontinue;\n>  \n> -\t\t/*\n> -\t\t * \\todo Read delay values from the sensor itself or from a\n> -\t\t * a sensor database. For now use generic values taken from\n> -\t\t * the Raspberry Pi and listed as 'generic values'.\n> -\t\t */\n> +\t\tconst CameraSensorProperties::SensorDelays &delays = cio2->sensor()->sensorDelays();\n>  \t\tstd::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n> -\t\t\t{ V4L2_CID_ANALOGUE_GAIN, { 1, false } },\n> -\t\t\t{ V4L2_CID_EXPOSURE, { 2, false } },\n> +\t\t\t{ V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n> +\t\t\t{ V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>  \t\t};\n>  \n>  \t\tdata->delayedCtrls_ =\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 6c6d711f..908724e2 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -34,6 +34,7 @@\n>  \n>  #include \"libcamera/internal/camera.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>  #include \"libcamera/internal/converter/converter_v4l2_m2m.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n> @@ -1239,14 +1240,10 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>  \t/* Initialize the camera properties. */\n>  \tdata->properties_ = data->sensor_->properties();\n>  \n> -\t/*\n> -\t * \\todo Read delay values from the sensor itself or from a\n> -\t * a sensor database. For now use generic values taken from\n> -\t * the Raspberry Pi and listed as generic values.\n> -\t */\n> +\tconst CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();\n>  \tstd::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n> -\t\t{ V4L2_CID_ANALOGUE_GAIN, { 1, false } },\n> -\t\t{ V4L2_CID_EXPOSURE, { 2, false } },\n> +\t\t{ V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n> +\t\t{ V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>  \t};\n>  \n>  \tdata->delayedCtrls_ =\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 41fdf84c..dae9f31f 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -31,6 +31,7 @@\n>  \n>  #include \"libcamera/internal/camera.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>  #include \"libcamera/internal/converter.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n> @@ -1290,9 +1291,10 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>  \tif (outputCfgs.empty())\n>  \t\treturn 0;\n>  \n> +\tconst CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();\n>  \tstd::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n> -\t\t{ V4L2_CID_ANALOGUE_GAIN, { 2, false } },\n> -\t\t{ V4L2_CID_EXPOSURE, { 2, false } },\n> +\t\t{ V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n> +\t\t{ V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>  \t};\n>  \tdata->delayedCtrls_ =\n>  \t\tstd::make_unique<DelayedControls>(data->sensor_->device(),","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 F3DC9BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Nov 2024 07:02:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 376BB66098;\n\tWed, 27 Nov 2024 08:02:12 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3BA3465FD6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Nov 2024 08:02:10 +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 EE2C878C;\n\tWed, 27 Nov 2024 08:01:46 +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=\"I/wQob8z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732690907;\n\tbh=YiLVvFSBJkSLMSOn8lZ1E6pA35y6d6FQbqi3F4h+b68=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=I/wQob8zMbe+R+QAxHCPdZ1B14YpYM03X1dGuXI6NY3Cd3p+d1CnjrOl1ZXATJyoB\n\tpssORbG+QTJA4qJ9rwSvR3vXVEG2gtqEoxQhR7F8UVNF0l45Z5Ja8tvPdLRwGSMdnX\n\twNyTZI2QZB4h+bvjWhRtL1oRHnQ16wTC5Jt9DiUU=","Date":"Wed, 27 Nov 2024 09:01:59 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, mike.rudenko@gmail.com,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH v5 2/2] libcamera: pipelines: Draw control delays from\n\tCameraSensor properties","Message-ID":"<20241127070159.GS5461@pendragon.ideasonboard.com>","References":"<20241126151203.108407-1-dan.scally@ideasonboard.com>\n\t<20241126151203.108407-3-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241126151203.108407-3-dan.scally@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":32410,"web_url":"https://patchwork.libcamera.org/comment/32410/","msgid":"<d0018135-9e1d-43f9-8945-aeff76c0e0d1@ideasonboard.com>","date":"2024-11-27T09:06:14","subject":"Re: [PATCH v5 2/2] libcamera: pipelines: Draw control delays from\n\tCameraSensor properties","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Morning Laurent\n\nOn 27/11/2024 07:01, Laurent Pinchart wrote:\n> On Tue, Nov 26, 2024 at 03:12:03PM +0000, Daniel Scally wrote:\n>> Rather than hard coding default delays for control values in the\n>> pipeline handlers, pick up the ones defined in the CameraSensor\n>> properties.\n>>\n>> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nThanks\n> Any chance we could do the same for the Raspberry Pi pipeline handler,\n> and drop the delays from its IPA module (in a separate patch of course)\n> ?\n\nSure, will do.\n\n>\n>> ---\n>> Changes in v5:\n>>\n>> \t- Fixed the includes in each pipeline (remove property_ids.h, added\n>> \t  camera_sensor_properties.h)\n>>\n>> Changes in v4:\n>>\n>> \t- Used the struct reference rather than values directly\n>>\n>> Changes in v3:\n>>\n>> \t- Fixed some broken alignment\n>>\n>> Changes in v2:\n>>\n>> \t- Switched to use the new getSensorDelays() function\n>>\n>>   src/libcamera/pipeline/ipu3/ipu3.cpp     | 11 ++++-------\n>>   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 11 ++++-------\n>>   src/libcamera/pipeline/simple/simple.cpp |  6 ++++--\n>>   3 files changed, 12 insertions(+), 16 deletions(-)\n>>\n>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n>> index 0069d5e2..e31e3879 100644\n>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n>> @@ -28,6 +28,7 @@\n>>   #include \"libcamera/internal/camera.h\"\n>>   #include \"libcamera/internal/camera_lens.h\"\n>>   #include \"libcamera/internal/camera_sensor.h\"\n>> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>>   #include \"libcamera/internal/delayed_controls.h\"\n>>   #include \"libcamera/internal/device_enumerator.h\"\n>>   #include \"libcamera/internal/framebuffer.h\"\n>> @@ -1077,14 +1078,10 @@ int PipelineHandlerIPU3::registerCameras()\n>>   \t\tif (ret)\n>>   \t\t\tcontinue;\n>>   \n>> -\t\t/*\n>> -\t\t * \\todo Read delay values from the sensor itself or from a\n>> -\t\t * a sensor database. For now use generic values taken from\n>> -\t\t * the Raspberry Pi and listed as 'generic values'.\n>> -\t\t */\n>> +\t\tconst CameraSensorProperties::SensorDelays &delays = cio2->sensor()->sensorDelays();\n>>   \t\tstd::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n>> -\t\t\t{ V4L2_CID_ANALOGUE_GAIN, { 1, false } },\n>> -\t\t\t{ V4L2_CID_EXPOSURE, { 2, false } },\n>> +\t\t\t{ V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n>> +\t\t\t{ V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>>   \t\t};\n>>   \n>>   \t\tdata->delayedCtrls_ =\n>> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n>> index 6c6d711f..908724e2 100644\n>> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n>> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n>> @@ -34,6 +34,7 @@\n>>   \n>>   #include \"libcamera/internal/camera.h\"\n>>   #include \"libcamera/internal/camera_sensor.h\"\n>> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>>   #include \"libcamera/internal/converter/converter_v4l2_m2m.h\"\n>>   #include \"libcamera/internal/delayed_controls.h\"\n>>   #include \"libcamera/internal/device_enumerator.h\"\n>> @@ -1239,14 +1240,10 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>>   \t/* Initialize the camera properties. */\n>>   \tdata->properties_ = data->sensor_->properties();\n>>   \n>> -\t/*\n>> -\t * \\todo Read delay values from the sensor itself or from a\n>> -\t * a sensor database. For now use generic values taken from\n>> -\t * the Raspberry Pi and listed as generic values.\n>> -\t */\n>> +\tconst CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();\n>>   \tstd::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n>> -\t\t{ V4L2_CID_ANALOGUE_GAIN, { 1, false } },\n>> -\t\t{ V4L2_CID_EXPOSURE, { 2, false } },\n>> +\t\t{ V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n>> +\t\t{ V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>>   \t};\n>>   \n>>   \tdata->delayedCtrls_ =\n>> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n>> index 41fdf84c..dae9f31f 100644\n>> --- a/src/libcamera/pipeline/simple/simple.cpp\n>> +++ b/src/libcamera/pipeline/simple/simple.cpp\n>> @@ -31,6 +31,7 @@\n>>   \n>>   #include \"libcamera/internal/camera.h\"\n>>   #include \"libcamera/internal/camera_sensor.h\"\n>> +#include \"libcamera/internal/camera_sensor_properties.h\"\n>>   #include \"libcamera/internal/converter.h\"\n>>   #include \"libcamera/internal/delayed_controls.h\"\n>>   #include \"libcamera/internal/device_enumerator.h\"\n>> @@ -1290,9 +1291,10 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>>   \tif (outputCfgs.empty())\n>>   \t\treturn 0;\n>>   \n>> +\tconst CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();\n>>   \tstd::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n>> -\t\t{ V4L2_CID_ANALOGUE_GAIN, { 2, false } },\n>> -\t\t{ V4L2_CID_EXPOSURE, { 2, false } },\n>> +\t\t{ V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n>> +\t\t{ V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n>>   \t};\n>>   \tdata->delayedCtrls_ =\n>>   \t\tstd::make_unique<DelayedControls>(data->sensor_->device(),","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 74816C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Nov 2024 09:06:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C3188660A7;\n\tWed, 27 Nov 2024 10:06:19 +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 907FC660A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Nov 2024 10:06:17 +0100 (CET)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 312D9792;\n\tWed, 27 Nov 2024 10:05:54 +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=\"Eqkq+ZKC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732698354;\n\tbh=xUunatwnNs+0ZHJMP5de/OT5Pdeas3afCRAAwu+Xmvg=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=Eqkq+ZKCn1hOzrzuoz/rn95lppbRJpmgxQCvJvV8ZldmrkqBKbB8OXXTRR4pawk+7\n\tQ+rO8FhtvCeHShhIbtT+kiWVRzH5cdJ4rQYDXpOo+BAXpSlA5wKh7gBhCYHSEtTrH9\n\tBo/ybWWIVS0O+qaymLaTYLmz90Q6ZzbHsO1Zbq84=","Message-ID":"<d0018135-9e1d-43f9-8945-aeff76c0e0d1@ideasonboard.com>","Date":"Wed, 27 Nov 2024 09:06:14 +0000","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v5 2/2] libcamera: pipelines: Draw control delays from\n\tCameraSensor properties","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, mike.rudenko@gmail.com,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>","References":"<20241126151203.108407-1-dan.scally@ideasonboard.com>\n\t<20241126151203.108407-3-dan.scally@ideasonboard.com>\n\t<20241127070159.GS5461@pendragon.ideasonboard.com>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\txsFNBGLydlEBEADa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F-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}}]