Patch Detail
Show a patch.
GET /api/1.1/patches/20649/?format=api
{ "id": 20649, "url": "https://patchwork.libcamera.org/api/1.1/patches/20649/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20649/", "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": "<20240712052920.33396-2-umang.jain@ideasonboard.com>", "date": "2024-07-12T05:29:15", "name": "[RFC,1/6] libcamera: v4l2_device: Add support for V4L2_CTRL_TYPE_U32", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "8bb7b398b718ff00a8d2bb5a9cf104477480b895", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20649/mbox/", "series": [ { "id": 4451, "url": "https://patchwork.libcamera.org/api/1.1/series/4451/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4451", "date": "2024-07-12T05:29:14", "name": "converter_dw100: Add vertex map support", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4451/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20649/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20649/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 AAA9FBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Jul 2024 05:29:41 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C643463374;\n\tFri, 12 Jul 2024 07:29:37 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 94B8E619A9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Jul 2024 07:29:33 +0200 (CEST)", "from localhost.localdomain (unknown\n\t[IPv6:2405:201:2015:f873:55f8:639e:8e9f:12ec])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 81BB5D50;\n\tFri, 12 Jul 2024 07:28:58 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"uy5FYBQy\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720762139;\n\tbh=d9nWrdKic1P+XVgN81WRUQs94uSk0gkUXefH13F5mfI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=uy5FYBQyYcXlofQPfjGA6ee+GVlD1LvIkNu/dYn5VlO0OEyGyOS1t0SaPeX0/nhz0\n\tZJZgzzRuEJz7RIaEfRMqBI9Iw8zGQnNYUYpZpQLTMY+RmD/jBu7Lvmi10Nu/ehI2Lc\n\t6NhHdZ5DL1nmUYpSsgMhrWpWHV7QctDZS8adm9+o=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Xavier Roumegue <xavier.roumegue@oss.nxp.com>,\n\tUmang Jain <umang.jain@ideasonboard.com>", "Subject": "[RFC PATCH 1/6] libcamera: v4l2_device: Add support for\n\tV4L2_CTRL_TYPE_U32", "Date": "Fri, 12 Jul 2024 10:59:15 +0530", "Message-ID": "<20240712052920.33396-2-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.45.0", "In-Reply-To": "<20240712052920.33396-1-umang.jain@ideasonboard.com>", "References": "<20240712052920.33396-1-umang.jain@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Support for the U16 and U32 compound control types is missing. U16 will\nrequire a new libcamera control type, but U32 maps to the existing\nControlTypeInteger32 and can be added easily.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n include/libcamera/controls.h | 5 +++++\n src/libcamera/v4l2_device.cpp | 11 +++++++++++\n 2 files changed, 16 insertions(+)", "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 7c2bb287..c6db4ebb 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -57,6 +57,11 @@ struct control_type<uint8_t> {\n \tstatic constexpr ControlType value = ControlTypeByte;\n };\n \n+template<>\n+struct control_type<uint32_t> {\n+\tstatic constexpr ControlType value = ControlTypeInteger32;\n+};\n+\n template<>\n struct control_type<int32_t> {\n \tstatic constexpr ControlType value = ControlTypeInteger32;\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 4a2048cf..db20f31c 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -212,6 +212,10 @@ ControlList V4L2Device::getControls(const std::vector<uint32_t> &ids)\n \t\t\t\ttype = ControlTypeByte;\n \t\t\t\tbreak;\n \n+\t\t\tcase V4L2_CTRL_TYPE_U32:\n+\t\t\t\ttype = ControlTypeInteger32;\n+\t\t\t\tbreak;\n+\n \t\t\tdefault:\n \t\t\t\tLOG(V4L2, Error)\n \t\t\t\t\t<< \"Unsupported payload control type \"\n@@ -491,6 +495,7 @@ ControlType V4L2Device::v4l2CtrlType(uint32_t ctrlType)\n \t\treturn ControlTypeBool;\n \n \tcase V4L2_CTRL_TYPE_INTEGER:\n+\tcase V4L2_CTRL_TYPE_U32:\n \t\treturn ControlTypeInteger32;\n \n \tcase V4L2_CTRL_TYPE_INTEGER64:\n@@ -543,6 +548,11 @@ std::optional<ControlInfo> V4L2Device::v4l2ControlInfo(const v4l2_query_ext_ctrl\n \t\t\t\t static_cast<bool>(ctrl.maximum),\n \t\t\t\t static_cast<bool>(ctrl.default_value));\n \n+\tcase V4L2_CTRL_TYPE_U32:\n+\t\treturn ControlInfo(static_cast<uint32_t>(ctrl.minimum),\n+\t\t\t\t static_cast<uint32_t>(ctrl.maximum),\n+\t\t\t\t static_cast<uint32_t>(ctrl.default_value));\n+\n \tcase V4L2_CTRL_TYPE_INTEGER64:\n \t\treturn ControlInfo(static_cast<int64_t>(ctrl.minimum),\n \t\t\t\t static_cast<int64_t>(ctrl.maximum),\n@@ -624,6 +634,7 @@ void V4L2Device::listControls()\n \t\tcase V4L2_CTRL_TYPE_BITMASK:\n \t\tcase V4L2_CTRL_TYPE_INTEGER_MENU:\n \t\tcase V4L2_CTRL_TYPE_U8:\n+\t\tcase V4L2_CTRL_TYPE_U32:\n \t\t\tbreak;\n \t\t/* \\todo Support other control types. */\n \t\tdefault:\n", "prefixes": [ "RFC", "1/6" ] }