[{"id":32680,"web_url":"https://patchwork.libcamera.org/comment/32680/","msgid":"<rxgd67xakcaqgximl76jrw6eynkzs2q45xu46mbxeoxbyltygf@ozjff2ejoqdx>","date":"2024-12-11T14:46:51","subject":"Re: [PATCH v3 17/17] libcamera: pipeline: rkisp1: Limit sensor size\n\tto max resolution","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Stefan\n\nOn Fri, Dec 06, 2024 at 11:13:39AM +0100, Stefan Klug wrote:\n> In RkISPPath::validate() the sensor sizes are correctly filtered to the\n> ones supported by the ISP. But later in RkISPPipeline::configure() the\n> configured stream size is passed to sensor->getFormat() and the\n> CameraSensor class chooses the best sensor format for the requested\n> stream size. This can result in a sensor format that is too big for the\n> ISP. Fix that by supplying the maximum resolution supported by the ISP\n> to setFormat().\n>\n> Fixes: 761545407c76 (\"pipeline: rkisp1: Filter out sensor sizes not supported by the pipeline\")\n\nNot a big deal as we don't do backports yet, but this requires\n\"libcamera: camera_sensor: Add parameter to limit returned sensor size\"\n\nI admit I'm not sure how we should be handling patch dependencies when\nwe'll do backporting of fixes. Anyway, not an issue for now\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n> Changes in v3:\n> - Added this patch\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp    | 3 ++-\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.h | 1 +\n>  2 files changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 2baff6da7cb7..4dcc5a4fa6a1 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -677,7 +677,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n>  \t\t\t       [](const auto &value) { return value.second; });\n>  \t}\n>\n> -\tsensorFormat_ = sensor->getFormat(mbusCodes, maxSize);\n> +\tsensorFormat_ = sensor->getFormat(mbusCodes, maxSize,\n> +\t\t\t\t\t  mainPath->maxResolution());\n>\n>  \tif (sensorFormat_.size.isNull())\n>  \t\tsensorFormat_.size = sensor->resolution();\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> index 45be8476616c..2a1ef0abe6d1 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> @@ -62,6 +62,7 @@ public:\n>\n>  \tint queueBuffer(FrameBuffer *buffer) { return video_->queueBuffer(buffer); }\n>  \tSignal<FrameBuffer *> &bufferReady() { return video_->bufferReady; }\n> +\tconst Size &maxResolution() const { return maxResolution_; }\n>\n>  private:\n>  \tvoid populateFormats();\n> --\n> 2.43.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 006AFC32DD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Dec 2024 14:46:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 23B3567EB3;\n\tWed, 11 Dec 2024 15:46:57 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 27BB5618AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Dec 2024 15:46:55 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E0D0A352;\n\tWed, 11 Dec 2024 15:46:21 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"WTkkqyLh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1733928382;\n\tbh=s+0YF8xxv+f8y7z0476y3lvfE1jpPbNMTKdU09eCgWI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=WTkkqyLhQXaWOLY5/7SOk6h9EE1Sk7Ly6hD9ShK013Jx6qi2rOD0/3UauhLq4MA8Q\n\tNN3S9tqitmL5r03q1Ve4Xp9qpGwUQToQOqJZxBfx7Jsfpk1FwCL0gavMc9s6YDxJ/0\n\tD4i7ODGkZAjr6FotMm4czxNslQGOZX38Y0s9Rle4=","Date":"Wed, 11 Dec 2024 15:46:51 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v3 17/17] libcamera: pipeline: rkisp1: Limit sensor size\n\tto max resolution","Message-ID":"<rxgd67xakcaqgximl76jrw6eynkzs2q45xu46mbxeoxbyltygf@ozjff2ejoqdx>","References":"<20241206101344.767170-1-stefan.klug@ideasonboard.com>\n\t<20241206101344.767170-18-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241206101344.767170-18-stefan.klug@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32704,"web_url":"https://patchwork.libcamera.org/comment/32704/","msgid":"<Z1rT6aXa2-hn6Ge-@pyrite.rasen.tech>","date":"2024-12-12T12:15:37","subject":"Re: [PATCH v3 17/17] libcamera: pipeline: rkisp1: Limit sensor size\n\tto max resolution","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Fri, Dec 06, 2024 at 11:13:39AM +0100, Stefan Klug wrote:\n> In RkISPPath::validate() the sensor sizes are correctly filtered to the\n> ones supported by the ISP. But later in RkISPPipeline::configure() the\n> configured stream size is passed to sensor->getFormat() and the\n> CameraSensor class chooses the best sensor format for the requested\n> stream size. This can result in a sensor format that is too big for the\n> ISP. Fix that by supplying the maximum resolution supported by the ISP\n> to setFormat().\n> \n> Fixes: 761545407c76 (\"pipeline: rkisp1: Filter out sensor sizes not supported by the pipeline\")\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n> Changes in v3:\n> - Added this patch\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp    | 3 ++-\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.h | 1 +\n>  2 files changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 2baff6da7cb7..4dcc5a4fa6a1 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -677,7 +677,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n>  \t\t\t       [](const auto &value) { return value.second; });\n>  \t}\n>  \n> -\tsensorFormat_ = sensor->getFormat(mbusCodes, maxSize);\n> +\tsensorFormat_ = sensor->getFormat(mbusCodes, maxSize,\n> +\t\t\t\t\t  mainPath->maxResolution());\n>  \n>  \tif (sensorFormat_.size.isNull())\n>  \t\tsensorFormat_.size = sensor->resolution();\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> index 45be8476616c..2a1ef0abe6d1 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n> @@ -62,6 +62,7 @@ public:\n>  \n>  \tint queueBuffer(FrameBuffer *buffer) { return video_->queueBuffer(buffer); }\n>  \tSignal<FrameBuffer *> &bufferReady() { return video_->bufferReady; }\n> +\tconst Size &maxResolution() const { return maxResolution_; }\n>  \n>  private:\n>  \tvoid populateFormats();\n> -- \n> 2.43.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 48716C3260\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Dec 2024 12:15:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DE74B67EDA;\n\tThu, 12 Dec 2024 13:15:46 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DDF5967EC7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Dec 2024 13:15:44 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:39eb:989c:b016:217b])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5774A316;\n\tThu, 12 Dec 2024 13:15:10 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hqOIevS8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734005711;\n\tbh=puaSI5M9IGZhH8YzX1ZHswjVIFX+aAbmUcCXhk11eM8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hqOIevS80e3jEtjbzA/Y9mm4UvcWXDGoHdc5UPyj610SRpK2qE7YboqnQXADzoqU9\n\tyGfTHtyN7EqWPSWgEqA/+njZFp/Iri0RmyHPE6XJvA65FHFXTxAM2GMRjQkybCCPhs\n\tsBXl/S2v11KIjjNDP6J/pV1rOYwUrI1bmlR2lLoI=","Date":"Thu, 12 Dec 2024 21:15:37 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v3 17/17] libcamera: pipeline: rkisp1: Limit sensor size\n\tto max resolution","Message-ID":"<Z1rT6aXa2-hn6Ge-@pyrite.rasen.tech>","References":"<20241206101344.767170-1-stefan.klug@ideasonboard.com>\n\t<20241206101344.767170-18-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20241206101344.767170-18-stefan.klug@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]