Patch Detail
Show a patch.
GET /api/patches/10456/?format=api
{ "id": 10456, "url": "https://patchwork.libcamera.org/api/patches/10456/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10456/", "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": "<20201120124503.22718-2-sebastian.fricke.linux@gmail.com>", "date": "2020-11-20T12:45:03", "name": "[libcamera-devel,v2,1/1] pipeline: rkisp1: Fix sensor-ISP format mismatch", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "63fa140bc4d5ec32e6e5ab3325f0a2444c3b6a46", "submitter": { "id": 73, "url": "https://patchwork.libcamera.org/api/people/73/?format=api", "name": "Sebastian Fricke", "email": "sebastian.fricke.linux@gmail.com" }, "delegate": { "id": 14, "url": "https://patchwork.libcamera.org/api/users/14/?format=api", "username": "pinchartl", "first_name": "Laurent", "last_name": "Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/10456/mbox/", "series": [ { "id": 1472, "url": "https://patchwork.libcamera.org/api/series/1472/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1472", "date": "2020-11-20T12:45:02", "name": "pipeline-rkisp1-Fix-sensor-ISP-format-mismatch", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1472/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10456/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10456/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 CBAB9BE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Nov 2020 12:45:38 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9AEBE61564;\n\tFri, 20 Nov 2020 13:45:38 +0100 (CET)", "from mail-ej1-x643.google.com (mail-ej1-x643.google.com\n\t[IPv6:2a00:1450:4864:20::643])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 45DDC61564\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Nov 2020 13:45:37 +0100 (CET)", "by mail-ej1-x643.google.com with SMTP id oq3so12668488ejb.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Nov 2020 04:45:37 -0800 (PST)", "from basti.fritz.box\n\t(p200300d1ff2882007ff0233db4c9f029.dip0.t-ipconnect.de.\n\t[2003:d1:ff28:8200:7ff0:233d:b4c9:f029])\n\tby smtp.gmail.com with ESMTPSA id\n\t22sm1093492ejw.27.2020.11.20.04.45.35\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 20 Nov 2020 04:45:36 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"CFNsZUPh\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=oSGqzQg4SKRtBdyqkNnbRsVBO68Cz9bVSvwczoOzO54=;\n\tb=CFNsZUPhlaBkyeG1SHnTak0BZyGP+D+VgaKXuTBqOxa8ryftzZ7ZoiEUToBzMnFfYR\n\tv0P5TRBWWbdzpm3/1jKN3ecVw+aYX/6Gw0F5HSOV1Wwgi2MHgY4udtlwlQy0G+z11VXv\n\tBqyIkwtr42bZZzQSlJxtEeToSHWPr6h3+ApnnMSo8zHVFpC9P3s6O/PtIR4hpmpKaTY5\n\tpkjORFpqbXto263rkeqTBLaI33Mtak+l8W0O4qvDx4CUwGueo+b346X+ZjyCMXiTKNLr\n\tbpvXjuCwqdTBw18NBCaBZiLP/qSqkkDrRn0vV1bxn++6anuuG2KnThuS4KcYkGEY4jKL\n\twunw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=oSGqzQg4SKRtBdyqkNnbRsVBO68Cz9bVSvwczoOzO54=;\n\tb=uLownDF+53xOu49LID3i2TAWK7N+mM+r5WMaMoZkRj9PtAb6cV64/M/tg1rz8w6ZL4\n\tod4u9qqZdcAOUYTcj2FdnOrgCwooRzHl0kSuUU2MBY2eDantbSlgTUrfBNWY5mlS60QY\n\tW2m9B+MDhNRx4m0aRZgScOBEoK+XhNJx6X0ISYlVWR4L5dhw2z86la+ZtGZVqOHhBG7m\n\tZJtSwrLNFiIR0+xqaDeyMrq8aAHJsOjVD7qSkBFj4T0LOc0HQtumPoVvHOOJMylw1Jz4\n\tzcpYzVxLnhdMA1wnGeLk/um+D42oVRQZn1C3B5O97ghgh5wYywdTHuNS/wzAcpZXG2hB\n\t7lqw==", "X-Gm-Message-State": "AOAM531Wm9I8uZh8KDN4L0QzTLBZBaBT3IYSMCMFI5q6ubdIwaK2ibOt\n\tUKUt+wgsget6Wzb0MC2SOQpkY3Jtx6g=", "X-Google-Smtp-Source": "ABdhPJymt/+d4BGECDt75lBc58JiMu7BbaphDHfhQ9eNkTCeRUZq+yUrzYLPiVnSqNdfOGoPDNHB2A==", "X-Received": "by 2002:a17:906:d931:: with SMTP id\n\trn17mr32245820ejb.308.1605876336648; \n\tFri, 20 Nov 2020 04:45:36 -0800 (PST)", "From": "Sebastian Fricke <sebastian.fricke.linux@gmail.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 20 Nov 2020 13:45:03 +0100", "Message-Id": "<20201120124503.22718-2-sebastian.fricke.linux@gmail.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20201120124503.22718-1-sebastian.fricke.linux@gmail.com>", "References": "<20201120124503.22718-1-sebastian.fricke.linux@gmail.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v2 1/1] 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": "Make 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\t\t4032\ndefine RKISP1_ISP_MAX_HEIGHT\t\t3024\n\nChange the order of setting the formats, in order to first check if the\nrequested resolution exceeds the maximum and search for the next smaller\navailable sensor resolution if that is the case.\nFail if no viable sensor format was located.\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.linux@gmail.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 46 ++++++++++++++++++++----\n 1 file changed, 40 insertions(+), 6 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 1b1922a..3ef8acd 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -677,22 +677,56 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \t\treturn ret;\n \n \t/*\n-\t * Configure the format on the sensor output and propagate it through\n-\t * the pipeline.\n+\t * Configure the format at the ISP input and pass it on through\n+\t * the pipeline after checking that the maximum resolution allowed\n+\t * for the ISP is not exceeded.\n \t */\n \tV4L2SubdeviceFormat format = config->sensorFormat();\n-\tLOG(RkISP1, Debug) << \"Configuring sensor with \" << format.toString();\n+\tLOG(RkISP1, Debug) << \"Configuring ISP with \" << format.toString();\n+\t/*\n+\t * format is changed in setFormat, keep the resolution for comparison\n+\t */\n+\tSize originalFormatSize = format.size;\n \n-\tret = sensor->setFormat(&format);\n+\tret = isp_->setFormat(0, &format);\n \tif (ret < 0)\n \t\treturn ret;\n+\tLOG(RkISP1, Debug) << \"ISP configured with \" << format.toString();\n+\n+\tif (originalFormatSize != format.size) {\n+\t\tSize maxSize = Size(0, 0);\n+\t\tLOG(RkISP1, Info) << \"Configured resolution is greater than \"\n+\t\t\t\t \"the maximum resolution for the ISP, \"\n+\t\t\t\t \"trying to re-configure to a smaller \"\n+\t\t\t\t \"valid sensor format\";\n+\n+\t\tfor (const Size &size : sensor->sizes()) {\n+\t\t\tif (size.width > format.size.width ||\n+\t\t\t size.height > format.size.height)\n+\t\t\t\tcontinue;\n+\t\t\tmaxSize = std::max(maxSize, size);\n+\t\t}\n+\t\tif (maxSize == Size(0, 0)) {\n+\t\t\tLOG(RkISP1, Error) << \"No available sensor resolution\"\n+\t\t\t\t\t \"that is smaller or equal to \"\n+\t\t\t\t\t << format.toString();\n+\t\t\treturn -1;\n+\t\t}\n+\t\tformat = sensor->getFormat(sensor->mbusCodes(), maxSize);\n \n-\tLOG(RkISP1, Debug) << \"Sensor configured with \" << format.toString();\n+\t\tret = isp_->setFormat(0, &format);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\t\tLOG(RkISP1, Debug) << \"ISP re-configured with \"\n+\t\t\t\t << format.toString();\n+\t}\n \n-\tret = isp_->setFormat(0, &format);\n+\tret = sensor->setFormat(&format);\n \tif (ret < 0)\n \t\treturn ret;\n \n+\tLOG(RkISP1, Debug) << \"Sensor configured with \" << format.toString();\n+\n \tRectangle rect(0, 0, format.size);\n \tret = isp_->setSelection(0, V4L2_SEL_TGT_CROP, &rect);\n \tif (ret < 0)\n", "prefixes": [ "libcamera-devel", "v2", "1/1" ] }