{"id":17559,"url":"https://patchwork.libcamera.org/api/1.1/patches/17559/?format=json","web_url":"https://patchwork.libcamera.org/patch/17559/","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":"<20221006230747.11688-5-laurent.pinchart@ideasonboard.com>","date":"2022-10-06T23:07:47","name":"[libcamera-devel,v2,4/4] ipa: raspberrypi: Remove unneeded Span casts","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"562422bc20da73dd986bea51d9c9f16743a71e99","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17559/mbox/","series":[{"id":3541,"url":"https://patchwork.libcamera.org/api/1.1/series/3541/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3541","date":"2022-10-06T23:07:43","name":"libcamera: Improve handling of fixed-size array controls","version":2,"mbox":"https://patchwork.libcamera.org/series/3541/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17559/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17559/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 0278CBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Oct 2022 23:08:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A7A9C62D15;\n\tFri,  7 Oct 2022 01:08:02 +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 2AE2562D12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  7 Oct 2022 01:08:01 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A51B16D6;\n\tFri,  7 Oct 2022 01:08:00 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665097682;\n\tbh=wPRX9qYEUtVsq1h35g13Cuk4X6YvkP3ZOA1nlRHv5sI=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=N75PBoz24Ox6x/oXaBaAIblDOMpssRhXxM8POhbic8hsBjmrM0Dlb9W7aOQ24x3np\n\tQwdIqOXcqytHKTx74dO803jf7H4CBe4yXEYFzU2dQeDyWpIA/2JArNlNFwsy506/Kw\n\tQMpvXCeBThMh56e9gVszKkSylIP2sxIpbQeQPdzAtnC5SW2YUU4sdk1R8zGHvKD6IY\n\tvgKiCh1Kdbcxz11qdSFqXaJDU0nYNIhjJo7qmGwjm4hhet5jbn97sSyqvRjG88CH7y\n\tqMlZB4grO9YXZtLPAECo2cmWNGd5Z+zbmWKbAkd8sGV0VVTFQeuoOQvFhnKpMpyD23\n\tDLCYSw0BNclrg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665097680;\n\tbh=wPRX9qYEUtVsq1h35g13Cuk4X6YvkP3ZOA1nlRHv5sI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=BbvTtrnvkvtpvJy5D6TUbnTTkAdc3ICL8HQT8nRhQIf/CAMAcsrYrVwnL/xFW3JvD\n\tu26BwyLUhOo9eLQI0/SgZ/9aiMo/Y5U6dh/kbEUOJ8FuFXhzoE9nmbxlHD4EMbOeNg\n\tR5Fp0OIM2OrVlUOPkmAWlQ/dOaDTIgAkadq3hIa0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"BbvTtrnv\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  7 Oct 2022 02:07:47 +0300","Message-Id":"<20221006230747.11688-5-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20221006230747.11688-1-laurent.pinchart@ideasonboard.com>","References":"<20221006230747.11688-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 4/4] ipa: raspberrypi: Remove unneeded\n\tSpan casts","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Commit 09c1b081baa2 (\"libcamera: controls: Generate and use fixed-sized\nSpan types\") added explicit Span casts for fixed extent spans that were\nrequired due to the ControlList::set() function that takes an\nstd::initializer_list not being able to infer a control size from\ntemplate arguments. This has now been fixed, so the casts are not needed\nanymore. Drop them.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Christian Rauch <Rauch.Christian@gmx.de>\n---\n src/ipa/raspberrypi/raspberrypi.cpp | 19 +++++++++----------\n 1 file changed, 9 insertions(+), 10 deletions(-)","diff":"diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 8d731435764e..14b06a4feae6 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -566,19 +566,18 @@ void IPARPi::reportMetadata()\n \n \tAwbStatus *awbStatus = rpiMetadata_.getLocked<AwbStatus>(\"awb.status\");\n \tif (awbStatus) {\n-\t\tlibcameraMetadata_.set(controls::ColourGains,\n-\t\t\t\t       Span<const float, 2>({ static_cast<float>(awbStatus->gainR),\n-\t\t\t\t\t\t\t      static_cast<float>(awbStatus->gainB) }));\n+\t\tlibcameraMetadata_.set(controls::ColourGains, { static_cast<float>(awbStatus->gainR),\n+\t\t\t\t\t\t\t\tstatic_cast<float>(awbStatus->gainB) });\n \t\tlibcameraMetadata_.set(controls::ColourTemperature, awbStatus->temperatureK);\n \t}\n \n \tBlackLevelStatus *blackLevelStatus = rpiMetadata_.getLocked<BlackLevelStatus>(\"black_level.status\");\n \tif (blackLevelStatus)\n \t\tlibcameraMetadata_.set(controls::SensorBlackLevels,\n-\t\t\t\t       Span<const int32_t, 4>({ static_cast<int32_t>(blackLevelStatus->blackLevelR),\n-\t\t\t\t\t\t\t\tstatic_cast<int32_t>(blackLevelStatus->blackLevelG),\n-\t\t\t\t\t\t\t\tstatic_cast<int32_t>(blackLevelStatus->blackLevelG),\n-\t\t\t\t\t\t\t\tstatic_cast<int32_t>(blackLevelStatus->blackLevelB) }));\n+\t\t\t\t       { static_cast<int32_t>(blackLevelStatus->blackLevelR),\n+\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->blackLevelG),\n+\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->blackLevelG),\n+\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->blackLevelB) });\n \n \tFocusStatus *focusStatus = rpiMetadata_.getLocked<FocusStatus>(\"focus.status\");\n \tif (focusStatus && focusStatus->num == 12) {\n@@ -883,7 +882,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\tif (gains[0] != 0.0f && gains[1] != 0.0f)\n \t\t\t\t/* A gain of 0.0f will switch back to auto mode. */\n \t\t\t\tlibcameraMetadata_.set(controls::ColourGains,\n-\t\t\t\t\t\t       Span<const float, 2>({ gains[0], gains[1] }));\n+\t\t\t\t\t\t       { gains[0], gains[1] });\n \t\t\tbreak;\n \t\t}\n \n@@ -1167,8 +1166,8 @@ void IPARPi::applyFrameDurations(Duration minFrameDuration, Duration maxFrameDur\n \n \t/* Return the validated limits via metadata. */\n \tlibcameraMetadata_.set(controls::FrameDurationLimits,\n-\t\t\t       Span<const int64_t, 2>({ static_cast<int64_t>(minFrameDuration_.get<std::micro>()),\n-\t\t\t\t\t\t\tstatic_cast<int64_t>(maxFrameDuration_.get<std::micro>()) }));\n+\t\t\t       { static_cast<int64_t>(minFrameDuration_.get<std::micro>()),\n+\t\t\t\t static_cast<int64_t>(maxFrameDuration_.get<std::micro>()) });\n \n \t/*\n \t * Calculate the maximum exposure time possible for the AGC to use.\n","prefixes":["libcamera-devel","v2","4/4"]}