Patch Detail
Show a patch.
GET /api/1.1/patches/14072/?format=api
{ "id": 14072, "url": "https://patchwork.libcamera.org/api/1.1/patches/14072/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14072/", "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": "<20211008101556.22987-1-laurent.pinchart@ideasonboard.com>", "date": "2021-10-08T10:15:56", "name": "[libcamera-devel] libcamera: v4l2_videodevice: Improve debugging when buffer is too small", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "46baf2906cf185c1b655bfeb1ac81efac97c83d1", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14072/mbox/", "series": [ { "id": 2608, "url": "https://patchwork.libcamera.org/api/1.1/series/2608/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2608", "date": "2021-10-08T10:15:56", "name": "[libcamera-devel] libcamera: v4l2_videodevice: Improve debugging when buffer is too small", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2608/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14072/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14072/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 866DBC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 8 Oct 2021 10:16:17 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 07C81691B6;\n\tFri, 8 Oct 2021 12:16:17 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B5963691AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 8 Oct 2021 12:16:10 +0200 (CEST)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3E1D0581;\n\tFri, 8 Oct 2021 12:16:10 +0200 (CEST)" ], "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=\"pO/QA+2/\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633688170;\n\tbh=IH9Tp4ibZLmqS8+yxuES226T9mx9VUt+2MkyCJ8bzks=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=pO/QA+2/Yt618GVzArnQA+ayPCm2lifAEKU4x44FBUtdDcIGswNOLRk8skTn3Sp8j\n\t/LJ3mUtfLCbUjxmVxqfqNZiWI2uPc4kpT47gFvvbTQ1eNB/hL7Y2mHTRAoAxwLCy+h\n\tPtHvOFDsc13nZ1gq9Fu44fiUXiVDj1lQYPepWPks=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 8 Oct 2021 13:15:56 +0300", "Message-Id": "<20211008101556.22987-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.32.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Improve\n\tdebugging when buffer is too small", "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": "When a dequeued buffer is too small, the condition is logged and an\nerror is returned. The logged message doesn't provide any information\nabout the sizes, making debugging more difficult. Improve it by logging\nboth the bytesused value and the length of each plane.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nCompile-tested only. Eugen, could you give it a try to debug the problem\nyou're facing ?\n\n---\n src/libcamera/v4l2_videodevice.cpp | 14 ++++++++++----\n 1 file changed, 10 insertions(+), 4 deletions(-)\n\n\nbase-commit: 962df634bd0afe12e6f38464f5e602cf1460c430", "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex ba5f88cd41ed..bd74103de7af 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1713,19 +1713,25 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer()\n \n \t\tunsigned int bytesused = multiPlanar ? planes[0].bytesused\n \t\t\t\t : buf.bytesused;\n+\t\tunsigned int remaining = bytesused;\n \n \t\tfor (auto [i, plane] : utils::enumerate(buffer->planes())) {\n-\t\t\tif (!bytesused) {\n+\t\t\tif (!remaining) {\n \t\t\t\tLOG(V4L2, Error)\n-\t\t\t\t\t<< \"Dequeued buffer is too small\";\n+\t\t\t\t\t<< \"Dequeued buffer (\" << bytesused\n+\t\t\t\t\t<< \" bytes) too small for plane lengths \"\n+\t\t\t\t\t<< utils::join(buffer->planes(), \"/\",\n+\t\t\t\t\t\t [](const FrameBuffer::Plane &p){\n+\t\t\t\t\t\t\t return p.length;\n+\t\t\t\t\t\t });\n \n \t\t\t\tmetadata.status = FrameMetadata::FrameError;\n \t\t\t\treturn buffer;\n \t\t\t}\n \n \t\t\tmetadata.planes()[i].bytesused =\n-\t\t\t\tstd::min(plane.length, bytesused);\n-\t\t\tbytesused -= metadata.planes()[i].bytesused;\n+\t\t\t\tstd::min(plane.length, remaining);\n+\t\t\tremaining -= metadata.planes()[i].bytesused;\n \t\t}\n \t} else if (multiPlanar) {\n \t\t/*\n", "prefixes": [ "libcamera-devel" ] }