[{"id":25347,"web_url":"https://patchwork.libcamera.org/comment/25347/","msgid":"<aaa121d7-436a-55ef-8a04-83d436661848@ideasonboard.com>","date":"2022-10-07T14:49:54","subject":"Re: [libcamera-devel] [PATCH v2 4/4] ipa: raspberrypi: Remove\n\tunneeded Span casts","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent\n\nThank you for the patch\n\nOn 10/7/22 4:37 AM, Laurent Pinchart via libcamera-devel wrote:\n> Commit 09c1b081baa2 (\"libcamera: controls: Generate and use fixed-sized\n> Span types\") added explicit Span casts for fixed extent spans that were\n> required due to the ControlList::set() function that takes an\n> std::initializer_list not being able to infer a control size from\n> template arguments. This has now been fixed, so the casts are not needed\n> anymore. Drop them.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Christian Rauch <Rauch.Christian@gmx.de>\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/ipa/raspberrypi/raspberrypi.cpp | 19 +++++++++----------\n>   1 file changed, 9 insertions(+), 10 deletions(-)\n>\n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 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.","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 7C7EEBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  7 Oct 2022 14:50:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2BDE662D27;\n\tFri,  7 Oct 2022 16:50: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 0215A60A88\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  7 Oct 2022 16:50:01 +0200 (CEST)","from [192.168.1.103] (unknown [103.251.226.3])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E8727BBE;\n\tFri,  7 Oct 2022 16:49:59 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665154202;\n\tbh=X+EviVRX0vZta4VG0OBefCcrevbJgseL4P2mMv43pzw=;\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=QVFYogNejZuwrYun6/k4WsWGT38K1cnaWKDKH4VEk5yldXIA7e2gyFTQSiIoShkS9\n\toIz8P1id0fTZnVMLtiAc18/2fYNfHonvmQVs4FJCxev9CmPnkilFaLfmRX/aVM33DR\n\ta1/aiq80gIMjxC8w8CrIRLagiVKs89K0AgqgAa5YJSoEKsuvQ7NLFPi4ebF4gj3Ge6\n\t9RFjhAWZqP0fjA0goXbds7+enSJne0yjJnkuHCIGs1sWFf9ozlUSDKGAmAB56k1uju\n\tru1IG02SsSr7iBT10xJZxrYpARi5OEAliIOXF/mphseE2I6dWbsSd6MCKTyd8RWMj/\n\tuh0rtBn/m7WaA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665154200;\n\tbh=X+EviVRX0vZta4VG0OBefCcrevbJgseL4P2mMv43pzw=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=jgNLheg0sqQeKgtuEnvBtNkLGqa943OOFOpCPO0I9R/L6FE2pG1wjvperbTM6+Kat\n\t4J1jy1AZvBGA3U9FVqSY+8wwZpWmLh6ssa76CdYDVHMiZvaSm+UVA5Asapbg5gEZvW\n\tpsR+FWCT+/nHnnHlfiuTul3+6fGNxHF2YDPyNsds="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"jgNLheg0\"; dkim-atps=neutral","Message-ID":"<aaa121d7-436a-55ef-8a04-83d436661848@ideasonboard.com>","Date":"Fri, 7 Oct 2022 20:19:54 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.2.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20221006230747.11688-1-laurent.pinchart@ideasonboard.com>\n\t<20221006230747.11688-5-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20221006230747.11688-5-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 4/4] ipa: raspberrypi: Remove\n\tunneeded Span 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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]