From patchwork Thu Jan 28 09:10:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11038 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 A6FD0C33BC for ; Thu, 28 Jan 2021 09:10:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7453D68384; Thu, 28 Jan 2021 10:10:57 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="lhm3lI2t"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 50EFF68379 for ; Thu, 28 Jan 2021 10:10:55 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id l12so4613736wry.2 for ; Thu, 28 Jan 2021 01:10:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x05WP2jGPAHR3jvXFT93jDzxY90RnftgMznUPHjSXzM=; b=lhm3lI2tx7uzFFCx6rd+ZIjrfX2OmgV5Y3K2KjSjhVYriKvLZcErIzaBoq/2G787w9 Jk6TFMIBkV18jBWdXRjz4KZMs4ZJrvi4AfHvWzKdcs7/uYXDwA5JHg7ZO7RVouFVoeGB 8CsPKzsZ0E8p+CdTwQihFk094h53rjwqeNUGYQCvvCsgKksBjAVZXXM+e9IuVgfwqZyw Ea2E7oudCi6HcSltyn2NDE8xi89t4fmsnSDNNI3SPIAYGKGocHK/0LoESPuRQySra4mW dIBf3WWnnlwq8fdKCFhlYVRpEEsoo1xi6OlHsCzjOx4bhqTU/h+Y4Yx2uQNfe8z3AHlE IuTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x05WP2jGPAHR3jvXFT93jDzxY90RnftgMznUPHjSXzM=; b=AoJNRjaxpHMXZBKzEZ84DkopqufqfHHabXMncNW6/N76nTQykDR4zjS1oaEwl6Z28G +n7pBNZ03YnaROaQfQ1C9Ojg82qeWmk6APOux85lDYqsijVzFGz/Gz0v6NZZY/ll5RrM a7LgfnQtgxYJCkkmZQqOajIFS2Dx0kQEQi5V/vGYvOId+NPvhjJxquEMvSf0eJ21w133 Au+mHvcxENHUt77RsuNRtA6mplLwWGrpycrYOedcoyQIhr7EYI1kuO7jqcpY1qeCeNcA N7If8Mscs8topxDyQ/rUR5Rp/0aZ3y+UsCrMCQ+tMSkeCE2QWl/TTlXCx5J9NZKB0Yat mFmQ== X-Gm-Message-State: AOAM532fA/SoqDKh8FSeBhgYfIHy5GAB+5tliO8wJNl2EMqJIzCssFP/ L1cvEnUo2EJcTeHHUwwFrzthmRLdEakEUUZR X-Google-Smtp-Source: ABdhPJxM1WZAMzhOeNKV/tBrpZg0kzTKo//Mn62+fVvsh++1FCWZUE5lNcRnYXeMCo+5a/KOLqsNgQ== X-Received: by 2002:adf:eb4e:: with SMTP id u14mr15241568wrn.99.1611825054785; Thu, 28 Jan 2021 01:10:54 -0800 (PST) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id f17sm6517056wrv.0.2021.01.28.01.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 01:10:54 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Jan 2021 09:10:46 +0000 Message-Id: <20210128091050.881815-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210128091050.881815-1-naush@raspberrypi.com> References: <20210128091050.881815-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/5] libcamera: camera_sensor: Make VBLANK 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" From: Jacopo Mondi Add the V4L2_CID_VBLANK control to the list of mandatory controls the sensor driver has to report and document the new requirement. The vertical blanking control is used to calculate the frame duration. Signed-off-by: Jacopo Mondi Signed-off-by: Naushir Patuck Reviewed-by: Naushir Patuck --- Documentation/sensor_driver_requirements.rst | 6 ++++-- src/libcamera/camera_sensor.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/sensor_driver_requirements.rst b/Documentation/sensor_driver_requirements.rst index 6dcd4e68d64d..590797f054ce 100644 --- a/Documentation/sensor_driver_requirements.rst +++ b/Documentation/sensor_driver_requirements.rst @@ -27,18 +27,20 @@ The sensor driver shall support the following V4L2 controls: * `V4L2_CID_EXPOSURE`_ * `V4L2_CID_HBLANK`_ * `V4L2_CID_PIXEL_RATE`_ +* `V4L2_CID_VBLANK`_ .. _V4L2_CID_EXPOSURE: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/control.html .. _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_VBLANK: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-image-source.html While V4L2 doesn't specify a unit for the `EXPOSURE` control, libcamera requires it to be expressed as a number of image lines. Camera sensor drivers that do not comply with this requirement will need to be adapted or will produce incorrect results. -The `HBLANK` and `PIXEL_RATE` controls are used to compute the sensor output -timings. +The `HBLANK`, `PIXEL_RATE` and `VBLANK` 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 ca33c0094088..ab315bdc468c 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -244,6 +244,7 @@ int CameraSensor::validateSensorDriver() V4L2_CID_EXPOSURE, V4L2_CID_HBLANK, V4L2_CID_PIXEL_RATE, + V4L2_CID_VBLANK, }; ControlList ctrls = subdev_->getControls(mandatoryControls);