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>
This commit is contained in:
Egbert Eich
2011-05-10 20:00:19 +00:00
committed by Kristian Høgsberg
parent b79216e7a0
commit e7b8d9055e
5 changed files with 5 additions and 0 deletions
+1
View File
@@ -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) {
+1
View File
@@ -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");
+1
View File
@@ -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");
+1
View File
@@ -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");