Patch Detail
Show a patch.
GET /api/patches/22586/?format=api
{ "id": 22586, "url": "https://patchwork.libcamera.org/api/patches/22586/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22586/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20250120141657.95664-1-pobrn@protonmail.com>", "date": "2025-01-20T14:16:59", "name": "[v1] libcamera: request: addBuffer(): Do fence check earlier", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "cb44c1fa864e40eb83914fea0be3cf793555909b", "submitter": { "id": 133, "url": "https://patchwork.libcamera.org/api/people/133/?format=api", "name": "Pőcze Barnabás", "email": "pobrn@protonmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22586/mbox/", "series": [ { "id": 4957, "url": "https://patchwork.libcamera.org/api/series/4957/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4957", "date": "2025-01-20T14:16:59", "name": "[v1] libcamera: request: addBuffer(): Do fence check earlier", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4957/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22586/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22586/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 3D4C9C327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Jan 2025 14:17:09 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3455968550;\n\tMon, 20 Jan 2025 15:17:08 +0100 (CET)", "from mail-10630.protonmail.ch (mail-10630.protonmail.ch\n\t[79.135.106.30])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A627684E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jan 2025 15:17:06 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"gXqdqdVR\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1737382625; x=1737641825;\n\tbh=EZ15LKxgYPOmqH+IXimN7zAbu3/pPkDM2jnFknmmCp4=;\n\th=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:\n\tSubject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector:\n\tList-Unsubscribe:List-Unsubscribe-Post;\n\tb=gXqdqdVR/Y9oPdOsi2lgWrl46qQA78HQ2E06vT4URrMAQBIZd06hB7E86JwmAhRQX\n\t8LVNzyeneXhdAZIC+Z4WZmOTeTfiB1tBZHgQlNkICV2TEEocMPAvjeup2k50dhuoQ9\n\taIRHsDRnJkz0RsSl7EU2POo37wNu/XRIry2Ytu9zIAiNAP2km4l8xE+pT66i4xks6u\n\tTrYPTgmiKxOegQTmNCMzw22ADGC+qbjXpHVsTqR2gtL0rYETEIaMWCcKgye0jMhIMS\n\tZJ0P0rysyK/HPSxtExahPgilVp9hLFlc5h6Th0CW829fyYgv/fAPRNUMQlei44Olje\n\t+/QpgeALQdjOg==", "Date": "Mon, 20 Jan 2025 14:16:59 +0000", "To": "libcamera-devel@lists.libcamera.org", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>", "Subject": "[PATCH v1] libcamera: request: addBuffer(): Do fence check earlier", "Message-ID": "<20250120141657.95664-1-pobrn@protonmail.com>", "Feedback-ID": "20568564:user:proton", "X-Pm-Message-ID": "741dfc6fc2438c2abc09ff8bb1baa0e8355c394f", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=utf-8", "Content-Transfer-Encoding": "quoted-printable", "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": "Check if the buffer has a fence before making any modifications because\notherwise it is possible for `Request::addBuffer()` to return an error code\nwhile at the same time the buffer - for all intents and purposes - is added\nto the request.\n\nSigned-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n---\n src/libcamera/request.cpp | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)", "diff": "diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\nindex 5cfafea89..e7eb1c0c8 100644\n--- a/src/libcamera/request.cpp\n+++ b/src/libcamera/request.cpp\n@@ -466,6 +466,15 @@ int Request::addBuffer(const Stream *stream, FrameBuffer *buffer,\n \t\treturn -EINVAL;\n \t}\n \n+\t/*\n+\t * Make sure the fence has been extracted from the buffer\n+\t * to avoid waiting on a stale fence.\n+\t */\n+\tif (buffer->_d()->fence()) {\n+\t\tLOG(Request, Error) << \"Can't add buffer that still references a fence\";\n+\t\treturn -EEXIST;\n+\t}\n+\n \tauto it = bufferMap_.find(stream);\n \tif (it != bufferMap_.end()) {\n \t\tLOG(Request, Error) << \"FrameBuffer already set for stream\";\n@@ -476,15 +485,6 @@ int Request::addBuffer(const Stream *stream, FrameBuffer *buffer,\n \t_d()->pending_.insert(buffer);\n \tbufferMap_[stream] = buffer;\n \n-\t/*\n-\t * Make sure the fence has been extracted from the buffer\n-\t * to avoid waiting on a stale fence.\n-\t */\n-\tif (buffer->_d()->fence()) {\n-\t\tLOG(Request, Error) << \"Can't add buffer that still references a fence\";\n-\t\treturn -EEXIST;\n-\t}\n-\n \tif (fence && fence->isValid())\n \t\tbuffer->_d()->setFence(std::move(fence));\n \n", "prefixes": [ "v1" ] }