[{"id":13800,"web_url":"https://patchwork.libcamera.org/comment/13800/","msgid":"<8e522f9b-74e1-e547-2d9a-0f9188708aa0@collabora.com>","date":"2020-11-19T14:49:44","subject":"Re: [libcamera-devel] [PATCH 1/1] pipeline: rkisp1: Fix sensor-ISP\n\tformat mismatch","submitter":{"id":20,"url":"https://patchwork.libcamera.org/api/people/20/","name":"Helen Koike","email":"helen.koike@collabora.com"},"content":"Hi Sebastian,\n\nThanks for your patch.\n\nOn 11/19/20 10:13 AM, Sebastian Fricke wrote:\n> Make sure to use a sensor format resolution that is smaller or equal to\n> the maximum allowed resolution for the RkISP1. The maximum resolution\n> is defined within the `rkisp1-common.h` file as:\n> define RKISP1_ISP_MAX_WIDTH\t\t4032\n> define RKISP1_ISP_MAX_HEIGHT\t\t3024\n> \n> Change the order of setting the formats, in order to first check if the\n> requested resolution exceeds the maximum and search for the next smaller\n> available sensor resolution if that is the case.\n> Fail if no viable sensor format was located.\n> \n> This means that some camera sensors can never operate with their maximum\n> resolution, for example on my OV13850 camera sensor, there are two\n> possible resolutions: 4224x3136 & 2112x1568, the first of those two will\n> never be picked as it surpasses the maximum of the ISP.\n> \n> Signed-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(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 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\nI believe you can declare this when you need it (when assigning format.size),\nand you don't need to call the constructor to init to zero.\n\n(at least this is the style I see being used in the project).\n\n> +\tSize max_size = Size(0, 0);\n\nYou can declare this inside the if block, since you only use this there.\n\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\nThis message should be updated, since you are configuring the isp and not the sensor.\n\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\nI'm not sure if comparing Size objects is enough.\n\nAccording to the docs:\n\n * Sizes are compared on three criteria, in the following order.\n *\n * - A size with smaller width and smaller height is smaller.\n * - A size with smaller area is smaller.\n * - A size with smaller width is smaller.\n\nIf it reaches the 3rd case, we can have a resolution that is smaller in\nwidth but bigger in height that could go over isp limitation leading to\na non-matching configuration.\n\nRegards,\nHelen\n\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>","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 0B504BE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Nov 2020 14:49:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 966CF615B1;\n\tThu, 19 Nov 2020 15:49:50 +0100 (CET)","from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B6A7D615A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 15:49:49 +0100 (CET)","from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: koike) with ESMTPSA id 8B71B1F4590B"],"To":"Sebastian Fricke <sebastian.fricke.linux@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20201119131331.30847-1-sebastian.fricke.linux@gmail.com>\n\t<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>","From":"Helen Koike <helen.koike@collabora.com>","Message-ID":"<8e522f9b-74e1-e547-2d9a-0f9188708aa0@collabora.com>","Date":"Thu, 19 Nov 2020 11:49:44 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.4.0","MIME-Version":"1.0","In-Reply-To":"<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>","Content-Language":"en-US","Subject":"Re: [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>"}},{"id":13802,"web_url":"https://patchwork.libcamera.org/comment/13802/","msgid":"<20201119145834.uslyirfdbrnuwlqa@uno.localdomain>","date":"2020-11-19T14:58:34","subject":"Re: [libcamera-devel] [PATCH 1/1] pipeline: rkisp1: Fix sensor-ISP\n\tformat mismatch","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Sebastian,\n\nOn Thu, Nov 19, 2020 at 02:13:31PM +0100, Sebastian Fricke wrote:\n> Make sure to use a sensor format resolution that is smaller or equal to\n> the maximum allowed resolution for the RkISP1. The maximum resolution\n> is defined within the `rkisp1-common.h` file as:\n> define RKISP1_ISP_MAX_WIDTH\t\t4032\n> define RKISP1_ISP_MAX_HEIGHT\t\t3024\n>\n> Change the order of setting the formats, in order to first check if the\n> requested resolution exceeds the maximum and search for the next smaller\n> available sensor resolution if that is the case.\n> Fail if no viable sensor format was located.\n>\n> This means that some camera sensors can never operate with their maximum\n> resolution, for example on my OV13850 camera sensor, there are two\n> possible resolutions: 4224x3136 & 2112x1568, the first of those two will\n> never be picked as it surpasses the maximum of the ISP.\n>\n> Signed-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(-)\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 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\nJust a style note skimming through the patch.\n\nlibcamera enforces a common code style\nhttp://libcamera.org/coding-style.html#coding-style-guidelines\n\nand provides a style checker tool in utils/checkstyle.py\n\nMake sure to use it before submitting patches.\n\nThanks\n  j\n\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> --\n> 2.20.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 7B87ABE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Nov 2020 14:58:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0BB66615AF;\n\tThu, 19 Nov 2020 15:58:32 +0100 (CET)","from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D9D3615A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 15:58:31 +0100 (CET)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 8DD311BF209;\n\tThu, 19 Nov 2020 14:58:30 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Thu, 19 Nov 2020 15:58:34 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Sebastian Fricke <sebastian.fricke.linux@gmail.com>","Message-ID":"<20201119145834.uslyirfdbrnuwlqa@uno.localdomain>","References":"<20201119131331.30847-1-sebastian.fricke.linux@gmail.com>\n\t<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>","Subject":"Re: [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>","Cc":"libcamera-devel@lists.libcamera.org","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>"}},{"id":13803,"web_url":"https://patchwork.libcamera.org/comment/13803/","msgid":"<20201119151101.56lqpjkbapcsh6yo@basti.Speedport_W_724V_Typ_A_05011603_06_001>","date":"2020-11-19T15:11:01","subject":"Re: [libcamera-devel] [PATCH 1/1] pipeline: rkisp1: Fix sensor-ISP\n\tformat mismatch","submitter":{"id":73,"url":"https://patchwork.libcamera.org/api/people/73/","name":"Sebastian Fricke","email":"sebastian.fricke.linux@gmail.com"},"content":"On 19.11.2020 15:58, Jacopo Mondi wrote:\n>Hi Sebastian,\n\nHey Jacopo,\n\n>\n>On Thu, Nov 19, 2020 at 02:13:31PM +0100, Sebastian Fricke wrote:\n>> Make sure to use a sensor format resolution that is smaller or equal to\n>> the maximum allowed resolution for the RkISP1. The maximum resolution\n>> is defined within the `rkisp1-common.h` file as:\n>> define RKISP1_ISP_MAX_WIDTH\t\t4032\n>> define RKISP1_ISP_MAX_HEIGHT\t\t3024\n>>\n>> Change the order of setting the formats, in order to first check if the\n>> requested resolution exceeds the maximum and search for the next smaller\n>> available sensor resolution if that is the case.\n>> Fail if no viable sensor format was located.\n>>\n>> This means that some camera sensors can never operate with their maximum\n>> resolution, for example on my OV13850 camera sensor, there are two\n>> possible resolutions: 4224x3136 & 2112x1568, the first of those two will\n>> never be picked as it surpasses the maximum of the ISP.\n>>\n>> Signed-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(-)\n>>\n>> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n>> index 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>\n>Just a style note skimming through the patch.\n>\n>libcamera enforces a common code style\n>http://libcamera.org/coding-style.html#coding-style-guidelines\n\nI think you refer to the '//' comment, should I use a '/* */' comment\nblock for this comment? I read through both the style guidelines and\nkernel guidelines and I couldn't spot a sentence where it states that\n'//' comments are not allowed. Or do you not like that explain why I do\nit?\n\n>\n>and provides a style checker tool in utils/checkstyle.py\n>\n>Make sure to use it before submitting patches.\n\nThat is odd, here is the result of the run I did before submitting the\npatch:\n\n```\nbasti@basti:~/Kernel/libcamera$ ./utils/checkstyle.py\n-----------------------------------------------------------------------------------------\n4cfb814796f2f27bfa4057b2a69618b01eb1de93 pipeline: rkisp1: Fix sensor-ISP format mismatch\n-----------------------------------------------------------------------------------------\nNo style issue detected\n```\n\nDo you get a different result?\nAnd should we change the the style checker in order to detect this\nmistake?\n\n\n>\n>Thanks\n>  j\n\nThanks for taking a look!\nSebastian\n\n>\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>> --\n>> 2.20.1\n>>\n>> _______________________________________________\n>> libcamera-devel mailing list\n>> libcamera-devel@lists.libcamera.org\n>> https://lists.libcamera.org/listinfo/libcamera-devel","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 9A800BE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Nov 2020 15:11:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2D074615AF;\n\tThu, 19 Nov 2020 16:11:05 +0100 (CET)","from mail-ej1-x641.google.com (mail-ej1-x641.google.com\n\t[IPv6:2a00:1450:4864:20::641])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5747C615A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 16:11:04 +0100 (CET)","by mail-ej1-x641.google.com with SMTP id bo9so2646484ejb.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 07:11:04 -0800 (PST)","from localhost\n\t(p200300d1ff000d0083023bfe18317ada.dip0.t-ipconnect.de.\n\t[2003:d1:ff00:d00:8302:3bfe:1831:7ada])\n\tby smtp.gmail.com with ESMTPSA id\n\tf9sm14538835ejd.85.2020.11.19.07.11.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 19 Nov 2020 07:11:03 -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=\"GCdGaP6y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:reply-to:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=c+Ejdnx4Q18Y4q6dlAlskHDi78X6baPO/05/zcFskgc=;\n\tb=GCdGaP6y1ecKOTPyGa/dEBWfjCbPdBEV04hAz7uWwVaUUgcC4iR4OlzXTUSxRPTuZ0\n\tq/hT3zjfjmskSTDytXsORK38zbvNue7uqNzPLlZ5IxqW7FQB2PVE5c9bihpiJUmGVmEm\n\tcKnQScXXnqnXKpHooOmz17CJPz9MJJYe/ufb9LO7O3YE8T2zwD+SL77N4crmxFtjJhfm\n\t9fera3Nc8S/yYMiQPuaN4lixi9+eXUJCMTf3DLGlLE5i27kFcFUdJSZIqd6VjAD7xS47\n\t41XsrgkCPof93uqAnaSldxqVlokUmcKaiPfvWfcubmX9GA06DK7sC6Lb33sn9Z9UpyXM\n\t2JJA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to\n\t:references:mime-version:content-disposition:in-reply-to:user-agent; \n\tbh=c+Ejdnx4Q18Y4q6dlAlskHDi78X6baPO/05/zcFskgc=;\n\tb=K4CFTZ0u4mTzNKBMCvAjdWfDBre8VSubwtowk90W2RLcd/Kp24StsLGMV82jfJttS5\n\tu2oXdxhueyCFtmwzs4ypeIv4xXjue3hkd8ZYTM2gQgcXp1OqoBhpPyLLBFEizY3Ddxfe\n\tzC4hQWQ75C9PkBUm48t2OnGwo7Lzz3KJDZo5KQy7jCmkL/stYNVkYg4Gfaszp3sVckhr\n\toUbKKAPxdzLDgaHWYoS+i/x/QxE6JNFwnyloSNQRNAQW6s6yBMG7uhCfqyjwcdzyFy9S\n\tkYzaj4F83j1o1yyRblriw8PQZtAFNGNUOltp/mxhFr/kkxXwO1cRgXI2F+hchzVyxkVB\n\txaIQ==","X-Gm-Message-State":"AOAM5316hEWfuxeY/2co7r3Tdn5FgiuliOKPFanJg8clXh1nqBEzdePm\n\txZNKBdarDqDO4R+Tikz56+cxLOweMnGVGA==","X-Google-Smtp-Source":"ABdhPJxxMpeowvi+ol4aeR092SJMElXBqNuMuYWzRrban2BJP4voDQ0wx2VxWc/Bj3AdlBa/SwMuxQ==","X-Received":"by 2002:a17:906:614:: with SMTP id\n\ts20mr16781345ejb.202.1605798663721; \n\tThu, 19 Nov 2020 07:11:03 -0800 (PST)","Date":"Thu, 19 Nov 2020 16:11:01 +0100","From":"Sebastian Fricke <sebastian.fricke.linux@gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20201119151101.56lqpjkbapcsh6yo@basti.Speedport_W_724V_Typ_A_05011603_06_001>","References":"<20201119131331.30847-1-sebastian.fricke.linux@gmail.com>\n\t<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>\n\t<20201119145834.uslyirfdbrnuwlqa@uno.localdomain>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201119145834.uslyirfdbrnuwlqa@uno.localdomain>","User-Agent":"NeoMutt/20180716","Subject":"Re: [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>","Reply-To":"Sebastian Fricke <sebastian.fricke.linux@gmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":13804,"web_url":"https://patchwork.libcamera.org/comment/13804/","msgid":"<20201119152524.myhqvh7jkhdlnl32@uno.localdomain>","date":"2020-11-19T15:25:24","subject":"Re: [libcamera-devel] [PATCH 1/1] pipeline: rkisp1: Fix sensor-ISP\n\tformat mismatch","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Sebastian,\n\nOn Thu, Nov 19, 2020 at 04:11:01PM +0100, Sebastian Fricke wrote:\n> On 19.11.2020 15:58, Jacopo Mondi wrote:\n> > Hi Sebastian,\n>\n> Hey Jacopo,\n>\n> >\n> > On Thu, Nov 19, 2020 at 02:13:31PM +0100, Sebastian Fricke wrote:\n> > > Make sure to use a sensor format resolution that is smaller or equal to\n> > > the maximum allowed resolution for the RkISP1. The maximum resolution\n> > > is defined within the `rkisp1-common.h` file as:\n> > > define RKISP1_ISP_MAX_WIDTH\t\t4032\n> > > define RKISP1_ISP_MAX_HEIGHT\t\t3024\n> > >\n> > > Change the order of setting the formats, in order to first check if the\n> > > requested resolution exceeds the maximum and search for the next smaller\n> > > available sensor resolution if that is the case.\n> > > Fail if no viable sensor format was located.\n> > >\n> > > This means that some camera sensors can never operate with their maximum\n> > > resolution, for example on my OV13850 camera sensor, there are two\n> > > possible resolutions: 4224x3136 & 2112x1568, the first of those two will\n> > > never be picked as it surpasses the maximum of the ISP.\n> > >\n> > > Signed-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(-)\n> > >\n> > > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > index 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> > >\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> >\n> > Just a style note skimming through the patch.\n> >\n> > libcamera enforces a common code style\n> > http://libcamera.org/coding-style.html#coding-style-guidelines\n>\n> I think you refer to the '//' comment, should I use a '/* */' comment\n> block for this comment? I read through both the style guidelines and\n> kernel guidelines and I couldn't spot a sentence where it states that\n> '//' comments are not allowed. Or do you not like that explain why I do\n> it?\n\nWell, kernel is C, so it does not disallow C++ commenting explicitely\nin facts :)\n\nBut yes, we use /* */\n\nAlso we use camelCase and not snake_case for variables\n\n>\n> >\n> > and provides a style checker tool in utils/checkstyle.py\n> >\n> > Make sure to use it before submitting patches.\n>\n> That is odd, here is the result of the run I did before submitting the\n> patch:\n>\n> ```\n> basti@basti:~/Kernel/libcamera$ ./utils/checkstyle.py\n> -----------------------------------------------------------------------------------------\n> 4cfb814796f2f27bfa4057b2a69618b01eb1de93 pipeline: rkisp1: Fix sensor-ISP format mismatch\n> -----------------------------------------------------------------------------------------\n> No style issue detected\n> ```\n>\n> Do you get a different result?\n> And should we change the the style checker in order to detect this\n> mistake?\n\nI thought checkstyle checks for // and snake_case, I'm sorry...\n\n>\n>\n> >\n> > Thanks\n> >  j\n>\n> Thanks for taking a look!\n> Sebastian\n>\n> >\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> > > --\n> > > 2.20.1\n> > >\n> > > _______________________________________________\n> > > libcamera-devel mailing list\n> > > libcamera-devel@lists.libcamera.org\n> > > https://lists.libcamera.org/listinfo/libcamera-devel","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 F319CBE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Nov 2020 15:25:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 978CA615AD;\n\tThu, 19 Nov 2020 16:25:22 +0100 (CET)","from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net\n\t[217.70.183.198])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EEBB2615A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 16:25:20 +0100 (CET)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 7D592C0007;\n\tThu, 19 Nov 2020 15:25:20 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Thu, 19 Nov 2020 16:25:24 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Sebastian Fricke <sebastian.fricke.linux@gmail.com>","Message-ID":"<20201119152524.myhqvh7jkhdlnl32@uno.localdomain>","References":"<20201119131331.30847-1-sebastian.fricke.linux@gmail.com>\n\t<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>\n\t<20201119145834.uslyirfdbrnuwlqa@uno.localdomain>\n\t<20201119151101.56lqpjkbapcsh6yo@basti.Speedport_W_724V_Typ_A_05011603_06_001>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201119151101.56lqpjkbapcsh6yo@basti.Speedport_W_724V_Typ_A_05011603_06_001>","Subject":"Re: [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>","Cc":"libcamera-devel@lists.libcamera.org","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>"}},{"id":13805,"web_url":"https://patchwork.libcamera.org/comment/13805/","msgid":"<20201119153006.sigmagtbxel2w2d6@basti.Speedport_W_724V_Typ_A_05011603_06_001>","date":"2020-11-19T15:30:06","subject":"Re: [libcamera-devel] [PATCH 1/1] pipeline: rkisp1: Fix sensor-ISP\n\tformat mismatch","submitter":{"id":73,"url":"https://patchwork.libcamera.org/api/people/73/","name":"Sebastian Fricke","email":"sebastian.fricke.linux@gmail.com"},"content":"On 19.11.2020 16:25, Jacopo Mondi wrote:\n>Hi Sebastian,\n>\n>On Thu, Nov 19, 2020 at 04:11:01PM +0100, Sebastian Fricke wrote:\n>> On 19.11.2020 15:58, Jacopo Mondi wrote:\n>> > Hi Sebastian,\n>>\n>> Hey Jacopo,\n>>\n>> >\n>> > On Thu, Nov 19, 2020 at 02:13:31PM +0100, Sebastian Fricke wrote:\n>> > > Make sure to use a sensor format resolution that is smaller or equal to\n>> > > the maximum allowed resolution for the RkISP1. The maximum resolution\n>> > > is defined within the `rkisp1-common.h` file as:\n>> > > define RKISP1_ISP_MAX_WIDTH\t\t4032\n>> > > define RKISP1_ISP_MAX_HEIGHT\t\t3024\n>> > >\n>> > > Change the order of setting the formats, in order to first check if the\n>> > > requested resolution exceeds the maximum and search for the next smaller\n>> > > available sensor resolution if that is the case.\n>> > > Fail if no viable sensor format was located.\n>> > >\n>> > > This means that some camera sensors can never operate with their maximum\n>> > > resolution, for example on my OV13850 camera sensor, there are two\n>> > > possible resolutions: 4224x3136 & 2112x1568, the first of those two will\n>> > > never be picked as it surpasses the maximum of the ISP.\n>> > >\n>> > > Signed-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(-)\n>> > >\n>> > > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n>> > > index 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>> > >\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>> >\n>> > Just a style note skimming through the patch.\n>> >\n>> > libcamera enforces a common code style\n>> > http://libcamera.org/coding-style.html#coding-style-guidelines\n>>\n>> I think you refer to the '//' comment, should I use a '/* */' comment\n>> block for this comment? I read through both the style guidelines and\n>> kernel guidelines and I couldn't spot a sentence where it states that\n>> '//' comments are not allowed. Or do you not like that explain why I do\n>> it?\n>\n>Well, kernel is C, so it does not disallow C++ commenting explicitely\n>in facts :)\n>\n>But yes, we use /* */\n>\n>Also we use camelCase and not snake_case for variables\n>\n\nThanks I take that into consideration for v2.\n\n>>\n>> >\n>> > and provides a style checker tool in utils/checkstyle.py\n>> >\n>> > Make sure to use it before submitting patches.\n>>\n>> That is odd, here is the result of the run I did before submitting the\n>> patch:\n>>\n>> ```\n>> basti@basti:~/Kernel/libcamera$ ./utils/checkstyle.py\n>> -----------------------------------------------------------------------------------------\n>> 4cfb814796f2f27bfa4057b2a69618b01eb1de93 pipeline: rkisp1: Fix sensor-ISP format mismatch\n>> -----------------------------------------------------------------------------------------\n>> No style issue detected\n>> ```\n>>\n>> Do you get a different result?\n>> And should we change the the style checker in order to detect this\n>> mistake?\n>\n>I thought checkstyle checks for // and snake_case, I'm sorry...\n>\n\nDo we want to add that to the ToDo list?\n\n>>\n>>\n>> >\n>> > Thanks\n>> >  j\n>>\n>> Thanks for taking a look!\n>> Sebastian\n>>\n>> >\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>> > > --\n>> > > 2.20.1\n>> > >\n>> > > _______________________________________________\n>> > > libcamera-devel mailing list\n>> > > libcamera-devel@lists.libcamera.org\n>> > > https://lists.libcamera.org/listinfo/libcamera-devel","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 83AB7BE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Nov 2020 15:30:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19FC9615AF;\n\tThu, 19 Nov 2020 16:30:12 +0100 (CET)","from mail-ed1-x543.google.com (mail-ed1-x543.google.com\n\t[IPv6:2a00:1450:4864:20::543])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D07E8615A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 16:30:10 +0100 (CET)","by mail-ed1-x543.google.com with SMTP id v22so6239785edt.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Nov 2020 07:30:10 -0800 (PST)","from localhost\n\t(p200300d1ff000d0083023bfe18317ada.dip0.t-ipconnect.de.\n\t[2003:d1:ff00:d00:8302:3bfe:1831:7ada])\n\tby smtp.gmail.com with ESMTPSA id\n\tb6sm15483874edu.21.2020.11.19.07.30.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 19 Nov 2020 07:30:09 -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=\"IzTcgzxu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=DAOudMfOyxJEVJC2pfDB94/cW6RK0NF+PFolS/t9/Mw=;\n\tb=IzTcgzxurpi2tBghmt+TcgD1qfWY/fNrup2wwusHZAYdDwIOcAIdGpkplCHBn2nWeL\n\t67fXLhs/be5OgntOomEAljl4D2iMaJlO+i8hUI/rWxFlPIme3UG7sCbpDOLqvoOcePMq\n\tBvLhlyFjycQw+03MYHAEZJqhyETxn9vdhVoDEuOAM6VnIPWsc9u1dYBRvGi/IjePEvXZ\n\t7VTYioJm/lURztkglGEzdgZ5q+Uh9G0CvWg6FTbSvdtsbVgj5KUmXTrcdK7OpCdNMD2k\n\tI7VPqr6dgKk1hq5MhbNOn1Slh8qm1Z3GOW8Hc/EMH9RwpCOvLFbSA3ggxK1d9tQucnaF\n\tx2hg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=DAOudMfOyxJEVJC2pfDB94/cW6RK0NF+PFolS/t9/Mw=;\n\tb=sTIfrn337lxcDP/ERNbVDQnPskMVWKw+Qz2amEITLwzKPFvg0l735CkIiU8n7B55sN\n\tQ7nnfqHGVVuM9Rp8JNetM9IGi8SXGVzZ7S2TLWYde3X2bee54Dgn0I/rLrblsPf2jDco\n\twwKpSLgvnW2Xz4s9ZIXj29bR6rTvQ9wmZD4b/DS37KeVf4DxjErlBnGkA2mEi4Xi0NKp\n\trPLfIudvjORzb2BMfmN9d2xdNvVftoChDwXFLsrG4C4DF2BE7riFeq83B2BS7YswDyAc\n\t3DxJI6g0nOefuhcXe1HdRkvUwHDZZ2GoOnEGbQ4UWqGNkOUmRows3WJdp8Sqc1p7lq9C\n\tQXpA==","X-Gm-Message-State":"AOAM532a4Qyhyb+gvtROaU08Z7mf4Romxs7/iNykqcjd/N6yeTADw7nB\n\tXr6QYZoOVl6S0+sU9EERsk8l3b0/c391YA==","X-Google-Smtp-Source":"ABdhPJxn+FQKv/+N2g21CgqZihktMGkGip+hbDJkvUV0ws0Xekt6KWQ9Uh44VhAabObxe8I3bl/KGQ==","X-Received":"by 2002:aa7:d717:: with SMTP id\n\tt23mr30506253edq.286.1605799810365; \n\tThu, 19 Nov 2020 07:30:10 -0800 (PST)","Date":"Thu, 19 Nov 2020 16:30:06 +0100","From":"Sebastian Fricke <sebastian.fricke.linux@gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20201119153006.sigmagtbxel2w2d6@basti.Speedport_W_724V_Typ_A_05011603_06_001>","References":"<20201119131331.30847-1-sebastian.fricke.linux@gmail.com>\n\t<20201119131331.30847-2-sebastian.fricke.linux@gmail.com>\n\t<20201119145834.uslyirfdbrnuwlqa@uno.localdomain>\n\t<20201119151101.56lqpjkbapcsh6yo@basti.Speedport_W_724V_Typ_A_05011603_06_001>\n\t<20201119152524.myhqvh7jkhdlnl32@uno.localdomain>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201119152524.myhqvh7jkhdlnl32@uno.localdomain>","User-Agent":"NeoMutt/20180716","Subject":"Re: [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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]