From patchwork Wed Dec 23 18:45:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10711 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 BD881C0F1A for ; Wed, 23 Dec 2020 18:45:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7645A62000; Wed, 23 Dec 2020 19:45:11 +0100 (CET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 09C79615B0 for ; Wed, 23 Dec 2020 19:45:09 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id A082A20004 for ; Wed, 23 Dec 2020 18:45:08 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 23 Dec 2020 19:45:14 +0100 Message-Id: <20201223184516.58791-4-jacopo@jmondi.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201223184516.58791-1-jacopo@jmondi.org> References: <20201223184516.58791-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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. Signed-off-by: Jacopo Mondi Reviewed-by: Paul Elder --- 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 609f948c56a6..fa85484f6186 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -616,10 +616,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 021d0ffe3ffb..31c9683f783b 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 8bda746f3136..e33b2c0823af 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) {