[{"id":14434,"web_url":"https://patchwork.libcamera.org/comment/14434/","msgid":"<X/MSGuKaMpbcOwYh@oden.dyn.berto.se>","date":"2021-01-04T13:03:22","subject":"Re: [libcamera-devel] [PATCH v4 1/6] libcamera: Document sensor\n\tdriver requirements","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2020-12-31 00:05:58 +0100, Jacopo Mondi wrote:\n> Document the feature an image sensor driver has to provide to be\n> fully libcamera-compliant.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  Documentation/index.rst                      |  1 +\n>  Documentation/meson.build                    |  1 +\n>  Documentation/sensor_driver_requirements.rst | 64 ++++++++++++++++++++\n\nThe word separator used in filenames for Documentation/ are mixed \nbetween - and _, the most commonly used is -. Not for this series but \nmaybe we should standardize on one of them?\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n>  3 files changed, 66 insertions(+)\n>  create mode 100644 Documentation/sensor_driver_requirements.rst\n> \n> diff --git a/Documentation/index.rst b/Documentation/index.rst\n> index 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>\n> diff --git a/Documentation/meson.build b/Documentation/meson.build\n> index 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>  \n> diff --git a/Documentation/sensor_driver_requirements.rst b/Documentation/sensor_driver_requirements.rst\n> new file mode 100644\n> index 000000000000..0e658aaa03b5\n> --- /dev/null\n> +++ b/Documentation/sensor_driver_requirements.rst\n> @@ -0,0 +1,64 @@\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 exposed 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> +has 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> +Support for the selection API is scheduled to become a mandatory feature in\n> +the near future.\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> -- \n> 2.29.2\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 688C4C0F1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Jan 2021 13:03:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E093962005;\n\tMon,  4 Jan 2021 14:03:27 +0100 (CET)","from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com\n\t[IPv6:2a00:1450:4864:20::12f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AD07060110\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Jan 2021 14:03:24 +0100 (CET)","by mail-lf1-x12f.google.com with SMTP id y19so63903670lfa.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 04 Jan 2021 05:03:24 -0800 (PST)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tl205sm7265142lfd.284.2021.01.04.05.03.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 04 Jan 2021 05:03:23 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"eA8k94QG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=asc5BhAP9tGYkTbEGXpi4+tiGZK+XTSHZS/WOMdwdOE=;\n\tb=eA8k94QGITc1aqVzkYXKpwnyEe6ZHkpyyoif3/hlzRw2pjLz/zr1BgbdMnvffFUlFB\n\t1WRFRKKSDPD0fknYle/7GEb1j7FSww/RYp2cdLIzx+yGF+/mZT3n+E+G3ia2B2B2ktue\n\tVd4JuVJiukj46W+G7swviQXz3AI//IGmznKqjxLFR98N0K5ZEJ6ljiBCKFFkQH+VJtxU\n\tCtC3eBCOLl2XdOf+KyNpwVtJTQhFyXV3ZTOUuGmhLyDUJlLSYHPNh3JzOmdM/M1lKFiW\n\tAnZZqhSD4DzdwcBzC2+Ux1JXvIW79EvPr8rsAwlfOmZpk5JqI5FrGlDegfCw1z0fzxOM\n\tpaPw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=asc5BhAP9tGYkTbEGXpi4+tiGZK+XTSHZS/WOMdwdOE=;\n\tb=tEBUWbd6uw9I5pehE6J20NkMxZkc6iOmB5L/njYPGA+gN5I8RKRpeIo3z3kliUxuXm\n\tx3ToIV8jQxW86/wuFU012X9cb49rpV9JNdSAoyHXt4dGSPIwZfMohNQHWJHgRzm6tYtL\n\teTvasmPj4zk9BGy3SG80IVV/FMkzjMQmVDh01ibuWu0qXCoLkh3KhBzgIOmMV5Fe/vET\n\tzkGruJRyYAr9AjuQVF9ZslKO7dvqoxnMJC5eFAUaQF/EGC53ENIB8z09QLAZhKMOK1k+\n\tfJX0wMgm8OMKYlf6mj3ItXfUFpV66KOlKFGK9ig4YQyXy+SJH1DNUtnpQYp+e7Cxxkuj\n\tqoQg==","X-Gm-Message-State":"AOAM5331QBksR637DhGxfZd3EggIvmlGtIFT+iAhLswZtAFy9GJ9rpm4\n\tjZ45svBYpc/9oI8sfL1/TWkDIQ==","X-Google-Smtp-Source":"ABdhPJyt0wggKCaa8ZDpeZ1d8duP37FFAZgR1e7rMjw/K4hg5GVC2hnxPOVA5eQFDwgW5wewGck/9A==","X-Received":"by 2002:a19:c20d:: with SMTP id l13mr30212451lfc.1.1609765403811;\n\tMon, 04 Jan 2021 05:03:23 -0800 (PST)","Date":"Mon, 4 Jan 2021 14:03:22 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<X/MSGuKaMpbcOwYh@oden.dyn.berto.se>","References":"<20201230230603.123486-1-jacopo@jmondi.org>\n\t<20201230230603.123486-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201230230603.123486-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v4 1/6] libcamera: Document sensor\n\tdriver requirements","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=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]