{"id":3405,"url":"https://patchwork.libcamera.org/api/covers/3405/?format=json","web_url":"https://patchwork.libcamera.org/cover/3405/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20200407152157.1686474-1-jacopo@jmondi.org>","date":"2020-04-07T15:21:54","name":"[libcamera-devel,v3,0/3] media: Register read-only sub-dev devnode","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/cover/3405/mbox/","series":[{"id":800,"url":"https://patchwork.libcamera.org/api/series/800/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=800","date":"2020-04-07T15:21:54","name":"media: Register read-only sub-dev devnode","version":3,"mbox":"https://patchwork.libcamera.org/series/800/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/3405/comments/","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1F35F600F0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Apr 2020 17:19:05 +0200 (CEST)","from localhost.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id B686DFF809;\n\tTue,  7 Apr 2020 15:19:02 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"linux-media@vger.kernel.org,\n\tlibcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo@jmondi.org>, mchehab@kernel.org,\n\thverkuil-cisco@xs4all.nl, sakari.ailus@linux.intel.com,\n\tandrey.konovalov@linaro.org, laurent.pinchart@ideasonboard.com","Date":"Tue,  7 Apr 2020 17:21:54 +0200","Message-Id":"<20200407152157.1686474-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.26.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 0/3] media: Register read-only sub-dev\n\tdevnode","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>","X-List-Received-Date":"Tue, 07 Apr 2020 15:19:05 -0000"},"content":"Add new function v4l2_device_register_ro_subdev_nodes() to pair with\nv4l2_device_register_subdev_nodes() that allows a bridge driver to register the\ndevice node for its subdevices in read-only mode.\n\nDevnode-centric (aka non-MC) bridge drivers control their subdevices through\ndirect calls to v4l2 subdev operations and do not want userspace to be able\nto control the subdevice configuration by calling ioctls on the sub-device\ndevnode. For this reason, they usually refrain from registering any devnode at\nall for their subdevices.\n\nHowever it is sometimes required for userspace to access the sub-dev device\nnodes to collect information on the actual configuration, without changing\nthe one currently applied to the device.\n\nThis requirement became pressing while working on libcamera on devnode-centric\nplatforms that do not expose any sub-device for their camera sensor to prevent\nuserspace from changing their configuration. To allow them to register device\nnode and being guaranteed to retain control of the subdevice configuration this\nseries proposes a way to register device nodes in read-only to restrict\naccess to all ioctls that could potentially affect the sub-dev configuration.\n\nThanks\n   j\n\nv2->v3:\n- Add Sakari's ack to the series\n- Documentation:\n  - Address Sakari' and Hans suggestions\n- Implementation:\n  - Rename V4L2_FL_RO_DEVNODE to V4L2_FL_SUBDEV_RO_DEVNODE\n  - Limit the ability to register sub-device video device nodes to\n    driver claiming support for CONFIG_VIDEO_V4L2_SUBDEV_API\n\nv1->v2:\n- Documentation:\n  - Add a new patch using Laurent's suggestion to update the sub-device\n    userspace API introduction\n  - Take in some of Laurent's suggestions in v4l2-subdev.rst and add a new\n    section in dev-subdev.rst\n- Implementation:\n  - As noted by Andrey, V4L2_FL_* are meant to be used as bitmasks. Use\n    test_bit()/set_bit() as the rest of the v4l2 core does. It's a bit an\n    overkill compared to use plain BIT() as noted by Sakari but I preferred\n    consistency with the rest of the core\n  - Make v4l2_device_register_subdev_nodes() and\n    v4l2_device_register_ro_subdev_nodes() to v4l2-device.h and make them\n    inline functions. Documentation style has been copied from other functions\n    with similar implementations, such as __video_register_device() in\n    v4l2-dev.h\n\nJacopo Mondi (3):\n  Documentation: media: Update sub-device API intro\n  Documentation: media: Document read-only subdevice\n  media: v4l2-dev: Add v4l2_device_register_ro_subdev_node()\n\n Documentation/media/kapi/v4l2-subdev.rst      | 53 ++++++++++++++++++-\n Documentation/media/uapi/v4l/dev-subdev.rst   |  5 ++\n .../media/uapi/v4l/vidioc-g-dv-timings.rst    |  6 +++\n Documentation/media/uapi/v4l/vidioc-g-std.rst |  6 +++\n .../media/uapi/v4l/vidioc-subdev-g-crop.rst   |  9 ++++\n .../media/uapi/v4l/vidioc-subdev-g-fmt.rst    |  8 +++\n .../v4l/vidioc-subdev-g-frame-interval.rst    |  8 +++\n .../uapi/v4l/vidioc-subdev-g-selection.rst    |  8 +++\n drivers/media/v4l2-core/v4l2-device.c         |  7 ++-\n drivers/media/v4l2-core/v4l2-subdev.c         | 19 +++++++\n include/media/v4l2-dev.h                      |  7 +++\n include/media/v4l2-device.h                   | 50 +++++++++++++++--\n 12 files changed, 178 insertions(+), 8 deletions(-)\n\n--\n2.26.0"}