From patchwork Tue Jan 5 19:05:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10816 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 BC3B8C0F1A for ; Tue, 5 Jan 2021 19:05:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6517663171; Tue, 5 Jan 2021 20:05:16 +0100 (CET) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4FD046297D for ; Tue, 5 Jan 2021 20:05:14 +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 18445100002 for ; Tue, 5 Jan 2021 19:05:13 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Jan 2021 20:05:12 +0100 Message-Id: <20210105190522.682324-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210105190522.682324-1-jacopo@jmondi.org> References: <20210105190522.682324-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 02/12] libcamera: camera_sensor: Make V4L2_CID_EXPOSURE mandatory 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" Add the V4L2_CID_EXPOSURE control to the list of mandatory controls the sensor driver has to report and document this new requirement. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- Documentation/sensor_driver_requirements.rst | 11 ++++++++++- src/libcamera/camera_sensor.cpp | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Documentation/sensor_driver_requirements.rst b/Documentation/sensor_driver_requirements.rst index 0e658aaa03b5..97e98b9e12ef 100644 --- a/Documentation/sensor_driver_requirements.rst +++ b/Documentation/sensor_driver_requirements.rst @@ -26,11 +26,20 @@ The sensor driver shall support the following V4L2 controls: * `V4L2_CID_HBLANK`_ * `V4L2_CID_PIXEL_RATE`_ +* `V4L2_CID_EXPOSURE`_ .. _V4L2_CID_HBLANK: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-image-source.html .. _V4L2_CID_PIXEL_RATE: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-image-process.html +.. _V4L2_CID_EXPOSURE: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/control.html + +The `HBLANK` and `PIXEL_RATE` controls are used to compute the sensor +output timings. + +The `EXPOSURE` control shall report the image integration time in number of +lines. The V4L2 documentation does not specify a unit for this control, drivers +compliant with the V4L2 specification might need to be changed to be used by +libcamera. -Both controls are used to compute the sensor output timings. Optional Requirements --------------------- diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 05a1d7c22e97..f7939b94d2f8 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -245,6 +245,7 @@ int CameraSensor::validateSensorDriver() const std::vector mandatoryControls{ V4L2_CID_PIXEL_RATE, V4L2_CID_HBLANK, + V4L2_CID_EXPOSURE, }; ControlList ctrls = subdev_->getControls(mandatoryControls);