Show a patch.

GET /api/1.1/patches/15608/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 15608,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15608/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15608/",
    "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": "<20220401000616.12976-6-Rauch.Christian@gmx.de>",
    "date": "2022-04-01T00:06:16",
    "name": "[libcamera-devel,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/15608/mbox/",
    "series": [
        {
            "id": 3022,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3022/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3022",
            "date": "2022-04-01T00:06:11",
            "name": "generate and use fixed-sized Span Control types",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3022/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15608/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15608/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 BD9F0C3265\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  1 Apr 2022 00:06:50 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5B09665633;\n\tFri,  1 Apr 2022 02:06:50 +0200 (CEST)",
            "from mout.gmx.net (mout.gmx.net [212.227.15.19])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5225065631\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Apr 2022 02:06:46 +0200 (CEST)",
            "from localhost.localdomain ([92.10.251.63]) by mail.gmx.net\n\t(mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id\n\t1M7b6l-1nfslc3fy9-00819F; Fri, 01 Apr 2022 02:06:46 +0200"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648771610;\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=dlc4GYLFJucOUjUPM8xI9tWqOex9ot911BGAM14DT7TtcaCbNywdwhfv4FXXhhpaa\n\tOZtF+xiJ7F4qFgLu1zf6wK2xrP2uSgU+9qI8juQPeNI3tOxqWmZ5F5GJ0ITFzMPp1+\n\tSJBuoc90JMVR5wdy92Z41rND048qXFern9q9vL2Rq9E1mqZ0QZ6CYFmuxemALuBgb6\n\tcB10JwvBROnbNHsXEOW/KcDi9qnCjcf8pyMkI99g2hOjY1DVXZyQz0UzvyQUtZOEue\n\tmV/3GG9GHfZYJ01JN/SHXYsActHVlvP/KmW1YiRWmQmZreu5ZQzButf1zWxm5vF6q0\n\t2Qc7BTt1BtG4A==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;\n\ts=badeba3b8450; t=1648771606;\n\tbh=InSS1aMS9uqLW8CBU1NK5f37YyIWVBJAMr5et4FWe74=;\n\th=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=idtxihlxBvljrZktLcNmlYf+PsJw53hX280gUAiCdr4uc/ZFczNbJl8OV6UQuoexC\n\tXmI1tiB6ky0vpP7qrTaIDuMDo7v9YAmPTlsHFm5rjs/M/8G7ZgX8M6Ua4X5XpieNE+\n\tDuuq2sYZnANnEzi1gnH+2AaH88wbPLDByT69LJ+U="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=gmx.net header.i=@gmx.net\n\theader.b=\"idtxihlx\"; dkim-atps=neutral",
        "X-UI-Sender-Class": "01bb95c1-4bf8-414a-932a-4f6e2808ef9c",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  1 Apr 2022 01:06:16 +0100",
        "Message-Id": "<20220401000616.12976-6-Rauch.Christian@gmx.de>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220401000616.12976-1-Rauch.Christian@gmx.de>",
        "References": "<20220401000616.12976-1-Rauch.Christian@gmx.de>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-Provags-ID": "V03:K1:vXkxMZ+8ontAhJp4nZPjyQns8/gVfN3/OeS0+fz2uufrBb+t/tH\n\tsNezpoOtWoXwCxfzOeNorSsJ3KfyNKzWXL6REYkhH5LwZyJdS8Kz2a0mSC1Fnd4hhfT4Ck9\n\twf+G+9NLV5YcsvFKdHb6Ow7TP47UBiDnDz/MYFL8FKKms44k4LUpoZxIkW6DUS3Ipvl/wcg\n\tJYup68+7xf58gLecPoKAw==",
        "X-Spam-Flag": "NO",
        "X-UI-Out-Filterresults": "notjunk:1; V03:K0:SLycFwaQoXo=:1ti9+TILYjkBoxNIJQQudJ\n\t01FhriWUUAYLL8vrIhEMp6m5Kk6f3tKtPrgvf/zT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LSzwZsDZw9qjZy8QYvPuAcu/ePrk/7PMMz0sKFqXsl0r8\n\tMdNppdURHMdwEY=",
        "Subject": "[libcamera-devel] [PATCH 5/5] apply explicit fixed-sized Span type\n\tcasts",
        "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",
        "5/5"
    ]
}