[{"id":23410,"web_url":"https://patchwork.libcamera.org/comment/23410/","msgid":"<165533445018.2586493.6469333453422674061@Monstersaurus>","date":"2022-06-15T23:07:30","subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: simple:\n\tStore sensor resolution in configuration","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2022-06-12 16:23:10)\n> When enumerating the supported configurations, store the corresponding\n> sensor resolution in the SimpleCameraData::Configuration structure and\n> use it when configuring the camera, instead of hardcoding the sensor\n> full resolution. This prepares for support of downscaling in the camera\n> sensor.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nSounds reasonable too, ... So the final patch probably has the magic I'm\nlooking for...\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 3c90bdec60e0..8c48162d7ff0 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -225,6 +225,7 @@ public:\n>  \n>         struct Configuration {\n>                 uint32_t code;\n> +               Size sensorSize;\n>                 PixelFormat captureFormat;\n>                 Size captureSize;\n>                 std::vector<PixelFormat> outputFormats;\n> @@ -542,6 +543,7 @@ void SimpleCameraData::tryPipeline(unsigned int code, const Size &size)\n>  \n>                 Configuration config;\n>                 config.code = code;\n> +               config.sensorSize = size;\n>                 config.captureFormat = pixelFormat;\n>                 config.captureSize = format.size;\n>  \n> @@ -943,7 +945,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>         const SimpleCameraData::Configuration *pipeConfig = config->pipeConfig();\n>         V4L2SubdeviceFormat format{};\n>         format.mbus_code = pipeConfig->code;\n> -       format.size = data->sensor_->resolution();\n> +       format.size = pipeConfig->sensorSize;\n>  \n>         ret = data->setupFormats(&format, V4L2Subdevice::ActiveFormat);\n>         if (ret < 0)\n> -- \n> Regards,\n> \n> Laurent Pinchart\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 78010BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jun 2022 23:07:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3756A65635;\n\tThu, 16 Jun 2022 01:07:34 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C3C1F601EF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Jun 2022 01:07:32 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 743B7415;\n\tThu, 16 Jun 2022 01:07:32 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655334454;\n\tbh=XkjoPZlY1HsPIjTij9VVOtoNwsYvLTJRCOXydGjyTdo=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=MBiKgdPhFK4GC2n7qjH4oZlTxF8Tcc142/6eNmST2+yIbGGiGAZyW70vPOg0Cc5Pk\n\tfGve48mGW6vuT8AIbOPINwh2NS0bRTxL8uRan08lTRqDiwzVYDXyxlx9rTmOh8Zre+\n\tLTCB11wOdfw4erP4lhZAf6FtKsB9UwNKjJgc0iJzMg72k8jyttLh6aZV3WwcRT7S4n\n\tTDgG1ZkUWoPRYPVS05DHWt1EKYf2pbAc15xwNU+QncWqj6BqIMmDI42+GMwI/vGWyy\n\tDR/jyddyBxbRSpijXg4q4vJYM8VGIi3yQ88ZOETo4Xdsr4QYymHrEx5YVEaXaFIWF9\n\tgEdthagTHvfYg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1655334452;\n\tbh=XkjoPZlY1HsPIjTij9VVOtoNwsYvLTJRCOXydGjyTdo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=oxOPlml3/5/bf8PQXedHyW897qzcQlIIo0SMi1k1LLC+OAf20ZOJ8guOPyqzpKVQF\n\thNwOsK2wBUAlSUgUP+qubxJsv2j/dkemqYz5HI97PlLcS8p/UWEzB44Zi4WC3hL5kw\n\tnycOujwQfNMfjedyQtPqniyzBfFfBUq/IcoZYmHk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"oxOPlml3\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220612152311.8408-5-laurent.pinchart@ideasonboard.com>","References":"<20220612152311.8408-1-laurent.pinchart@ideasonboard.com>\n\t<20220612152311.8408-5-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 16 Jun 2022 00:07:30 +0100","Message-ID":"<165533445018.2586493.6469333453422674061@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: simple:\n\tStore sensor resolution in configuration","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>,\n\tBenjamin Schaaf <ben.schaaf@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23511,"web_url":"https://patchwork.libcamera.org/comment/23511/","msgid":"<20220621191811.2d5a852a.dorota.czaplejewicz@puri.sm>","date":"2022-06-21T17:18:11","subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: simple:\n\tStore sensor resolution in configuration","submitter":{"id":96,"url":"https://patchwork.libcamera.org/api/people/96/","name":"Dorota Czaplejewicz","email":"dorota.czaplejewicz@puri.sm"},"content":"On Sun, 12 Jun 2022 18:23:10 +0300\nLaurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:\n\n> When enumerating the supported configurations, store the corresponding\n> sensor resolution in the SimpleCameraData::Configuration structure and\n> use it when configuring the camera, instead of hardcoding the sensor\n> full resolution. This prepares for support of downscaling in the camera\n> sensor.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 3c90bdec60e0..8c48162d7ff0 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -225,6 +225,7 @@ public:\n>  \n>  \tstruct Configuration {\n>  \t\tuint32_t code;\n> +\t\tSize sensorSize;\n>  \t\tPixelFormat captureFormat;\n>  \t\tSize captureSize;\n>  \t\tstd::vector<PixelFormat> outputFormats;\n> @@ -542,6 +543,7 @@ void SimpleCameraData::tryPipeline(unsigned int code, const Size &size)\n>  \n>  \t\tConfiguration config;\n>  \t\tconfig.code = code;\n> +\t\tconfig.sensorSize = size;\n>  \t\tconfig.captureFormat = pixelFormat;\n>  \t\tconfig.captureSize = format.size;\n>  \n> @@ -943,7 +945,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>  \tconst SimpleCameraData::Configuration *pipeConfig = config->pipeConfig();\n>  \tV4L2SubdeviceFormat format{};\n>  \tformat.mbus_code = pipeConfig->code;\n> -\tformat.size = data->sensor_->resolution();\n> +\tformat.size = pipeConfig->sensorSize;\n\nDoes it not always equal pipeConfig->captureSize?\n\nIt's not an issue with this series, but captureSize confuses me. outputSize seems clearer, as it is only relevant for the scaler.\n\n--Dorota\n>  \n>  \tret = data->setupFormats(&format, V4L2Subdevice::ActiveFormat);\n>  \tif (ret < 0)","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 CA0FBBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 21 Jun 2022 17:18:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D197265634;\n\tTue, 21 Jun 2022 19:18:30 +0200 (CEST)","from comms.puri.sm (comms.puri.sm [159.203.221.185])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C207160473\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jun 2022 19:18:28 +0200 (CEST)","from localhost (localhost [127.0.0.1])\n\tby comms.puri.sm (Postfix) with ESMTP id 31ACEE0338;\n\tTue, 21 Jun 2022 10:18:27 -0700 (PDT)","from comms.puri.sm ([127.0.0.1])\n\tby localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id OEy7i9j_0pMu; Tue, 21 Jun 2022 10:18:26 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655831910;\n\tbh=IHoqZrlY/hbIB2ipEKrdB8au3i6rlP2NkNAe7bjr9JY=;\n\th=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=u8KtvqnVlifqI1QAtwr7cOA1Rpn8e3/yLYOoYJvbTto3VDPQPypw7zvybv+xg8YXP\n\t7cOJ+GhPQAPqHvh81H5XADdi7pkE/WYe9UD4lGYXzGCtVMity4IkbUORYjZ1uVxHPL\n\t3sgiYXIHuufaSh0lFKUT3SMRdtxrufyFfY/LeP1qNgMGHbje1rMMlqfOpAWyONKsWd\n\tARMXFtbjyd8JPDFVU4WpvU8TNPlI9bXVhnMlb2/VrOFF04akSLcUDfS4QycHnF8LeE\n\tvzPKY4pD97xRtegTnDmjtRVDtONuTVHABaELhqdRgECf/7zftpbPgO3UB3wX8RIHdX\n\tpzf/iHLhNhp5A==","v=1; a=rsa-sha256; c=relaxed/simple; d=puri.sm; s=comms;\n\tt=1655831906; bh=IHoqZrlY/hbIB2ipEKrdB8au3i6rlP2NkNAe7bjr9JY=;\n\th=Date:From:To:Cc:Subject:In-Reply-To:References:From;\n\tb=Gf2yTr5Z4EVJ4WnwCjTd/rXcIzQoo3HSdu8Xd2SK5/6JvCsyMqdGiIN4GP2bhW4Cz\n\t0+AqvhY0WnKYhfmP+GixNgeq6l50S/YlsgGngkeZoPg/Mv4y8TCejnIsdJH+9xZixK\n\tkDYRyJxKW6z1Fb+TfhLvTPmc1dmWvbIY60hki8Yag6rJnWXE5pRlF+84UQ4Ave4Vhv\n\tNgzc6ZgYu1lWqlCMaCuU6P3eOXAlE0diSt4Yp6f/tJ7EkjtFWT3UFV2iqs/BoNmI+v\n\t8arobrLrfbbCyLmmlTTKf2YAWRkdOjIRliq3osP8HUi7CJH9nOViUHpIIIN2ObLUta\n\t9KpkxONIoiyBA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=puri.sm header.i=@puri.sm\n\theader.b=\"Gf2yTr5Z\"; dkim-atps=neutral","Date":"Tue, 21 Jun 2022 19:18:11 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220621191811.2d5a852a.dorota.czaplejewicz@puri.sm>","In-Reply-To":"<20220612152311.8408-5-laurent.pinchart@ideasonboard.com>","References":"<20220612152311.8408-1-laurent.pinchart@ideasonboard.com>\n\t<20220612152311.8408-5-laurent.pinchart@ideasonboard.com>","Organization":"Purism","MIME-Version":"1.0","Content-Type":"multipart/signed; boundary=\"Sig_/iybMtP2g0VGI+x_wbtULPSN\";\n\tprotocol=\"application/pgp-signature\"; micalg=pgp-sha256","Subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: simple:\n\tStore sensor resolution in configuration","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>","From":"Dorota Czaplejewicz via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>","Cc":"libcamera-devel@lists.libcamera.org,\n\tBenjamin Schaaf <ben.schaaf@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]