Patch Detail
Show a patch.
GET /api/1.1/patches/4049/?format=api
{ "id": 4049, "url": "https://patchwork.libcamera.org/api/1.1/patches/4049/?format=api", "web_url": "https://patchwork.libcamera.org/patch/4049/", "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": "<20200616131244.70308-6-paul.elder@ideasonboard.com>", "date": "2020-06-16T13:12:34", "name": "[libcamera-devel,05/15] v4l2: v4l2_camera_proxy: Implement VIDIOC_ENUMINPUT, VIDIOC_G/S_INPUT", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "efd25b6d34e515ffde58aef7b7cfeff03c991173", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/4049/mbox/", "series": [ { "id": 1006, "url": "https://patchwork.libcamera.org/api/1.1/series/1006/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1006", "date": "2020-06-16T13:12:29", "name": "Support v4l2-compliance", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1006/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/4049/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/4049/checks/", "tags": {}, "headers": { "Return-Path": "<paul.elder@ideasonboard.com>", "Received": [ "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 E2C75603C1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Jun 2020 15:13:09 +0200 (CEST)", "from jade.flets-east.jp (unknown\n\t[IPv6:2400:4051:61:600:2807:bdfa:f6a:8e53])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5A332F9;\n\tTue, 16 Jun 2020 15:13:08 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rPuq2sbi\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592313189;\n\tbh=y/vOLRN6xRrkRkkvDb1TKpC5d0iLmLjQLru3wnFYy5o=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rPuq2sbiCTaMNYTB/cOQH8Sv81i2IGhjsKyA89LZ8+theEXo1G716CVm6CF55imLK\n\tUU6HWd5Ol4REt8IbS9GKq3X6Ec3g/M/aCMb3DyR65N308pIHNQsXTMC31VYqFgMfcv\n\toN9w5Tfa0mpwx26ZI8Ocf5ogZnxAXmqeoeOPv5BE=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 16 Jun 2020 22:12:34 +0900", "Message-Id": "<20200616131244.70308-6-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200616131244.70308-1-paul.elder@ideasonboard.com>", "References": "<20200616131244.70308-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 05/15] v4l2: v4l2_camera_proxy: Implement\n\tVIDIOC_ENUMINPUT, VIDIOC_G/S_INPUT", "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": "Tue, 16 Jun 2020 13:13:10 -0000" }, "content": "Implement VIDIOC_ENUMINPUT, VIDIOC_G_INPUT, and VIDIOC_S_INPUT. Only the\nzeroth input device is supported, and the info returned by enuminput is\nhardcoded and basic. This is sufficient to pass v4l2-compliance.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/v4l2/v4l2_camera_proxy.cpp | 54 ++++++++++++++++++++++++++++++++++\n src/v4l2/v4l2_camera_proxy.h | 3 ++\n 2 files changed, 57 insertions(+)", "diff": "diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex f268f7a..6c0dacc 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -397,6 +397,51 @@ int V4L2CameraProxy::vidioc_s_priority(int fd, enum v4l2_priority *arg)\n \treturn 0;\n }\n \n+int V4L2CameraProxy::vidioc_enuminput(int fd, struct v4l2_input *arg)\n+{\n+\tLOG(V4L2Compat, Debug) << \"Servicing vidioc_enuminput fd = \" << fd;\n+\n+\tif (arg == nullptr)\n+\t\treturn -EFAULT;\n+\n+\tif (arg->index != 0)\n+\t\treturn -EINVAL;\n+\n+\tmemset(arg, 0, sizeof(*arg));\n+\n+\tutils::strlcpy(reinterpret_cast<char *>(arg->name),\n+\t\t reinterpret_cast<char *>(capabilities_.card),\n+\t\t sizeof(arg->name));\n+\targ->type = V4L2_INPUT_TYPE_CAMERA;\n+\n+\treturn 0;\n+}\n+\n+int V4L2CameraProxy::vidioc_g_input(int fd, int *arg)\n+{\n+\tLOG(V4L2Compat, Debug) << \"Servicing vidioc_g_input fd = \" << fd;\n+\n+\tif (arg == nullptr)\n+\t\treturn -EFAULT;\n+\n+\t*arg = 0;\n+\n+\treturn 0;\n+}\n+\n+int V4L2CameraProxy::vidioc_s_input(int fd, int *arg)\n+{\n+\tLOG(V4L2Compat, Debug) << \"Servicing vidioc_s_input fd = \" << fd;\n+\n+\tif (arg == nullptr)\n+\t\treturn -EFAULT;\n+\n+\tif (*arg != 0)\n+\t\treturn -EINVAL;\n+\n+\treturn 0;\n+}\n+\n int V4L2CameraProxy::freeBuffers()\n {\n \tLOG(V4L2Compat, Debug) << \"Freeing libcamera bufs\";\n@@ -649,6 +694,15 @@ int V4L2CameraProxy::ioctl(int fd, unsigned long request, void *arg)\n \tcase VIDIOC_S_PRIORITY:\n \t\tret = vidioc_s_priority(fd, static_cast<enum v4l2_priority *>(arg));\n \t\tbreak;\n+\tcase VIDIOC_ENUMINPUT:\n+\t\tret = vidioc_enuminput(fd, static_cast<struct v4l2_input *>(arg));\n+\t\tbreak;\n+\tcase VIDIOC_G_INPUT:\n+\t\tret = vidioc_g_input(fd, static_cast<int *>(arg));\n+\t\tbreak;\n+\tcase VIDIOC_S_INPUT:\n+\t\tret = vidioc_s_input(fd, static_cast<int *>(arg));\n+\t\tbreak;\n \tcase VIDIOC_REQBUFS:\n \t\tret = vidioc_reqbufs(fd, static_cast<struct v4l2_requestbuffers *>(arg));\n \t\tbreak;\ndiff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\nindex a0c373d..2e90bfd 100644\n--- a/src/v4l2/v4l2_camera_proxy.h\n+++ b/src/v4l2/v4l2_camera_proxy.h\n@@ -51,6 +51,9 @@ private:\n \tint vidioc_try_fmt(int fd, struct v4l2_format *arg);\n \tint vidioc_g_priority(int fd, enum v4l2_priority *arg);\n \tint vidioc_s_priority(int fd, enum v4l2_priority *arg);\n+\tint vidioc_enuminput(int fd, struct v4l2_input *arg);\n+\tint vidioc_g_input(int fd, int *arg);\n+\tint vidioc_s_input(int fd, int *arg);\n \tint vidioc_reqbufs(int fd, struct v4l2_requestbuffers *arg);\n \tint vidioc_querybuf(int fd, struct v4l2_buffer *arg);\n \tint vidioc_qbuf(int fd, struct v4l2_buffer *arg);\n", "prefixes": [ "libcamera-devel", "05/15" ] }