Patch Detail
Show a patch.
GET /api/1.1/patches/14110/?format=api
{ "id": 14110, "url": "https://patchwork.libcamera.org/api/1.1/patches/14110/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14110/", "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": "<20211012220053.5139-1-laurent.pinchart@ideasonboard.com>", "date": "2021-10-12T22:00:53", "name": "[libcamera-devel,v1.1,3/3] cam: Drop frames once the capture limit is reached", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "698b966b9f1f69676b327b7dae84b80191f9a22a", "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/14110/mbox/", "series": [ { "id": 2619, "url": "https://patchwork.libcamera.org/api/1.1/series/2619/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2619", "date": "2021-10-12T22:00:53", "name": null, "version": 1, "mbox": "https://patchwork.libcamera.org/series/2619/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14110/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14110/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 03274C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Oct 2021 22:01:14 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63A4468F51;\n\tWed, 13 Oct 2021 00:01:13 +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 0EBBA6012B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Oct 2021 00:01:11 +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 061F6CC;\n\tWed, 13 Oct 2021 00:01:09 +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=\"W76OTpdA\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634076070;\n\tbh=RQRY7YcE/PghAOykN1xd3xECAu6OFwC3Esosu2CDu8k=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=W76OTpdApzWjpsX7LH+IP8C9MqZsB9jPVSo5SZXJ4ll57HvXRAUpHzVt8IfGmy76H\n\tlVtrMCs2gJe+N6WVRGf5tCUoS3wSi1Y2ntC/vgvSEv9NMW6Uuv8bimkufZB66x9Jl8\n\t5uxxBLZj7T+j9F11mbBToPEkxZ5uZARBzg1uKwjU=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 13 Oct 2021 01:00:53 +0300", "Message-Id": "<20211012220053.5139-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<163403741592.2943484.12457394596940840718@Monstersaurus>", "References": "<163403741592.2943484.12457394596940840718@Monstersaurus>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v1.1 3/3] cam: Drop frames once the\n\tcapture limit is reached", "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": "The camera session keeps requeuing requests until the capture limit is\nreached. This causes more request than the limit to complete, as there's\na queue of requests in flight. When capturing from multiple cameras\nconcurrently, this results in the captureDone signal being emitted for\nevery request completion after the limit is reached, instead of once per\ncamera session when reaching the limit.\n\nFix this by simply dropping any request that completes after the limit\nis reached. We could instead avoid requeuing more requests than needed\nto reach the limit, but that may cause request starvation in pipelines,\nwhich are currently not handled consistently (or correctly).\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\nChanges since v1:\n\n- Add comments\n---\n src/cam/camera_session.cpp | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)", "diff": "diff --git a/src/cam/camera_session.cpp b/src/cam/camera_session.cpp\nindex 605018278c5a..1bf460fa3fb7 100644\n--- a/src/cam/camera_session.cpp\n+++ b/src/cam/camera_session.cpp\n@@ -346,6 +346,16 @@ void CameraSession::requestComplete(Request *request)\n \n void CameraSession::processRequest(Request *request)\n {\n+\t/*\n+\t * If we've reached the capture limit, we're done. This doesn't\n+\t * duplicate the check below that emits the captureDone signal, as this\n+\t * function will be called for each request still in flight after the\n+\t * capture limit is reached and we don't want to emit the signal every\n+\t * single time.\n+\t */\n+\tif (captureLimit_ && captureCount_ >= captureLimit_)\n+\t\treturn;\n+\n \tconst Request::BufferMap &buffers = request->buffers();\n \n \t/*\n@@ -398,6 +408,10 @@ void CameraSession::processRequest(Request *request)\n \t\t}\n \t}\n \n+\t/*\n+\t * Notify the user that capture is complete if the limit has just been\n+\t * reached.\n+\t */\n \tcaptureCount_++;\n \tif (captureLimit_ && captureCount_ >= captureLimit_) {\n \t\tcaptureDone.emit();\n", "prefixes": [ "libcamera-devel", "v1.1", "3/3" ] }