[{"id":14752,"web_url":"https://patchwork.libcamera.org/comment/14752/","msgid":"<YA6o8Eow4ausnspY@pendragon.ideasonboard.com>","date":"2021-01-25T11:18:08","subject":"Re: [libcamera-devel] [PATCH v2.1 02/11] libcamera: camera_sensor:\n\tMake V4L2_CID_EXPOSURE mandatory","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, Jan 20, 2021 at 11:29:37AM +0100, Jacopo Mondi wrote:\n> Add the V4L2_CID_EXPOSURE control to the list of mandatory controls the\n> sensor driver has to report and document this new requirement.\n> \n> While at it, re-sort the mandatory V4L2 controls in alphabetical\n> order in the CameraSensor class and remove the above comment as\n> the usage of the controls is better reported in the documentation.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  Documentation/sensor_driver_requirements.rst | 11 ++++++++++-\n>  src/libcamera/camera_sensor.cpp              |  5 ++---\n>  2 files changed, 12 insertions(+), 4 deletions(-)\n> \n> diff --git a/Documentation/sensor_driver_requirements.rst b/Documentation/sensor_driver_requirements.rst\n> index 1dc8c890d16d..c45d5a7ae61b 100644\n> --- a/Documentation/sensor_driver_requirements.rst\n> +++ b/Documentation/sensor_driver_requirements.rst\n> @@ -24,13 +24,22 @@ The sensor driver is assumed to be fully compliant with the V4L2 specification.\n> \n>  The sensor driver shall support the following V4L2 controls:\n> \n> +* `V4L2_CID_EXPOSURE`_\n>  * `V4L2_CID_HBLANK`_\n>  * `V4L2_CID_PIXEL_RATE`_\n> \n> +.. _V4L2_CID_EXPOSURE: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/control.html\n>  .. _V4L2_CID_HBLANK: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-image-source.html\n>  .. _V4L2_CID_PIXEL_RATE: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-image-process.html\n> \n> -Both controls are used to compute the sensor output timings.\n> +The `EXPOSURE` control shall report the image integration time in number of\n> +lines. While V4L2 doesn't specify a unit for the `EXPOSURE` control, libcamera\n> +requires it to be expressed as a number of image lines. Camera sensor drivers\n\nDon't these two sentences say the same thing ? I'd drop the first one.\n\n> +that do not comply with this requirement will need to be adapted or will produce\n> +incorrect results.\n> +\n> +The `HBLANK` and `PIXEL_RATE` controls are used to compute the sensor output\n> +timings.\n> \n>  Optional Requirements\n>  ---------------------\n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index 9abb9d330664..ca33c0094088 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -239,12 +239,11 @@ int CameraSensor::validateSensorDriver()\n>  \t/*\n>  \t * Make sure the sensor driver supports the mandatory controls\n>  \t * required by the CameraSensor class.\n> -\t * - V4L2_CID_PIXEL_RATE is used to calculate the sensor timings\n> -\t * - V4L2_CID_HBLANK is used to calculate the line length\n>  \t */\n>  \tconst std::vector<uint32_t> mandatoryControls{\n> -\t\tV4L2_CID_PIXEL_RATE,\n> +\t\tV4L2_CID_EXPOSURE,\n>  \t\tV4L2_CID_HBLANK,\n> +\t\tV4L2_CID_PIXEL_RATE,\n>  \t};\n> \n>  \tControlList ctrls = subdev_->getControls(mandatoryControls);","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 05845C0F2B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Jan 2021 11:18:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 76668682BE;\n\tMon, 25 Jan 2021 12:18:30 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9ACF96030B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Jan 2021 12:18:28 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1BF86331;\n\tMon, 25 Jan 2021 12:18:28 +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=\"DjKmKHiy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1611573508;\n\tbh=JKUUMIqchzJfd86pzyVkjAIZqcpTYfiS5orBZl/7r/k=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DjKmKHiyoj6QtfzspJeR+KdBdTxxsa9aG1E/SRMgEDY9nrMNIBixUeu9cVnFseDki\n\tKBP8f95MGC8ADXQU0CW/RvuF6MWLW//gGkT1c5+0tDhcYMYFFjei6ebWW2MTKiotj6\n\ttrDdjCzUQ0dnE+dnJB+oPbnwB1qu3JhW6bS9iye8=","Date":"Mon, 25 Jan 2021 13:18:08 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YA6o8Eow4ausnspY@pendragon.ideasonboard.com>","References":"<20210119143711.153517-3-jacopo@jmondi.org>\n\t<20210120102937.200745-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210120102937.200745-1-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v2.1 02/11] libcamera: camera_sensor:\n\tMake V4L2_CID_EXPOSURE mandatory","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>"}}]