summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl/common/native_buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/egl/common/native_buffer.h')
-rw-r--r--src/gallium/state_trackers/egl/common/native_buffer.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/egl/common/native_buffer.h b/src/gallium/state_trackers/egl/common/native_buffer.h
index 5c29ab97411..b8a66d17e12 100644
--- a/src/gallium/state_trackers/egl/common/native_buffer.h
+++ b/src/gallium/state_trackers/egl/common/native_buffer.h
@@ -30,30 +30,43 @@
#define _NATIVE_BUFFER_H_
#include "pipe/p_compiler.h"
+#include "pipe/p_state.h"
struct native_display;
-struct pipe_resource;
+
+enum native_buffer_type {
+ NATIVE_BUFFER_DRM,
+
+ NUM_NATIVE_BUFFERS
+};
+
+struct native_buffer {
+ enum native_buffer_type type;
+
+ union {
+ struct {
+ struct pipe_resource templ;
+ unsigned name; /**< the name of the GEM object */
+ unsigned handle; /**< the handle of the GEM object */
+ unsigned stride;
+ } drm;
+ } u;
+};
/**
* Buffer interface of the native display. It allows native buffers to be
* imported and exported.
- *
- * Just like a native window or a native pixmap, a native buffer is another
- * native type. Its definition depends on the native display.
- *
- * For DRM platform, the type of a native buffer is struct winsys_handle.
*/
struct native_display_buffer {
struct pipe_resource *(*import_buffer)(struct native_display *ndpy,
- const struct pipe_resource *templ,
- void *buf);
+ struct native_buffer *buf);
/**
* The resource must be creatred with PIPE_BIND_SHARED.
*/
boolean (*export_buffer)(struct native_display *ndpy,
struct pipe_resource *res,
- void *buf);
+ struct native_buffer *nbuf);
};
#endif /* _NATIVE_BUFFER_H_ */