summaryrefslogtreecommitdiff
path: root/src/gallium/include
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2010-06-28 20:59:09 +0200
committerJakob Bornecrantz <jakob@vmware.com>2010-06-28 21:14:45 +0200
commita01e0afd9fc0d647081c6903baa1a7ba505c4b05 (patch)
tree7e04eb2b4e87137455920f6131b064dc87056e14 /src/gallium/include
parent250b92f3bb4fc4a53f3150b0e8ff1e121a5adbc7 (diff)
parent9ca563a9a8573bf79821abc75ccf0fdade19c8a9 (diff)
downloadmesa-a01e0afd9fc0d647081c6903baa1a7ba505c4b05.tar.gz
Merge branch 'gallium-drm-driver-drescriptor'
Conflicts: src/gallium/state_trackers/egl/x11/native_dri2.c src/gallium/state_trackers/egl/x11/native_x11.c src/gallium/state_trackers/egl/x11/native_x11.h src/gallium/state_trackers/xorg/xorg_driver.c src/gallium/winsys/radeon/drm/radeon_drm.c
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/state_tracker/drm_api.h57
-rw-r--r--src/gallium/include/state_tracker/drm_driver.h71
2 files changed, 71 insertions, 57 deletions
diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h
deleted file mode 100644
index 4572c7e0423..00000000000
--- a/src/gallium/include/state_tracker/drm_api.h
+++ /dev/null
@@ -1,57 +0,0 @@
-
-#ifndef _DRM_API_H_
-#define _DRM_API_H_
-
-#include "pipe/p_compiler.h"
-
-struct pipe_screen;
-struct pipe_winsys;
-struct pipe_context;
-struct pipe_resource;
-
-#define DRM_API_HANDLE_TYPE_SHARED 0
-#define DRM_API_HANDLE_TYPE_KMS 1
-
-/**
- * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
- */
-struct winsys_handle
-{
- /**
- * Unused for texture_from_handle, always
- * DRM_API_HANDLE_TYPE_SHARED. Input to texture_get_handle,
- * use TEXTURE_USAGE to select handle for kms or ipc.
- */
- 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;
-};
-
-struct drm_api
-{
- void (*destroy)(struct drm_api *api);
-
- const char *name;
-
- /**
- * Kernel driver name, as accepted by drmOpenByName.
- */
- const char *driver_name;
-
- /**
- * Create a pipe srcreen.
- */
- struct pipe_screen* (*create_screen)(struct drm_api *api, int drm_fd);
-};
-
-extern struct drm_api * drm_api_create(void);
-
-#endif
diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h
new file mode 100644
index 00000000000..d94c1e6a7cf
--- /dev/null
+++ b/src/gallium/include/state_tracker/drm_driver.h
@@ -0,0 +1,71 @@
+
+#ifndef _DRM_DRIVER_H_
+#define _DRM_DRIVER_H_
+
+#include "pipe/p_compiler.h"
+
+struct pipe_screen;
+struct pipe_winsys;
+struct pipe_context;
+struct pipe_resource;
+
+#define DRM_API_HANDLE_TYPE_SHARED 0
+#define DRM_API_HANDLE_TYPE_KMS 1
+
+/**
+ * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
+ */
+struct winsys_handle
+{
+ /**
+ * Unused for texture_from_handle, always
+ * DRM_API_HANDLE_TYPE_SHARED. Input to texture_get_handle,
+ * use TEXTURE_USAGE to select handle for kms or ipc.
+ */
+ 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;
+};
+
+struct drm_driver_descriptor
+{
+ /**
+ * Identifying sufix/prefix of the binary, used by egl.
+ */
+ const char *name;
+
+ /**
+ * Kernel driver name, as accepted by drmOpenByName.
+ */
+ const char *driver_name;
+
+ /**
+ * Create a pipe srcreen.
+ *
+ * This function does any wrapping of the screen.
+ * For example wrapping trace or rbug debugging drivers around it.
+ */
+ struct pipe_screen* (*create_screen)(int drm_fd);
+};
+
+extern struct drm_driver_descriptor driver_descriptor;
+
+/**
+ * Instantiate a drm_driver_descriptor struct.
+ */
+#define DRM_DRIVER_DESCRIPTOR(name_str, driver_name_str, func) \
+struct drm_driver_descriptor driver_descriptor = { \
+ .name = name_str, \
+ .driver_name = driver_name_str, \
+ .create_screen = func, \
+};
+
+#endif