{"id":10779,"url":"https://patchwork.libcamera.org/api/1.1/patches/10779/?format=json","web_url":"https://patchwork.libcamera.org/patch/10779/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201230180120.78407-2-jacopo@jmondi.org>","date":"2020-12-30T18:01:15","name":"[libcamera-devel,v3,1/6] libcamera: Document sensor driver requirements","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f868b096b3e205d936e90dd1e8978043e73d6117","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10779/mbox/","series":[{"id":1560,"url":"https://patchwork.libcamera.org/api/1.1/series/1560/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1560","date":"2020-12-30T18:01:14","name":"libcamera: camera_sensor: Make validation more strict","version":3,"mbox":"https://patchwork.libcamera.org/series/1560/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10779/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10779/checks/","tags":{},"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 F1C50C0F1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 30 Dec 2020 18:01:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7E2D161FF6;\n\tWed, 30 Dec 2020 19:01:13 +0100 (CET)","from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7B1F360526\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Dec 2020 19:01:11 +0100 (CET)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 40C7820006\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Dec 2020 18:01:11 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 30 Dec 2020 19:01:15 +0100","Message-Id":"<20201230180120.78407-2-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.29.2","In-Reply-To":"<20201230180120.78407-1-jacopo@jmondi.org>","References":"<20201230180120.78407-1-jacopo@jmondi.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 1/6] libcamera: Document sensor driver\n\trequirements","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>","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>"},"content":"Document the feature an image sensor driver has to provide to be\nfully libcamera-compliant.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n Documentation/index.rst                      |  1 +\n Documentation/meson.build                    |  1 +\n Documentation/sensor_driver_requirements.rst | 61 ++++++++++++++++++++\n 3 files changed, 63 insertions(+)\n create mode 100644 Documentation/sensor_driver_requirements.rst","diff":"diff --git a/Documentation/index.rst b/Documentation/index.rst\nindex c49db18d52bd..285ca7c3e5ae 100644\n--- a/Documentation/index.rst\n+++ b/Documentation/index.rst\n@@ -18,3 +18,4 @@\n    Pipeline Handler Writer's Guide <guides/pipeline-handler>\n    Tracing guide <guides/tracing>\n    Environment variables <environment_variables>\n+   Sensor driver requirements <sensor_driver_requirements>\ndiff --git a/Documentation/meson.build b/Documentation/meson.build\nindex b1f5bb52474c..9950465ded6e 100644\n--- a/Documentation/meson.build\n+++ b/Documentation/meson.build\n@@ -57,6 +57,7 @@ if sphinx.found()\n         'guides/pipeline-handler.rst',\n         'guides/tracing.rst',\n         'index.rst',\n+        'sensor_driver_requirements.rst',\n        '../README.rst',\n     ]\n \ndiff --git a/Documentation/sensor_driver_requirements.rst b/Documentation/sensor_driver_requirements.rst\nnew file mode 100644\nindex 000000000000..89ddd58a5ec6\n--- /dev/null\n+++ b/Documentation/sensor_driver_requirements.rst\n@@ -0,0 +1,61 @@\n+.. SPDX-License-Identifier: CC-BY-SA-4.0\n+\n+.. _sensor-driver-requirements:\n+\n+Sensor Driver Requirements\n+==========================\n+\n+libcamera handles imaging devices in the CameraSensor class and defines\n+through its API a consistent interface towards other library components.\n+\n+The CameraSensor class uses the V4L2 subdev kernel API to interface with the\n+camera sensor through one or multiple sub-devices registered in userspace by\n+the sensor driver.\n+\n+In order for libcamera to be fully operational and provide to applications and\n+pipeline handlers all the required information to interface with the camera\n+sensor, a set of mandatory and optional features the driver has to support\n+have been defined.\n+\n+Mandatory Requirements\n+----------------------\n+\n+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_HBLANK`_\n+* `V4L2_CID_PIXEL_RATE`_\n+\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+\n+Optional Requirements\n+---------------------\n+\n+The sensor driver should support the following V4L2 controls:\n+\n+* `V4L2_CID_CAMERA_ORIENTATION`_\n+* `V4L2_CID_CAMERA_SENSOR_ROTATION`_\n+\n+.. _V4L2_CID_CAMERA_ORIENTATION: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-camera.html\n+.. _V4L2_CID_CAMERA_SENSOR_ROTATION: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-image-process.html\n+\n+The controls are used to register the camera location and orientation.\n+\n+The sensor driver should implement support for the V4L2 Selection API,\n+specifically it should implement support for the\n+`VIDIOC_SUBDEV_G_SELECTION`_ ioctl with support for the following selection\n+targets:\n+\n+.. _VIDIOC_SUBDEV_G_SELECTION: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/vidioc-subdev-g-selection.html?highlight=g_selection#c.V4L.VIDIOC_SUBDEV_G_SELECTION\n+\n+* `V4L2_SEL_TGT_CROP_BOUNDS`_ to report the readable pixel array area size\n+* `V4L2_SEL_TGT_CROP_DEFAULT`_ to report the active pixel array area size\n+* `V4L2_SEL_TGT_CROP`_ to report the analogue selection rectangle\n+\n+.. _V4L2_SEL_TGT_CROP_BOUNDS: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/v4l2-selection-targets.html\n+.. _V4L2_SEL_TGT_CROP_DEFAULT: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/v4l2-selection-targets.html\n+.. _V4L2_SEL_TGT_CROP: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/v4l2-selection-targets.html\n","prefixes":["libcamera-devel","v3","1/6"]}