Patch Detail
Show a patch.
GET /api/patches/3204/?format=api
{ "id": 3204, "url": "https://patchwork.libcamera.org/api/patches/3204/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3204/", "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": "<20200320003224.3536634-1-niklas.soderlund@ragnatech.se>", "date": "2020-03-20T00:32:24", "name": "[libcamera-devel,v2] libcamera: pipeline: rkisp1: Use correct buffer count when importing buffers", "commit_ref": "a118b1a49110b43f4bff5616a5072ade41f8b684", "pull_url": null, "state": "accepted", "archived": false, "hash": "d8e4eb4714aa7996984ff30ecc785e877d465ca2", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3204/mbox/", "series": [ { "id": 746, "url": "https://patchwork.libcamera.org/api/series/746/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=746", "date": "2020-03-20T00:32:24", "name": "[libcamera-devel,v2] libcamera: pipeline: rkisp1: Use correct buffer count when importing buffers", "version": 2, "mbox": "https://patchwork.libcamera.org/series/746/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3204/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3204/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 928B160415\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Mar 2020 01:32:29 +0100 (CET)", "from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de\n\t[79.202.35.146]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 45e8eb65-6a42-11ea-89d0-0050569116f7;\n\tFri, 20 Mar 2020 01:32:28 +0100 (CET)" ], "X-Halon-ID": "45e8eb65-6a42-11ea-89d0-0050569116f7", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 20 Mar 2020 01:32:24 +0100", "Message-Id": "<20200320003224.3536634-1-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2] libcamera: pipeline: rkisp1: Use\n\tcorrect buffer count when importing 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>", "X-List-Received-Date": "Fri, 20 Mar 2020 00:32:29 -0000" }, "content": "When folding buffer management with start/stop the wrong variable was\npassed to importBuffers() resulting in only one buffer being imported\nfor the video node making capture impossible. Fix this by first renaming\nthe confusingly named variable 'count' to 'ipaBufferId'. And then\nreusing the 'count' name for the buffer count.\n\nWhile at it remove the loop to find the maximum value of buffers from\nthe single stream used by the pipeline. Once we add more stream this\nneeds to be reworked anyhow so keep it simple for now.\n\nFixes: 33fedea818e2b6a9 (\"libcamera: pipeline_handler: Fold buffer management with start/stop\")\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 15 ++++++---------\n 1 file changed, 6 insertions(+), 9 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 97bb4f72cde5423e..ec54291db416a669 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -668,34 +668,31 @@ int PipelineHandlerRkISP1::exportFrameBuffers(Camera *camera, Stream *stream,\n int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)\n {\n \tRkISP1CameraData *data = cameraData(camera);\n-\tunsigned int count = 1;\n+\tunsigned int count = data->stream_.configuration().bufferCount;\n+\tunsigned int ipaBufferId = 1;\n \tint ret;\n \n-\tunsigned int maxBuffers = 0;\n-\tfor (const Stream *s : camera->streams())\n-\t\tmaxBuffers = std::max(maxBuffers, s->configuration().bufferCount);\n-\n \tret = video_->importBuffers(count);\n \tif (ret < 0)\n \t\tgoto error;\n \n-\tret = param_->allocateBuffers(maxBuffers, ¶mBuffers_);\n+\tret = param_->allocateBuffers(count, ¶mBuffers_);\n \tif (ret < 0)\n \t\tgoto error;\n \n-\tret = stat_->allocateBuffers(maxBuffers, &statBuffers_);\n+\tret = stat_->allocateBuffers(count, &statBuffers_);\n \tif (ret < 0)\n \t\tgoto error;\n \n \tfor (std::unique_ptr<FrameBuffer> &buffer : paramBuffers_) {\n-\t\tbuffer->setCookie(count++);\n+\t\tbuffer->setCookie(ipaBufferId++);\n \t\tdata->ipaBuffers_.push_back({ .id = buffer->cookie(),\n \t\t\t\t\t .planes = buffer->planes() });\n \t\tavailableParamBuffers_.push(buffer.get());\n \t}\n \n \tfor (std::unique_ptr<FrameBuffer> &buffer : statBuffers_) {\n-\t\tbuffer->setCookie(count++);\n+\t\tbuffer->setCookie(ipaBufferId++);\n \t\tdata->ipaBuffers_.push_back({ .id = buffer->cookie(),\n \t\t\t\t\t .planes = buffer->planes() });\n \t\tavailableStatBuffers_.push(buffer.get());\n", "prefixes": [ "libcamera-devel", "v2" ] }