Patch Detail
Show a patch.
GET /api/1.1/patches/17483/?format=api
{ "id": 17483, "url": "https://patchwork.libcamera.org/api/1.1/patches/17483/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17483/", "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": "<20221002003612.13603-2-laurent.pinchart@ideasonboard.com>", "date": "2022-10-02T00:36:09", "name": "[libcamera-devel,1/4] libcamera: v4l2_videodevice: Ensure non-zero bytesused for output buffers", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "616f5b5cf406259ee16ed22afaed4868ca9e72bc", "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/17483/mbox/", "series": [ { "id": 3522, "url": "https://patchwork.libcamera.org/api/1.1/series/3522/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3522", "date": "2022-10-02T00:36:08", "name": "libcamera: Fix kernel deprecation warning with output buffers", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3522/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17483/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17483/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 10F24BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 2 Oct 2022 00:36:18 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B835262CB6;\n\tSun, 2 Oct 2022 02:36:17 +0200 (CEST)", "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 9657362CB6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 2 Oct 2022 02:36:15 +0200 (CEST)", "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0779D2D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 2 Oct 2022 02:36:14 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664670977;\n\tbh=tmA9ctq5gKfYG/CrI3y/pJiY2IWhhB6FwdgTYHBRWrQ=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=xmPelMLP28j0W3hb7zaNnpWVkIH70NIxGWwiv06rjtE+5t664dn5BZT4ZIVhbW3Ge\n\tMb39nir/X2rbitB/sPrTm9CDkhGcPaT41PJZ7nLiDx9xHikNrXAhTiXeEVFwqk2n+2\n\tn4sNJk3tqmzGYHuAh+jbpqfL4tbI7yRGiRbDR4fDVT3S1enkbtHoS55KkLOLKNS7fr\n\tPI0/34CC2efK1rDiqoyCg9mldIZx9unh0Lxx4bta/JWqZ+KdfWYLOiVokXVu2ET6rr\n\tppWUtLabh0FdtnzH4G4FKLxS80Nzq/G2BXXwQcXhaDGtK/aFxB5xKjfK+ENpjFaaGF\n\tk8h6K4P+ImAgQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664670975;\n\tbh=tmA9ctq5gKfYG/CrI3y/pJiY2IWhhB6FwdgTYHBRWrQ=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=HkztxGVfb1vdTQ3/uGmyPS/sDc8bCnC1mFQoeU/4lyBB8YVswAfVtXL0gAd9X46cK\n\t1+yydk3OAJkG+fxjwCsD9feVk4/xaG8sQaIx9oCmy22YpUqAb2oL23eNr1y5Xavkd4\n\tlU+H9jdZJARdm+NodH1HzmaU7x2C9/tRUXwbqZEQ=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"HkztxGVf\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 2 Oct 2022 03:36:09 +0300", "Message-Id": "<20221002003612.13603-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20221002003612.13603-1-laurent.pinchart@ideasonboard.com>", "References": "<20221002003612.13603-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 1/4] libcamera: v4l2_videodevice: Ensure\n\tnon-zero bytesused for output buffers", "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>", "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The V4L2 API specification indicates that, for an output video device,\nthe driver will interpret a zero bytesused value as the buffer length\n(for v4l2_buffer) or the plane length (for v4l2_plane). The videobuf2\nframework implements this behaviour, but also considers this case as\ndeprecated and prints a warning:\n\n[ 54.375534] use of bytesused == 0 is deprecated and will be removed in the future,\n[ 54.388026] use the actual size instead.\n\nAvoid the warning by setting bytesused to the buffer or plane length\nbefore queuing a buffer to an output video device.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)", "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 955e150867ef..1dbb839ed456 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1645,10 +1645,10 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)\n \t\t\t}\n \n \t\t\tif (multiPlanar) {\n-\t\t\t\tv4l2Planes[0].bytesused = bytesused;\n+\t\t\t\tv4l2Planes[0].bytesused = bytesused ? : length;\n \t\t\t\tv4l2Planes[0].length = length;\n \t\t\t} else {\n-\t\t\t\tbuf.bytesused = bytesused;\n+\t\t\t\tbuf.bytesused = bytesused ? : length;\n \t\t\t\tbuf.length = length;\n \t\t\t}\n \t\t} else if (multiPlanar) {\n@@ -1658,7 +1658,8 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)\n \t\t\t * V4L2 buffer is guaranteed to be equal at this point.\n \t\t\t */\n \t\t\tfor (auto [i, plane] : utils::enumerate(planes)) {\n-\t\t\t\tv4l2Planes[i].bytesused = metadata.planes()[i].bytesused;\n+\t\t\t\tv4l2Planes[i].bytesused = metadata.planes()[i].bytesused\n+\t\t\t\t\t\t\t? : plane.length;\n \t\t\t\tv4l2Planes[i].length = plane.length;\n \t\t\t}\n \t\t} else {\n@@ -1666,7 +1667,8 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)\n \t\t\t * Single-planar API with a single plane in the buffer\n \t\t\t * is trivial to handle.\n \t\t\t */\n-\t\t\tbuf.bytesused = metadata.planes()[0].bytesused;\n+\t\t\tbuf.bytesused = metadata.planes()[0].bytesused\n+\t\t\t\t ? : planes[0].length;\n \t\t\tbuf.length = planes[0].length;\n \t\t}\n \n", "prefixes": [ "libcamera-devel", "1/4" ] }