[{"id":14370,"web_url":"https://patchwork.libcamera.org/comment/14370/","msgid":"<20201228082754.GG1933@pyrite.rasen.tech>","date":"2020-12-28T08:27:54","subject":"Re: [libcamera-devel] [PATCH 3/5] libcamera: camera_sensor: Rename\n\tcontrols() method","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Wed, Dec 23, 2020 at 07:45:14PM +0100, Jacopo Mondi wrote:\n> The CameraSensor::controls() methods returns the information relative to\n> the V4L2 controls registered by the sensor sub-device driver. Its\n> current use is to inform the IPA module of two pipelines (RkISP1 and\n> VIMC) about the V4L2 controls limits.\n> \n> The CameraSensor class has a controls_ field, which is instead the\n> ControlInfoMap of libcamera controls registered by the CameraSensor\n> class and meant to be exported as Camera controls.\n> \n> To prepare to register libcamera controls in the CameraSensor::controls_\n> info map, and remove any ambiguity on the intended usage of\n> CameraSensor::controls(), rename the method in\n> CameraSensor::subdevControls() and update its users in the code base.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  include/libcamera/internal/camera_sensor.h | 2 +-\n>  src/libcamera/camera_sensor.cpp            | 6 +++---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp   | 2 +-\n>  src/libcamera/pipeline/vimc/vimc.cpp       | 4 ++--\n>  4 files changed, 7 insertions(+), 7 deletions(-)\n> \n> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\n> index 0357b2a630f7..841c7f4bef0f 100644\n> --- a/include/libcamera/internal/camera_sensor.h\n> +++ b/include/libcamera/internal/camera_sensor.h\n> @@ -57,7 +57,7 @@ public:\n>  \t\t\t\t      const Size &size) const;\n>  \tint setFormat(V4L2SubdeviceFormat *format);\n>  \n> -\tconst ControlInfoMap &controls() const;\n> +\tconst ControlInfoMap &subdevControls() const;\n>  \tControlList getControls(const std::vector<uint32_t> &ids);\n>  \tint setControls(ControlList *ctrls);\n>  \n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index 609f948c56a6..fa85484f6186 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -616,10 +616,10 @@ int CameraSensor::setFormat(V4L2SubdeviceFormat *format)\n>  }\n>  \n>  /**\n> - * \\brief Retrieve the supported V4L2 controls and their information\n> - * \\return A map of the V4L2 controls supported by the sensor\n> + * \\brief Retrieve the controls supported by the V4L2 subdev and their information\n> + * \\return A map of the V4L2 controls supported by the video subdevice\n>   */\n> -const ControlInfoMap &CameraSensor::controls() const\n> +const ControlInfoMap &CameraSensor::subdevControls() const\n>  {\n>  \treturn subdev_->controls();\n>  }\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 021d0ffe3ffb..31c9683f783b 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -906,7 +906,7 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] ControlList *c\n>  \t}\n>  \n>  \tstd::map<unsigned int, const ControlInfoMap &> entityControls;\n> -\tentityControls.emplace(0, data->sensor_->controls());\n> +\tentityControls.emplace(0, data->sensor_->subdevControls());\n>  \n>  \tIPAOperationData ipaConfig;\n>  \tdata->ipa_->configure(sensorInfo, streamConfig, entityControls,\n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index 8bda746f3136..e33b2c0823af 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -338,7 +338,7 @@ void PipelineHandlerVimc::stop(Camera *camera)\n>  \n>  int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request)\n>  {\n> -\tControlList controls(data->sensor_->controls());\n> +\tControlList controls(data->sensor_->subdevControls());\n>  \n>  \tfor (auto it : request->controls()) {\n>  \t\tunsigned int id = it.first;\n> @@ -480,7 +480,7 @@ int VimcCameraData::init()\n>  \t\treturn -ENODEV;\n>  \n>  \t/* Initialise the supported controls. */\n> -\tconst ControlInfoMap &controls = sensor_->controls();\n> +\tconst ControlInfoMap &controls = sensor_->subdevControls();\n>  \tControlInfoMap::Map ctrls;\n>  \n>  \tfor (const auto &ctrl : controls) {\n> -- \n> 2.29.2\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 7A093C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Dec 2020 08:28:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 39B7E6159A;\n\tMon, 28 Dec 2020 09:28:02 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7485F6031E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Dec 2020 09:28:01 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2156125C;\n\tMon, 28 Dec 2020 09:27:59 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pG6Jfblf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1609144081;\n\tbh=XKuepNGK54Sic4lcxpqfZiXha/SFKYkCN32iWnySAiU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pG6JfblfN4Ojpr6JEoAIT540wLA9xZkGymxJO4gyE8XNOWCEcz5y0rhYaMuMAHCAR\n\tHaq5eaSbrmTsarRrlUHUU1djt3IFAe77g1JARs4/f6eRsWViq6xNTUSVUqA2HqvmKi\n\ta+7RwoPTlcfm9lS1RtiGufsjjDcCT49st/2TUuwA=","Date":"Mon, 28 Dec 2020 17:27:54 +0900","From":"paul.elder@ideasonboard.com","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20201228082754.GG1933@pyrite.rasen.tech>","References":"<20201223184516.58791-1-jacopo@jmondi.org>\n\t<20201223184516.58791-4-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201223184516.58791-4-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 3/5] libcamera: camera_sensor: Rename\n\tcontrols() method","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]