{"id":23577,"url":"https://patchwork.libcamera.org/api/1.1/patches/23577/?format=json","web_url":"https://patchwork.libcamera.org/patch/23577/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250616100900.1524567-1-barnabas.pocze@ideasonboard.com>","date":"2025-06-16T10:09:00","name":"[v2] ipa: rpi: Initialize enum controls with a list of values","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a14438c00b842c2c96530f8f6c77f518eca07199","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/1.1/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23577/mbox/","series":[{"id":5221,"url":"https://patchwork.libcamera.org/api/1.1/series/5221/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5221","date":"2025-06-16T10:09:00","name":"[v2] ipa: rpi: Initialize enum controls with a list of values","version":2,"mbox":"https://patchwork.libcamera.org/series/5221/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23577/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23577/checks/","tags":{},"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 B8D46BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Jun 2025 10:09:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C059C68DCF;\n\tMon, 16 Jun 2025 12:09:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C83AB68DC7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 12:09:03 +0200 (CEST)","from pb-laptop.local (185.221.143.107.nat.pool.zt.hu\n\t[185.221.143.107])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1F074752\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 12:08:52 +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=\"EQWwMVEN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1750068532;\n\tbh=WDt0jLyowGrZN4PRQNWG0O/hMRtwMrrjpITSPrsY6Lk=;\n\th=From:To:Subject:Date:From;\n\tb=EQWwMVENpw3o0Zcs+8pIOmh2sVuf3Ritz51Y6fccn/K9Gfj0bl6Um1G+CFO2MGllL\n\teB/BKYFpRY5bCG6OtzPEMc2qPBmCpJq9+aeWDsupIhf+JEi390Atm1PMsoil4wRZhY\n\tKkCDT4YOpUC2vwcRQX76NryHY3+GkMuoc+qXtSNE=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v2] ipa: rpi: Initialize enum controls with a list of values","Date":"Mon, 16 Jun 2025 12:09:00 +0200","Message-ID":"<20250616100900.1524567-1-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.49.0","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","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>"},"content":"This is how uvcvideo and rkisp1 do it. See ee918b370a08b\n(\"ipa: rkisp1: agc: Initialize enum controls with a list of values\")\nfor the motivation. In summary, having a list of values is used as a sign\nthat the control is an enum in multiple places (e.g. `cam`, `camshark`).\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\nchanges in v2:\n  * specify all supported values explicitly\n\nv1: 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--\n2.49.0","diff":"diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\nindex 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) },\n","prefixes":["v2"]}