Patch Detail
Show a patch.
GET /api/1.1/patches/3491/?format=api
{ "id": 3491, "url": "https://patchwork.libcamera.org/api/1.1/patches/3491/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3491/", "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": "<20200418103216.140572-6-jacopo@jmondi.org>", "date": "2020-04-18T10:32:16", "name": "[libcamera-devel,v4,5/5] v4l: document VIDIOC_SUBDEV_QUERYCAP", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "c2a0c0293efa0d5e364fc9ddb7abb96c1929f9a2", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3491/mbox/", "series": [ { "id": 816, "url": "https://patchwork.libcamera.org/api/1.1/series/816/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=816", "date": "2020-04-18T10:32:11", "name": "media: Register read-only sub-dev devnode", "version": 4, "mbox": "https://patchwork.libcamera.org/series/816/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3491/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3491/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F373C60401\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 18 Apr 2020 12:30:08 +0200 (CEST)", "from uno.homenet.telecomitalia.it (unknown [87.13.136.104])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 914C660007;\n\tSat, 18 Apr 2020 10:29:58 +0000 (UTC)" ], "X-Originating-IP": "87.13.136.104", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "linux-media@vger.kernel.org,\n\tlibcamera-devel@lists.libcamera.org", "Cc": "Jacopo Mondi <jacopo@jmondi.org>, mchehab@kernel.org,\n\thverkuil-cisco@xs4all.nl, sakari.ailus@linux.intel.com,\n\tandrey.konovalov@linaro.org, laurent.pinchart@ideasonboard.com,\n\tHans Verkuil <hans.verkuil@cisco.com>", "Date": "Sat, 18 Apr 2020 12:32:16 +0200", "Message-Id": "<20200418103216.140572-6-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.26.1", "In-Reply-To": "<20200418103216.140572-1-jacopo@jmondi.org>", "References": "<20200418103216.140572-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 5/5] v4l: document\n\tVIDIOC_SUBDEV_QUERYCAP", "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>", "X-List-Received-Date": "Sat, 18 Apr 2020 10:30:09 -0000" }, "content": "From: Hans Verkuil <hans.verkuil@cisco.com>\n\nAdd documentation for the new VIDIOC_SUBDEV_QUERYCAP ioctl.\n\nSigned-off-by: Hans Verkuil <hans.verkuil@cisco.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n .../userspace-api/media/v4l/user-func.rst | 1 +\n .../media/v4l/vidioc-subdev-querycap.rst | 114 ++++++++++++++++++\n 2 files changed, 115 insertions(+)\n create mode 100644 Documentation/userspace-api/media/v4l/vidioc-subdev-querycap.rst", "diff": "diff --git a/Documentation/userspace-api/media/v4l/user-func.rst b/Documentation/userspace-api/media/v4l/user-func.rst\nindex f235f88efe89..559cce421d41 100644\n--- a/Documentation/userspace-api/media/v4l/user-func.rst\n+++ b/Documentation/userspace-api/media/v4l/user-func.rst\n@@ -78,6 +78,7 @@ Function Reference\n vidioc-subdev-g-fmt\n vidioc-subdev-g-frame-interval\n vidioc-subdev-g-selection\n+ vidioc-subdev-querycap.rst\n vidioc-subscribe-event\n func-mmap\n func-munmap\ndiff --git a/Documentation/userspace-api/media/v4l/vidioc-subdev-querycap.rst b/Documentation/userspace-api/media/v4l/vidioc-subdev-querycap.rst\nnew file mode 100644\nindex 000000000000..d9b2e19e1339\n--- /dev/null\n+++ b/Documentation/userspace-api/media/v4l/vidioc-subdev-querycap.rst\n@@ -0,0 +1,114 @@\n+.. Permission is granted to copy, distribute and/or modify this\n+.. document under the terms of the GNU Free Documentation License,\n+.. Version 1.1 or any later version published by the Free Software\n+.. Foundation, with no Invariant Sections, no Front-Cover Texts\n+.. and no Back-Cover Texts. A copy of the license is included at\n+.. Documentation/userspace-api/media/fdl-appendix.rst.\n+..\n+\n+.. _VIDIOC_SUBDEV_QUERYCAP:\n+\n+****************************\n+ioctl VIDIOC_SUBDEV_QUERYCAP\n+****************************\n+\n+Name\n+====\n+\n+VIDIOC_SUBDEV_QUERYCAP - Query sub-device capabilities\n+\n+\n+Synopsis\n+========\n+\n+.. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_QUERYCAP, struct v4l2_subdev_capability *argp )\n+ :name: VIDIOC_SUBDEV_QUERYCAP\n+\n+\n+Arguments\n+=========\n+\n+``fd``\n+ File descriptor returned by :ref:`open() <func-open>`.\n+\n+``argp``\n+ Pointer to struct :c:type:`v4l2_subdev_capability`.\n+\n+\n+Description\n+===========\n+\n+All V4L2 sub-devices support the\n+``VIDIOC_SUBDEV_QUERYCAP`` ioctl. It is used to identify\n+kernel devices compatible with this specification and to obtain\n+information about driver and hardware capabilities. The ioctl takes a\n+pointer to a struct :c:type:`v4l2_subdev_capability` which is filled by the\n+driver. When the driver is not compatible with this specification the ioctl\n+returns ``ENOTTY`` error code.\n+\n+.. tabularcolumns:: |p{1.5cm}|p{2.5cm}|p{13cm}|\n+\n+.. c:type:: v4l2_subdev_capability\n+\n+.. flat-table:: struct v4l2_subdev_capability\n+ :header-rows: 0\n+ :stub-columns: 0\n+ :widths: 3 4 20\n+\n+ * - __u32\n+ - ``version``\n+ - Version number of the driver.\n+\n+ The version reported is provided by the V4L2 subsystem following the\n+ kernel numbering scheme. However, it may not always return the same\n+ version as the kernel if, for example, a stable or\n+ distribution-modified kernel uses the V4L2 stack from a newer kernel.\n+\n+\tThe version number is formatted using the ``KERNEL_VERSION()``\n+\tmacro:\n+ * - :cspan:`2`\n+\n+\t``#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))``\n+\n+\t``__u32 version = KERNEL_VERSION(0, 8, 1);``\n+\n+\t``printf (\"Version: %u.%u.%u\\\\n\",``\n+\n+\t``(version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);``\n+ * - __u32\n+ - ``subdev_caps``\n+ - Sub-device capabilities of the opened device, see\n+\t:ref:`subdevice-capabilities`.\n+\n+.. tabularcolumns:: |p{6cm}|p{2.2cm}|p{8.8cm}|\n+\n+.. _subdevice-capabilities:\n+\n+.. cssclass:: longtable\n+\n+.. flat-table:: Sub-Device Capabilities Flags\n+ :header-rows: 0\n+ :stub-columns: 0\n+ :widths: 3 1 4\n+\n+ * - V4L2_SUBDEV_CAP_RO_SUBDEV\n+ - 0x00000001\n+ - The sub-device device node is registered in read-only mode.\n+ Access to the sub-device ioctls that modify the device state is\n+ restricted. Refer to each individual subdevice ioctl documentation\n+ for a description of which restrictions apply to a read-only sub-device.\n+\n+ * - V4L2_SUBDEV_CAP_RW_SUBDEV\n+ - 0x00000002\n+ - The sub-device device node is registered in read/write mode, all the\n+ subdevice ioctls are accessible from userspace.\n+\n+Return Value\n+============\n+\n+On success 0 is returned, on error -1 and the ``errno`` variable is set\n+appropriately. The generic error codes are described at the\n+:ref:`Generic Error Codes <gen-errors>` chapter.\n+\n+ENOTTY\n+ The device node is not a V4L2 sub-device.\n", "prefixes": [ "libcamera-devel", "v4", "5/5" ] }