Patch Detail
Show a patch.
GET /api/1.1/patches/15619/?format=api
{ "id": 15619, "url": "https://patchwork.libcamera.org/api/1.1/patches/15619/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15619/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220405004215.86340-6-Rauch.Christian@gmx.de>", "date": "2022-04-05T00:42:15", "name": "[libcamera-devel,v2,5/5] apply explicit fixed-sized Span type casts", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a2979ec4bfdb6ae76244aae9a96c2794d8563dd5", "submitter": { "id": 111, "url": "https://patchwork.libcamera.org/api/1.1/people/111/?format=api", "name": "Christian Rauch", "email": "Rauch.Christian@gmx.de" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/15619/mbox/", "series": [ { "id": 3028, "url": "https://patchwork.libcamera.org/api/1.1/series/3028/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3028", "date": "2022-04-05T00:42:10", "name": "generate and use fixed-sized Span Control types", "version": 2, "mbox": "https://patchwork.libcamera.org/series/3028/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15619/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15619/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 4AD96C326D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 5 Apr 2022 00:42:28 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0BF2565653;\n\tTue, 5 Apr 2022 02:42:27 +0200 (CEST)", "from mout.gmx.net (mout.gmx.net [212.227.17.22])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 86ABC65643\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 5 Apr 2022 02:42:23 +0200 (CEST)", "from localhost.localdomain ([92.10.251.63]) by mail.gmx.net\n\t(mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id\n\t1M3DNt-1naAtO0cQf-003coA; Tue, 05 Apr 2022 02:42:23 +0200" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649119347;\n\tbh=InSS1aMS9uqLW8CBU1NK5f37YyIWVBJAMr5et4FWe74=;\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=PVnmM+d3MjZ1otbsofazWkwfY55Txg03JMUMyh2oRfQzdjPvuGPjdB+xFLtaFDqyE\n\t15Z/fXCygxgOy1stfgJ2ZlzIZIdjDqA40Uv357josBnWb7RkRjFL0JCkCfhDs3VAdG\n\tYtS9H4drb2RrJrrJRhwl6mdzPe4LtirTLG6PkX5QfJG3dDC/vtbnAB/qyY49sVy2e2\n\t6HYYKnrboEQFfqtBPFbxTy8bqaYulEJ1mPJ6gYdDH+4uwCmTOyp/a7mAQ0QWWcW9HM\n\tXsh5QP0Y5j/O/DK6cHK2ghfyMkPFFBuTgqn9DOIzyNq04Kv+UMZZFI5wPyOgA0OLT+\n\tkiRFDdIL50GKw==", "v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;\n\ts=badeba3b8450; t=1649119343;\n\tbh=InSS1aMS9uqLW8CBU1NK5f37YyIWVBJAMr5et4FWe74=;\n\th=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=LunkeF+KQH4wmDK6kuNXpIWV9dFTKElc5fXDLSnuuJAllFlzgaMrrRMBct/rGYiLy\n\tOm37U6bGcSPwLT1FrGRwjiKdPedeOVS2SeNxRBoSoDoGqahtYYHS7M2c6hSPxi4/SM\n\tN0CNU9sMttP/rjkbP3lrX49fH5nIf8kMXObNNO8A=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=gmx.net header.i=@gmx.net\n\theader.b=\"LunkeF+K\"; dkim-atps=neutral", "X-UI-Sender-Class": "01bb95c1-4bf8-414a-932a-4f6e2808ef9c", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 5 Apr 2022 01:42:15 +0100", "Message-Id": "<20220405004215.86340-6-Rauch.Christian@gmx.de>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220405004215.86340-1-Rauch.Christian@gmx.de>", "References": "<20220405004215.86340-1-Rauch.Christian@gmx.de>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "quoted-printable", "X-Provags-ID": "V03:K1:X4tywJo2l37GzmXeLnZj98FTq+P/cO53w5zinK0BInia9gjAW3v\n\tDPeNaame2MtaL816+75TLOv5AMSICMWc0igRC6olRzDVchFwVafGOlxfEvng9asY86ch4Xn\n\t2yHW/99ATK1h2NBM1Qi/zw5PkLgWNpsRCKH5ypIfG3h1qiATKnMlKCpHo7j8kIwIJpAHHAQ\n\tHakw/nGwWkdjIqdxYIRkA==", "X-Spam-Flag": "NO", "X-UI-Out-Filterresults": "notjunk:1; V03:K0:qs35K/Gqh+A=:SbCzE4TtN1AbTap5d9TeW8\n\tlbCWIk52sg/+kfui90/PaCoV5IJzJLmT36SSZ0ggVhwjLhM1RKcHPHdTchw9qZCRlKB25sdTe\n\t2Ss2LGY+yFPannla3b0uQE9tl2m+MrGQ3GmH5dN1O0jyG1avRYaxVnTPBKvdTH6vzj1qbuM5n\n\tvCm1Tf4DEquMcy6AUAbw4g+msvnMSmU23zNvnM3lzqBd4562kxJEj2DSW1IYF84tpu6LS2jXy\n\tNbe3Zehj2HxBCESpVsawtN4WAAyRgEuMJa7PcC9zMCRlNOBNSRPdkbvcOvoEmx1UaVeueV7p2\n\tHRP44mKat/Djj1bAyly3w/DWSDoFhEzs2rsWj8qHl3f3bdIrSCDkwAMClXNfC21x63ZI6fFJ2\n\typ1HNnMQcr2POsyhafF/9fZ8hjWrdb/05xW+i1M8Bpv0D7WToFgkIuIbGPO/0qyIVRBlzvoe5\n\tsmyKbRgXdXGOBmX4c0ptMQjM36p1P3lFUvYgXdihrvaDfKfsQnxkO/wE5NiEjIRJ8Mx/6Ee7s\n\tcXj1G1escGGO5rdPOJ072MB/llATUsI4arcpBTPRk6s3wJkum/zQx95XJj46PS8YpMEeYZGMC\n\tas1EOJo/RkZh4zVsL7LIs7qMtQkddFnxohDOi1AD2J2Uu9OdYEb5PS2dyXhUz0P5kXefWILxW\n\t/K07GmLbPbqiKZxMphbagxr91dv9G6jUiowOqMnHID4VrddKmbjoymGSLxMpMx7fMg3vZ6AaM\n\t5CwRPElIMgIceZFpBqax8KuAVKFr1XHT+BY4gp1MpPbHtvyKlzKhOAr6vSV2PEU54JORMBJEs\n\tS2BA3YftS1O3Dd84ICto9rDXoPjmdcp9zIuOvchKE7nJVFHqfitrUzN1PgAGkF8n91DhGZW3d\n\tqQXYKJMY88Bc+o4ef9vYOtz4ZkQe15MFjdCqWVsC8YOw551aDE6AtrhrSHmpt7X51HkAPCHsf\n\tzC9udNq6PaIrHZ2PCak5QMGGSeKSiMcLj8+sTkpqJZHcgkIGfV0KEodYuf/VK4xMXpsjpmYEQ\n\t9SuGRdp4d5Q2dYFKQBEJmcHvPjolKHCbwntLSw7fS8egBpxO+ee+aFvFLP0Q48bjCBe13TIUf\n\tslhvX0WH+f6ASA=", "Subject": "[libcamera-devel] [PATCH v2 5/5] apply explicit fixed-sized Span\n\ttype 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": "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>" }, "content": "The change of types of some Controls from variable- to fixed-sized requires\nexplicit casting of FrameDurationLimits, ColourGains and SensorBlackLevels.\n\nSigned-off-by: Christian Rauch <Rauch.Christian@gmx.de>\n---\n src/ipa/raspberrypi/raspberrypi.cpp | 18 +++++++++---------\n .../pipeline/raspberrypi/raspberrypi.cpp | 2 +-\n src/qcam/dng_writer.cpp | 2 +-\n 3 files changed, 11 insertions(+), 11 deletions(-)\n\n--\n2.25.1", "diff": "diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 926b3185..c27c897f 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -499,18 +499,18 @@ void IPARPi::reportMetadata()\n\n \tAwbStatus *awbStatus = rpiMetadata_.GetLocked<AwbStatus>(\"awb.status\");\n \tif (awbStatus) {\n-\t\tlibcameraMetadata_.set(controls::ColourGains, { static_cast<float>(awbStatus->gain_r),\n-\t\t\t\t\t\t\t\tstatic_cast<float>(awbStatus->gain_b) });\n+\t\tlibcameraMetadata_.set(controls::ColourGains, Span<const float, 2>({ static_cast<float>(awbStatus->gain_r),\n+\t\t\t\t\t\t\t\t\t\t static_cast<float>(awbStatus->gain_b) }));\n \t\tlibcameraMetadata_.set(controls::ColourTemperature, awbStatus->temperature_K);\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 { static_cast<int32_t>(blackLevelStatus->black_level_r),\n-\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->black_level_g),\n-\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->black_level_g),\n-\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->black_level_b) });\n+\t\t\t\t Span<const int32_t, 4>({ static_cast<int32_t>(blackLevelStatus->black_level_r),\n+\t\t\t\t\t\t\t\tstatic_cast<int32_t>(blackLevelStatus->black_level_g),\n+\t\t\t\t\t\t\t\tstatic_cast<int32_t>(blackLevelStatus->black_level_g),\n+\t\t\t\t\t\t\t\tstatic_cast<int32_t>(blackLevelStatus->black_level_b) }));\n\n \tFocusStatus *focusStatus = rpiMetadata_.GetLocked<FocusStatus>(\"focus.status\");\n \tif (focusStatus && focusStatus->num == 12) {\n@@ -815,7 +815,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 { gains[0], gains[1] });\n+\t\t\t\t\t\t Span<const float, 2>({ gains[0], gains[1] }));\n \t\t\tbreak;\n \t\t}\n\n@@ -1099,8 +1099,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 { static_cast<int64_t>(minFrameDuration_.get<std::micro>()),\n-\t\t\t\t static_cast<int64_t>(maxFrameDuration_.get<std::micro>()) });\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\n \t/*\n \t * Calculate the maximum exposure time possible for the AGC to use.\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 34d9f4c4..7d4142cf 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1692,7 +1692,7 @@ void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList &\n \t * V4L2_CID_NOTIFY_GAINS control (which means notifyGainsUnity_ is set).\n \t */\n \tif (notifyGainsUnity_ && controls.contains(libcamera::controls::ColourGains)) {\n-\t\tlibcamera::Span<const float> colourGains = controls.get(libcamera::controls::ColourGains);\n+\t\tlibcamera::Span<const float, 2> colourGains = controls.get(libcamera::controls::ColourGains);\n \t\t/* The control wants linear gains in the order B, Gb, Gr, R. */\n \t\tControlList ctrls(sensor_->controls());\n \t\tstd::array<int32_t, 4> gains{\ndiff --git a/src/qcam/dng_writer.cpp b/src/qcam/dng_writer.cpp\nindex a7dd30f8..d712dab2 100644\n--- a/src/qcam/dng_writer.cpp\n+++ b/src/qcam/dng_writer.cpp\n@@ -437,7 +437,7 @@ int DNGWriter::write(const char *filename, const Camera *camera,\n \tconst double eps = 1e-2;\n\n \tif (metadata.contains(controls::ColourGains)) {\n-\t\tSpan<const float> const &colourGains = metadata.get(controls::ColourGains);\n+\t\tSpan<const float, 2> const &colourGains = metadata.get(controls::ColourGains);\n \t\tif (colourGains[0] > eps && colourGains[1] > eps) {\n \t\t\twbGain = Matrix3d::diag(colourGains[0], 1, colourGains[1]);\n \t\t\tneutral[0] = 1.0 / colourGains[0]; /* red */\n", "prefixes": [ "libcamera-devel", "v2", "5/5" ] }