summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2014-01-28 16:45:07 -0800
committerChad Versace <[email protected]>2014-03-17 15:36:04 -0700
commitbc8b07a65722ad25aa52aa4918b51e236a13b09e (patch)
treec40f640d070470a0fb021912a8d325255021b869
parent0a0c881a13afc99c7a88bf16117850350ccb85df (diff)
egl/dri2: Dispatch eglCreatePixmapSurface by display, not driver
Add dri2_egl_display_vtbl::create_pbuffer_surface, set it for each platform, and let egl_dri2 dispatch eglCreatePixmapSurface to that. This prepares for the EGL platform extensions. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c11
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h5
-rw-r--r--src/egl/drivers/dri2/egl_dri2_fallbacks.h9
-rw-r--r--src/egl/drivers/dri2/platform_android.c10
-rw-r--r--src/egl/drivers/dri2/platform_drm.c1
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c1
-rw-r--r--src/egl/drivers/dri2/platform_x11.c4
7 files changed, 30 insertions, 11 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 87dd2f67d4d..0c8b4ff45eb 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1023,6 +1023,16 @@ dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy,
attrib_list);
}
+static _EGLSurface*
+dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLConfig *conf, EGLNativePixmapType pixmap,
+ const EGLint *attrib_list)
+{
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ return dri2_dpy->vtbl->create_pixmap_surface(drv, dpy, conf, pixmap,
+ attrib_list);
+}
+
static EGLBoolean
dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
EGLint interval)
@@ -2067,6 +2077,7 @@ _eglBuiltInDriverDRI2(const char *args)
dri2_drv->base.API.DestroyContext = dri2_destroy_context;
dri2_drv->base.API.MakeCurrent = dri2_make_current;
dri2_drv->base.API.CreateWindowSurface = dri2_create_window_surface;
+ dri2_drv->base.API.CreatePixmapSurface = dri2_create_pixmap_surface;
dri2_drv->base.API.GetProcAddress = dri2_get_proc_address;
dri2_drv->base.API.WaitClient = dri2_wait_client;
dri2_drv->base.API.WaitNative = dri2_wait_native;
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 22c8cf58e75..7ab0ef44922 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -92,6 +92,11 @@ struct dri2_egl_display_vtbl {
EGLNativeWindowType window,
const EGLint *attrib_list);
+ _EGLSurface* (*create_pixmap_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLConfig *config,
+ EGLNativePixmapType pixmap,
+ const EGLint *attrib_list);
+
EGLBoolean (*swap_interval)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf, EGLint interval);
diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h
index 51c0a99aaa6..80dd4ace3bf 100644
--- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h
+++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h
@@ -26,6 +26,15 @@
#include "egltypedefs.h"
+static inline _EGLSurface *
+dri2_fallback_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
+ _EGLConfig *conf,
+ EGLNativePixmapType pixmap,
+ const EGLint *attrib_list)
+{
+ return NULL;
+}
+
static inline EGLBoolean
dri2_fallback_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf, EGLint interval)
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 77175059f26..d8f56b4a6f6 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -262,14 +262,6 @@ droid_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
}
static _EGLSurface *
-droid_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativePixmapType pixmap,
- const EGLint *attrib_list)
-{
- return NULL;
-}
-
-static _EGLSurface *
droid_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, const EGLint *attrib_list)
{
@@ -431,7 +423,6 @@ droid_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
static void
droid_init_driver_functions(_EGLDriver *drv)
{
- drv->API.CreatePixmapSurface = droid_create_pixmap_surface;
drv->API.CreatePbufferSurface = droid_create_pbuffer_surface;
drv->API.DestroySurface = droid_destroy_surface;
@@ -654,6 +645,7 @@ droid_log(EGLint level, const char *msg)
static struct dri2_egl_display_vtbl droid_display_vtbl = {
.authenticate = NULL,
.create_window_surface = droid_create_window_surface,
+ .create_pixmap_surface = dri2_fallback_pixmap_surface,
.swap_interval = dri2_fallback_swap_interval,
.swap_buffers = droid_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index cd24772078d..571f016002d 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -444,6 +444,7 @@ dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
static struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
.authenticate = dri2_drm_authenticate,
.create_window_surface = dri2_drm_create_window_surface,
+ .create_pixmap_surface = dri2_fallback_create_pixmap_surface,
.swap_interval = dri2_fallback_swap_interval,
.swap_buffers = dri2_drm_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index db1b2c4f3c7..2ea61edbabf 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -960,6 +960,7 @@ dri2_wl_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
static struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
.authenticate = dri2_wl_authenticate,
.create_window_surface = dri2_wl_create_window_surface,
+ .create_pixmap_surface = dri2_fallback_create_pixmap_surface,
.swap_interval = dri2_wl_swap_interval,
.swap_buffers = dri2_wl_swap_buffers,
.swap_buffers_with_damage = dri2_wl_swap_buffers_with_damage,
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index aa6e55a328b..6be99130479 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -995,6 +995,7 @@ dri2_x11_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
static struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
.authenticate = NULL,
.create_window_surface = dri2_x11_create_window_surface,
+ .create_pixmap_surface = dri2_x11_create_pixmap_surface,
.swap_interval = dri2_fallback_swap_interval,
.swap_buffers = dri2_x11_swap_buffers,
};
@@ -1002,6 +1003,7 @@ static struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
static struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {
.authenticate = dri2_x11_authenticate,
.create_window_surface = dri2_x11_create_window_surface,
+ .create_pixmap_surface = dri2_x11_create_pixmap_surface,
.swap_interval = dri2_x11_swap_interval,
.swap_buffers = dri2_x11_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
@@ -1012,7 +1014,6 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
- drv->API.CreatePixmapSurface = dri2_x11_create_pixmap_surface;
drv->API.CreatePbufferSurface = dri2_x11_create_pbuffer_surface;
drv->API.DestroySurface = dri2_x11_destroy_surface;
drv->API.CopyBuffers = dri2_x11_copy_buffers;
@@ -1136,7 +1137,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
- drv->API.CreatePixmapSurface = dri2_x11_create_pixmap_surface;
drv->API.CreatePbufferSurface = dri2_x11_create_pbuffer_surface;
drv->API.DestroySurface = dri2_x11_destroy_surface;
drv->API.CopyBuffers = dri2_x11_copy_buffers;