Patch Detail
Show a patch.
GET /api/1.1/patches/11483/?format=api
{ "id": 11483, "url": "https://patchwork.libcamera.org/api/1.1/patches/11483/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11483/", "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": "<20210303170426.189648-4-kieran.bingham@ideasonboard.com>", "date": "2021-03-03T17:04:26", "name": "[libcamera-devel,3/3] libcamera: v4l2_videodevice: Prevent queueing buffers without a cache", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a90994fd93d98eb481a151ca75ab9e445530a0f2", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": { "id": 11, "url": "https://patchwork.libcamera.org/api/1.1/users/11/?format=api", "username": "kbingham", "first_name": "Kieran", "last_name": "Bingham", "email": "kieran.bingham@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/11483/mbox/", "series": [ { "id": 1754, "url": "https://patchwork.libcamera.org/api/1.1/series/1754/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1754", "date": "2021-03-03T17:04:23", "name": "IPU3 Stability", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1754/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11483/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11483/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 8375CBD80E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 3 Mar 2021 17:04:33 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3FBB368AA9;\n\tWed, 3 Mar 2021 18:04:32 +0100 (CET)", "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 9136868A91\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 3 Mar 2021 18:04:30 +0100 (CET)", "from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F24A8CA;\n\tWed, 3 Mar 2021 18:04:30 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gMG3ZeQj\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1614791070;\n\tbh=hKEekJNtVNA4pumGwYYfJyLAUPQc0ElpV43hQ60SklQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=gMG3ZeQj38SGnzyXnJIBpouoZGC+GbOvAxDJanmUO04aGU12pQoZ7VEnNyPxS1rh7\n\tZDXuVv+nnFZt5fjJV9GcNrNbf2577X8gubvu+A+NlngU7hTS8NVUFK8xtDPLuEh+nn\n\tWbDEX/00+MrVUgLVvMySfrjFAzsX9UpHUZl/bW38=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Wed, 3 Mar 2021 17:04:26 +0000", "Message-Id": "<20210303170426.189648-4-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210303170426.189648-1-kieran.bingham@ideasonboard.com>", "References": "<20210303170426.189648-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 3/3] libcamera: v4l2_videodevice: Prevent\n\tqueueing buffers without a cache", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The v4l2 buffer cache allows us to map incoming buffers to an instance\nof the V4L2 Buffer required to actually queue.\n\nIf the cache_ is not available, then the buffers required to allow\nqueuing to a device have been released, and this indicates an issue at\nthe pipeline handler.\n\nThis could be a common mistake, as it could happen if a pipeline handler\nalways requeues buffers to the device after they complete, without\nchecking if they are cancelled.\n\nThat can then lead to trying to queue a buffer to a device which no\nlonger expects buffers, so add a loud message to indicate what has\nhappened but return an error without fatally crashing.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 10 ++++++++++\n 1 file changed, 10 insertions(+)", "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex c77e1aff7978..6129ce529afc 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1390,6 +1390,16 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)\n \tstruct v4l2_buffer buf = {};\n \tint ret;\n \n+\t/*\n+\t * Pipeline handlers should not requeue buffers after releasing the\n+\t * buffers on the device. Any occurence of this error should be fixed\n+\t * in the pipeline handler directly.\n+\t */\n+\tif (!cache_) {\n+\t\tLOG(V4L2, Error) << \"No BufferCache available to queue.\";\n+\t\treturn -ENOENT;\n+\t}\n+\n \tret = cache_->get(*buffer);\n \tif (ret < 0)\n \t\treturn ret;\n", "prefixes": [ "libcamera-devel", "3/3" ] }