Show a patch.

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

{
    "id": 15490,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15490/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15490/",
    "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": "<20220321230246.663401-1-Rauch.Christian@gmx.de>",
    "date": "2022-03-21T23:02:46",
    "name": "[libcamera-devel] fix ControlInfo for Span Controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "93870ca56b0048ed1513a79ad3b0fce398055d64",
    "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/15490/mbox/",
    "series": [
        {
            "id": 2979,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2979/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2979",
            "date": "2022-03-21T23:02:46",
            "name": "[libcamera-devel] fix ControlInfo for Span Controls",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2979/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15490/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15490/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 3D780BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 21 Mar 2022 23:02:53 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 61DBC604DC;\n\tTue, 22 Mar 2022 00:02:52 +0100 (CET)",
            "from mout.gmx.net (mout.gmx.net [212.227.15.18])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1BFB8604C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Mar 2022 00:02:50 +0100 (CET)",
            "from localhost.localdomain ([92.10.251.63]) by mail.gmx.net\n\t(mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id\n\t1MPokD-1njzz82Uj5-00MrEp; Tue, 22 Mar 2022 00:02:49 +0100"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647903772;\n\tbh=wmCXtR2FbgbBhVrJeez6j8+XAIfFqgoFlpLCZmTLjLY=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=qiLI20fvUURnJePtv3QGVdqeO5yceVHt09hEJ5MF/s4tX2ZGi/3ZmoGPafNjIYLE9\n\tZL5wnNZOdM9d8YASCSU60oLgSjnMmFCGQz2oj/zAkulkVe+M8era79APjIH0WSFfDZ\n\tfVJhqEW8s3KbPQHsiTonJ/rosFfOPneJqA48nfbr9y5Dgu6M1kcMGrCOxz49jM2ftI\n\twdDIItNejJyBesPzfF3Md8AiHIzfVD4/bVjRSUf0eHycXzJKeI4IyjhiWDnNdU23fo\n\t1CmDssh9ayaYVlpFjbIUKDu4qcjeF0WuGsyxtkxoTLD6wChYLL78qWHM9cUdBTAehJ\n\t2vojd54fD6mWg==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;\n\ts=badeba3b8450; t=1647903769;\n\tbh=wmCXtR2FbgbBhVrJeez6j8+XAIfFqgoFlpLCZmTLjLY=;\n\th=X-UI-Sender-Class:From:To:Cc:Subject:Date;\n\tb=FF3Wnk75SoalXBAymepKS5+K7vqxrrHMROgolwhvLWKhdqSrTI6wVsTCpaD4Z5S1c\n\twR2Mw4XBQUlREFLDjfZSsHrC6WwObhH8EVrT3jNiJoF0qOp3TcyevRMoyd2wINxrSH\n\tRUWUjdNRd02qBBlaLyIvNadHLUlW6e4mpVi9cKLg="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=gmx.net header.i=@gmx.net\n\theader.b=\"FF3Wnk75\"; dkim-atps=neutral",
        "X-UI-Sender-Class": "01bb95c1-4bf8-414a-932a-4f6e2808ef9c",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 21 Mar 2022 23:02:46 +0000",
        "Message-Id": "<20220321230246.663401-1-Rauch.Christian@gmx.de>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-Provags-ID": "V03:K1:K8EpVn94cOgA9l7oQthv1+aP95+slVAEyuwRRfnRz+NvDn/hbq2\n\tQCA/gpAgtX/ZB/RxRCi1uNhDonsoIjZxm5UmNzGHjKKPAVVvgBo/ajQwb5IAJbsFiuKi4Dy\n\t4VaA7DbggTylZ+jiJpQ+i6atxuROkLA64wR1ayC4IfcXYUekrrNx3Gc5HUZzmZrBGkB20e7\n\tSQ2eI5uKlE57U5PzqN58g==",
        "X-Spam-Flag": "NO",
        "X-UI-Out-Filterresults": "notjunk:1; V03:K0:W0q3Uz6BaGo=:YYzgxrvJBevjp3D+3VhsR4\n\tU/JQmDECd2TvetvESvPSe7kVLoaGd3mWRuxUh+YpA7hzcvnjiSMgOTw0frfJb08juh+Hyd0Gl\n\tWjdfqv/ll4PxXMy4CTvjDgYOrosdMTC2DoEe+FOh3gwmj8vZfjc3syb1bE7F0/M25CGoNZstL\n\tlBHicBlNKhipCNTAr/sivUjTji/qEeCae1erz+TK5mIzEaeorMSVs1GzB5Tyl3org9NI50GsQ\n\tjAYD9dAOxwdnm3ibLCS2FIws2/PteoAMcb0aLtpZWpDIeA1oeOSPvc1KwWmeIHLijmaXmQ0mN\n\tFCfGxUMF3h8KQcve6pMy0s1H+DBENi0EcMokWDUpp605J1MdRobC9VWLL/P9FiTx0o7Vy4HjP\n\tbOK/Hxd/xSRr+cq1q054h2cjUPAq7Cb4drWdoKYt9yHA5PE5z+2MaF6+ns3Htv5+wDoHorEfU\n\tVJ0RFDcmuxpzXlcP0RqWWGPY8wRFozEyLUtPA8nVeBJSQsjL7re4mKlYEoiiWrb5stoLdNUF2\n\tWQhzIaMh+E+CHfvbZUd9062+/XPxPUOriVY/0VtXQ76byqXIlkSTS1kWL5wKOVCt1zE539uwa\n\tVPt95f8VHoYl3/xDE+yfr80MDTF8mCStT2/xahPEt01GDv2YSX+Up+UnZeSEDYU9dlCxdEwXs\n\t6VXh90gr38/DDuQx1ca3HPSnv317ngcVav0xNlwcsSk37aiJnPvCPQcHAGLuclQ5l2jXJkioW\n\tr23YOxRvDEffgoda7dwPFw30W4WNOQndw/NJGHty8di1JodaaqYmRY5ky2t0exRsz1vJNM4de\n\tXq/7aYTk9CyQeQfkRctBTdfPQFLW4rXSULgVCzA0nbDwuos5eRbALEwq4axGP7HYJf4cyqyfk\n\tnb04RNLdhyoug836r5zFN34o0aN+n9IrWOH0bf93FfC3ICu+Hvan5n4VMZM0/AbT7P43UvJvO\n\tR37OPVGwwXp4F+ZHYRkCEaTRDneaY3L4MSPvZQAHiDrgeHwkEkL3nkPao/o1K7ml1ZaNErYy0\n\t387zHdAIzttBATOGZeaUJoVIuAFwj6t9V17C+imBK2+xHFMgLSw9mBsOvwLsL0b9Q9X6RRWQK\n\tATJAv2vKf4ZEwA=",
        "Subject": "[libcamera-devel] [PATCH] fix ControlInfo for Span 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---\n include/libcamera/ipa/raspberrypi.h           | 52 ++++++++++++-------\n src/ipa/ipu3/ipu3.cpp                         |  6 +--\n .../ipa_data_serializer_test.cpp              |  8 +--\n 3 files changed, 40 insertions(+), 26 deletions(-)\n\n--\n2.25.1",
    "diff": "diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\nindex 7f705e49..fb5188a1 100644\n--- a/include/libcamera/ipa/raspberrypi.h\n+++ b/include/libcamera/ipa/raspberrypi.h\n@@ -27,26 +27,38 @@ namespace RPi {\n  * and the pipeline handler may be reverted so that it aborts when an\n  * unsupported control is encountered.\n  */\n-static const ControlInfoMap Controls({\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::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },\n-\t\t{ &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },\n-\t\t{ &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n-\t\t{ &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },\n-\t\t{ &controls::AwbEnable, ControlInfo(false, true) },\n-\t\t{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },\n-\t\t{ &controls::AwbMode, ControlInfo(controls::AwbModeValues) },\n-\t\t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n-\t\t{ &controls::Contrast, ControlInfo(0.0f, 32.0f) },\n-\t\t{ &controls::Saturation, ControlInfo(0.0f, 32.0f) },\n-\t\t{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n-\t\t{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },\n-\t\t{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n-\t\t{ &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },\n-\t\t{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }\n-\t}, controls::controls);\n+static const ControlInfoMap Controls(\n+\t{ { &controls::AeEnable, ControlInfo(false, true) },\n+\t  { &controls::ExposureTime, ControlInfo(0, 999999) },\n+\t  { &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },\n+\t  { &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },\n+\t  { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },\n+\t  { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n+\t  { &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },\n+\t  { &controls::AwbEnable, ControlInfo(false, true) },\n+\t  { &controls::ColourGains, ControlInfo{\n+\t\t\t\t\t    Span<const float>({ 0, 0 }),\n+\t\t\t\t\t    Span<const float>({ 32, 32 }),\n+\t\t\t\t\t    Span<const float>({ 0, 0 }),\n+\t\t\t\t    } },\n+\t  { &controls::AwbMode, ControlInfo(controls::AwbModeValues) },\n+\t  { &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n+\t  { &controls::Contrast, ControlInfo(0.0f, 32.0f) },\n+\t  { &controls::Saturation, ControlInfo(0.0f, 32.0f) },\n+\t  { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.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{\n+\t\t\t\t\t\t    Span<const int64_t>({ 1000, 1000 }),\n+\t\t\t\t\t\t    Span<const int64_t>({ 1000000000, 1000000000 }),\n+\t\t\t\t\t\t    Span<const int64_t>({ 1000, 1000 }),\n+\t\t\t\t\t    } },\n+\t  { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) } },\n+\tcontrols::controls);\n\n } /* namespace RPi */\n\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 1ea2c898..e64fc2bb 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -267,9 +267,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/test/serialization/ipa_data_serializer_test.cpp b/test/serialization/ipa_data_serializer_test.cpp\nindex d2050a86..5503cc8a 100644\n--- a/test/serialization/ipa_data_serializer_test.cpp\n+++ b/test/serialization/ipa_data_serializer_test.cpp\n@@ -32,13 +32,15 @@\n using namespace std;\n using namespace libcamera;\n\n-static const ControlInfoMap Controls = ControlInfoMap({\n+static const ControlInfoMap Controls = ControlInfoMap(\n+\t{\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+\t},\n+\tcontrols::controls);\n\n namespace libcamera {\n\n",
    "prefixes": [
        "libcamera-devel"
    ]
}