From patchwork Mon Dec 28 16:55:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10763 X-Patchwork-Delegate: jacopo@jmondi.org Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 46CF6C0F1A for ; Mon, 28 Dec 2020 16:55:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 21BDF615D5; Mon, 28 Dec 2020 17:55:55 +0100 (CET) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6794360111 for ; Mon, 28 Dec 2020 17:55:51 +0100 (CET) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id F1C3F100008; Mon, 28 Dec 2020 16:55:50 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 28 Dec 2020 17:55:58 +0100 Message-Id: <20201228165600.53987-4-jacopo@jmondi.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228165600.53987-1-jacopo@jmondi.org> References: <20201228165600.53987-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/5] libcamera: camera_sensor: Rename controls() method X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The CameraSensor::controls() methods returns the information relative to the V4L2 controls registered by the sensor sub-device driver. Its current use is to inform the IPA module of two pipelines (RkISP1 and VIMC) about the V4L2 controls limits. The CameraSensor class has a controls_ field, which is instead the ControlInfoMap of libcamera controls registered by the CameraSensor class and meant to be exported as Camera controls. To prepare to register libcamera controls in the CameraSensor::controls_ info map, and remove any ambiguity on the intended usage of CameraSensor::controls(), rename the method in CameraSensor::subdevControls() and update its users in the code base. Reviewed-by: Paul Elder Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- include/libcamera/internal/camera_sensor.h | 2 +- src/libcamera/camera_sensor.cpp | 6 +++--- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +- src/libcamera/pipeline/vimc/vimc.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 0357b2a630f7..841c7f4bef0f 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -57,7 +57,7 @@ public: const Size &size) const; int setFormat(V4L2SubdeviceFormat *format); - const ControlInfoMap &controls() const; + const ControlInfoMap &subdevControls() const; ControlList getControls(const std::vector &ids); int setControls(ControlList *ctrls); diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 18dc6d723e27..337d73c524bf 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -617,10 +617,10 @@ int CameraSensor::setFormat(V4L2SubdeviceFormat *format) } /** - * \brief Retrieve the supported V4L2 controls and their information - * \return A map of the V4L2 controls supported by the sensor + * \brief Retrieve the controls supported by the V4L2 subdev and their information + * \return A map of the V4L2 controls supported by the video subdevice */ -const ControlInfoMap &CameraSensor::controls() const +const ControlInfoMap &CameraSensor::subdevControls() const { return subdev_->controls(); } diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 5ce37febc1d7..628d1f39bfbd 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -906,7 +906,7 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] ControlList *c } std::map entityControls; - entityControls.emplace(0, data->sensor_->controls()); + entityControls.emplace(0, data->sensor_->subdevControls()); IPAOperationData ipaConfig; data->ipa_->configure(sensorInfo, streamConfig, entityControls, diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index 36325ffbbd7d..d5f6e8a453ff 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -338,7 +338,7 @@ void PipelineHandlerVimc::stop(Camera *camera) int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request) { - ControlList controls(data->sensor_->controls()); + ControlList controls(data->sensor_->subdevControls()); for (auto it : request->controls()) { unsigned int id = it.first; @@ -480,7 +480,7 @@ int VimcCameraData::init() return -ENODEV; /* Initialise the supported controls. */ - const ControlInfoMap &controls = sensor_->controls(); + const ControlInfoMap &controls = sensor_->subdevControls(); ControlInfoMap::Map ctrls; for (const auto &ctrl : controls) {