From patchwork Fri Jan 29 11:16:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11051 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 6C117BD808 for ; Fri, 29 Jan 2021 11:16:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3E75D683AA; Fri, 29 Jan 2021 12:16:27 +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="PhjfmVro"; dkim-atps=neutral Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E6C75683A2 for ; Fri, 29 Jan 2021 12:16:25 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id m13so8432076wro.12 for ; Fri, 29 Jan 2021 03:16:25 -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=PhjfmVrosEtWrcb6JwldGS0FPuiYnEA+anMREJDA9YBMb5tD1LXHhFZGkj+31vBKBl crkAcpivc0aWxDa+4AbUSAQBoNNcZWBzVcRtbwAsGFB5zi796bH+Hzz6YtwpZSPFM+xC FKsCiSJnTYvKUL35KUMj823ST+sxBRyeyJ+szIlLR8nQCtMzVBz5x4daYRXqf4jIF/1N NMxZbNmhV58V2N29b/BkTywmozq8alikDxlHx6f7gCfSwsZI/VgwCzWNxC7jaSwXLKuG 3fh2togvCsf0MMW3fEU+L5c246YqzNsaEEPPgkoCAJeIyvYabbpKFlUqk03FdpqfVUAO KCdQ== 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=uj8FO/pPSSGJh335SUCpccyvW2oW1L4DMkstSpnE7Q4rWXasQHFv1y7bssTqxeGYU2 5ZQ5bpmIu4ReuQcSNCBeWQsdxLtboqCOp6/o3sWW6gX4Zyb1EpyMm+h5M6/ZR2Pssrwr IaCLyHbrWSFhZe9gPY6bl5vtvh/cSQ0XoGEx27ukjn8JLLT5cp+0qS8QhztYZHg6T23a egaEsO8DAq+Q3q/OAtrnmOZkfxf7DIOwGC5Ibk3H07npmJUZhG5CLi1HTCzg2XNRoaQx gU4RCXpdsEslhoCZw2Grn1Ouaq+6NSO3jO7B5u7K2dKjoiQ186Slbz8KUKVTR30WgPBG TCgA== X-Gm-Message-State: AOAM531bjxCq0V8espyBoWcZJ39+xm9pzCs2nWpNLbQRZDJBbWMM2Uy5 oGWQx3xuV5jTxBYv1N+8bV6m5EurZNWi5YLf X-Google-Smtp-Source: ABdhPJxFEvlzy38LE3dp1AwHGQkoun9SU/Rvuhirk6jtAUACosC1C1CZ6Dv414ayYNUAuuBQTAVtQQ== X-Received: by 2002:a5d:4a0c:: with SMTP id m12mr3935345wrq.309.1611918985479; Fri, 29 Jan 2021 03:16:25 -0800 (PST) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id f14sm11324007wre.69.2021.01.29.03.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 03:16:23 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 29 Jan 2021 11:16:12 +0000 Message-Id: <20210129111616.1047483-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129111616.1047483-1-naush@raspberrypi.com> References: <20210129111616.1047483-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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 Reviewed-by: Laurent Pinchart --- 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);