Patch Detail
Show a patch.
GET /api/patches/9792/?format=api
{ "id": 9792, "url": "https://patchwork.libcamera.org/api/patches/9792/?format=api", "web_url": "https://patchwork.libcamera.org/patch/9792/", "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": "<20200924145143.117733-2-jacopo@jmondi.org>", "date": "2020-09-24T14:51:41", "name": "[libcamera-devel,1/3] libcamera: ipu3: Fix RAW+YUV capture", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "a35d6133de08e57d19bea9619b8484e8c4e47eef", "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/9792/mbox/", "series": [ { "id": 1323, "url": "https://patchwork.libcamera.org/api/series/1323/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1323", "date": "2020-09-24T14:51:40", "name": "libcamera: ipu3: Fix RAW+YUV capture", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1323/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/9792/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/9792/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 66DC6C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Sep 2020 14:47:58 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4436A60367;\n\tThu, 24 Sep 2020 16:47:58 +0200 (CEST)", "from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1A4DF60367\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Sep 2020 16:47:56 +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 relay10.mail.gandi.net (Postfix) with ESMTPSA id AF1A324000C;\n\tThu, 24 Sep 2020 14:47:55 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 24 Sep 2020 16:51:41 +0200", "Message-Id": "<20200924145143.117733-2-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.28.0", "In-Reply-To": "<20200924145143.117733-1-jacopo@jmondi.org>", "References": "<20200924145143.117733-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 1/3] libcamera: ipu3: Fix RAW+YUV capture", "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=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "When requesting one RAW stream and one YUV stream the\nStreamConfiguration assigned to the RAW stream is the first one\nadded to the CameraConfiguration, while the YUV stream gets assigned to\nthe main output.\n\nAt configure() time the viewfinder output needs to be configured with\nthe same format as the main output, but since the introduction of RAW\ncapture support, the pipeline has not been updated and still assumes\nthe main output configuration is the first one in the\nCameraConfiguration. This causes the viewfinder to be configured\nwith the same format as the raw stream, breaking capture operations.\n\nBefore this commit the following command fails and the ImgU does not\nproduce frames:\ncam -srole=stillraw -srole=viewfinder -c2 -C\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 20 +++++++++-----------\n 1 file changed, 9 insertions(+), 11 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 221259c7fe61..9cea6c7e9611 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -476,25 +476,23 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \t\treturn ret;\n \n \t/* Apply the format to the configured streams output devices. */\n-\tbool outActive = false;\n-\tbool vfActive = false;\n+\tStreamConfiguration *mainCfg = nullptr;\n+\tStreamConfiguration *vfCfg = nullptr;\n \n \tfor (unsigned int i = 0; i < config->size(); ++i) {\n \t\tStreamConfiguration &cfg = (*config)[i];\n \t\tStream *stream = cfg.stream();\n \n \t\tif (stream == outStream) {\n+\t\t\tmainCfg = &cfg;\n \t\t\tret = imgu->configureOutput(cfg, &outputFormat);\n \t\t\tif (ret)\n \t\t\t\treturn ret;\n-\n-\t\t\toutActive = true;\n \t\t} else if (stream == vfStream) {\n+\t\t\tvfCfg = &cfg;\n \t\t\tret = imgu->configureViewfinder(cfg, &outputFormat);\n \t\t\tif (ret)\n \t\t\t\treturn ret;\n-\n-\t\t\tvfActive = true;\n \t\t}\n \t}\n \n@@ -503,14 +501,14 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \t * the configuration of the active one for that purpose (there should\n \t * be at least one active stream in the configuration request).\n \t */\n-\tif (!outActive) {\n-\t\tret = imgu->configureOutput(config->at(0), &outputFormat);\n+\tif (!mainCfg) {\n+\t\tret = imgu->configureOutput(*vfCfg, &outputFormat);\n \t\tif (ret)\n \t\t\treturn ret;\n \t}\n \n-\tif (!vfActive) {\n-\t\tret = imgu->configureViewfinder(config->at(0), &outputFormat);\n+\tif (!vfCfg) {\n+\t\tret = imgu->configureViewfinder(*mainCfg, &outputFormat);\n \t\tif (ret)\n \t\t\treturn ret;\n \t}\n@@ -529,7 +527,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \t/* Apply the \"pipe_mode\" control to the ImgU subdevice. */\n \tControlList ctrls(imgu->imgu_->controls());\n \tctrls.set(V4L2_CID_IPU3_PIPE_MODE,\n-\t\t static_cast<int32_t>(vfActive ? IPU3PipeModeVideo :\n+\t\t static_cast<int32_t>(vfCfg ? IPU3PipeModeVideo :\n \t\t\t\t IPU3PipeModeStillCapture));\n \tret = imgu->imgu_->setControls(&ctrls);\n \tif (ret) {\n", "prefixes": [ "libcamera-devel", "1/3" ] }