Patch Detail
Show a patch.
GET /api/patches/8890/?format=api
{ "id": 8890, "url": "https://patchwork.libcamera.org/api/patches/8890/?format=api", "web_url": "https://patchwork.libcamera.org/patch/8890/", "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": "<20200720104736.19986-19-jacopo@jmondi.org>", "date": "2020-07-20T10:47:35", "name": "[libcamera-devel,v4,18/19] libcamera: ipu3: Configure ImgU with the computed parameters", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "67da0967056291378d7bed482a3cf6c549602a0d", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/8890/mbox/", "series": [ { "id": 1118, "url": "https://patchwork.libcamera.org/api/series/1118/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1118", "date": "2020-07-20T10:47:17", "name": "ipu3: rework pipe confiuguration", "version": 4, "mbox": "https://patchwork.libcamera.org/series/1118/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/8890/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/8890/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 C0EC0C2E7A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Jul 2020 10:44:30 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 97E8E60832;\n\tMon, 20 Jul 2020 12:44:30 +0200 (CEST)", "from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 284C560717\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jul 2020 12:44:28 +0200 (CEST)", "from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 447A66000A;\n\tMon, 20 Jul 2020 10:44:27 +0000 (UTC)" ], "X-Originating-IP": "93.34.118.233", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 20 Jul 2020 12:47:35 +0200", "Message-Id": "<20200720104736.19986-19-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200720104736.19986-1-jacopo@jmondi.org>", "References": "<20200720104736.19986-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v4 18/19] libcamera: ipu3: Configure ImgU\n\twith the computed parameters", "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": "Instrument the ImgUDevice::configureInput() function to use the provided\npipe configuration parameters to configure the IF, BDS and GDC\nrectangles.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/imgu. | 0\n src/libcamera/pipeline/ipu3/imgu.cpp | 26 +++++++++++++-------------\n src/libcamera/pipeline/ipu3/imgu.h | 2 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++++++++++++++-\n 4 files changed, 29 insertions(+), 15 deletions(-)\n create mode 100644 src/libcamera/pipeline/ipu3/imgu.", "diff": "diff --git a/src/libcamera/pipeline/ipu3/imgu. b/src/libcamera/pipeline/ipu3/imgu.\nnew file mode 100644\nindex 000000000000..e69de29bb2d1\ndiff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\nindex 17b749435ee2..ad51a64a84e4 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.cpp\n+++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n@@ -425,11 +425,11 @@ ImgUDevice::PipeConfig ImgUDevice::calculatePipeConfig(Pipe *pipe)\n \n /**\n * \\brief Configure the ImgU unit input\n- * \\param[in] size The ImgU input frame size\n+ * \\param[in] config The ImgU pipe configuration parameters\n * \\param[in] inputFormat The format to be applied to ImgU input\n * \\return 0 on success or a negative error code otherwise\n */\n-int ImgUDevice::configureInput(const Size &size,\n+int ImgUDevice::configureInput(const PipeConfig &pipeConfig,\n \t\t\t V4L2DeviceFormat *inputFormat)\n {\n \t/* Configure the ImgU input video device with the requested sizes. */\n@@ -449,27 +449,27 @@ int ImgUDevice::configureInput(const Size &size,\n \t * to configure the crop/compose rectangles, contradicting the\n \t * V4L2 specification.\n \t */\n-\tRectangle rect{ 0, 0, inputFormat->size };\n-\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n+\tRectangle iif{ 0, 0, pipeConfig.iif };\n+\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &iif);\n \tif (ret)\n \t\treturn ret;\n+\tLOG(IPU3, Debug) << \"ImgU IF rectangle = \" << iif.toString();\n \n-\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_COMPOSE, &rect);\n+\tRectangle bds{ 0, 0, pipeConfig.bds };\n+\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_COMPOSE, &bds);\n \tif (ret)\n \t\treturn ret;\n+\tLOG(IPU3, Debug) << \"ImgU BDS rectangle = \" << bds.toString();\n \n-\tLOG(IPU3, Debug) << \"ImgU input feeder and BDS rectangle = \"\n-\t\t\t << rect.toString();\n+\tV4L2SubdeviceFormat gdcFormat = {};\n+\tgdcFormat.mbus_code = MEDIA_BUS_FMT_FIXED;\n+\tgdcFormat.size = pipeConfig.gdc;\n \n-\tV4L2SubdeviceFormat imguFormat = {};\n-\timguFormat.mbus_code = MEDIA_BUS_FMT_FIXED;\n-\timguFormat.size = size;\n-\n-\tret = imgu_->setFormat(PAD_INPUT, &imguFormat);\n+\tret = imgu_->setFormat(PAD_INPUT, &gdcFormat);\n \tif (ret)\n \t\treturn ret;\n \n-\tLOG(IPU3, Debug) << \"ImgU GDC format = \" << imguFormat.toString();\n+\tLOG(IPU3, Debug) << \"ImgU GDC format = \" << gdcFormat.toString();\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\nindex 0b2dd1f965c1..91715c78fa83 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.h\n+++ b/src/libcamera/pipeline/ipu3/imgu.h\n@@ -45,7 +45,7 @@ public:\n \n \tPipeConfig calculatePipeConfig(Pipe *pipe);\n \n-\tint configureInput(const Size &size, V4L2DeviceFormat *inputFormat);\n+\tint configureInput(const PipeConfig &pipeConfig, V4L2DeviceFormat *inputFormat);\n \n \tint configureOutput(const StreamConfiguration &cfg,\n \t\t\t V4L2DeviceFormat *outputFormat)\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 5237c3b306df..d7c0076a57e3 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -67,6 +67,7 @@ public:\n \tStatus validate() override;\n \n \tconst StreamConfiguration &cio2Format() const { return cio2Configuration_; };\n+\tconst ImgUDevice::PipeConfig imguConfig() const { return pipeConfig_; }\n \n private:\n \t/*\n@@ -461,7 +462,20 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \tif (ret)\n \t\treturn ret;\n \n-\tret = imgu->configureInput(sensorSize, &cio2Format);\n+\t/*\n+\t * If the ImgU gets configured with proper IF, BDS and GDC sizes, it\n+\t * is then expected that frames are dequeued from its main output\n+\t * otherwise the system stalls.\n+\t *\n+\t * If no ImgU configuration has been computed, it means only a RAW\n+\t * stream has been requested: return here to skip the ImgU configuration\n+\t * part.\n+\t */\n+\tImgUDevice::PipeConfig imguConfig = config->imguConfig();\n+\tif (imguConfig.isNull())\n+\t\treturn 0;\n+\n+\tret = imgu->configureInput(imguConfig, &cio2Format);\n \tif (ret)\n \t\treturn ret;\n \n", "prefixes": [ "libcamera-devel", "v4", "18/19" ] }