Patch Detail
Show a patch.
GET /api/patches/24978/?format=api
{ "id": 24978, "url": "https://patchwork.libcamera.org/api/patches/24978/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24978/", "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": "<20251105135859.282979-1-stefan.klug@ideasonboard.com>", "date": "2025-11-05T13:58:19", "name": "[v2] libcamera: pipeline_handler: Fix requestComplete on waiting requests on stop", "commit_ref": "731a340c8064843075cb9a41e22908eadadbf1bd", "pull_url": null, "state": "accepted", "archived": false, "hash": "7f0348115a8b84d573d7d4c958ab0aa41e3a3372", "submitter": { "id": 184, "url": "https://patchwork.libcamera.org/api/people/184/?format=api", "name": "Stefan Klug", "email": "stefan.klug@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24978/mbox/", "series": [ { "id": 5565, "url": "https://patchwork.libcamera.org/api/series/5565/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5565", "date": "2025-11-05T13:58:19", "name": "[v2] libcamera: pipeline_handler: Fix requestComplete on waiting requests on stop", "version": 2, "mbox": "https://patchwork.libcamera.org/series/5565/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24978/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24978/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 B7352BDE4C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 5 Nov 2025 13:59:07 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B614C60A80;\n\tWed, 5 Nov 2025 14:59:06 +0100 (CET)", "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 18F2160805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 5 Nov 2025 14:59:05 +0100 (CET)", "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:3793:9dc2:3dec:ebc3])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 93BB2E45;\n\tWed, 5 Nov 2025 14:57:10 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"G/ao7yeD\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1762351030;\n\tbh=NuIPLkjjha9Qb199TObYAQVZ56RAR7i4srDwGIsbKw4=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=G/ao7yeD76DCreFpO60hE4aM79+UX3b9teLw1l40597FlB6dMooE6ZLZc2tLCaipq\n\tJ06rp6KbJbUTTGXKQD9lBCgm/ojLPNdxV90e1SC4is/1LkJtM6fQPNrfcrmPnILT4O\n\t7dtvc8sjcywaqRybvinMxPWk33eiHKcWEpwqeP3E=", "From": "Stefan Klug <stefan.klug@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>", "Subject": "[PATCH v2] libcamera: pipeline_handler: Fix requestComplete on\n\twaiting requests on stop", "Date": "Wed, 5 Nov 2025 14:58:19 +0100", "Message-ID": "<20251105135859.282979-1-stefan.klug@ideasonboard.com>", "X-Mailer": "git-send-email 2.51.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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 requestComplete signal is not emitted when the camera is stopped and\nthe request is still in the waitingRequests_ queue. Fix that by calling\ndoQueueRequest() on the waiting requests after marking them as\ncancelled. This ensures that the requests gets a proper sequence number\nand are added to the queuedRequests_ list. This list is then iterated in\ncompleteRequest() and leads to the requestComplete signal.\n\nCloses: https://gitlab.freedesktop.org/camera/libcamera/-/issues/281\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\n\nHey all,\n\nIn the discussion on v1 https://patchwork.libcamera.org/patch/24719/ it\nwas rightly noted that the solution does feel a bit hacky. However there\nwas no clear better solution and it was also acknowledged that the\nchange is quite small and solves the problem. So I'd propose to merge it\nin as long as there is no better proposal.\n\nChanges in v2:\n- Collected rby tag\n- Added closes tag to automatically close the issue\n- Slightly modified the comment and commit message to mention that this\n logic also ensures that the requests get a sequence number.\n\nBest regards,\nStefan\n\n---\n src/libcamera/pipeline_handler.cpp | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex e5f9e55c9783..f398f62e0085 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -380,7 +380,16 @@ void PipelineHandler::stop(Camera *camera)\n \twhile (!waitingRequests.empty()) {\n \t\tRequest *request = waitingRequests.front();\n \t\twaitingRequests.pop();\n-\t\tcancelRequest(request);\n+\n+\t\t/*\n+\t\t * Cancel all requests by marking them as cancelled and calling\n+\t\t * doQueueRequest() instead of cancelRequest(). This ensures\n+\t\t * that the requests get a sequence number and are temporarily\n+\t\t * added to queuedRequests_ so they can be properly completed in\n+\t\t * completeRequest().\n+\t\t */\n+\t\trequest->_d()->cancel();\n+\t\tdoQueueRequest(request);\n \t}\n \n \t/* Make sure no requests are pending. */\n", "prefixes": [ "v2" ] }