summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl_g3d/common/native.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/egl_g3d/common/native.h')
-rw-r--r--src/gallium/state_trackers/egl_g3d/common/native.h51
1 files changed, 40 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/egl_g3d/common/native.h b/src/gallium/state_trackers/egl_g3d/common/native.h
index 88d87c6f3a..f374f2e4a6 100644
--- a/src/gallium/state_trackers/egl_g3d/common/native.h
+++ b/src/gallium/state_trackers/egl_g3d/common/native.h
@@ -64,13 +64,19 @@ struct native_surface {
boolean (*flush_frontbuffer)(struct native_surface *nsurf);
/**
- * Validate the buffers of the surface. Those not listed in the attachments
- * will be destroyed. The returned textures are owned by the caller.
+ * Validate the buffers of the surface. textures, if not NULL, points to an
+ * array of size NUM_NATIVE_ATTACHMENTS and the returned textures are owned
+ * by the caller. A sequence number is also returned. The caller can use
+ * it to check if anything has changed since the last call. Any of the
+ * pointers may be NULL and it indicates the caller has no interest in those
+ * values.
+ *
+ * If this function is called multiple times with different attachment
+ * masks, those not listed in the latest call might be destroyed. This
+ * behavior might change in the future.
*/
- boolean (*validate)(struct native_surface *nsurf,
- const enum native_attachment *natts,
- unsigned num_natts,
- struct pipe_texture **textures,
+ boolean (*validate)(struct native_surface *nsurf, uint attachment_mask,
+ unsigned int *seq_num, struct pipe_texture **textures,
int *width, int *height);
/**
@@ -80,6 +86,7 @@ struct native_surface {
};
struct native_config {
+ /* __GLcontextModes should go away some day */
__GLcontextModes mode;
enum pipe_format color_format;
enum pipe_format depth_format;
@@ -107,7 +114,14 @@ struct native_display_modeset;
* the native display server.
*/
struct native_display {
+ /**
+ * The pipe screen of the native display.
+ *
+ * Note that the "flush_frontbuffer" and "update_buffer" callbacks will be
+ * overridden.
+ */
struct pipe_screen *screen;
+
void (*destroy)(struct native_display *ndpy);
/**
@@ -122,6 +136,17 @@ struct native_display {
int *num_configs);
/**
+ * Test if a pixmap is supported by the given config. Required unless no
+ * config has GLX_PIXMAP_BIT set.
+ *
+ * This function is usually called to find a config that supports a given
+ * pixmap. Thus, it is usually called with the same pixmap in a row.
+ */
+ boolean (*is_pixmap_supported)(struct native_display *ndpy,
+ EGLNativePixmapType pix,
+ const struct native_config *nconf);
+
+ /**
* Create a pipe context.
*/
struct pipe_context *(*create_context)(struct native_display *ndpy,
@@ -197,15 +222,19 @@ struct native_display_modeset {
const struct native_mode *nmode);
};
-typedef void (*native_flush_frontbuffer)(void *dummy,
- struct pipe_surface *surf,
- void *context_private);
+/**
+ * Test whether an attachment is set in the mask.
+ */
+static INLINE boolean
+native_attachment_mask_test(uint mask, enum native_attachment att)
+{
+ return !!(mask & (1 << att));
+}
const char *
native_get_name(void);
struct native_display *
-native_create_display(EGLNativeDisplayType dpy,
- native_flush_frontbuffer flush_frontbuffer);
+native_create_display(EGLNativeDisplayType dpy);
#endif /* _NATIVE_H_ */