Patch Detail
Show a patch.
GET /api/patches/11697/?format=api
{ "id": 11697, "url": "https://patchwork.libcamera.org/api/patches/11697/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11697/", "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": "<20210324150125.1318325-4-kieran.bingham@ideasonboard.com>", "date": "2021-03-24T15:01:22", "name": "[libcamera-devel,v3,3/6] libcamera: buffer: Initialise status", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": false, "hash": "d57c18d280970eb6f2bfb5bfc56313bf0711f1c4", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": { "id": 11, "url": "https://patchwork.libcamera.org/api/users/11/?format=api", "username": "kbingham", "first_name": "Kieran", "last_name": "Bingham", "email": "kieran.bingham@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/11697/mbox/", "series": [ { "id": 1828, "url": "https://patchwork.libcamera.org/api/series/1828/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1828", "date": "2021-03-24T15:01:19", "name": "IPU3 Stability", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1828/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11697/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11697/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 14635C32E5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Mar 2021 15:01:37 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C88B968D72;\n\tWed, 24 Mar 2021 16:01:36 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 27BC5602E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Mar 2021 16:01:32 +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 B2E37A52;\n\tWed, 24 Mar 2021 16:01:31 +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=\"jQLWb1EQ\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1616598091;\n\tbh=EGb+GuXa1N2wwQFIP+D+xlmADU9XJ/ajKKA/y4GqIJo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=jQLWb1EQtstcKaYpnjHhWsamSXa9hoCFpBynuih8v18CS/3h98j8KBJIJG4ZRfD3q\n\tA9iMlcYAOk2hkEvR7XpF1wFloB22DssIY3D7qb9xVomZN2c6Y2qZv9mrtmraonljpp\n\thxJOYur+xICTsEtnNLcPF9t9XyHXt/FKAoyHsOXw=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Wed, 24 Mar 2021 15:01:22 +0000", "Message-Id": "<20210324150125.1318325-4-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210324150125.1318325-1-kieran.bingham@ideasonboard.com>", "References": "<20210324150125.1318325-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v3 3/6] libcamera: buffer: Initialise\n\tstatus", "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": "Buffers queued to a pipeline handler may not be yet queued to a device\nwhen the request is cancelled.\n\nThis can lead to the FrameMetadata having never been explicitly set by\nan underlying V4L2 device.\n\nThe status field on this is used to check the state of the buffer to\ndetermine if it was correctly filled, or if it was cancelled.\n\nIn the event that the buffer is not used, it must be marked as Cancelled\nas the metadata associated with that frame will not be valid.\n\nInitialise the FrameMetadata to FrameCancelled to prevent uninitialised access.\nFurthermore, re-initialise the metadata to this state when the buffers\nare re-used, or added to a Request to ensure that they are in the\ncorrect state in the event that they do not get used at all.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\nv3:\n - Initialise as FrameCancelled\n - Re-initialise to FrameCancelled when buffers are re-used\n - Do not re-order the enum\n\n include/libcamera/buffer.h | 2 +-\n src/libcamera/request.cpp | 9 +++++++--\n 2 files changed, 8 insertions(+), 3 deletions(-)", "diff": "diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h\nindex 302fe3d3e86b..f6673e2f6eda 100644\n--- a/include/libcamera/buffer.h\n+++ b/include/libcamera/buffer.h\n@@ -28,7 +28,7 @@ struct FrameMetadata {\n \t\tunsigned int bytesused;\n \t};\n \n-\tStatus status;\n+\tStatus status = FrameCancelled;\n \tunsigned int sequence;\n \tuint64_t timestamp;\n \tstd::vector<Plane> planes;\ndiff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\nindex 0071667e4a2c..9ea6ed09446b 100644\n--- a/src/libcamera/request.cpp\n+++ b/src/libcamera/request.cpp\n@@ -118,8 +118,12 @@ void Request::reuse(ReuseFlag flags)\n \tpending_.clear();\n \tif (flags & ReuseBuffers) {\n \t\tfor (auto pair : bufferMap_) {\n-\t\t\tpair.second->request_ = this;\n-\t\t\tpending_.insert(pair.second);\n+\t\t\tFrameBuffer *buffer = pair.second;\n+\n+\t\t\tbuffer->metadata_.status = FrameMetadata::Status::FrameCancelled;\n+\t\t\tbuffer->request_ = this;\n+\n+\t\t\tpending_.insert(buffer);\n \t\t}\n \t} else {\n \t\tbufferMap_.clear();\n@@ -188,6 +192,7 @@ int Request::addBuffer(const Stream *stream, FrameBuffer *buffer)\n \t}\n \n \tbuffer->request_ = this;\n+\tbuffer->metadata_.status = FrameMetadata::Status::FrameCancelled;\n \tpending_.insert(buffer);\n \tbufferMap_[stream] = buffer;\n \n", "prefixes": [ "libcamera-devel", "v3", "3/6" ] }