[{"id":34474,"web_url":"https://patchwork.libcamera.org/comment/34474/","msgid":"<CAEmqJPrRUax1330w0Ti+prm9_AWH4yDNMNRBQF4a5Nr5-LxLQA@mail.gmail.com>","date":"2025-06-16T11:24:59","subject":"Re: [PATCH v2] ipa: rpi: Initialize enum controls with a list of\n\tvalues","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Barnabás,\n\nLooks reasonable to me.\n\nOn Mon, 16 Jun 2025 at 11:09, Barnabás Pőcze\n<barnabas.pocze@ideasonboard.com> wrote:\n>\n> This is how uvcvideo and rkisp1 do it. See ee918b370a08b\n> (\"ipa: rkisp1: agc: Initialize enum controls with a list of values\")\n> for the motivation. In summary, having a list of values is used as a sign\n> that the control is an enum in multiple places (e.g. `cam`, `camshark`).\n>\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n> ---\n> changes in v2:\n>   * specify all supported values explicitly\n>\n> v1: https://patchwork.libcamera.org/patch/23505/\n> ---\n>  src/ipa/rpi/common/ipa_base.cpp | 19 ++++++++++---------\n>  1 file changed, 10 insertions(+), 9 deletions(-)\n>\n> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> index 50e25f057..6565f5366 100644\n> --- a/src/ipa/rpi/common/ipa_base.cpp\n> +++ b/src/ipa/rpi/common/ipa_base.cpp\n> @@ -58,23 +58,24 @@ const ControlInfoMap::Map ipaControls{\n>         /* \\todo Move this to the Camera class */\n>         { &controls::AeEnable, ControlInfo(false, true, true) },\n>         { &controls::ExposureTimeMode,\n> -         ControlInfo(static_cast<int32_t>(controls::ExposureTimeModeAuto),\n> -                     static_cast<int32_t>(controls::ExposureTimeModeManual),\n> -                     static_cast<int32_t>(controls::ExposureTimeModeAuto)) },\n> +         ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto),\n> +                         ControlValue(controls::ExposureTimeModeManual) } },\n> +                     ControlValue(controls::ExposureTimeModeAuto)) },\n>         { &controls::ExposureTime,\n>           ControlInfo(1, 66666, static_cast<int32_t>(defaultExposureTime.get<std::micro>())) },\n>         { &controls::AnalogueGainMode,\n> -         ControlInfo(static_cast<int32_t>(controls::AnalogueGainModeAuto),\n> -                     static_cast<int32_t>(controls::AnalogueGainModeManual),\n> -                     static_cast<int32_t>(controls::AnalogueGainModeAuto)) },\n> +         ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto),\n> +                         ControlValue(controls::AnalogueGainModeManual) } },\n> +                     ControlValue(controls::AnalogueGainModeAuto)) },\n>         { &controls::AnalogueGain, ControlInfo(1.0f, 16.0f, 1.0f) },\n>         { &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },\n>         { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },\n>         { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n>         { &controls::ExposureValue, ControlInfo(-8.0f, 8.0f, 0.0f) },\n> -       { &controls::AeFlickerMode, ControlInfo(static_cast<int>(controls::FlickerOff),\n> -                                               static_cast<int>(controls::FlickerManual),\n> -                                               static_cast<int>(controls::FlickerOff)) },\n> +       { &controls::AeFlickerMode,\n> +         ControlInfo({ { ControlValue(controls::FlickerOff),\n> +                         ControlValue(controls::FlickerManual) } },\n> +                     ControlValue(controls::FlickerOff)) },\n>         { &controls::AeFlickerPeriod, ControlInfo(100, 1000000) },\n>         { &controls::Brightness, ControlInfo(-1.0f, 1.0f, 0.0f) },\n>         { &controls::Contrast, ControlInfo(0.0f, 32.0f, 1.0f) },\n> --\n> 2.49.0","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 9BF38C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Jun 2025 11:25:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DBDBC68DC9;\n\tMon, 16 Jun 2025 13:25:38 +0200 (CEST)","from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com\n\t[IPv6:2607:f8b0:4864:20::e2e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BDCF768DC7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 13:25:36 +0200 (CEST)","by mail-vs1-xe2e.google.com with SMTP id\n\tada2fe7eead31-4e7f0697bb4so113775137.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 04:25:36 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"dQ8jJ6a6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1750073135; x=1750677935;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=aJgKWGk/igHJYEoSSS55tIdoQydOZVAURFeK4lPSmHk=;\n\tb=dQ8jJ6a6TDNQk4lqqAvsF+/PFRq9/a4zdxPvMKtBy/XkEN51h1lLt0RL3gOc3gL3cD\n\tUXPUgkbEkxCmu421UHXvq+iFvLAWmm7PzTdQYhrx+gEEvUr9oosFw6qFv5xHljG+J1R7\n\tBh+LrlSLNngm/HIJQ3JUrHI2a+OAJrkbRdLSJYEK+6DbRIor5bnL6QmG8iMKjfcw4pUv\n\tr9CQK7GZk4gy/yuHHG8ZY2VphFp4lfJPFf3PxFb/21rAgLZAbyo4+rtzNjrZEUTUUxHu\n\t0EEpjR1HAM0qHrXL/6+qrqubGzqsOD5LBr31h38P6dMV8YNEZ+OKNJ7J4Ibc53/migW/\n\tf7xg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1750073135; x=1750677935;\n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=aJgKWGk/igHJYEoSSS55tIdoQydOZVAURFeK4lPSmHk=;\n\tb=TL0dV2x+q12WpCeAtXfwJxCxy/dKYQx5HwKdcbJGyxxF5g979idn4RkqiZKNg15/yd\n\tUQnDHjztutzg9Xhg8+9sy5geCF6GPkdfgH87VM9ryZKgAlf6J5fFjxll0iIZnYdEL2aH\n\t8Xf7LMIOoapXGL9/2jhhTw5H2sYsiEwgRz2ekfWr/cte94QkabRI7/9kd2vQhJmSCVcI\n\tBZ/PF6I6XUCyXoZJ6ATyJ0PxEo3jgcuoCEhZ3PL8EgOsKm9wN7lhyyV9Z8Z0lwADmbI9\n\tn1MoZImtfVumyvyUzcWR/nMuZwKWWaSAp7FlKd8UG7jfuluXDvBBUTa1EmKWcQ07sVrS\n\t0XQw==","X-Gm-Message-State":"AOJu0YwjxBaWWGLbPvxwbpGOZB7gDTpCawNLdP2YejiDGHO7rNg9i9pN\n\tJ+mNAFWBGyPoyZ5fmCDKqd84LN2JTZjn61omymhIOdiPrs875RErP6t3Aw1KETZLfD+Gt9pO1gs\n\t9AmyygND+dMgwDZ/nokR8ZX0lTqoMEXjQ6tIHgpNXKg==","X-Gm-Gg":"ASbGncvbLQSLO1FDlZaGe7EAsaM3UOySu+Pg2urGGrbb7NAXPYdKtRTde8K1MGKQvDg\n\t1x0s/5x2dBpNqTrF4m0pXfSV8tny2dAW99V2wWcxhHbYNW70e06Te5inF3oZtLdogXsIrwDeNdu\n\tyWchyYClC06ibkQjc5aTBRBEb4X+6QZuPuylxLo6oD","X-Google-Smtp-Source":"AGHT+IEIA1W9Nib8NBJEAX4PF+QpbVjsgezvxE0isQx62MpajFWnzON6qrJ5zLoseb7/07GTgRiXmMOYs7rpwRvsN3U=","X-Received":"by 2002:a05:6102:2929:b0:4e5:a837:b0cd with SMTP id\n\tada2fe7eead31-4e7f6112eb1mr1689531137.1.1750073135408;\n\tMon, 16 Jun 2025 04:25:35 -0700 (PDT)","MIME-Version":"1.0","References":"<20250616100900.1524567-1-barnabas.pocze@ideasonboard.com>","In-Reply-To":"<20250616100900.1524567-1-barnabas.pocze@ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 16 Jun 2025 12:24:59 +0100","X-Gm-Features":"AX0GCFtMOsKQnNEY7zjWjYOFHzzBrOv9FdCYsGlyeBntZvXzhZ5SWda5jStvpHY","Message-ID":"<CAEmqJPrRUax1330w0Ti+prm9_AWH4yDNMNRBQF4a5Nr5-LxLQA@mail.gmail.com>","Subject":"Re: [PATCH v2] ipa: rpi: Initialize enum controls with a list of\n\tvalues","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","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":34475,"web_url":"https://patchwork.libcamera.org/comment/34475/","msgid":"<20250616120031.GY10542@pendragon.ideasonboard.com>","date":"2025-06-16T12:00:31","subject":"Re: [PATCH v2] ipa: rpi: Initialize enum controls with a list of\n\tvalues","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Jun 16, 2025 at 12:09:00PM +0200, Barnabás Pőcze wrote:\n> This is how uvcvideo and rkisp1 do it. See ee918b370a08b\n> (\"ipa: rkisp1: agc: Initialize enum controls with a list of values\")\n> for the motivation. In summary, having a list of values is used as a sign\n> that the control is an enum in multiple places (e.g. `cam`, `camshark`).\n> \n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> changes in v2:\n>   * specify all supported values explicitly\n> \n> v1: https://patchwork.libcamera.org/patch/23505/\n> ---\n>  src/ipa/rpi/common/ipa_base.cpp | 19 ++++++++++---------\n>  1 file changed, 10 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> index 50e25f057..6565f5366 100644\n> --- a/src/ipa/rpi/common/ipa_base.cpp\n> +++ b/src/ipa/rpi/common/ipa_base.cpp\n> @@ -58,23 +58,24 @@ const ControlInfoMap::Map ipaControls{\n>  \t/* \\todo Move this to the Camera class */\n>  \t{ &controls::AeEnable, ControlInfo(false, true, true) },\n>  \t{ &controls::ExposureTimeMode,\n> -\t  ControlInfo(static_cast<int32_t>(controls::ExposureTimeModeAuto),\n> -\t\t      static_cast<int32_t>(controls::ExposureTimeModeManual),\n> -\t\t      static_cast<int32_t>(controls::ExposureTimeModeAuto)) },\n> +\t  ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto),\n> +\t\t\t  ControlValue(controls::ExposureTimeModeManual) } },\n> +\t\t      ControlValue(controls::ExposureTimeModeAuto)) },\n>  \t{ &controls::ExposureTime,\n>  \t  ControlInfo(1, 66666, static_cast<int32_t>(defaultExposureTime.get<std::micro>())) },\n>  \t{ &controls::AnalogueGainMode,\n> -\t  ControlInfo(static_cast<int32_t>(controls::AnalogueGainModeAuto),\n> -\t\t      static_cast<int32_t>(controls::AnalogueGainModeManual),\n> -\t\t      static_cast<int32_t>(controls::AnalogueGainModeAuto)) },\n> +\t  ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto),\n> +\t\t\t  ControlValue(controls::AnalogueGainModeManual) } },\n> +\t\t      ControlValue(controls::AnalogueGainModeAuto)) },\n>  \t{ &controls::AnalogueGain, ControlInfo(1.0f, 16.0f, 1.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(-8.0f, 8.0f, 0.0f) },\n> -\t{ &controls::AeFlickerMode, ControlInfo(static_cast<int>(controls::FlickerOff),\n> -\t\t\t\t\t\tstatic_cast<int>(controls::FlickerManual),\n> -\t\t\t\t\t\tstatic_cast<int>(controls::FlickerOff)) },\n> +\t{ &controls::AeFlickerMode,\n> +\t  ControlInfo({ { ControlValue(controls::FlickerOff),\n> +\t\t\t  ControlValue(controls::FlickerManual) } },\n> +\t\t      ControlValue(controls::FlickerOff)) },\n>  \t{ &controls::AeFlickerPeriod, ControlInfo(100, 1000000) },\n>  \t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f, 0.0f) },\n>  \t{ &controls::Contrast, ControlInfo(0.0f, 32.0f, 1.0f) },","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 D6A95BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Jun 2025 12:00:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E255068DD0;\n\tMon, 16 Jun 2025 14:00:48 +0200 (CEST)","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 61EEB68DC7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 14:00:47 +0200 (CEST)","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 88FCB346;\n\tMon, 16 Jun 2025 14:00:35 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"u3X46RLt\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1750075235;\n\tbh=Zf+Th6b0AwCl/EcB//vb1IBdgCkTTqsi7QZVfb2b/34=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=u3X46RLt2V0RMa4OkT9AYCqjT/ZK+IEVUUsXVS78cUOU8cNGSusIKKov4OFf0IKXc\n\tI0eiVrz32kVuP0oEp4xDNFtwMYxxxgdy50GjBIJA8u+5jB4AZ2MRIXaMr+iCQTopwB\n\tHMu+sRRhV/8WTMUYjl3/mR6JzluON74ieoSTgFCs=","Date":"Mon, 16 Jun 2025 15:00:31 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2] ipa: rpi: Initialize enum controls with a list of\n\tvalues","Message-ID":"<20250616120031.GY10542@pendragon.ideasonboard.com>","References":"<20250616100900.1524567-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250616100900.1524567-1-barnabas.pocze@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>"}}]