Patch Detail
Show a patch.
GET /api/1.1/patches/10341/?format=api
{ "id": 10341, "url": "https://patchwork.libcamera.org/api/1.1/patches/10341/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10341/", "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": "<20201105001546.1690179-5-niklas.soderlund@ragnatech.se>", "date": "2020-11-05T00:15:39", "name": "[libcamera-devel,04/11] libcamera: ipu3: imgu: Add parameters video device", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "420ee66ad6c0bc6ff18496b6f9ccfd0adc22b41f", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": { "id": 16, "url": "https://patchwork.libcamera.org/api/1.1/users/16/?format=api", "username": "neg", "first_name": "Niklas", "last_name": "Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "mbox": "https://patchwork.libcamera.org/patch/10341/mbox/", "series": [ { "id": 1447, "url": "https://patchwork.libcamera.org/api/1.1/series/1447/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1447", "date": "2020-11-05T00:15:35", "name": "libcamera: ipu3: Attach to an skeleton IPA", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1447/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10341/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10341/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 2A4C5BE081\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 5 Nov 2020 00:16:21 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E06A462CC7;\n\tThu, 5 Nov 2020 01:16:20 +0100 (CET)", "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E264462C85\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 5 Nov 2020 01:16:17 +0100 (CET)", "from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de\n\t[79.202.36.88])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 6c6f4e22-1efa-11eb-8a9c-005056917a89;\n\tThu, 05 Nov 2020 01:04:07 +0100 (CET)" ], "X-Halon-ID": "6c6f4e22-1efa-11eb-8a9c-005056917a89", "Authorized-sender": "niklas.soderlund@fsdn.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 5 Nov 2020 01:15:39 +0100", "Message-Id": "<20201105001546.1690179-5-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.29.2", "In-Reply-To": "<20201105001546.1690179-1-niklas.soderlund@ragnatech.se>", "References": "<20201105001546.1690179-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 04/11] libcamera: ipu3: imgu: Add\n\tparameters video device", "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>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add the parameters video device to the data structure of the ImgUDevice.\nEven if the video device is configured, prepared to import buffers and\nstarted no buffers are ever queued to it so it does not yet effect the\ncapture. Nor is does this change hinder the current capture mode to\nfunction.\n\nThis is done in preparation to attache an IPA to the IPU3 pipeline.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/ipu3/imgu.cpp | 38 ++++++++++++++++++++++++++--\n src/libcamera/pipeline/ipu3/imgu.h | 3 ++-\n 2 files changed, 38 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\nindex 0a3bf62020fd23fb..547a9e00325e7519 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.cpp\n+++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n@@ -365,6 +365,11 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index)\n \tif (ret)\n \t\treturn ret;\n \n+\tparam_.reset(V4L2VideoDevice::fromEntityName(media, name_ + \" parameters\"));\n+\tret = param_->open();\n+\tif (ret)\n+\t\treturn ret;\n+\n \tstat_.reset(V4L2VideoDevice::fromEntityName(media, name_ + \" 3a stat\"));\n \tret = stat_->open();\n \tif (ret)\n@@ -477,6 +482,13 @@ int ImgUDevice::configure(const PipeConfig &pipeConfig, V4L2DeviceFormat *inputF\n \n \tLOG(IPU3, Debug) << \"ImgU GDC format = \" << gdcFormat.toString();\n \n+\tStreamConfiguration paramCfg = {};\n+\tparamCfg.size = inputFormat->size;\n+\tV4L2DeviceFormat paramFormat;\n+\tret = configureVideoDevice(param_.get(), PAD_PARAM, paramCfg, ¶mFormat);\n+\tif (ret)\n+\t\treturn ret;\n+\n \tStreamConfiguration statCfg = {};\n \tstatCfg.size = inputFormat->size;\n \tV4L2DeviceFormat statFormat;\n@@ -507,8 +519,8 @@ int ImgUDevice::configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad,\n \tif (ret)\n \t\treturn ret;\n \n-\t/* No need to apply format to the stat node. */\n-\tif (dev == stat_.get())\n+\t/* No need to apply format to the param or stat video devices. */\n+\tif (dev == param_.get() || dev == stat_.get())\n \t\treturn 0;\n \n \t*outputFormat = {};\n@@ -539,6 +551,12 @@ int ImgUDevice::allocateBuffers(unsigned int bufferCount)\n \t\treturn ret;\n \t}\n \n+\tret = param_->importBuffers(bufferCount);\n+\tif (ret < 0) {\n+\t\tLOG(IPU3, Error) << \"Failed to allocate ImgU param buffers\";\n+\t\tgoto error;\n+\t}\n+\n \t/*\n \t * The kernel fails to start if buffers are not either imported or\n \t * allocated for the statistics video device. As statistics buffers are\n@@ -588,6 +606,10 @@ void ImgUDevice::freeBuffers()\n \tif (ret)\n \t\tLOG(IPU3, Error) << \"Failed to release ImgU output buffers\";\n \n+\tret = param_->releaseBuffers();\n+\tif (ret)\n+\t\tLOG(IPU3, Error) << \"Failed to release ImgU param buffers\";\n+\n \tret = stat_->releaseBuffers();\n \tif (ret)\n \t\tLOG(IPU3, Error) << \"Failed to release ImgU stat buffers\";\n@@ -618,6 +640,12 @@ int ImgUDevice::start()\n \t\treturn ret;\n \t}\n \n+\tret = param_->streamOn();\n+\tif (ret) {\n+\t\tLOG(IPU3, Error) << \"Failed to start ImgU param\";\n+\t\treturn ret;\n+\t}\n+\n \tret = stat_->streamOn();\n \tif (ret) {\n \t\tLOG(IPU3, Error) << \"Failed to start ImgU stat\";\n@@ -639,6 +667,7 @@ int ImgUDevice::stop()\n \n \tret = output_->streamOff();\n \tret |= viewfinder_->streamOff();\n+\tret |= param_->streamOff();\n \tret |= stat_->streamOff();\n \tret |= input_->streamOff();\n \n@@ -680,6 +709,7 @@ int ImgUDevice::linkSetup(const std::string &source, unsigned int sourcePad,\n int ImgUDevice::enableLinks(bool enable)\n {\n \tstd::string viewfinderName = name_ + \" viewfinder\";\n+\tstd::string paramName = name_ + \" parameters\";\n \tstd::string outputName = name_ + \" output\";\n \tstd::string statName = name_ + \" 3a stat\";\n \tstd::string inputName = name_ + \" input\";\n@@ -697,6 +727,10 @@ int ImgUDevice::enableLinks(bool enable)\n \tif (ret)\n \t\treturn ret;\n \n+\tret = linkSetup(paramName, 0, name_, PAD_PARAM, enable);\n+\tif (ret)\n+\t\treturn ret;\n+\n \treturn linkSetup(name_, PAD_STAT, statName, 0, enable);\n }\n \ndiff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\nindex 37f5ae77c99ff8fe..1388d07a45b28590 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.h\n+++ b/src/libcamera/pipeline/ipu3/imgu.h\n@@ -73,11 +73,12 @@ public:\n \tstd::unique_ptr<V4L2VideoDevice> input_;\n \tstd::unique_ptr<V4L2VideoDevice> output_;\n \tstd::unique_ptr<V4L2VideoDevice> viewfinder_;\n+\tstd::unique_ptr<V4L2VideoDevice> param_;\n \tstd::unique_ptr<V4L2VideoDevice> stat_;\n-\t/* \\todo Add param video device for 3A tuning */\n \n private:\n \tstatic constexpr unsigned int PAD_INPUT = 0;\n+\tstatic constexpr unsigned int PAD_PARAM = 1;\n \tstatic constexpr unsigned int PAD_OUTPUT = 2;\n \tstatic constexpr unsigned int PAD_VF = 3;\n \tstatic constexpr unsigned int PAD_STAT = 4;\n", "prefixes": [ "libcamera-devel", "04/11" ] }