Patch Detail
Show a patch.
GET /api/1.1/patches/21917/?format=api
{ "id": 21917, "url": "https://patchwork.libcamera.org/api/1.1/patches/21917/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21917/", "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": "<20241115101334.453104-14-dan.scally@ideasonboard.com>", "date": "2024-11-15T10:13:33", "name": "[v6,13/14] libcamera: mali-c55: Enable usage of scaler", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "b2fd8efe06bdfb49f37dfc50bcf999c1c04204b0", "submitter": { "id": 156, "url": "https://patchwork.libcamera.org/api/1.1/people/156/?format=api", "name": "Dan Scally", "email": "dan.scally@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/21917/mbox/", "series": [ { "id": 4793, "url": "https://patchwork.libcamera.org/api/1.1/series/4793/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4793", "date": "2024-11-15T10:13:20", "name": "Miscellaneous Mali-C55 Pipeline Fixes", "version": 6, "mbox": "https://patchwork.libcamera.org/series/4793/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21917/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21917/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 D1ED6C32CE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Nov 2024 10:14:25 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E08DB65890;\n\tFri, 15 Nov 2024 11:14:24 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A73A6587A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Nov 2024 11:13:52 +0100 (CET)", "from mail.ideasonboard.com\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F1DCB1590;\n\tFri, 15 Nov 2024 11:13:37 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"P/KtW7Iz\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731665618;\n\tbh=4j1rsI/VC751cgoYwUXU/Ry6Htj9ynzYyDZUJLDbliM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=P/KtW7IzTL0wGg2EiKqCES/ikzyig9LYKxdKyDlbndITGhj9ulVHxFoYdJjcuElnU\n\tQ+jaDUuKO8pZo3hN6Smf0Ywv7rbMGkEWp2kEDSpTKTB9gUmDpbQSvf9DNW15q2m+d5\n\tOSuSjsOUOFfLIPvX/gDQTomP+e5fZy+krmNrqIkQ=", "From": "Daniel Scally <dan.scally@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Anthony.McGivern@arm.com, Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tDaniel Scally <dan.scally@ideasonboard.com>", "Subject": "[PATCH v6 13/14] libcamera: mali-c55: Enable usage of scaler", "Date": "Fri, 15 Nov 2024 10:13:33 +0000", "Message-Id": "<20241115101334.453104-14-dan.scally@ideasonboard.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20241115101334.453104-1-dan.scally@ideasonboard.com>", "References": "<20241115101334.453104-1-dan.scally@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": "From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThe Mali C55 ISP has a resizing pipeline that allows to crop and scale\nimages.\n\nSo far the mali-c55 pipeline has only supported cropping without using\nthe scaling functionalities.\n\nNow that the kernel has gained support for the scaling operations, make\nthe libcamera pipeline use it by combining it with a first cropping step\nto align the input and output images FOV ratio, and then scale to the\ndesired output size.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\nChanges in v6:\n\n\t- None\n\nChanges in v5:\n\n\t- None\n\n src/libcamera/pipeline/mali-c55/mali-c55.cpp | 18 +++++++++++++++---\n 1 file changed, 15 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\nindex c0206ea2..d0218349 100644\n--- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n+++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n@@ -756,16 +756,28 @@ int PipelineHandlerMaliC55::configureProcessedStream(MaliC55CameraData *data,\n \tif (ret)\n \t\treturn ret;\n \n-\t/* \\todo Configure the resizer crop/compose rectangles. */\n-\tRectangle ispCrop = { 0, 0, config.size };\n+\t/*\n+\t * Compute the scaler-in to scaler-out ratio: first center-crop to align\n+\t * the FOV to the desired resolution, then scale to the desired size.\n+\t */\n+\tSize scalerIn = subdevFormat.size.boundedToAspectRatio(config.size);\n+\tint xCrop = (subdevFormat.size.width - scalerIn.width) / 2;\n+\tint yCrop = (subdevFormat.size.height - scalerIn.height) / 2;\n+\tRectangle ispCrop = { xCrop, yCrop, scalerIn };\n \tret = pipe->resizer->setSelection(0, V4L2_SEL_TGT_CROP, &ispCrop);\n \tif (ret)\n \t\treturn ret;\n \n-\tret = pipe->resizer->setSelection(0, V4L2_SEL_TGT_COMPOSE, &ispCrop);\n+\tRectangle ispCompose = { 0, 0, config.size };\n+\tret = pipe->resizer->setSelection(0, V4L2_SEL_TGT_COMPOSE, &ispCompose);\n \tif (ret)\n \t\treturn ret;\n \n+\t/*\n+\t * The source pad format size comes directly from the sink\n+\t * compose rectangle.\n+\t */\n+\tsubdevFormat.size = ispCompose.size();\n \tsubdevFormat.code = maliC55FmtToCode.find(config.pixelFormat)->second;\n \treturn pipe->resizer->setFormat(1, &subdevFormat);\n }\n", "prefixes": [ "v6", "13/14" ] }