Show a patch.

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

{
    "id": 15252,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15252/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15252/",
    "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": "<20220105155539.5550-3-david.plowman@raspberrypi.com>",
    "date": "2022-01-05T15:55:38",
    "name": "[libcamera-devel,v3,2/3] libcamera: v4l2_device: Add support for integer array controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "719d67dea6b785ccfd8a2190a04d31beb8e3a089",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/15252/mbox/",
    "series": [
        {
            "id": 2879,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2879/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2879",
            "date": "2022-01-05T15:55:36",
            "name": "Make use of V4L2_CID_NOTIFY_GAINS",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2879/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15252/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15252/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 F159DC3258\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Jan 2022 15:55:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A09EE60927;\n\tWed,  5 Jan 2022 16:55:54 +0100 (CET)",
            "from mail-wm1-x332.google.com (mail-wm1-x332.google.com\n\t[IPv6:2a00:1450:4864:20::332])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F388960868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jan 2022 16:55:52 +0100 (CET)",
            "by mail-wm1-x332.google.com with SMTP id\n\tm14-20020a7bcb8e000000b00346da381d59so791941wmi.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 05 Jan 2022 07:55:52 -0800 (PST)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tg18sm3387491wmq.5.2022.01.05.07.55.52\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 05 Jan 2022 07:55:52 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"tBJrO7hK\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=gqqGVwD5RfUgJkDkv34YgTJkIjI5WuIHwVNOXj2xvNI=;\n\tb=tBJrO7hK7aYZvfPuAWcJWuIwZNkw5Uy2OFuvKQKrEUd2tVVW+5Dv4ZMIp6AqhIZk7s\n\tBQve6CtxE5TM1unQ95I6f7BQFB9ftlTf69B+tOL06Z14KKYJ+lRo5nX0BDbhPjuJ+P3V\n\t2YwmFo+Vmx3/2mPzu8+red56bNbsYN3uE8+3qjai9N8mziO+LSGsINfIw+GADXhW+9ks\n\tj57LTH8sKdwc4kAj81KlSJtcOg23+ChclwMmg4WMM8XbpsEFxoL7wWMFD4qlORl35Ej6\n\twZdPXUQwlCm93AHfl3oV+tSEZdjb0CdaZWeCENukYECA2I/2q4cJVeQNsS9tW7edzoFA\n\tELDA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=gqqGVwD5RfUgJkDkv34YgTJkIjI5WuIHwVNOXj2xvNI=;\n\tb=mNr8Hcl60AtRxSx6QW0OXk4EqVKYnKMzmZvNSNgqUYeWV2jXV7vmC/PDbUY7TQU++W\n\tFyuNkZCz4QB+6jQW4STtuh8w3eIiiBVgq97Ya6SSMepy+Re6PGbJ8W6vv1ITfuX4Prv7\n\t2o7uDuAkxBzp7zk77ASkWLitM+tk1aVZJzlxWawOHVokBpTTtioTJJ+Nfu7dz9QZlzHE\n\tDhFWt4ySc4Zc/xCtAKXi/tLcIh/d3tqS3linuP4DICWqQ9PGM+OJiGJq9jRM4dnaDGO1\n\t08kqoQu57LpjBK1VH7ee+dw1Mo0PcRdNz7TOqorPjtD35jEqdH7gz1d4NzAOaGJB30YO\n\tHj+w==",
        "X-Gm-Message-State": "AOAM531jt/AIv1V8Q5R7peyGdT4whAYTiq90qhhG4RtGON3YS4lNEZAU\n\tHsUsAJfH7+BQKac7jgR5sCK9pD1vtpA7/7DU",
        "X-Google-Smtp-Source": "ABdhPJwEPcTwcoMxJOwOtUUONPwGq9YIt6wQAq6vT1vkKSU0ZDLyjDsy61O/eaISKd+NoPwTLioXpw==",
        "X-Received": "by 2002:a05:600c:1d1c:: with SMTP id\n\tl28mr3302741wms.69.1641398152547; \n\tWed, 05 Jan 2022 07:55:52 -0800 (PST)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  5 Jan 2022 15:55:38 +0000",
        "Message-Id": "<20220105155539.5550-3-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20220105155539.5550-1-david.plowman@raspberrypi.com>",
        "References": "<20220105155539.5550-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 2/3] libcamera: v4l2_device: Add\n\tsupport for integer array 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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "V4L2Device::setControl and V4L2Device::updateControl are both updated\nto handle ControlTypeInteger32 array controls.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/v4l2_device.cpp | 33 ++++++++++++++++++++++-----------\n 1 file changed, 22 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 62c91779..3fc8438f 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -297,6 +297,18 @@ int V4L2Device::setControls(ControlList *ctrls)\n \t\t/* Set the v4l2_ext_control value for the write operation. */\n \t\tControlValue &value = ctrl->second;\n \t\tswitch (iter->first->type()) {\n+\t\tcase ControlTypeInteger32: {\n+\t\t\tif (value.isArray()) {\n+\t\t\t\tSpan<uint8_t> data = value.data();\n+\t\t\t\tv4l2Ctrl.p_u32 = reinterpret_cast<uint32_t *>(data.data());\n+\t\t\t\tv4l2Ctrl.size = data.size();\n+\t\t\t} else {\n+\t\t\t\tv4l2Ctrl.value = value.get<int32_t>();\n+\t\t\t}\n+\n+\t\t\tbreak;\n+\t\t}\n+\n \t\tcase ControlTypeInteger64:\n \t\t\tv4l2Ctrl.value64 = value.get<int64_t>();\n \t\t\tbreak;\n@@ -671,6 +683,14 @@ void V4L2Device::updateControls(ControlList *ctrls,\n \t\tconst unsigned int id = v4l2Ctrl.id;\n \n \t\tControlValue value = ctrls->get(id);\n+\t\tif (value.isArray()) {\n+\t\t\t/*\n+\t\t\t * No action required, the VIDIOC_[GS]_EXT_CTRLS ioctl\n+\t\t\t * accessed the ControlValue storage directly for array\n+\t\t\t * controls.\n+\t\t\t */\n+\t\t\tcontinue;\n+\t\t}\n \n \t\tconst auto iter = controls_.find(id);\n \t\tASSERT(iter != controls_.end());\n@@ -680,19 +700,10 @@ void V4L2Device::updateControls(ControlList *ctrls,\n \t\t\tvalue.set<int64_t>(v4l2Ctrl.value64);\n \t\t\tbreak;\n \n-\t\tcase ControlTypeInteger32:\n-\t\t\tvalue.set<int32_t>(v4l2Ctrl.value);\n-\t\t\tbreak;\n-\n-\t\tcase ControlTypeByte:\n-\t\t\t/*\n-\t\t\t * No action required, the VIDIOC_[GS]_EXT_CTRLS ioctl\n-\t\t\t * accessed the ControlValue storage directly.\n-\t\t\t */\n-\t\t\tbreak;\n-\n \t\tdefault:\n \t\t\t/*\n+\t\t\t * Note: this catches the ControlTypeInteger32 case.\n+\t\t\t *\n \t\t\t * \\todo To be changed when support for string controls\n \t\t\t * will be added.\n \t\t\t */\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "2/3"
    ]
}