[Libva] [PATCH 1/2] New wayland-drm.xml

Xiang, Haihao haihao.xiang at intel.com
Fri Sep 2 04:30:22 UTC 2016


Update wayland-drm-client-protocol.h as well

Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
 src/wayland-drm-client-protocol.h | 155 ++++++++++++++++++++++++++++----------
 src/wayland-drm.xml               |  32 +++++++-
 2 files changed, 147 insertions(+), 40 deletions(-)

diff --git a/src/wayland-drm-client-protocol.h b/src/wayland-drm-client-protocol.h
index cba188e..da267e8 100644
--- a/src/wayland-drm-client-protocol.h
+++ b/src/wayland-drm-client-protocol.h
@@ -1,7 +1,26 @@
-/* 
+/* Generated by wayland-scanner 1.11.90 */
+
+#ifndef DRM_CLIENT_PROTOCOL_H
+#define DRM_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_drm The drm protocol
+ * @section page_ifaces_drm Interfaces
+ * - @subpage page_iface_wl_drm - 
+ * @section page_copyright_drm Copyright
+ * <pre>
+ *
  * Copyright © 2008-2011 Kristian Høgsberg
  * Copyright © 2010-2011 Intel Corporation
- * 
+ *
  * Permission to use, copy, modify, distribute, and sell this
  * software and its documentation for any purpose is hereby granted
  * without fee, provided that\n the above copyright notice appear in
@@ -13,7 +32,7 @@
  * representations about the suitability of this software for any
  * purpose.  It is provided "as is" without express or implied
  * warranty.
- * 
+ *
  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
@@ -22,24 +41,19 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  * THIS SOFTWARE.
+ * </pre>
  */
-
-#ifndef DRM_CLIENT_PROTOCOL_H
-#define DRM_CLIENT_PROTOCOL_H
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-#include "wayland-client.h"
-
-struct wl_client;
-struct wl_resource;
-
+struct wl_buffer;
 struct wl_drm;
 
+/**
+ * @page page_iface_wl_drm wl_drm
+ * @section page_iface_wl_drm_api API
+ * See @ref iface_wl_drm.
+ */
+/**
+ * @defgroup iface_wl_drm The wl_drm interface
+ */
 extern const struct wl_interface wl_drm_interface;
 
 #ifndef WL_DRM_ERROR_ENUM
@@ -115,28 +129,51 @@ enum wl_drm_format {
 };
 #endif /* WL_DRM_FORMAT_ENUM */
 
+#ifndef WL_DRM_CAPABILITY_ENUM
+#define WL_DRM_CAPABILITY_ENUM
+/**
+ * @ingroup iface_wl_drm
+ * wl_drm capability bitmask
+ *
+ * Bitmask of capabilities.
+ */
+enum wl_drm_capability {
+	/**
+	 * wl_drm prime available
+	 */
+	WL_DRM_CAPABILITY_PRIME = 1,
+};
+#endif /* WL_DRM_CAPABILITY_ENUM */
+
+/**
+ * @ingroup iface_wl_drm
+ * @struct wl_drm_listener
+ */
 struct wl_drm_listener {
 	/**
-	 * device - device
-	 * @name: name
 	 */
 	void (*device)(void *data,
 		       struct wl_drm *wl_drm,
 		       const char *name);
 	/**
-	 * format - format
-	 * @format: format
 	 */
 	void (*format)(void *data,
 		       struct wl_drm *wl_drm,
 		       uint32_t format);
 	/**
-	 * authenticated - authenticated
 	 */
 	void (*authenticated)(void *data,
 			      struct wl_drm *wl_drm);
+	/**
+	 */
+	void (*capabilities)(void *data,
+			     struct wl_drm *wl_drm,
+			     uint32_t value);
 };
 
+/**
+ * @ingroup wl_drm_iface
+ */
 static inline int
 wl_drm_add_listener(struct wl_drm *wl_drm,
 		    const struct wl_drm_listener *listener, void *data)
@@ -145,28 +182,58 @@ wl_drm_add_listener(struct wl_drm *wl_drm,
 				     (void (**)(void)) listener, data);
 }
 
-#define WL_DRM_AUTHENTICATE	0
-#define WL_DRM_CREATE_BUFFER	1
-#define WL_DRM_CREATE_PLANAR_BUFFER	2
+#define WL_DRM_AUTHENTICATE 0
+#define WL_DRM_CREATE_BUFFER 1
+#define WL_DRM_CREATE_PLANAR_BUFFER 2
+#define WL_DRM_CREATE_PRIME_BUFFER 3
 
+/**
+ * @ingroup iface_wl_drm
+ */
+#define WL_DRM_AUTHENTICATE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_drm
+ */
+#define WL_DRM_CREATE_BUFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_drm
+ */
+#define WL_DRM_CREATE_PLANAR_BUFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_drm
+ */
+#define WL_DRM_CREATE_PRIME_BUFFER_SINCE_VERSION 2
+
+/** @ingroup iface_wl_drm */
 static inline void
 wl_drm_set_user_data(struct wl_drm *wl_drm, void *user_data)
 {
 	wl_proxy_set_user_data((struct wl_proxy *) wl_drm, user_data);
 }
 
+/** @ingroup iface_wl_drm */
 static inline void *
 wl_drm_get_user_data(struct wl_drm *wl_drm)
 {
 	return wl_proxy_get_user_data((struct wl_proxy *) wl_drm);
 }
 
+static inline uint32_t
+wl_drm_get_version(struct wl_drm *wl_drm)
+{
+	return wl_proxy_get_version((struct wl_proxy *) wl_drm);
+}
+
+/** @ingroup iface_wl_drm */
 static inline void
 wl_drm_destroy(struct wl_drm *wl_drm)
 {
 	wl_proxy_destroy((struct wl_proxy *) wl_drm);
 }
 
+/**
+ * @ingroup iface_wl_drm
+ */
 static inline void
 wl_drm_authenticate(struct wl_drm *wl_drm, uint32_t id)
 {
@@ -174,34 +241,44 @@ wl_drm_authenticate(struct wl_drm *wl_drm, uint32_t id)
 			 WL_DRM_AUTHENTICATE, id);
 }
 
+/**
+ * @ingroup iface_wl_drm
+ */
 static inline struct wl_buffer *
 wl_drm_create_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t stride, uint32_t format)
 {
 	struct wl_proxy *id;
 
-	id = wl_proxy_create((struct wl_proxy *) wl_drm,
-			     &wl_buffer_interface);
-	if (!id)
-		return NULL;
-
-	wl_proxy_marshal((struct wl_proxy *) wl_drm,
-			 WL_DRM_CREATE_BUFFER, id, name, width, height, stride, format);
+	id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
+			 WL_DRM_CREATE_BUFFER, &wl_buffer_interface, NULL, name, width, height, stride, format);
 
 	return (struct wl_buffer *) id;
 }
 
+/**
+ * @ingroup iface_wl_drm
+ */
 static inline struct wl_buffer *
 wl_drm_create_planar_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t format, int32_t offset0, int32_t stride0, int32_t offset1, int32_t stride1, int32_t offset2, int32_t stride2)
 {
 	struct wl_proxy *id;
 
-	id = wl_proxy_create((struct wl_proxy *) wl_drm,
-			     &wl_buffer_interface);
-	if (!id)
-		return NULL;
+	id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
+			 WL_DRM_CREATE_PLANAR_BUFFER, &wl_buffer_interface, NULL, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2);
 
-	wl_proxy_marshal((struct wl_proxy *) wl_drm,
-			 WL_DRM_CREATE_PLANAR_BUFFER, id, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2);
+	return (struct wl_buffer *) id;
+}
+
+/**
+ * @ingroup iface_wl_drm
+ */
+static inline struct wl_buffer *
+wl_drm_create_prime_buffer(struct wl_drm *wl_drm, int32_t name, int32_t width, int32_t height, uint32_t format, int32_t offset0, int32_t stride0, int32_t offset1, int32_t stride1, int32_t offset2, int32_t stride2)
+{
+	struct wl_proxy *id;
+
+	id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
+			 WL_DRM_CREATE_PRIME_BUFFER, &wl_buffer_interface, NULL, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2);
 
 	return (struct wl_buffer *) id;
 }
diff --git a/src/wayland-drm.xml b/src/wayland-drm.xml
index 265d4f8..5e64622 100644
--- a/src/wayland-drm.xml
+++ b/src/wayland-drm.xml
@@ -29,7 +29,7 @@
 
   <!-- drm support. This object is created by the server and published
        using the display's global event. -->
-  <interface name="wl_drm" version="1">
+  <interface name="wl_drm" version="2">
     <enum name="error">
       <entry name="authenticate_fail" value="0"/>
       <entry name="invalid_format" value="1"/>
@@ -150,6 +150,36 @@
 
     <!-- Raised if the authenticate request succeeded -->
     <event name="authenticated"/>
+
+    <enum name="capability" since="2">
+      <description summary="wl_drm capability bitmask">
+        Bitmask of capabilities.
+      </description>
+      <entry name="prime" value="1" summary="wl_drm prime available"/>
+    </enum>
+
+    <event name="capabilities">
+      <arg name="value" type="uint"/>
+    </event>
+
+    <!-- Version 2 additions -->
+
+    <!-- Create a wayland buffer for the prime fd.  Use for regular and planar
+         buffers.  Pass 0 for offset and stride for unused planes. -->
+    <request name="create_prime_buffer" since="2">
+      <arg name="id" type="new_id" interface="wl_buffer"/>
+      <arg name="name" type="fd"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="format" type="uint"/>
+      <arg name="offset0" type="int"/>
+      <arg name="stride0" type="int"/>
+      <arg name="offset1" type="int"/>
+      <arg name="stride1" type="int"/>
+      <arg name="offset2" type="int"/>
+      <arg name="stride2" type="int"/>
+    </request>
+
   </interface>
 
 </protocol>
-- 
1.9.1



More information about the Libva mailing list