Patch Detail
Show a patch.
GET /api/patches/11096/?format=api
{ "id": 11096, "url": "https://patchwork.libcamera.org/api/patches/11096/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11096/", "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": "<20210131224702.8838-18-laurent.pinchart@ideasonboard.com>", "date": "2021-01-31T22:46:59", "name": "[libcamera-devel,17/20] libcamera: pipeline: simple: Hardcode the number of internal buffers", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "4ca25678b65b26c0801cd3180aad59b83f5724a7", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": { "id": 14, "url": "https://patchwork.libcamera.org/api/users/14/?format=api", "username": "pinchartl", "first_name": "Laurent", "last_name": "Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/11096/mbox/", "series": [ { "id": 1633, "url": "https://patchwork.libcamera.org/api/series/1633/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1633", "date": "2021-01-31T22:46:42", "name": "[libcamera-devel,01/20] libcamera: pipeline: simple: Manage converter with std::unique_ptr<>", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1633/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11096/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11096/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 154C7BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 31 Jan 2021 22:47:47 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D6B5B68405;\n\tSun, 31 Jan 2021 23:47:46 +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 D0601683FB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 31 Jan 2021 23:47:34 +0100 (CET)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5B0B71837; \n\tSun, 31 Jan 2021 23:47:34 +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=\"P8+x1yF3\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612133254;\n\tbh=M6YJCT5HNDQZjXGdDinaNuEli/O+JV1gaSEG9v1m1RA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=P8+x1yF3HqglBT11dDT6oc+tmSESlQsEF2N2rFts3Hzh/mQ44wn0Sio989k7eb09M\n\tTqReggXTuqUBGIyWzMRfMFadu85xH5e8xqwrQD8TUIDYKclNXnc+w6H4QS09aVT8sk\n\tjlv36YPhMuFpSrWgFSbFnHaGVY9w/4ya4PglT1/E=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 1 Feb 2021 00:46:59 +0200", "Message-Id": "<20210131224702.8838-18-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.28.0", "In-Reply-To": "<20210131224702.8838-1-laurent.pinchart@ideasonboard.com>", "References": "<20210131224702.8838-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 17/20] libcamera: pipeline: simple:\n\tHardcode the number of internal buffers", "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>", "Cc": "Phi-Bang Nguyen <pnguyen@baylibre.com>", "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": "The number of internal buffers, used between the capture device and the\nconverter, doesn't need to depend on the number of buffers allocated for\nthe output stream of the pipeline. Hardcode it to a fixed value.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 21 +++++++++++++++------\n 1 file changed, 15 insertions(+), 6 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 9dffe64ee870..c987e1a0d9cb 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -228,6 +228,8 @@ protected:\n \tint queueRequestDevice(Camera *camera, Request *request) override;\n \n private:\n+\tstatic constexpr unsigned int kNumInternalBuffers = 3;\n+\n \tSimpleCameraData *cameraData(const Camera *camera)\n \t{\n \t\treturn static_cast<SimpleCameraData *>(\n@@ -699,7 +701,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \t\tinputCfg.pixelFormat = pipeConfig->captureFormat;\n \t\tinputCfg.size = pipeConfig->captureSize;\n \t\tinputCfg.stride = captureFormat.planes[0].bpl;\n-\t\tinputCfg.bufferCount = cfg.bufferCount;\n+\t\tinputCfg.bufferCount = kNumInternalBuffers;\n \n \t\tret = converter_->configure(inputCfg, { cfg });\n \t\tif (ret < 0) {\n@@ -736,13 +738,20 @@ int SimplePipelineHandler::start(Camera *camera, [[maybe_unused]] ControlList *c\n {\n \tSimpleCameraData *data = cameraData(camera);\n \tV4L2VideoDevice *video = data->video_;\n-\tunsigned int count = data->streams_[0].configuration().bufferCount;\n \tint ret;\n \n-\tif (data->useConverter_)\n-\t\tret = video->allocateBuffers(count, &data->converterBuffers_);\n-\telse\n-\t\tret = video->importBuffers(count);\n+\tif (data->useConverter_) {\n+\t\t/*\n+\t\t * When using the converter allocate a fixed number of internal\n+\t\t * buffers.\n+\t\t */\n+\t\tret = video->allocateBuffers(kNumInternalBuffers,\n+\t\t\t\t\t &data->converterBuffers_);\n+\t} else {\n+\t\t/* Otherwise, prepare for using buffers from the only stream. */\n+\t\tStream *stream = &data->streams_[0];\n+\t\tret = video->importBuffers(stream->configuration().bufferCount);\n+\t}\n \tif (ret < 0)\n \t\treturn ret;\n \n", "prefixes": [ "libcamera-devel", "17/20" ] }