Show a patch.

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

{
    "id": 15741,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15741/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15741/",
    "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": "<20220427223004.115381-5-Rauch.Christian@gmx.de>",
    "date": "2022-04-27T22:30:04",
    "name": "[libcamera-devel,v4,4/4] apply explicit fixed-sized Span type casts",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c350fc5d7a95480479b2ebb696e7a057d2aab438",
    "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/15741/mbox/",
    "series": [
        {
            "id": 3080,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3080/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3080",
            "date": "2022-04-27T22:30:00",
            "name": "generate and use fixed-sized Span Control types",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/3080/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15741/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15741/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 641DCC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Apr 2022 22:30:16 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D93C66564D;\n\tThu, 28 Apr 2022 00:30:14 +0200 (CEST)",
            "from mout.gmx.net (mout.gmx.net [212.227.17.20])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DC51665646\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Apr 2022 00:30:08 +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\t1MxlzC-1o56sg0bx0-00zEiS; Thu, 28 Apr 2022 00:30:08 +0200"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1651098614;\n\tbh=EHDUM2P5pwfuT7LnX3aqWA3xtIJT07JPWG1WLdGyah4=;\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=FPBolv0L1NvjbAbjpN7ewRcn7vlslGPKrbAjyR0EzcJw2lHSXzkzVSmZqU59PTLFM\n\tdOvA5Rat7uub/kVOyavw8KXB2YwNp1Uw5k+y87qdD36234hsLy5y8OQfu9+OhJtd2n\n\tEfvsEVR5NUt0HM15OlbfDcrjcCUnVD9MYcgHRr5LQ46ZPwIGKANwqjPjOZxoMF/Y5n\n\tO+veudXodFvQKI5qUwwDvcqpTUN+5SRr4DFH9sFSTdOTjmF75Nu6TIzQGRP04zgkiE\n\ta9fS4HxJobUJvDjkcSVVDj6B83dA0wMlhKYPhGTMoGtqKyqFX1Jab7g8zj9tDdnrJG\n\tglwn/wHsJavkw==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;\n\ts=badeba3b8450; t=1651098608;\n\tbh=EHDUM2P5pwfuT7LnX3aqWA3xtIJT07JPWG1WLdGyah4=;\n\th=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=ZbZEo31qH8A2VXCe4wDbCVUmO/m18BW4AX84Sh2ZDasj2dV21JNpZBmwifKO3T9Oe\n\tFbjs3B+wKuDB5Mm3cLdsH/IdvE7piEoPH+RcKD3Nn/jcB0i3aUNpM3KsH3Ni+Ztpbx\n\tpioek0tnQS2zcvMaNon0Ump1RjN2HB7za5J+JQ7I="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=gmx.net header.i=@gmx.net\n\theader.b=\"ZbZEo31q\"; dkim-atps=neutral",
        "X-UI-Sender-Class": "01bb95c1-4bf8-414a-932a-4f6e2808ef9c",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 27 Apr 2022 23:30:04 +0100",
        "Message-Id": "<20220427223004.115381-5-Rauch.Christian@gmx.de>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220427223004.115381-1-Rauch.Christian@gmx.de>",
        "References": "<20220427223004.115381-1-Rauch.Christian@gmx.de>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-Provags-ID": "V03:K1:K7a7ojRXfc5NtD2hy8HN8T2ijGK+Jan+Y0MBrx8fCm1urjqxRpu\n\tRbyUL/kRJWzsEijSMZuA3EFI4kEAq+sXXlqEXCoaKwnqOOzqPR/Mv5Iujeokna7c9X6emXN\n\t9OkVvJwXo1MBs43AghHEuR1LcSphSpQ98OzfYodtkpsJj5pAFiHeRepaZCHS7OUWWHwJSWI\n\tCe04IXJRcYdCmKkB9oXzg==",
        "X-Spam-Flag": "NO",
        "X-UI-Out-Filterresults": "notjunk:1; V03:K0:wH7/chnL4u4=:+EnweZOrDJKcvAQ+PQ0ynr\n\tGx77J81eYEVPGweMrb5Jh+ZF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CfIxRZlHIeVTdJ5FJOIksSsleX3QbJYxVqKkmcp1v2AOj2Wo+7jzi6nS7L5jBKWW/nxmUF+X\n\t62u9jbdBz8F6U8=",
        "Subject": "[libcamera-devel] [PATCH v4 4/4] 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           | 19 ++++++++++---------\n .../pipeline/raspberrypi/raspberrypi.cpp      |  4 ++--\n src/qcam/dng_writer.cpp                       | 12 ++++++------\n 3 files changed, 18 insertions(+), 17 deletions(-)\n\n--\n2.34.1",
    "diff": "diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex bf54f64f..57e3de5d 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -502,18 +502,19 @@ 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,\n+\t\t\t\t       Span<const float, 2>({ static_cast<float>(awbStatus->gain_r),\n+\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@@ -818,7 +819,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@@ -1102,8 +1103,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 ce86ba45..f526c558 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1696,9 +1696,9 @@ 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 =\n+\t\tlibcamera::Span<const float, 2> colourGains =\n \t\t\tcontrols.get(libcamera::controls::ColourGains).\\\n-\t\t\t\tvalue_or(libcamera::Span<const float>({ 0, 0 }));\n+\t\t\t\tvalue_or(libcamera::Span<const float, 2>({ 0, 0 }));\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 e119ca52..030432e3 100644\n--- a/src/qcam/dng_writer.cpp\n+++ b/src/qcam/dng_writer.cpp\n@@ -438,8 +438,8 @@ 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 =\n-\t\t\tmetadata.get(controls::ColourGains).value_or(libcamera::Span<const float>({ 0, 0 }));\n+\t\tSpan<const float, 2> const &colourGains =\n+\t\t\tmetadata.get(controls::ColourGains).value_or(libcamera::Span<const float, 2>({ 0, 0 }));\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@@ -447,8 +447,8 @@ int DNGWriter::write(const char *filename, const Camera *camera,\n \t\t}\n \t}\n \tif (metadata.contains(controls::ColourCorrectionMatrix)) {\n-\t\tSpan<const float> const &coeffs =\n-\t\t\tmetadata.get(controls::ColourCorrectionMatrix).value_or(Span<const float>({ 0, 0, 0, 0, 0, 0, 0, 0, 0 }));\n+\t\tSpan<const float, 9> const &coeffs =\n+\t\t\tmetadata.get(controls::ColourCorrectionMatrix).value_or(Span<const float, 9>({ 0, 0, 0, 0, 0, 0, 0, 0, 0 }));\n \t\tMatrix3d ccmSupplied(coeffs);\n \t\tif (ccmSupplied.determinant() > eps)\n \t\t\tccm = ccmSupplied;\n@@ -517,8 +517,8 @@ int DNGWriter::write(const char *filename, const Camera *camera,\n \tuint32_t whiteLevel = (1 << info->bitsPerSample) - 1;\n\n \tif (metadata.contains(controls::SensorBlackLevels)) {\n-\t\tSpan<const int32_t> levels =\n-\t\t\tmetadata.get(controls::SensorBlackLevels).value_or(Span<const int32_t>({ 0, 0, 0, 0 }));\n+\t\tSpan<const int32_t, 4> levels =\n+\t\t\tmetadata.get(controls::SensorBlackLevels).value_or(Span<const int32_t, 4>({ 0, 0, 0, 0 }));\n\n \t\t/*\n \t\t * The black levels control is specified in R, Gr, Gb, B order.\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "4/4"
    ]
}