Patch Detail
Show a patch.
GET /api/patches/11408/?format=api
{ "id": 11408, "url": "https://patchwork.libcamera.org/api/patches/11408/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11408/", "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": "<20210227180126.37591-3-sebastian.fricke@posteo.net>", "date": "2021-02-27T18:01:26", "name": "[libcamera-devel,v5,2/2] pipeline: rkisp1: Fix sensor ISP format mismatch", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e34621e31c631906fcd4c72d9b6c3d2cf66d1982", "submitter": { "id": 78, "url": "https://patchwork.libcamera.org/api/people/78/?format=api", "name": "Sebastian Fricke", "email": "sebastian.fricke@posteo.net" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11408/mbox/", "series": [ { "id": 1732, "url": "https://patchwork.libcamera.org/api/series/1732/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1732", "date": "2021-02-27T18:01:24", "name": "Fix a format mismatch within the RkISP1 pipeline", "version": 5, "mbox": "https://patchwork.libcamera.org/series/1732/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11408/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11408/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 309BFBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 27 Feb 2021 18:01:38 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EBE3A68A76;\n\tSat, 27 Feb 2021 19:01:37 +0100 (CET)", "from mout02.posteo.de (mout02.posteo.de [185.67.36.66])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 783C0689DD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 27 Feb 2021 19:01:36 +0100 (CET)", "from submission (posteo.de [89.146.220.130]) \n\tby mout02.posteo.de (Postfix) with ESMTPS id 0ADE92400FD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 27 Feb 2021 19:01:36 +0100 (CET)", "from customer (localhost [127.0.0.1])\n\tby submission (posteo.de) with ESMTPSA id 4DnvV722x8z9rxB;\n\tSat, 27 Feb 2021 19:01:35 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=posteo.net header.i=@posteo.net\n\theader.b=\"eO1BRFMe\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;\n\tt=1614448896; bh=OVEmYbcSn1D6efYgH+rT+khm0GMY05L8pv3e3bhRKsI=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=eO1BRFMeFM5yo5gBUXdmDbnnaVYdnB+c1+GxYNphDcTvvGE3F1DBJQZDR+oxzTXGh\n\tsViK+jAEtnMAm0Gv8tNa7NUi4WnCvOgjkQ+g3kDrJXXfbguZof5qjtGWRTJCQQVrt9\n\tUoSqmDTpxo23zVXKB6S9ttonNVUkM9gKpRhsADdVgatP/INFNHfXymDLg6y6eH7Wvl\n\t2gNoRYVi2alw/3vH7rmbFalIGBNSIdCRGUjFTKsuAQQj5sAxJZ9COXgPHG1ZwQxw0d\n\t2NhAaO3eblONRsj/kfXhYamDVqLv4SoIrYuqPE9dvIzs24PNfgngnWHi8KQUFrRPDC\n\tWmj1bQGQMR+Xw==", "From": "Sebastian Fricke <sebastian.fricke@posteo.net>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 27 Feb 2021 19:01:26 +0100", "Message-Id": "<20210227180126.37591-3-sebastian.fricke@posteo.net>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210227180126.37591-1-sebastian.fricke@posteo.net>", "References": "<20210227180126.37591-1-sebastian.fricke@posteo.net>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v5 2/2] pipeline: rkisp1: Fix sensor ISP\n\tformat mismatch", "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": "This patch fixes a mismatch of image formats during the pipeline\ncreation of the RkISP1. The mismatch happens because the current code\ndoes not check if the configured format exceeds the maximum viable\nresolution of the ISP.\n\nMake sure to use a sensor format resolution that is smaller or equal to\nthe maximum allowed resolution for the RkISP1. The maximum resolution\nis defined within the `rkisp1-common.h` file as:\ndefine RKISP1_ISP_MAX_WIDTH 4032\ndefine RKISP1_ISP_MAX_HEIGHT 3024\n\nEnumerate the frame-sizes of the ISP entity and compare the maximum with\nthe configured resolution.\n\nThis means that some camera sensors can never operate with their maximum\nresolution, for example on my OV13850 camera sensor, there are two\npossible resolutions: 4224x3136 & 2112x1568, the first of those two will\nnever be picked as it surpasses the maximum of the ISP.\n\nSigned-off-by: Sebastian Fricke <sebastian.fricke@posteo.net>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 35 +++++++++++++++++++++---\n 1 file changed, 31 insertions(+), 4 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 50eaa6a4..56a406c1 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -474,10 +474,37 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n \t\treturn Invalid;\n \t}\n \n-\t/* Select the sensor format. */\n-\tSize maxSize;\n+\t/* Get the ISP resolution limits */\n+\tV4L2Subdevice::Formats ispFormats = data_->isp_->formats(0);\n+\tif (ispFormats.empty()) {\n+\t\tLOG(RkISP1, Error) << \"Unable to fetch ISP formats.\";\n+\t\treturn Invalid;\n+\t}\n+\t/*\n+\t * The maximum resolution is identical for all media bus codes on\n+\t * the RkISP1 isp entity. Therefore take the first available resolution.\n+\t */\n+\tSize ispMaximum = ispFormats.begin()->second[0].max;\n+\n+\t/*\n+\t * Select the sensor format, use either the best fit to the configured\n+\t * format or a specific sensor format, when getFormat would choose a\n+\t * resolution that surpasses the ISP maximum.\n+\t */\n+\tSize maxSensorSize;\n+\tfor (const Size &size : sensor->sizes()) {\n+\t\tif (size.width > ispMaximum.width ||\n+\t\t size.height > ispMaximum.height)\n+\t\t\tcontinue;\n+\t\tmaxSensorSize = std::max(maxSensorSize, size);\n+\t}\n+\tSize maxConfigSize;\n \tfor (const StreamConfiguration &cfg : config_)\n-\t\tmaxSize = std::max(maxSize, cfg.size);\n+\t\tmaxConfigSize = std::max(maxConfigSize, cfg.size);\n+\n+\tif (maxConfigSize.height <= maxSensorSize.height &&\n+\t maxConfigSize.width <= maxSensorSize.width)\n+\t\tmaxSensorSize = maxConfigSize;\n \n \tsensorFormat_ = sensor->getFormat({ MEDIA_BUS_FMT_SBGGR12_1X12,\n \t\t\t\t\t MEDIA_BUS_FMT_SGBRG12_1X12,\n@@ -491,7 +518,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n \t\t\t\t\t MEDIA_BUS_FMT_SGBRG8_1X8,\n \t\t\t\t\t MEDIA_BUS_FMT_SGRBG8_1X8,\n \t\t\t\t\t MEDIA_BUS_FMT_SRGGB8_1X8 },\n-\t\t\t\t\t maxSize);\n+\t\t\t\t\t maxSensorSize);\n \tif (sensorFormat_.size.isNull())\n \t\tsensorFormat_.size = sensor->resolution();\n \n", "prefixes": [ "libcamera-devel", "v5", "2/2" ] }