From dab054200cb2135da2303ed0909a906da3c05083 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 17 Jul 2013 14:08:32 +0200 Subject: [PATCH] egl-kms: set the EGL_PLATFORM explicitly Otherwise, if we try egl-wayland first, we get the environment variable from that, which crashes mesa trying to open the gbm device as a wayland display. https://bugzilla.gnome.org/show_bug.cgi?id=705836 --- cogl/winsys/cogl-winsys-egl-kms.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c index 0e704223c..1c9cafb29 100644 --- a/cogl/winsys/cogl-winsys-egl-kms.c +++ b/cogl/winsys/cogl-winsys-egl-kms.c @@ -268,6 +268,12 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer, egl_renderer->platform = g_slice_new0 (CoglRendererKMS); kms_renderer = egl_renderer->platform; + /* The EGL API doesn't provide for a way to explicitly select a + * platform when the driver can support multiple. Mesa allows + * selection using an environment variable though so that's what + * we're doing here... */ + g_setenv ("EGL_PLATFORM", "drm", 1); + kms_renderer->fd = open (device_name, O_RDWR); if (kms_renderer->fd < 0) {