[Mesa-dev] [PATCHv2 5/9] gallium: move winsys_handle to its own header

Marc-André Lureau marcandre.lureau at gmail.com
Mon Jun 15 06:34:11 PDT 2015


The structure is shared in drm driver and sw_winsys headers, moving it
to a common place to have a common definition.
---
 src/gallium/include/state_tracker/drm_driver.h    | 32 +-----------------
 src/gallium/include/state_tracker/winsys_handle.h | 41 +++++++++++++++++++++++
 2 files changed, 42 insertions(+), 31 deletions(-)
 create mode 100644 src/gallium/include/state_tracker/winsys_handle.h

diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h
index 740c4bb..7e8c5df 100644
--- a/src/gallium/include/state_tracker/drm_driver.h
+++ b/src/gallium/include/state_tracker/drm_driver.h
@@ -3,42 +3,12 @@
 #define _DRM_DRIVER_H_
 
 #include "pipe/p_compiler.h"
+#include "state_tracker/winsys_handle.h"
 
 struct pipe_screen;
 struct pipe_context;
 struct pipe_resource;
 
-#define DRM_API_HANDLE_TYPE_SHARED 0
-#define DRM_API_HANDLE_TYPE_KMS    1
-#define DRM_API_HANDLE_TYPE_FD     2
-
-
-/**
- * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
- */
-struct winsys_handle
-{
-   /**
-    * Input for texture_from_handle, valid values are
-    * DRM_API_HANDLE_TYPE_SHARED or DRM_API_HANDLE_TYPE_FD.
-    * Input to texture_get_handle,
-    * to select handle for kms, flink, or prime.
-    */
-   unsigned type;
-   /**
-    * Input to texture_from_handle.
-    * Output for texture_get_handle.
-    */
-   unsigned handle;
-   /**
-    * Input to texture_from_handle.
-    * Output for texture_get_handle.
-    */
-   unsigned stride;
-};
-
-
-
 /**
  * Configuration queries.
  */
diff --git a/src/gallium/include/state_tracker/winsys_handle.h b/src/gallium/include/state_tracker/winsys_handle.h
new file mode 100644
index 0000000..8a48028
--- /dev/null
+++ b/src/gallium/include/state_tracker/winsys_handle.h
@@ -0,0 +1,41 @@
+
+#ifndef _WINSYS_HANDLE_H_
+#define _WINSYS_HANDLE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define DRM_API_HANDLE_TYPE_SHARED 0
+#define DRM_API_HANDLE_TYPE_KMS    1
+#define DRM_API_HANDLE_TYPE_FD     2
+
+/**
+ * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
+ */
+struct winsys_handle
+{
+   /**
+    * Input for texture_from_handle, valid values are
+    * WINSYS_HANDLE_TYPE_SHARED or WINSYS_HANDLE_TYPE_FD.
+    * Input to texture_get_handle,
+    * to select handle for kms, flink, or prime.
+    */
+   unsigned type;
+   /**
+    * Input to texture_from_handle.
+    * Output for texture_get_handle.
+    */
+   unsigned handle;
+   /**
+    * Input to texture_from_handle.
+    * Output for texture_get_handle.
+    */
+   unsigned stride;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINSYS_HANDLE_H_ */
-- 
2.4.2



More information about the mesa-dev mailing list