[{"id":26679,"web_url":"https://patchwork.libcamera.org/comment/26679/","msgid":"<20230320191531.q7fh2ejj2v6c5bhq@uno.localdomain>","date":"2023-03-20T19:15:31","subject":"Re: [libcamera-devel] [PATCH v4 01/10] rkisp1: Add camera lens to\n\tPH and expose it to the IPA","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Daniel\n\nOn Tue, Mar 14, 2023 at 03:48:25PM +0100, Daniel Semkowicz wrote:\n> Check in pipeline handler if camera lens exists, and expose its controls\n> to the IPA.\n>\n> Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>\n> ---\n> I did not include the \"reviewed-by\" markers from last review as there was\n> a change in this commit. Code in IPA file has been moved a bit down to better\n> fit with the changes from the next commit.\n\nThis still seems good to me\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n\n>\n>  include/libcamera/ipa/rkisp1.mojom       | 1 +\n>  src/ipa/rkisp1/rkisp1.cpp                | 5 +++++\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +++++\n>  3 files changed, 11 insertions(+)\n>\n> diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom\n> index 1009e970..bf6e9141 100644\n> --- a/include/libcamera/ipa/rkisp1.mojom\n> +++ b/include/libcamera/ipa/rkisp1.mojom\n> @@ -11,6 +11,7 @@ import \"include/libcamera/ipa/core.mojom\";\n>  struct IPAConfigInfo {\n>  \tlibcamera.IPACameraSensorInfo sensorInfo;\n>  \tlibcamera.ControlInfoMap sensorControls;\n> +\tlibcamera.ControlInfoMap lensControls;\n>  };\n>\n>  interface IPARkISP1Interface {\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 6544c925..248cf5e0 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -7,6 +7,7 @@\n>\n>  #include <algorithm>\n>  #include <math.h>\n> +#include <optional>\n>  #include <queue>\n>  #include <stdint.h>\n>  #include <string.h>\n> @@ -80,6 +81,7 @@ private:\n>  \tstd::map<unsigned int, MappedFrameBuffer> mappedBuffers_;\n>\n>  \tControlInfoMap sensorControls_;\n> +\tstd::optional<ControlInfoMap> lensControls_;\n>\n>  \t/* revision-specific data */\n>  \trkisp1_cif_isp_version hwRevision_;\n> @@ -265,6 +267,9 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n>  \t\t\treturn format.colourEncoding == PixelFormatInfo::ColourEncodingRAW;\n>  \t\t});\n>\n> +\tif (!ipaConfig.lensControls.empty())\n> +\t\tlensControls_ = ipaConfig.lensControls;\n> +\n>  \tfor (auto const &a : algorithms()) {\n>  \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 8a30fe06..83fb6287 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -32,6 +32,7 @@\n>  #include <libcamera/ipa/rkisp1_ipa_proxy.h>\n>\n>  #include \"libcamera/internal/camera.h\"\n> +#include \"libcamera/internal/camera_lens.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n> @@ -812,6 +813,10 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n>\n>  \tipaConfig.sensorControls = data->sensor_->controls();\n>\n> +\tCameraLens *lens = data->sensor_->focusLens();\n> +\tif (lens)\n> +\t\tipaConfig.lensControls = lens->controls();\n> +\n>  \tret = data->ipa_->configure(ipaConfig, streamConfig, &data->controlInfo_);\n>  \tif (ret) {\n>  \t\tLOG(RkISP1, Error) << \"failed configuring IPA (\" << ret << \")\";\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 5A87CC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Mar 2023 19:15:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5EEAE626E3;\n\tMon, 20 Mar 2023 20:15:56 +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 9982561ED4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Mar 2023 20:15:54 +0100 (CET)","from ideasonboard.com (host-82-63-22-244.business.telecomitalia.it\n\t[82.63.22.244])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 92D46832;\n\tMon, 20 Mar 2023 20:15:50 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1679339756;\n\tbh=oGd8tltVCWwPAyGREd4tU6h0yZk5XIvOp2o6UigBwFc=;\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=3O+9sECL908zfAHzqcy5D6vBEPN6/oUEOXgFgqACbOdY4kTBC1j/0t8hm/tlTUgc4\n\tds0eeYnN0I/NUbczb2M5TwBfPiu1tpNO7lalOcWxQr22teeSI5KFyG8smwUgAktBmS\n\tVWLIhzm9vtDAdpsvrBBeXb8swTaH7RpiQJL7AU5YywT4k93Qe54Li/qmOOAi8WKrbf\n\tWkiT4L58dcOCXG1mvxWIuI2XYwJpUhyur/31wlz8ftYxa8dhUpq6lfOKh+zGqGq9tC\n\tte26YR1AuHOiOoRfyYo6okldmLDOK44/PeXKVWxNqJ9T5c8MVZ+W83N665Z99OwB4v\n\t2SlkqlEw4jtvQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1679339754;\n\tbh=oGd8tltVCWwPAyGREd4tU6h0yZk5XIvOp2o6UigBwFc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QcIOEsI9lF1SDUTBuU/DI9dfntbgFCUzzMByoVwV+gIi1SB3gO60LJSOLxKH620TH\n\tUj+wuwAmYbposZWXvhw/uYxy4GY7FoSL7Haz6eilu1/JSP6L6C1OksXAAGVFyIKNX7\n\ttXB0O4vsrIx0k05eCyL6bJ6f9q0mcz1Te8y7Mimc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"QcIOEsI9\"; dkim-atps=neutral","Date":"Mon, 20 Mar 2023 20:15:31 +0100","To":"Daniel Semkowicz <dse@thaumatec.com>","Message-ID":"<20230320191531.q7fh2ejj2v6c5bhq@uno.localdomain>","References":"<20230314144834.85193-1-dse@thaumatec.com>\n\t<20230314144834.85193-2-dse@thaumatec.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230314144834.85193-2-dse@thaumatec.com>","Subject":"Re: [libcamera-devel] [PATCH v4 01/10] rkisp1: Add camera lens to\n\tPH and expose it to the IPA","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>"}}]