Show a patch.

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

{
    "id": 17142,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17142/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17142/",
    "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": "<20220816191752.109151-2-Rauch.Christian@gmx.de>",
    "date": "2022-08-16T19:17:52",
    "name": "[libcamera-devel,v2,1/1] libcamera: set ControlInfo for Span Controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a4423f3bf415e691899d15429f18e60d66bbd2f5",
    "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/17142/mbox/",
    "series": [
        {
            "id": 3421,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3421/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3421",
            "date": "2022-08-16T19:17:51",
            "name": "libcamera: set ControlInfo for Span Controls",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3421/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17142/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17142/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 122C6C3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Aug 2022 19:17:58 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F2D0261FBC;\n\tTue, 16 Aug 2022 21:17:56 +0200 (CEST)",
            "from mout.gmx.net (mout.gmx.net [212.227.17.20])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CE47161FBC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Aug 2022 21:17:54 +0200 (CEST)",
            "from voyager ([88.152.184.103]) by mail.gmx.net (mrgmx104\n\t[212.227.17.168]) with ESMTPSA (Nemesis) id 1MUowb-1nxFqN1bBh-00QmLw;\n\tTue, 16 Aug 2022 21:17:54 +0200"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660677477;\n\tbh=5Pyj2DASryP86s3YkFxon0LC9V9lzauKvYDWz8IAw9o=;\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=n5JlqE9f5l6kYGKG4BZCwGulsgVph1vFL0MGkojS+b7/ToIc5NwPaMoi/HrFZktaL\n\tCUFbh8ZIie3wr0+lJhRgJ/Ez1tdVit5hrClnGBSjNkUEvmOEt2wsfBIoLm9Mf3/388\n\t/z9sx2AVM3PAJg7z3A7A84VJmauwjaZegZJ3EjlwECu13W1MuIlVEjHpFRbjVQNm6k\n\tDnmioq4FccG6FXBqrInNVMFT3dEXHPssJmW5LKFBDAN+X2kUjZZOnwfhC957cNcVz5\n\tCU4fy4gDsxOc6weorp1Yqy6mEK+ZLZSqeNhg5ZvKixOQS5obHvsz6D9qlaZA7zLWNg\n\tkSkOG/Soqs8JA==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;\n\ts=badeba3b8450; t=1660677474;\n\tbh=5Pyj2DASryP86s3YkFxon0LC9V9lzauKvYDWz8IAw9o=;\n\th=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=RNbXHV6j0V9/YJYN8Wv4N9svrfrGxmwdujosRy/C2xSVLbfohP7aGgkDuJCenabzw\n\tT2suCeFV5UEVj3pq+C4Hn9SIOA1dqIwClkpu93bs6n5/6XMhCAcnACtxe4puzftCKL\n\t4XdzIjDoHURcINQbmb+yKQXGKG9W/m4a6sL4e8os="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=gmx.net header.i=@gmx.net\n\theader.b=\"RNbXHV6j\"; dkim-atps=neutral",
        "X-UI-Sender-Class": "01bb95c1-4bf8-414a-932a-4f6e2808ef9c",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 16 Aug 2022 21:17:52 +0200",
        "Message-Id": "<20220816191752.109151-2-Rauch.Christian@gmx.de>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220816191752.109151-1-Rauch.Christian@gmx.de>",
        "References": "<20220816191752.109151-1-Rauch.Christian@gmx.de>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-Provags-ID": "V03:K1:2KkrT4GXtpai0aDchKGxlvMZ6/pgSsy+coewrDrqJn7xSRAE1WV\n\tvKKu2MmvkQpW5t8PMzZIxAHbQAhYIUeqx00v7507ewCRkkHgfgA1/ZG1C5YAnBZyU7Zt04L\n\t133yJJz0AyYb/bmhVZgTdg1ns6ZUTT+7QxK9nCXNP6lNe5qBfjgsL279OoOIMBcjWRkhD/Z\n\totzLnUVgIpP60VPuCM5bw==",
        "X-Spam-Flag": "NO",
        "X-UI-Out-Filterresults": "notjunk:1; V03:K0:qSFogDzO1Wg=:AGIaPOukc01SJlopJGxYd+\n\tS9t+wu220pVyzGwPY3xL6h7OX+9eJ/9CFlVU32fM87A8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dfyTiQvsdwngFUoG/xBjN8Vfp+9Q\n\t98ofYeRVmrBZewdp65Dse8beDrYcTlp7/YcUz+2w0LMMBAt7CQ0qPVF3w==",
        "Subject": "[libcamera-devel] [PATCH v2 1/1] libcamera: set ControlInfo for\n\tSpan Controls",
        "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": "Some control properties are typed with a Span to store an array of values.\nCurrently those are ColourGains, SensorBlackLevels, ColourCorrectionMatrix\nand FrameDurationLimits. The value range and defaults in the ControlInfo of\nthose Controls is currently defined as scalar. This prevents accessing the\nControlInfo via the native Span type.\n\nBy defining the ControlInfo in terms of Spans, we can avoid this issue.\n\nSigned-off-by: Christian Rauch <Rauch.Christian@gmx.de>\n---\n src/ipa/ipu3/ipu3.cpp                           |  6 +++---\n src/ipa/raspberrypi/raspberrypi.cpp             | 14 +++++++++++---\n test/serialization/ipa_data_serializer_test.cpp |  2 +-\n 3 files changed, 15 insertions(+), 7 deletions(-)\n\n--\n2.34.1",
    "diff": "diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex e37b2fa0..0439cd9d 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -273,9 +273,9 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo,\n \t\tframeDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);\n \t}\n\n-\tcontrols[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],\n-\t\t\t\t\t\t\t       frameDurations[1],\n-\t\t\t\t\t\t\t       frameDurations[2]);\n+\tcontrols[&controls::FrameDurationLimits] = ControlInfo{ Span<const int64_t>({ frameDurations[0], frameDurations[0] }),\n+\t\t\t\t\t\t\t\tSpan<const int64_t>({ frameDurations[1], frameDurations[1] }),\n+\t\t\t\t\t\t\t\tSpan<const int64_t>({ frameDurations[2], frameDurations[2] }) };\n\n \t*ipaControls = ControlInfoMap(std::move(controls), controls::controls);\n }\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 69c73f8c..175b6b88 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -82,15 +82,23 @@ static const ControlInfoMap::Map ipaControls{\n \t{ &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n \t{ &controls::ExposureValue, ControlInfo(-8.0f, 8.0f, 0.0f) },\n \t{ &controls::AwbEnable, ControlInfo(false, true) },\n-\t{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },\n+\t{ &controls::ColourGains, ControlInfo{ Span<const float>({ 0, 0 }), Span<const float>({ 32, 32 }), Span<const float>({ 0, 0 }) } },\n \t{ &controls::AwbMode, ControlInfo(controls::AwbModeValues) },\n \t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f, 0.0f) },\n \t{ &controls::Contrast, ControlInfo(0.0f, 32.0f, 1.0f) },\n \t{ &controls::Saturation, ControlInfo(0.0f, 32.0f, 1.0f) },\n \t{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n-\t{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },\n+\t{ &controls::ColourCorrectionMatrix, ControlInfo{\n+\t\t\t\t\t\t     Span<const float>({ -16, -16, -16, -16, -16, -16, -16, -16, -16 }),\n+\t\t\t\t\t\t     Span<const float>({ 16, 16, 16, 16, 16, 16, 16, 16, 16 }),\n+\t\t\t\t\t\t     Span<const float>({ 1, 0, 0, 0, 1, 0, 0, 0, 1 }),\n+\t\t\t\t\t     } },\n \t{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n-\t{ &controls::FrameDurationLimits, ControlInfo(INT64_C(33333), INT64_C(120000)) },\n+\t{ &controls::FrameDurationLimits, ControlInfo{\n+\t\t\t\t\t\t  Span<const int64_t>({ 33333, 33333 }),\n+\t\t\t\t\t\t  Span<const int64_t>({ 120000, 120000 }),\n+\t\t\t\t\t\t  Span<const int64_t>({ 33333, 33333 }),\n+\t\t\t\t\t  } },\n \t{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }\n };\n\ndiff --git a/test/serialization/ipa_data_serializer_test.cpp b/test/serialization/ipa_data_serializer_test.cpp\nindex d2050a86..e9e29bd5 100644\n--- a/test/serialization/ipa_data_serializer_test.cpp\n+++ b/test/serialization/ipa_data_serializer_test.cpp\n@@ -36,7 +36,7 @@ static const ControlInfoMap Controls = ControlInfoMap({\n \t\t{ &controls::AeEnable, ControlInfo(false, true) },\n \t\t{ &controls::ExposureTime, ControlInfo(0, 999999) },\n \t\t{ &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },\n-\t\t{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },\n+\t\t{ &controls::ColourGains, ControlInfo{ Span<const float>({ 0, 0 }), Span<const float>({ 32, 32 }), Span<const float>({ 0, 0 }) } },\n \t\t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n \t}, controls::controls);\n\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "1/1"
    ]
}