[{"id":26734,"web_url":"https://patchwork.libcamera.org/comment/26734/","msgid":"<20230324145637.sr4bxjvkxhglohef@uno.localdomain>","date":"2023-03-24T14:56:37","subject":"Re: [libcamera-devel] [PATCH v5 02/10] ipa: rkisp1: Add lens limits\n\tto the session config","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Daniel\n\nOn Fri, Mar 24, 2023 at 03:29:00PM +0100, Daniel Semkowicz via libcamera-devel wrote:\n> Add information about focus lens position limits to the IPA session\n> configuration. These information can then be used by IPA algorithms\n> to know which focus positions are valid.\n>\n> Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>\n> ---\n>  src/ipa/rkisp1/ipa_context.cpp | 12 ++++++++++++\n>  src/ipa/rkisp1/ipa_context.h   |  5 +++++\n>  src/ipa/rkisp1/rkisp1.cpp      | 13 ++++++++++++-\n>  3 files changed, 29 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\n> index 9bbf3684..401c098f 100644\n> --- a/src/ipa/rkisp1/ipa_context.cpp\n> +++ b/src/ipa/rkisp1/ipa_context.cpp\n> @@ -89,6 +89,18 @@ namespace libcamera::ipa::rkisp1 {\n>   * \\brief Sensor output resolution\n>   */\n>\n> +/**\n> + * \\var IPASessionConfiguration::lens\n> + * \\brief Lens-specific information\n> + *\n> + * \\var IPASessionConfiguration::lens.minFocusPosition\n> + * \\brief Minimum position supported by the camera focus lens\n> + *\n> + * \\var IPASessionConfiguration::lens.maxFocusPosition\n> + * \\brief Maximum position supported by the camera focus lens\n> + *\n> + */\n> +\n>  /**\n>   * \\var IPASessionConfiguration::raw\n>   * \\brief Indicates if the camera is configured to capture raw frames\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index b9b20653..bfb6e1b7 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -45,6 +45,11 @@ struct IPASessionConfiguration {\n>  \t\tSize size;\n>  \t} sensor;\n>\n> +\tstruct {\n> +\t\tint32_t minFocusPosition;\n> +\t\tint32_t maxFocusPosition;\n> +\t} lens;\n> +\n>  \tstruct {\n>  \t\trkisp1_cif_isp_version revision;\n>  \t} hw;\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 248cf5e0..cd1fbae3 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -267,9 +267,20 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n>  \t\t\treturn format.colourEncoding == PixelFormatInfo::ColourEncodingRAW;\n>  \t\t});\n>\n> -\tif (!ipaConfig.lensControls.empty())\n> +\tif (!ipaConfig.lensControls.empty()) {\n>  \t\tlensControls_ = ipaConfig.lensControls;\n>\n> +\t\tconst ControlInfo focusAbsolute =\n\nThis could be a reference\n\n> +\t\t\tlensControls_->find(V4L2_CID_FOCUS_ABSOLUTE)->second;\n> +\n> +\t\tLOG(IPARkISP1, Debug)\n> +\t\t\t<< \"Focus lens: \" << focusAbsolute.toString();\n> +\n> +\t\tauto &lensConfig = context_.configuration.lens;\n> +\t\tlensConfig.minFocusPosition = focusAbsolute.min().get<int32_t>();\n> +\t\tlensConfig.maxFocusPosition = focusAbsolute.max().get<int32_t>();\n> +\t}\n> +\n\nThe rest looks good and I can fix when applying\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n>  \tfor (auto const &a : algorithms()) {\n>  \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n>\n> --\n> 2.39.2\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 7FA33C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Mar 2023 14:56:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E38896270E;\n\tFri, 24 Mar 2023 15:56:41 +0100 (CET)","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 14533603AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Mar 2023 15:56:41 +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 AAF9AA58;\n\tFri, 24 Mar 2023 15:56:40 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1679669801;\n\tbh=NmO/UY7Z6F5gRhnhihVAUeCjjfFYwR0AzhJ6XDZ9lQw=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=bGFIpCnjUNjDTj1Fxf43dn2K4molzdIXFHXsYdQ5/47FaLTKG3+coSxJlEFFnb2gk\n\tyaJmsaST5PpX6tugxCTQWFYBIQQP40+wwxFfONyXhnxgxSz3LPidRvWps2QKuHYnS5\n\teP9K6Zvi5MWklyOE6/q8Lxcbh3/uq0qhq3ssuy4fyWmphb66KuN8o+rccDpCvJfBE9\n\tsQ2wl4duVwYf7kKQ20hYLP22ZE9fFqXDX+vTpsOVgIUiqBno7Aw1hYvoVxwGr5uiq6\n\tVFpkGEVd1qc/hHOi6RjaTTJd2NRQUn4W3iqBkM2/lB9tTieanWjnebY8Nkg2bw2WZL\n\tXHlnWaK1qnJdw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1679669800;\n\tbh=NmO/UY7Z6F5gRhnhihVAUeCjjfFYwR0AzhJ6XDZ9lQw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=usbvvUTWn/HERnLLScLfqID3503BO8LblsfjzvS4CAMDxG1jG1T9PKRvkLBK035ei\n\tvTT+9HllsGeL0xEWhhl939EgdHKPOCtnNjcyfI+eRfgFYw+ZaJphqhxgHXnIjtWi+v\n\t7h6pAhjxzJrAl1MinWNH2ZUDxsXXzikLgKKmjXIg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"usbvvUTW\"; dkim-atps=neutral","Date":"Fri, 24 Mar 2023 15:56:37 +0100","To":"Daniel Semkowicz <dse@thaumatec.com>","Message-ID":"<20230324145637.sr4bxjvkxhglohef@uno.localdomain>","References":"<20230324142908.64224-1-dse@thaumatec.com>\n\t<20230324142908.64224-3-dse@thaumatec.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230324142908.64224-3-dse@thaumatec.com>","Subject":"Re: [libcamera-devel] [PATCH v5 02/10] ipa: rkisp1: Add lens limits\n\tto the session config","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"jacopo.mondi@ideasonboard.com, libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]