Patch Detail
Show a patch.
GET /api/patches/20363/?format=api
{ "id": 20363, "url": "https://patchwork.libcamera.org/api/patches/20363/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20363/", "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": "<20240624134859.171969-2-umang.jain@ideasonboard.com>", "date": "2024-06-24T13:48:56", "name": "[v4,1/4] converter: converter_v4l2_m2m: Rectify streams sanity check", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "5ec64924cb9eae0a03ea3daf4cdc27e8cfb2ee82", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20363/mbox/", "series": [ { "id": 4412, "url": "https://patchwork.libcamera.org/api/series/4412/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4412", "date": "2024-06-24T13:48:55", "name": "libcamera: converter: Replace usage of stream index by Stream pointer", "version": 4, "mbox": "https://patchwork.libcamera.org/series/4412/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20363/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20363/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 93640BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 Jun 2024 13:49:19 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AF209654AF;\n\tMon, 24 Jun 2024 15:49:18 +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 06115654A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Jun 2024 15:49:15 +0200 (CEST)", "from fedora.local (unknown\n\t[IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 844B3FF3;\n\tMon, 24 Jun 2024 15:48:52 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"TaCUJXz4\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1719236933;\n\tbh=KljAcoauDhQh5SXtUaCy5unCijNv6v91D/evORqfcq8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=TaCUJXz4bWNCZwjRcYyssRDEn0kNDjs7GgnytM4Kq4dBC7wpvX18VXw1joyNcgnDn\n\t88tK9zDSWHeWxMtFT0CDHuc90mOSUq/iTCG2bCUfwlXSVrq+RCwmyugJ8jo/DgjXAY\n\tGuqUQDHBGh/djZxGrYGIeOlWquYxmqlrkVfXwhDg=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Umang Jain <umang.jain@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>", "Subject": "[PATCH v4 1/4] converter: converter_v4l2_m2m: Rectify streams sanity\n\tcheck", "Date": "Mon, 24 Jun 2024 19:18:56 +0530", "Message-ID": "<20240624134859.171969-2-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.44.0", "In-Reply-To": "<20240624134859.171969-1-umang.jain@ideasonboard.com>", "References": "<20240624134859.171969-1-umang.jain@ideasonboard.com>", "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 streams sanity check tries to determine if all the stream indexes\npassed in outputs std::map<> are unique. However, since the data\ncontainer is std::map<>, all its keys (stream indexes in this case),\nare already unique.\n\nInstead, rectify the sanity check to ensure all the framebuffers passed\nin the outputs std::map<> are unique to each index. Hence, no two stream\nindexes should have same framebuffer. Update the comment to reflect\nthe change.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/converter/converter_v4l2_m2m.cpp | 11 ++++++-----\n 1 file changed, 6 insertions(+), 5 deletions(-)", "diff": "diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\nindex d8929fc5..27a50e34 100644\n--- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n+++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n@@ -403,13 +403,13 @@ void V4L2M2MConverter::stop()\n int V4L2M2MConverter::queueBuffers(FrameBuffer *input,\n \t\t\t\t const std::map<unsigned int, FrameBuffer *> &outputs)\n {\n-\tunsigned int mask = 0;\n+\tstd::set<FrameBuffer *> outputBufs;\n \tint ret;\n \n \t/*\n \t * Validate the outputs as a sanity check: at least one output is\n \t * required, all outputs must reference a valid stream and no two\n-\t * outputs can reference the same stream.\n+\t * streams can reference same output framebuffers.\n \t */\n \tif (outputs.empty())\n \t\treturn -EINVAL;\n@@ -419,12 +419,13 @@ int V4L2M2MConverter::queueBuffers(FrameBuffer *input,\n \t\t\treturn -EINVAL;\n \t\tif (index >= streams_.size())\n \t\t\treturn -EINVAL;\n-\t\tif (mask & (1 << index))\n-\t\t\treturn -EINVAL;\n \n-\t\tmask |= 1 << index;\n+\t\toutputBufs.insert(buffer);\n \t}\n \n+\tif (outputBufs.size() != streams_.size())\n+\t\treturn -EINVAL;\n+\n \t/* Queue the input and output buffers to all the streams. */\n \tfor (auto [index, buffer] : outputs) {\n \t\tret = streams_[index].queueBuffers(input, buffer);\n", "prefixes": [ "v4", "1/4" ] }