[cogl/cogl-1.16] egl-kms: set the EGL_PLATFORM explicitly



commit dab054200cb2135da2303ed0909a906da3c05083
Author: Giovanni Campagna <gcampagn redhat com>
Date:   Wed Jul 17 14:08:32 2013 +0200

    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 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c
index 0e70422..1c9cafb 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)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]