[{"id":3178,"web_url":"https://patchwork.libcamera.org/comment/3178/","msgid":"<20191204161415.GF7811@pendragon.ideasonboard.com>","date":"2019-12-04T16:14:15","subject":"Re: [libcamera-devel] [PATCH 07/10] libcamera: pipeline_handler:\n\tAdd Camera properties","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Wed, Dec 04, 2019 at 02:21:03PM +0100, Jacopo Mondi wrote:\n> Associate to each Camera a ControlList which contains the Camera\n> properties as created by pipeline handlers in the pipeline handler's\n> CameraData and provide an operation to retrieve them.\n> \n> Collect properties from the camera sensor in all pipeline handlers that\n> support one (IPU3, RKISP1 and VIMC).\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/include/pipeline_handler.h |  2 ++\n>  src/libcamera/pipeline/ipu3/ipu3.cpp     |  3 +++\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp |  3 +++\n>  src/libcamera/pipeline/vimc.cpp          |  4 ++++\n>  src/libcamera/pipeline_handler.cpp       | 19 +++++++++++++++++++\n>  5 files changed, 31 insertions(+)\n> \n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index a02e6e77dc9c..68761cc473c4 100644\n> --- a/src/libcamera/include/pipeline_handler.h\n> +++ b/src/libcamera/include/pipeline_handler.h\n> @@ -43,6 +43,7 @@ public:\n>  \tPipelineHandler *pipe_;\n>  \tstd::list<Request *> queuedRequests_;\n>  \tControlInfoMap controlInfo_;\n> +\tControlList properties_;\n>  \tstd::unique_ptr<IPAInterface> ipa_;\n>  \n>  private:\n> @@ -64,6 +65,7 @@ public:\n>  \tvoid unlock();\n>  \n>  \tconst ControlInfoMap &controls(Camera *camera);\n> +\tconst ControlList &properties(Camera *camera);\n>  \n>  \tvirtual CameraConfiguration *generateConfiguration(Camera *camera,\n>  \t\tconst StreamRoles &roles) = 0;\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 1c5fccf69428..536a63a30018 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -867,6 +867,9 @@ int PipelineHandlerIPU3::registerCameras()\n>  \t\tif (ret)\n>  \t\t\tcontinue;\n>  \n> +\t\t/* Initialize the camera properties. */\n> +\t\tdata->properties_ = cio2->sensor_->properties();\n> +\n>  \t\t/**\n>  \t\t * \\todo Dynamically assign ImgU and output devices to each\n>  \t\t * stream and camera; as of now, limit support to two cameras\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 4a583a7a1d7e..e9a70755f4c5 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -888,6 +888,9 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> +\t/* Initialize the camera properties. */\n> +\tdata->properties_ = data->sensor_->properties();\n> +\n>  \tret = data->loadIPA();\n>  \tif (ret)\n>  \t\treturn ret;\n> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> index 06664fed42e7..f043cf55889e 100644\n> --- a/src/libcamera/pipeline/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc.cpp\n> @@ -454,6 +454,10 @@ int VimcCameraData::init(MediaDevice *media)\n>  \t}\n>  \n>  \tcontrolInfo_ = std::move(ctrls);\n> +\n> +\t/* Initialize the camera properties. */\n> +\tproperties_ = sensor_->properties();\n> +\n\nIt would be nice if we could generalize this a little bit across\npipeline handlers, but that's out of scope for this patch series.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \treturn 0;\n>  }\n>  \n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index 4349ca8957e4..a023fa1001f5 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -96,6 +96,14 @@ LOG_DEFINE_CATEGORY(Pipeline)\n>   * creating the camera, and shall not be modified afterwards.\n>   */\n>  \n> +/**\n> + * \\var CameraData::properties_\n> + * \\brief The list of properties supported by the camera\n> + *\n> + * The list of camera properties shall be initialised by the pipeline handler\n> + * when creating the camera, and shall not be modified afterwards.\n> + */\n> +\n>  /**\n>   * \\var CameraData::ipa_\n>   * \\brief The IPA module used by the camera\n> @@ -244,6 +252,17 @@ const ControlInfoMap &PipelineHandler::controls(Camera *camera)\n>  \treturn data->controlInfo_;\n>  }\n>  \n> +/**\n> + * \\brief Retrieve the list of properties for a camera\n> + * \\param[in] camera The camera\n> + * \\return A ControlList of properties supported by \\a camera\n> + */\n> +const ControlList &PipelineHandler::properties(Camera *camera)\n> +{\n> +\tCameraData *data = cameraData(camera);\n> +\treturn data->properties_;\n> +}\n> +\n>  /**\n>   * \\fn PipelineHandler::generateConfiguration()\n>   * \\brief Generate a camera configuration for a specified camera","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 3FEF660BFF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Dec 2019 17:14:23 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 916D02E5;\n\tWed,  4 Dec 2019 17:14:22 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1575476062;\n\tbh=fIvhfGxD1aScZ9+CgZzaZHlqTghvK2NHgZoWOKIl+lo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=b1vhqkneNyKbFOBBctK/QyISTz1fNC9mZqEa/waT0BDkIxdKax3qkECNAGbZ0M3QS\n\tdITiyM2aYdx4b4GdYBIMcosN4R+Pog3XilQ3XRyqDgxITmIDFIAPDsL+bL1P9Rvwig\n\tCdQemho45gF5GyVNVSgYsIjI7gbxqqbMkMH1u0zo=","Date":"Wed, 4 Dec 2019 18:14:15 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191204161415.GF7811@pendragon.ideasonboard.com>","References":"<20191204132106.21582-1-jacopo@jmondi.org>\n\t<20191204132106.21582-8-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20191204132106.21582-8-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 07/10] libcamera: pipeline_handler:\n\tAdd Camera properties","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>","X-List-Received-Date":"Wed, 04 Dec 2019 16:14:23 -0000"}}]