Patch Detail
Show a patch.
GET /api/patches/10451/?format=api
{ "id": 10451, "url": "https://patchwork.libcamera.org/api/patches/10451/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10451/", "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": "<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>", "date": "2020-11-19T13:13:31", "name": "[libcamera-devel,1/1] pipeline: rkisp1: Fix sensor-ISP format mismatch", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "48bba1f96174455679f71be70f39dd04bcb748d1", "submitter": { "id": 73, "url": "https://patchwork.libcamera.org/api/people/73/?format=api", "name": "Sebastian Fricke", "email": "sebastian.fricke.linux@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/10451/mbox/", "series": [ { "id": 1470, "url": "https://patchwork.libcamera.org/api/series/1470/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1470", "date": "2020-11-19T13:13:30", "name": "pipeline-rkisp1-Fix-sensor-ISP-format-mismatch", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1470/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10451/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10451/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 70C79BE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Nov 2020 13:13:40 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3E00D615A4;\n\tThu, 19 Nov 2020 14:13:40 +0100 (CET)", "from mail-ej1-x642.google.com (mail-ej1-x642.google.com\n\t[IPv6:2a00:1450:4864:20::642])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F308B615A4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 14:13:38 +0100 (CET)", "by mail-ej1-x642.google.com with SMTP id f20so7828094ejz.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 05:13:38 -0800 (PST)", "from basti.fritz.box\n\t(p200300d1ff000d00631290ba0e9702d8.dip0.t-ipconnect.de.\n\t[2003:d1:ff00:d00:6312:90ba:e97:2d8])\n\tby smtp.gmail.com with ESMTPSA id\n\td19sm15056135eds.31.2020.11.19.05.13.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 19 Nov 2020 05:13:37 -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=\"B4yt/NqF\"; 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=RF8lsmNJBvg1jM+l8YKrOTVIOplSv3bSXXdpHvOv4GE=;\n\tb=B4yt/NqFIxqtfGmynnlj1MddQL71ygY42OIWIEgtP5xkOpPHjens8aMuMqzWUSvG6z\n\tdwny/nBt6sJBx9gEg6CW2zpXPzXnMGe3aGTfJi8QWdw+5Bc/cHyUcZXKKCFTmtnVy+IM\n\tN0nR44DqLmiHy1ujpw0v2JXxW1Lx9dCHXeDf2o8lCog+Ld7PngljGn7wwbNdoqyfgZhC\n\t3TNv5/6WgBWBWJkZK+98uri3PoR4uC7lv2pXiKwAVwlG4xMMC/xRed9zoV/I/YO8sbze\n\tgf81E1IZkv4EBXzWAm9+ZQio3c87nu+hxGejNjDC7A1QaLBB2XdxeM1vh9MKIyziEIGB\n\t1eSw==", "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=RF8lsmNJBvg1jM+l8YKrOTVIOplSv3bSXXdpHvOv4GE=;\n\tb=uR9gdWEuKV8YBMiS5H1G4XdLUgdNtRPgy6kEHAvZyOHz7yPwe6O6V6uTkizXEAWib3\n\ty7JSx3fDZ5zL03Dp+96pizvObYGkd+TEb/pCTeyKXaMDKLDEZFf0qd6p9JKlA1e8C4g3\n\tqM/OEePtVhFcvZpjhaxIM5hrU9w0G1/ySKg5q6MRrnp33OnyGJl61qtq1PfUheb2xb33\n\tZkx4Ggyg2r533knJmwqUzr9Zrk7DWZXYZLeu/7eTkRCFJngYrG5CGSDdT7ghkM77uZkm\n\tuoitHIsP4AsYmsq7W+X3MsGDWQXGukBJCQe+PT9Yddl1IYaix4kyI1BJ5GurHlR2BByd\n\t7HHg==", "X-Gm-Message-State": "AOAM5323f+GQOkOV/Ho3B8JDkrbUxrxOVif6MmK9j6Ot391cR74VXWeX\n\toGoxLiLQulpSQO2QzHQlI6KIqosTS6d3IA==", "X-Google-Smtp-Source": "ABdhPJxd9arKQc0ugwRor7H/fVpvo7Ts8lrC9xeRLZlJPwdt9OMyLfkzxt+2A8P3z0GWkDRQVhwSjA==", "X-Received": "by 2002:a17:906:4699:: with SMTP id\n\ta25mr27320878ejr.284.1605791618372; \n\tThu, 19 Nov 2020 05:13:38 -0800 (PST)", "From": "Sebastian Fricke <sebastian.fricke.linux@gmail.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 19 Nov 2020 14:13:31 +0100", "Message-Id": "<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20201119131331.30847-1-sebastian.fricke.linux@gmail.com>", "References": "<20201119131331.30847-1-sebastian.fricke.linux@gmail.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 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 | 36 ++++++++++++++++++++++--\n 1 file changed, 33 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 1b1922a..621e9bf 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -671,6 +671,9 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \tRkISP1CameraData *data = cameraData(camera);\n \tCameraSensor *sensor = data->sensor_;\n \tint ret;\n+\tSize original_format_size = Size(0, 0);\n+\tSize max_size = Size(0, 0);\n+\n \n \tret = initLinks(camera, sensor, *config);\n \tif (ret)\n@@ -682,17 +685,44 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \t */\n \tV4L2SubdeviceFormat format = config->sensorFormat();\n \tLOG(RkISP1, Debug) << \"Configuring sensor with \" << format.toString();\n+\t// format is changed in setFormat, keep the resolution for comparison\n+\toriginal_format_size = 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 (original_format_size > format.size) {\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+\t\tfor (const Size &size : sensor->sizes()) {\n+\t\t\tif (size <= format.size && size > max_size)\n+\t\t\t\tmax_size = size;\n+\t\t}\n+\t\tif (max_size == 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(), max_size);\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", "1/1" ] }