[PATCH wayland-protocols] RFC: unstable: DRM lease support

Marius Vlad marius-cristian.vlad at nxp.com
Wed Jan 24 19:09:02 UTC 2018


Simple protocol extension for DRM leases, based on the work done 
by Keith Packard in libdrm [1] and in the Linux kernel [2].

There are two requests (create/revoke) and three events
(created/revoked/failed). The server is responsible for choosing which output to
lease. Another patch will follow that makes use of this procotol extension.

[1] https://cgit.freedesktop.org/mesa/drm/commit/?id=c4171535389d72e9135c9615cecd07b346fd6d7e
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc9&id=62884cd386b876638720ef88374b31a84ca7ee5f

Signed-off-by: Marius Vlad <marius-cristian.vlad at nxp.com>
---
 Makefile.am                                  |  1 +
 unstable/drm-lease/README                    |  4 ++
 unstable/drm-lease/drm-lease-unstable-v1.xml | 98 ++++++++++++++++++++++++++++
 3 files changed, 103 insertions(+)
 create mode 100644 unstable/drm-lease/README
 create mode 100644 unstable/drm-lease/drm-lease-unstable-v1.xml

diff --git a/Makefile.am b/Makefile.am
index 4b9a901..4f6a874 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,6 +2,7 @@ unstable_protocols =								\
 	unstable/pointer-gestures/pointer-gestures-unstable-v1.xml		\
 	unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml		\
 	unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml			\
+	unstable/drm-lease/drm-lease-unstable-v1.xml				\
 	unstable/text-input/text-input-unstable-v1.xml				\
 	unstable/input-method/input-method-unstable-v1.xml			\
 	unstable/xdg-shell/xdg-shell-unstable-v5.xml				\
diff --git a/unstable/drm-lease/README b/unstable/drm-lease/README
new file mode 100644
index 0000000..a25600c
--- /dev/null
+++ b/unstable/drm-lease/README
@@ -0,0 +1,4 @@
+Linux DRM lease
+
+Maintainers:
+Marius Vlad <marius-cristian.vlad at nxp.com>
diff --git a/unstable/drm-lease/drm-lease-unstable-v1.xml b/unstable/drm-lease/drm-lease-unstable-v1.xml
new file mode 100644
index 0000000..ec67456
--- /dev/null
+++ b/unstable/drm-lease/drm-lease-unstable-v1.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="drm_lease_unstable_v1">
+
+  <copyright>
+    Copyright 2018 NXP
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal in the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice (including the next
+    paragraph) shall be included in all copies or substantial portions of the
+    Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS IN THE SOFTWARE.
+  </copyright>
+
+  <interface name="zwp_drm_lease_v1" version="1">
+    <description summary="drm lease">
+      This interface makes use of DRM lease written by Keith Packard.
+      It requires libdrm at least 2.4.89 and a recent (4.15) kernel.
+
+      Events:
+
+      - created -- event sent when the lease has been created succesfully
+      - revoked -- event sent when the lease has been revoked succesfully
+      - failed -- event sent when create/revoke requests failed.
+
+      Requests:
+
+      - create -- asks the server to create a lease. The server decides which
+      ouput to lease to the client. In case of success, the client receives
+      an event with a DRM capable-fd. The client can then issue libdrm
+      ioctls (i.e., modesetting).  The client also receives a lessee_id which
+      has be used in revoke request. In case of failure, a failed event will
+      be sent.
+      - revoke -- asks the server to revoke a previously leased fd, using the
+      lessee_id.
+      A revoke event will be sent in case of success or failed event otherwise.
+
+      Warning! The protocol described in this file is experimental and
+      backward incompatible changes may be made. Backward compatible changes
+      may be added together with the corresponding interface version bump.
+      Backward incompatible changes are done by bumping the version number in
+      the protocol and interface names and resetting the interface version.
+      Once the protocol is to be declared stable, the 'z' prefix and the
+      version number in the protocol and interface names are removed and the
+      interface version number is reset.
+    </description>
+
+    <request name="create">
+      <description summary="create a lease">
+	This asks for the creation of a lease.
+      </description>
+    </request>
+
+    <event name="created">
+    <description summary="drm lease created successfully">
+	This event indicates that the lease has been created. It provides the
+	leased fd which the client can use to perform modesetting and a lessee
+	id to revoke the lease when it has finished with it.
+    </description>
+    <arg name="fd" type="fd" summary="leased fd"/>
+    <arg name="id" type="uint" summary="lessee id"/>
+    </event>
+
+    <event name="failed">
+    <description summary="drm lease could not be created">
+	This event indicates that the lease could not be created/revoked.
+    </description>
+    </event>
+
+    <request name="revoke">
+      <description summary="revoke a lease">
+	This asks to revoke a lease using the lessee id previously given in event
+	created.
+      </description>
+      <arg name="id" type="uint" summary="lessee id"/>
+    </request>
+
+    <event name="revoked">
+    <description summary="lease revoked">
+	This event indicates that the leased has been revoked.
+    </description>
+    </event>
+
+  </interface>
+
+</protocol>
-- 
2.9.3



More information about the wayland-devel mailing list