summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgbert Eich <eich@freedesktop.org>2011-05-10 20:00:19 +0000
committerKristian Høgsberg <krh@bitplanet.net>2011-05-10 16:42:08 -0400
commite7b8d9055ef570ad05b44aef8c61cabf413a2f82 (patch)
tree401b59961e6122a5b8c9e986ece6a809df0afdaa
parentb79216e7a0be5fff5aba7a36fc3812cd803ba28b (diff)
compositor: Set EGL_PLATFORM env variable for each backend.
I may have missed something, but - since the Wayland compositor already picks a platform backend, opens a connection and initializes the backend specific display data structure it doesn't make sense to let egl pick a platform. If it picks a different one the display specific data structure will most likely not match. Thus determine the platform in the Wayland rendering backend by setting the EGL_PLATFORM env variable. For the client any other platform than 'wayland' doesn't seem to make sense. I'm not sure if I've got the the platform ofr openfwd right. Signed-off-by: Egbert Eich <eich@freedesktop.org>
-rw-r--r--clients/window.c1
-rw-r--r--compositor/compositor-drm.c1
-rw-r--r--compositor/compositor-openwfd.c1
-rw-r--r--compositor/compositor-wayland.c1
-rw-r--r--compositor/compositor-x11.c1
5 files changed, 5 insertions, 0 deletions
diff --git a/clients/window.c b/clients/window.c
index 9d0b753..8c3f8d2 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1757,6 +1757,7 @@ init_egl(struct display *d)
EGL_NONE
};
+ setenv("EGL_PLATFORM", "wayland", 1);
d->dpy = eglGetDisplay(d->display);
if (!eglInitialize(d->dpy, &major, &minor)) {
fprintf(stderr, "failed to initialize display\n");
diff --git a/compositor/compositor-drm.c b/compositor/compositor-drm.c
index 4897b38..9fc5b49 100644
--- a/compositor/compositor-drm.c
+++ b/compositor/compositor-drm.c
@@ -269,6 +269,7 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
return -1;
}
+ setenv("EGL_PLATFORM", "drm", 1);
ec->drm.fd = fd;
ec->base.display = eglGetDisplay(FD_TO_EGL_NATIVE_DPY(ec->drm.fd));
if (ec->base.display == NULL) {
diff --git a/compositor/compositor-openwfd.c b/compositor/compositor-openwfd.c
index 0ddde52..ccd3dce 100644
--- a/compositor/compositor-openwfd.c
+++ b/compositor/compositor-openwfd.c
@@ -118,6 +118,7 @@ init_egl(struct wfd_compositor *ec)
return -1;
ec->wfd_fd = fd;
+ setenv("EGL_PLATFORM", "drm", 1);
ec->base.display = eglGetDisplay(FD_TO_EGL_NATIVE_DPY(ec->wfd_fd));
if (ec->base.display == NULL) {
fprintf(stderr, "failed to create display\n");
diff --git a/compositor/compositor-wayland.c b/compositor/compositor-wayland.c
index 1a53e8d..6cd02ed 100644
--- a/compositor/compositor-wayland.c
+++ b/compositor/compositor-wayland.c
@@ -111,6 +111,7 @@ wayland_compositor_init_egl(struct wayland_compositor *c)
EGL_NONE
};
+ setenv("EGL_PLATFORM", "wayland", 1);
c->base.display = eglGetDisplay(c->parent.display);
if (c->base.display == NULL) {
fprintf(stderr, "failed to create display\n");
diff --git a/compositor/compositor-x11.c b/compositor/compositor-x11.c
index ac31881..3517fad 100644
--- a/compositor/compositor-x11.c
+++ b/compositor/compositor-x11.c
@@ -113,6 +113,7 @@ x11_compositor_init_egl(struct x11_compositor *c)
EGL_NONE
};
+ setenv("EGL_PLATFORM", "x11", 1);
c->base.display = eglGetDisplay(c->dpy);
if (c->base.display == NULL) {
fprintf(stderr, "failed to create display\n");