Patch Detail
Show a patch.
GET /api/1.1/patches/8413/?format=api
{ "id": 8413, "url": "https://patchwork.libcamera.org/api/1.1/patches/8413/?format=api", "web_url": "https://patchwork.libcamera.org/patch/8413/", "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": "<20200624145256.48266-16-paul.elder@ideasonboard.com>", "date": "2020-06-24T14:52:49", "name": "[libcamera-devel,v4,15/22] v4l2: v4l2_camera_proxy: Clear internal buffer vector on reqbufs 0", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "88663f3e7b31384617a6ba5e8ce4377f7120a2dc", "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/8413/mbox/", "series": [ { "id": 1041, "url": "https://patchwork.libcamera.org/api/1.1/series/1041/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1041", "date": "2020-06-24T14:52:34", "name": "Support v4l2-compliance", "version": 4, "mbox": "https://patchwork.libcamera.org/series/1041/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/8413/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/8413/checks/", "tags": {}, "headers": { "Return-Path": "<paul.elder@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B3519609C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2020 16:53:51 +0200 (CEST)", "from jade.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:8147:f2a2:a8c6:9087])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CA5902A8;\n\tWed, 24 Jun 2020 16:53:49 +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=\"bnndQHaz\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593010431;\n\tbh=kLZGupO242hvH2AcNydhWhWZII+Zp57aGQ/nzI8zmao=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=bnndQHazS0Mb7ZRAbWpb/iJm6i1NAIoSsOyAsTGP3mjEuBQzMWZzJt/Hm4zE7tdsO\n\tOgOJMh5iK9SvzfzjpemSVNOr8OULZ1OCliQex/so640zV4MqO7sedckh6kWNu+yZ0e\n\tALu0NRtxXbFIvp76b2sLNu3/f6CQp23iEbKwWaOQ=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 24 Jun 2020 23:52:49 +0900", "Message-Id": "<20200624145256.48266-16-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200624145256.48266-1-paul.elder@ideasonboard.com>", "References": "<20200624145256.48266-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 15/22] v4l2: v4l2_camera_proxy: Clear\n\tinternal buffer vector on reqbufs 0", "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": "Wed, 24 Jun 2020 14:53:52 -0000" }, "content": "If VIDIOC_REQBUFS with count = 0 is called when the stream is not on,\nclear the proxy's internal vector of buffer. If the stream is on when\nreqbufs 0 is called, return -EBUSY.\n\nNote that this is contrary to what the V4L2 docs say (reqbufs 0 when\nstreaming should also streamoff), but it is how the V4L2 implementation\nworks. v4l2-compliance doesn't seem to care either way, however, so we\ncater to the implementation, and no longer call streamoff on reqbufs 0.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nChanges in v4:\n- instead of resetting flags, clear the buffer vector in the proxy\n\nChanges in v3:\n- don't streamoff in reqbufs 0; return -EBUSY instead\n\nChanges in v2:\n- call only the necessary components, instead of\n V4L2CameraProxy::vidioc_streamoff\n---\n src/v4l2/v4l2_camera_proxy.cpp | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)", "diff": "diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex 7b269a5..9965a53 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -445,11 +445,8 @@ void V4L2CameraProxy::freeBuffers()\n {\n \tLOG(V4L2Compat, Debug) << \"Freeing libcamera bufs\";\n \n-\tint ret = vcam_->streamOff();\n-\tif (ret < 0)\n-\t\tLOG(V4L2Compat, Error) << \"Failed to stop stream\";\n-\n \tvcam_->freeBuffers();\n+\tbuffers_.clear();\n \tbufferCount_ = 0;\n }\n \n@@ -473,6 +470,9 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf\n \tmemset(arg->reserved, 0, sizeof(arg->reserved));\n \n \tif (arg->count == 0) {\n+\t\tif (vcam_->isRunning())\n+\t\t\treturn -EBUSY;\n+\n \t\tfreeBuffers();\n \t\trelease(file);\n \n", "prefixes": [ "libcamera-devel", "v4", "15/22" ] }