aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl_g3d/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/egl_g3d/common')
-rw-r--r--src/gallium/state_trackers/egl_g3d/common/egl_g3d.c10
-rw-r--r--src/gallium/state_trackers/egl_g3d/common/native.h17
2 files changed, 13 insertions, 14 deletions
diff --git a/src/gallium/state_trackers/egl_g3d/common/egl_g3d.c b/src/gallium/state_trackers/egl_g3d/common/egl_g3d.c
index 8b69a8cfcb6..7da9300c200 100644
--- a/src/gallium/state_trackers/egl_g3d/common/egl_g3d.c
+++ b/src/gallium/state_trackers/egl_g3d/common/egl_g3d.c
@@ -24,6 +24,7 @@
#include <assert.h>
#include <string.h>
+#include "pipe/p_screen.h"
#include "util/u_memory.h"
#include "egldriver.h"
#include "eglcurrent.h"
@@ -456,8 +457,8 @@ egl_g3d_add_configs(_EGLDriver *drv, _EGLDisplay *dpy, EGLint id)
* Flush the front buffer of the context's draw surface.
*/
static void
-egl_g3d_flush_frontbuffer(void *dummy, struct pipe_surface *surf,
- void *context_private)
+egl_g3d_flush_frontbuffer(struct pipe_screen *screen,
+ struct pipe_surface *surf, void *context_private)
{
struct egl_g3d_context *gctx = egl_g3d_context(context_private);
struct egl_g3d_surface *gsurf = egl_g3d_surface(gctx->base.DrawSurface);
@@ -509,13 +510,14 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy,
}
dpy->DriverData = gdpy;
- gdpy->native =
- native_create_display(dpy->NativeDisplay, egl_g3d_flush_frontbuffer);
+ gdpy->native = native_create_display(dpy->NativeDisplay);
if (!gdpy->native) {
_eglError(EGL_NOT_INITIALIZED, "eglInitialize(no usable display)");
goto fail;
}
+ gdpy->native->screen->flush_frontbuffer = egl_g3d_flush_frontbuffer;
+
dpy->ClientAPIsMask = gdrv->api_mask;
if (egl_g3d_add_configs(drv, dpy, 1) == 1) {
diff --git a/src/gallium/state_trackers/egl_g3d/common/native.h b/src/gallium/state_trackers/egl_g3d/common/native.h
index 4714e24b5c6..1c3b016b98a 100644
--- a/src/gallium/state_trackers/egl_g3d/common/native.h
+++ b/src/gallium/state_trackers/egl_g3d/common/native.h
@@ -114,7 +114,13 @@ struct native_display_modeset;
* the native display server.
*/
struct native_display {
+ /**
+ * The pipe screen of the native display.
+ *
+ * Note that the "flush_frontbuffer" callback will be overridden.
+ */
struct pipe_screen *screen;
+
void (*destroy)(struct native_display *ndpy);
/**
@@ -204,19 +210,10 @@ struct native_display_modeset {
const struct native_mode *nmode);
};
-/**
- * This function is called when the native display wants to display the front
- * buffer of the draw surface of the given context.
- */
-typedef void (*native_flush_frontbuffer)(void *dummy,
- struct pipe_surface *surf,
- void *context_private);
-
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_ */