Patch Detail
Show a patch.
GET /api/1.1/patches/24515/?format=api
{ "id": 24515, "url": "https://patchwork.libcamera.org/api/1.1/patches/24515/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24515/", "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": "<20250930122726.1837524-17-stefan.klug@ideasonboard.com>", "date": "2025-09-30T12:26:37", "name": "[v1,16/33] libcamera: rkisp1: Scale down in dewarper instead of resizer", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "5c9a49ea88f13efc4c1045730de94f94f623f790", "submitter": { "id": 184, "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api", "name": "Stefan Klug", "email": "stefan.klug@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24515/mbox/", "series": [ { "id": 5468, "url": "https://patchwork.libcamera.org/api/1.1/series/5468/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5468", "date": "2025-09-30T12:26:21", "name": "Full dewarper support on imx8mp", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5468/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24515/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24515/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 79F8EC328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Sep 2025 13:06:27 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 24E7B6B606;\n\tTue, 30 Sep 2025 15:06:26 +0200 (CEST)", "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 306E469367\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Sep 2025 15:06:24 +0200 (CEST)", "from ideasonboard.com (unknown [94.31.94.171])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id F11DA169;\n\tTue, 30 Sep 2025 15:04:55 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"fmlZBIUK\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759237496;\n\tbh=Zppoy0qnTKtXwU5ds5A1HZMS96OVCZv+wKeA8NCVMug=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=fmlZBIUKiaU+iH9MlDNKjWY9yJWDR28km26Awg6qT486GPGPGFeiwWXNegf/KMonI\n\tFpz8S35CWPm+o/+Yre/pxuwuXNiEk/X6QLI/S/cf8sNa+PQTHpAc1sN9kyjpBPZQlE\n\t68bk1xjCr55rVbLMtJ58PBNpBog0KXK7cT8cvwgg=", "From": "Stefan Klug <stefan.klug@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>", "Subject": "[PATCH v1 16/33] libcamera: rkisp1: Scale down in dewarper instead\n\tof resizer", "Date": "Tue, 30 Sep 2025 14:26:37 +0200", "Message-ID": "<20250930122726.1837524-17-stefan.klug@ideasonboard.com>", "X-Mailer": "git-send-email 2.48.1", "In-Reply-To": "<20250930122726.1837524-1-stefan.klug@ideasonboard.com>", "References": "<20250930122726.1837524-1-stefan.klug@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "In order to allow digital zooming, scale down in the dewarper instead of\nthe resizer. That means forwarding the full sensor size data to the\ndewarper. The ScalerCrop rectangle will also be applied at the dewarper.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 43 +++++++++++++++++++-----\n 1 file changed, 35 insertions(+), 8 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 6550469842e1..35a9d03198f1 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -888,16 +888,31 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \t/*\n \t * On devices without DUAL_CROP (like the imx8mp) cropping needs to be\n \t * done on the ISP/IS output.\n+\t *\n+\t * If the dewarper is used, the cropping shall be done by the dewarper.\n \t */\n \tif (media_->hwRevision() == RKISP1_V_IMX8MP) {\n \t\t/* imx8mp has only a single path. */\n \t\tconst auto &cfg = config->at(0);\n-\t\tSize ispCrop = format.size.boundedToAspectRatio(cfg.size);\n+\t\t/*\n+\t\t * If the dewarper is used, all cropping including aspect ratio\n+\t\t * preservation shall be done there. To ensure that the output\n+\t\t * format provided by the ISP is supported by the dewarper, a\n+\t\t * minimal crop still needs to be applied on the ISP output.\n+\t\t *\n+\t\t * \\todo It might be possible to allocate bigger buffers\n+\t\t * (aligned to 8 pixels) with a stride matching format.size for\n+\t\t * the ISP. The not-filled border could later be ignored by the\n+\t\t * dewarper. This way we could skip the minimal crop here and\n+\t\t * the MaximumScalerCrop would always match the isp output.\n+\t\t */\n+\t\tSize ispCrop;\n \t\tif (data->usesDewarper_)\n \t\t\tispCrop = dewarper_->adjustInputSize(cfg.pixelFormat,\n-\t\t\t\t\t\t\t ispCrop);\n+\t\t\t\t\t\t\t format.size);\n \t\telse\n-\t\t\tispCrop.alignUpTo(2, 2);\n+\t\t\tispCrop = format.size.boundedToAspectRatio(cfg.size)\n+\t\t\t\t\t .alignedUpTo(2, 2);\n \n \t\toutputCrop = ispCrop.centeredTo(Rectangle(format.size).center());\n \t\tformat.size = ispCrop;\n@@ -930,13 +945,21 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tfor (const StreamConfiguration &cfg : *config) {\n \t\tif (cfg.stream() == &data->mainPathStream_) {\n-\t\t\tret = mainPath_.configure(cfg, format);\n-\t\t\tstreamConfig[0] = IPAStream(cfg.pixelFormat,\n-\t\t\t\t\t\t cfg.size);\n-\t\t\t/* Configure dewarp */\n+\t\t\t/*\n+\t\t\t * To allow for digital zoom, scaling down should happen\n+\t\t\t * in the dewarper, instead of the resizer. Configure\n+\t\t\t * the isp output to the same size as the sensor output.\n+\t\t\t */\n+\t\t\tStreamConfiguration ispCfg = cfg;\n \t\t\tif (data->usesDewarper_) {\n \t\t\t\toutputCfgs.push_back(const_cast<StreamConfiguration &>(cfg));\n-\t\t\t\tret = dewarper_->configure(cfg, outputCfgs);\n+\n+\t\t\t\tispCfg.size = format.size;\n+\t\t\t\tispCfg.stride =\n+\t\t\t\t\tPixelFormatInfo::info(ispCfg.pixelFormat)\n+\t\t\t\t\t\t.stride(ispCfg.size.width, 0);\n+\n+\t\t\t\tret = dewarper_->configure(ispCfg, outputCfgs);\n \t\t\t\tif (ret)\n \t\t\t\t\treturn ret;\n \n@@ -949,6 +972,10 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \t\t\t\t\toutputCrop.transformedBetween(inputCrop,\n \t\t\t\t\t\t\t\t sensorInfo.analogCrop);\n \t\t\t}\n+\n+\t\t\tret = mainPath_.configure(ispCfg, format);\n+\t\t\tstreamConfig[0] = IPAStream(cfg.pixelFormat,\n+\t\t\t\t\t\t cfg.size);\n \t\t} else if (hasSelfPath_) {\n \t\t\tret = selfPath_.configure(cfg, format);\n \t\t\tstreamConfig[1] = IPAStream(cfg.pixelFormat,\n", "prefixes": [ "v1", "16/33" ] }