[{"id":22493,"web_url":"https://patchwork.libcamera.org/comment/22493/","msgid":"<4b7b3207-6af8-2d58-00ec-403629b44a54@gmx.de>","date":"2022-03-28T20:38:54","subject":"Re: [libcamera-devel] [PATCH] fix ControlInfo for Span Controls","submitter":{"id":111,"url":"https://patchwork.libcamera.org/api/people/111/","name":"Christian Rauch","email":"Rauch.Christian@gmx.de"},"content":"Hi,\n\nThis patch may have got lost because I was sending it multiple times in\ndifferent forms.\n\nIs this something that can be reviewed?\n\nBest,\nChristian\n\n\nAm 21.03.22 um 23:02 schrieb Christian Rauch:\n> Some control properties are typed with a Span to store an array of values.\n> Currently those are ColourGains, SensorBlackLevels, ColourCorrectionMatrix\n> and FrameDurationLimits. The value range and defaults in the ControlInfo of\n> those Controls is currently defined as scalar. This prevents accessing the\n> ControlInfo via the native Span type.\n>\n> By defining the ControlInfo in terms of Spans, we can avoid this issue.\n> ---\n>  include/libcamera/ipa/raspberrypi.h           | 52 ++++++++++++-------\n>  src/ipa/ipu3/ipu3.cpp                         |  6 +--\n>  .../ipa_data_serializer_test.cpp              |  8 +--\n>  3 files changed, 40 insertions(+), 26 deletions(-)\n>\n> diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\n> index 7f705e49..fb5188a1 100644\n> --- a/include/libcamera/ipa/raspberrypi.h\n> +++ b/include/libcamera/ipa/raspberrypi.h\n> @@ -27,26 +27,38 @@ namespace RPi {\n>   * and the pipeline handler may be reverted so that it aborts when an\n>   * unsupported control is encountered.\n>   */\n> -static const ControlInfoMap Controls({\n> -\t\t{ &controls::AeEnable, ControlInfo(false, true) },\n> -\t\t{ &controls::ExposureTime, ControlInfo(0, 999999) },\n> -\t\t{ &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },\n> -\t\t{ &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },\n> -\t\t{ &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },\n> -\t\t{ &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n> -\t\t{ &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },\n> -\t\t{ &controls::AwbEnable, ControlInfo(false, true) },\n> -\t\t{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },\n> -\t\t{ &controls::AwbMode, ControlInfo(controls::AwbModeValues) },\n> -\t\t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n> -\t\t{ &controls::Contrast, ControlInfo(0.0f, 32.0f) },\n> -\t\t{ &controls::Saturation, ControlInfo(0.0f, 32.0f) },\n> -\t\t{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n> -\t\t{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },\n> -\t\t{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n> -\t\t{ &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },\n> -\t\t{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }\n> -\t}, controls::controls);\n> +static const ControlInfoMap Controls(\n> +\t{ { &controls::AeEnable, ControlInfo(false, true) },\n> +\t  { &controls::ExposureTime, ControlInfo(0, 999999) },\n> +\t  { &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },\n> +\t  { &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },\n> +\t  { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },\n> +\t  { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n> +\t  { &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },\n> +\t  { &controls::AwbEnable, ControlInfo(false, true) },\n> +\t  { &controls::ColourGains, ControlInfo{\n> +\t\t\t\t\t    Span<const float>({ 0, 0 }),\n> +\t\t\t\t\t    Span<const float>({ 32, 32 }),\n> +\t\t\t\t\t    Span<const float>({ 0, 0 }),\n> +\t\t\t\t    } },\n> +\t  { &controls::AwbMode, ControlInfo(controls::AwbModeValues) },\n> +\t  { &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n> +\t  { &controls::Contrast, ControlInfo(0.0f, 32.0f) },\n> +\t  { &controls::Saturation, ControlInfo(0.0f, 32.0f) },\n> +\t  { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n> +\t  { &controls::ColourCorrectionMatrix, ControlInfo{\n> +\t\t\t\t\t\t       Span<const float>({ -16, -16, -16, -16, -16, -16, -16, -16, -16 }),\n> +\t\t\t\t\t\t       Span<const float>({ 16, 16, 16, 16, 16, 16, 16, 16, 16 }),\n> +\t\t\t\t\t\t       Span<const float>({ 1, 0, 0, 0, 1, 0, 0, 0, 1 }),\n> +\t\t\t\t\t       } },\n> +\t  { &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n> +\t  { &controls::FrameDurationLimits, ControlInfo{\n> +\t\t\t\t\t\t    Span<const int64_t>({ 1000, 1000 }),\n> +\t\t\t\t\t\t    Span<const int64_t>({ 1000000000, 1000000000 }),\n> +\t\t\t\t\t\t    Span<const int64_t>({ 1000, 1000 }),\n> +\t\t\t\t\t    } },\n> +\t  { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) } },\n> +\tcontrols::controls);\n>\n>  } /* namespace RPi */\n>\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 1ea2c898..e64fc2bb 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -267,9 +267,9 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo,\n>  \t\tframeDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);\n>  \t}\n>\n> -\tcontrols[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],\n> -\t\t\t\t\t\t\t       frameDurations[1],\n> -\t\t\t\t\t\t\t       frameDurations[2]);\n> +\tcontrols[&controls::FrameDurationLimits] = ControlInfo{ Span<const int64_t>({ frameDurations[0], frameDurations[0] }),\n> +\t\t\t\t\t\t\t\tSpan<const int64_t>({ frameDurations[1], frameDurations[1] }),\n> +\t\t\t\t\t\t\t\tSpan<const int64_t>({ frameDurations[2], frameDurations[2] }) };\n>\n>  \t*ipaControls = ControlInfoMap(std::move(controls), controls::controls);\n>  }\n> diff --git a/test/serialization/ipa_data_serializer_test.cpp b/test/serialization/ipa_data_serializer_test.cpp\n> index d2050a86..5503cc8a 100644\n> --- a/test/serialization/ipa_data_serializer_test.cpp\n> +++ b/test/serialization/ipa_data_serializer_test.cpp\n> @@ -32,13 +32,15 @@\n>  using namespace std;\n>  using namespace libcamera;\n>\n> -static const ControlInfoMap Controls = ControlInfoMap({\n> +static const ControlInfoMap Controls = ControlInfoMap(\n> +\t{\n>  \t\t{ &controls::AeEnable, ControlInfo(false, true) },\n>  \t\t{ &controls::ExposureTime, ControlInfo(0, 999999) },\n>  \t\t{ &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },\n> -\t\t{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },\n> +\t\t{ &controls::ColourGains, ControlInfo{ Span<const float>({ 0, 0 }), Span<const float>({ 32, 32 }), Span<const float>({ 0, 0 }) } },\n>  \t\t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n> -\t}, controls::controls);\n> +\t},\n> +\tcontrols::controls);\n>\n>  namespace libcamera {\n>\n> --\n> 2.25.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 15B7AC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Mar 2022 20:38:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5FD9765633;\n\tMon, 28 Mar 2022 22:38:56 +0200 (CEST)","from mout.gmx.net (mout.gmx.net [212.227.15.19])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 841CC604C0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Mar 2022 22:38:55 +0200 (CEST)","from [192.168.1.209] ([92.10.251.63]) by mail.gmx.net (mrgmx004\n\t[212.227.17.190]) with ESMTPSA (Nemesis) id 1MWRVh-1nWXg53kr5-00Xswr\n\tfor\n\t<libcamera-devel@lists.libcamera.org>; Mon, 28 Mar 2022 22:38:54 +0200"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648499936;\n\tbh=5cCvPkZiIcLBQcWk432ZYXtGGhE5BMR8kadDqWpeDBE=;\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:\n\tFrom;\n\tb=2GeHEkezELJ0z4IzSX+KcdFgUWsWrBL93aBf3lAH9o1thtrCGsWqtpd5Q8fMulayu\n\t1WIjNvydun1S8KUo9Gm6jbym0XXdc15AfTaYTBWXSySmcisPlFcWlnp+zAGp4k88z2\n\tgkJ8hW1872nlzbTVnzMgu+YOjO7P2jfliJC2n5oHHNGPQcfP3xhifDD1Xxt0GotrvY\n\t66D/zIqbqWcgkbcLhGqOFwIF1JX2BDUkVgCAFQQbUNrYRSpi5l94uAmguEHkUQul7N\n\tfncftmeE24y8Z1oZkPrqai3amOUV1TgpiM8JxGS+QR8r7aOxuq4C4B7qiPoUwS2vkn\n\tEEAB/XvbG78iA==","v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;\n\ts=badeba3b8450; t=1648499935;\n\tbh=5cCvPkZiIcLBQcWk432ZYXtGGhE5BMR8kadDqWpeDBE=;\n\th=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To;\n\tb=RQ5VVFGM0WWsoUhTrHN8+51vEom5l5YlFN0wSHnxdJ/yHEPDz+z1HrLATWCeeeeoo\n\tnggRbo3pR3//P1wJG/tcGeC7G0/i3jkQOcQfFHGMlisxROn0uFUf7v+y5fOKx88XAy\n\tEyugoCTfA7nLVcEMSujPHODF0nSsgH+/5K+V1VyA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=gmx.net header.i=@gmx.net\n\theader.b=\"RQ5VVFGM\"; dkim-atps=neutral","X-UI-Sender-Class":"01bb95c1-4bf8-414a-932a-4f6e2808ef9c","Message-ID":"<4b7b3207-6af8-2d58-00ec-403629b44a54@gmx.de>","Date":"Mon, 28 Mar 2022 21:38:54 +0100","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.7.0","Content-Language":"en-CA","To":"libcamera-devel@lists.libcamera.org","References":"<20220321230246.663401-1-Rauch.Christian@gmx.de>","In-Reply-To":"<20220321230246.663401-1-Rauch.Christian@gmx.de>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"quoted-printable","X-Provags-ID":"V03:K1:7BUWhqYXi02DUcPBqx+hPCDNh3fRTyOpJcd/foPD7/Py40NJ4lW\n\t/8OGnFm1Q+mV2e9XRPA9Uo1D5UsNXumnp7DyINWpmoOS1vdc/QR0qvLvGH7uO1igUR9MXmZ\n\ty6xgUN9LStwzhgDg5MXR+FucJu+uTKcFpAuZV/1K+hdZbVMgk1RK59vzY0VaDAGDgawUqVk\n\tUeDbYT7JT8xoKLVX6av9g==","X-Spam-Flag":"NO","X-UI-Out-Filterresults":"notjunk:1; V03:K0:zz+QbOnGEIc=:1LLP+4md2+UAF9202ZhmgI\n\tuEjo7DvQRptANREKZPKShVbvi+EAl9vrmlLnY02aTy3pv2ugwrG+KKZMF4v9HkIR9RourDt/s\n\twEghNPSseaKP4mTopyPMOl+6hlnjHa+aKTXSOzYO5SC3kpqQ2MQqk+jgHQVpm04HqcunCbmDh\n\tymIqiqmaNgf15OQxoK/Hgo3/cfpgUpkNJNIC1A/c3DC1zWjTYh9fn+4g3mL/brpCq6ctVet0u\n\tsyYsiqDS3iarWG+8JSSFbzZK7p673rbGnsKKhX5mafVhXehU9RmopTNoAgPW/EhYIkUUu6WuT\n\tur+/lItEW0RDt0s43Z142eZHrIz/9boeNYHp3L+9sKhFac2qyUM8/11hGmcVaZ6ZlHMXJdDTd\n\tSr+zr+ux2eCx+JxNMjxizfn0C2cjuBHCSI7YakIkdd9DmFyk4Ako7ZJMcJndEns8mF/AODGrv\n\tSInGQbjqUes5ReqqTx5W2FMffAjSff+GS+bZzGkqEpMk3BnX+q57fQZhGbhxaF2h/LbbqrLxl\n\t0Dh9In4zBasEHJ5eabodS6e5e6gudEbmLSnXDE3UrLswc/PWAC+990LRS78QA5bF7DIAdAEdH\n\tnVYoPYQd20A5B8MyUE/MsF5DvB1cQEW2EhMU88QOQS6ki77WaScxd3SuYQGjOcVRouM0nXd+G\n\tJnDKP/vkmA9ohFy3U3AZH8uex5Id/SwJIkCo5wfFKoHjxvSJscgGgNfUqMtq8+02841aDVRba\n\t1jNN0m0eEi1PNpH+7Vb3fGnnOh964fXCE+Ekjg8ZHD/2r+ocmIiirDb0caSXL8I9/5vYRB9ss\n\t2PBzprj3e4rHrp9yoreOAshUSENv+cxl/2PPCkAj7j6PhN5CxGzv4cHghe2w4Pfl7y800NrTE\n\tDCEyEGZpihlWLhPnqStk165CsFX9J2itNqgLvr/KEPuwIIZxBZjRhzW9jFtcy/TdPrc/46eOe\n\tLH3xC/SFJvyIL5vUzw7XtVkCuobZF03s06wfRB3ss3BLVKLFwYlJvH6qdAHMsfs9juTxGBX7E\n\tIlWhV8MvlvZ4bIyHdyGyEL8GfnKIirbtfMgLmiIlGzPxaQ3/GM6BOKxQ/0AtSQP72chJjon43\n\tqQyjas+J9ce0fA=","Subject":"Re: [libcamera-devel] [PATCH] fix ControlInfo for Span Controls","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":"Christian Rauch via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Christian Rauch <Rauch.Christian@gmx.de>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22507,"web_url":"https://patchwork.libcamera.org/comment/22507/","msgid":"<20220329070832.qp5tyd4tycr6lu5d@uno.localdomain>","date":"2022-03-29T07:08:32","subject":"Re: [libcamera-devel] [PATCH] fix ControlInfo for Span Controls","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Christian\n\nOn Mon, Mar 28, 2022 at 09:38:54PM +0100, Christian Rauch via libcamera-devel wrote:\n> Hi,\n>\n> This patch may have got lost because I was sending it multiple times in\n> different forms.\n\nLaurent has left review comments on your previous versions:\nhttps://patchwork.libcamera.org/patch/15477/#22343\n\nThe most relevant of which is, in my opinion, about how to define what\nmax min and def are for arrays.\n\nFeel free to reply to the comments on the previous version of the\npatch.\n\nThanks\n  j\n\n>\n> Is this something that can be reviewed?\n>\n> Best,\n> Christian\n>\n>\n> Am 21.03.22 um 23:02 schrieb Christian Rauch:\n> > Some control properties are typed with a Span to store an array of values.\n> > Currently those are ColourGains, SensorBlackLevels, ColourCorrectionMatrix\n> > and FrameDurationLimits. The value range and defaults in the ControlInfo of\n> > those Controls is currently defined as scalar. This prevents accessing the\n> > ControlInfo via the native Span type.\n> >\n> > By defining the ControlInfo in terms of Spans, we can avoid this issue.\n> > ---\n> >  include/libcamera/ipa/raspberrypi.h           | 52 ++++++++++++-------\n> >  src/ipa/ipu3/ipu3.cpp                         |  6 +--\n> >  .../ipa_data_serializer_test.cpp              |  8 +--\n> >  3 files changed, 40 insertions(+), 26 deletions(-)\n> >\n> > diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\n> > index 7f705e49..fb5188a1 100644\n> > --- a/include/libcamera/ipa/raspberrypi.h\n> > +++ b/include/libcamera/ipa/raspberrypi.h\n> > @@ -27,26 +27,38 @@ namespace RPi {\n> >   * and the pipeline handler may be reverted so that it aborts when an\n> >   * unsupported control is encountered.\n> >   */\n> > -static const ControlInfoMap Controls({\n> > -\t\t{ &controls::AeEnable, ControlInfo(false, true) },\n> > -\t\t{ &controls::ExposureTime, ControlInfo(0, 999999) },\n> > -\t\t{ &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },\n> > -\t\t{ &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },\n> > -\t\t{ &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },\n> > -\t\t{ &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n> > -\t\t{ &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },\n> > -\t\t{ &controls::AwbEnable, ControlInfo(false, true) },\n> > -\t\t{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },\n> > -\t\t{ &controls::AwbMode, ControlInfo(controls::AwbModeValues) },\n> > -\t\t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n> > -\t\t{ &controls::Contrast, ControlInfo(0.0f, 32.0f) },\n> > -\t\t{ &controls::Saturation, ControlInfo(0.0f, 32.0f) },\n> > -\t\t{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n> > -\t\t{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },\n> > -\t\t{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n> > -\t\t{ &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },\n> > -\t\t{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }\n> > -\t}, controls::controls);\n> > +static const ControlInfoMap Controls(\n> > +\t{ { &controls::AeEnable, ControlInfo(false, true) },\n> > +\t  { &controls::ExposureTime, ControlInfo(0, 999999) },\n> > +\t  { &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },\n> > +\t  { &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },\n> > +\t  { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },\n> > +\t  { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n> > +\t  { &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },\n> > +\t  { &controls::AwbEnable, ControlInfo(false, true) },\n> > +\t  { &controls::ColourGains, ControlInfo{\n> > +\t\t\t\t\t    Span<const float>({ 0, 0 }),\n> > +\t\t\t\t\t    Span<const float>({ 32, 32 }),\n> > +\t\t\t\t\t    Span<const float>({ 0, 0 }),\n> > +\t\t\t\t    } },\n> > +\t  { &controls::AwbMode, ControlInfo(controls::AwbModeValues) },\n> > +\t  { &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n> > +\t  { &controls::Contrast, ControlInfo(0.0f, 32.0f) },\n> > +\t  { &controls::Saturation, ControlInfo(0.0f, 32.0f) },\n> > +\t  { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n> > +\t  { &controls::ColourCorrectionMatrix, ControlInfo{\n> > +\t\t\t\t\t\t       Span<const float>({ -16, -16, -16, -16, -16, -16, -16, -16, -16 }),\n> > +\t\t\t\t\t\t       Span<const float>({ 16, 16, 16, 16, 16, 16, 16, 16, 16 }),\n> > +\t\t\t\t\t\t       Span<const float>({ 1, 0, 0, 0, 1, 0, 0, 0, 1 }),\n> > +\t\t\t\t\t       } },\n> > +\t  { &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n> > +\t  { &controls::FrameDurationLimits, ControlInfo{\n> > +\t\t\t\t\t\t    Span<const int64_t>({ 1000, 1000 }),\n> > +\t\t\t\t\t\t    Span<const int64_t>({ 1000000000, 1000000000 }),\n> > +\t\t\t\t\t\t    Span<const int64_t>({ 1000, 1000 }),\n> > +\t\t\t\t\t    } },\n> > +\t  { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) } },\n> > +\tcontrols::controls);\n> >\n> >  } /* namespace RPi */\n> >\n> > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> > index 1ea2c898..e64fc2bb 100644\n> > --- a/src/ipa/ipu3/ipu3.cpp\n> > +++ b/src/ipa/ipu3/ipu3.cpp\n> > @@ -267,9 +267,9 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo,\n> >  \t\tframeDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);\n> >  \t}\n> >\n> > -\tcontrols[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],\n> > -\t\t\t\t\t\t\t       frameDurations[1],\n> > -\t\t\t\t\t\t\t       frameDurations[2]);\n> > +\tcontrols[&controls::FrameDurationLimits] = ControlInfo{ Span<const int64_t>({ frameDurations[0], frameDurations[0] }),\n> > +\t\t\t\t\t\t\t\tSpan<const int64_t>({ frameDurations[1], frameDurations[1] }),\n> > +\t\t\t\t\t\t\t\tSpan<const int64_t>({ frameDurations[2], frameDurations[2] }) };\n> >\n> >  \t*ipaControls = ControlInfoMap(std::move(controls), controls::controls);\n> >  }\n> > diff --git a/test/serialization/ipa_data_serializer_test.cpp b/test/serialization/ipa_data_serializer_test.cpp\n> > index d2050a86..5503cc8a 100644\n> > --- a/test/serialization/ipa_data_serializer_test.cpp\n> > +++ b/test/serialization/ipa_data_serializer_test.cpp\n> > @@ -32,13 +32,15 @@\n> >  using namespace std;\n> >  using namespace libcamera;\n> >\n> > -static const ControlInfoMap Controls = ControlInfoMap({\n> > +static const ControlInfoMap Controls = ControlInfoMap(\n> > +\t{\n> >  \t\t{ &controls::AeEnable, ControlInfo(false, true) },\n> >  \t\t{ &controls::ExposureTime, ControlInfo(0, 999999) },\n> >  \t\t{ &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },\n> > -\t\t{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },\n> > +\t\t{ &controls::ColourGains, ControlInfo{ Span<const float>({ 0, 0 }), Span<const float>({ 32, 32 }), Span<const float>({ 0, 0 }) } },\n> >  \t\t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n> > -\t}, controls::controls);\n> > +\t},\n> > +\tcontrols::controls);\n> >\n> >  namespace libcamera {\n> >\n> > --\n> > 2.25.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 B7119C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Mar 2022 07:08:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 239FB65633;\n\tTue, 29 Mar 2022 09:08:36 +0200 (CEST)","from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7BEA9604BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Mar 2022 09:08:34 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 06970FF806;\n\tTue, 29 Mar 2022 07:08:33 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648537716;\n\tbh=4hm3wMNZyPhr/Pl6U/rEWXCqoPPyGF/kt048nAEiTds=;\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=sLDPabk8rIEZMF2TrShzzzGbO6Vn82wZESz842+IoQavjkmJFzzTsaq/BmHKG6MLS\n\tMDHvty/3Zqm2AeCsIEga+fbZaBPXVjh8cMYJ7eYtvZlRPzXMrqlWGb1gtT+msnNy2C\n\tKhs7Ck74qsMyOBw0lyZQmqdv6tb+GWyBNmGkHYSkR1fYsQUaojxpWHAt4A2Jznp88Z\n\tJyXLI5A7mWYkQmPwhekYDSwL/qe2nsu6QSpiUERocENP+4GmabQ6WWPNua3bDTuFAJ\n\tLMmk2nNLtWreI7pywOK17eEW/rSq4QOV8u6vtsxJkzwoaKjTO8xQJzM2RvbpSfzxuV\n\t5U0tUMle0TBPg==","Date":"Tue, 29 Mar 2022 09:08:32 +0200","To":"Christian Rauch <Rauch.Christian@gmx.de>","Message-ID":"<20220329070832.qp5tyd4tycr6lu5d@uno.localdomain>","References":"<20220321230246.663401-1-Rauch.Christian@gmx.de>\n\t<4b7b3207-6af8-2d58-00ec-403629b44a54@gmx.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<4b7b3207-6af8-2d58-00ec-403629b44a54@gmx.de>","Subject":"Re: [libcamera-devel] [PATCH] fix ControlInfo for Span Controls","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]