summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-06-15 21:46:44 +0100
committerRobert Bragg <robert@linux.intel.com>2013-10-13 18:07:11 +0100
commit4bb71549986e9a4324a6aa14e479f4faf078067d (patch)
tree4ab5d953422382b032c2c5347e00b6a3b7aea40c
parent5839a4683c0e84a63ff15574261da090a38cb1fb (diff)
downloadcogl-4bb71549986e9a4324a6aa14e479f4faf078067d.tar.gz
kms: set EGL_PLATFORM environment variable
Although EGL doesn't currently have a standard way of supporting multiple platforms and being able explicitly select a platform, Mesa at least lets you explicitly select a platform via the EGL_PLATFORM environment variable. This makes the egl-kms winsys set EGL_PLATFORM to "gbm".
-rw-r--r--cogl/winsys/cogl-winsys-egl-kms.c6
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 f3edb27a..a81237de 100644
--- a/cogl/winsys/cogl-winsys-egl-kms.c
+++ b/cogl/winsys/cogl-winsys-egl-kms.c
@@ -520,6 +520,12 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
goto error;
}
+ /* 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", "gbm", 1);
+
egl_renderer->edpy = eglGetDisplay ((EGLNativeDisplayType)kms_renderer->gbm);
if (egl_renderer->edpy == EGL_NO_DISPLAY)
{