diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-05-29 17:01:19 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-05-29 17:04:24 -0600 |
commit | d1a0faffc3fde42b030f3eb18d6f31c10dfdc8f6 (patch) | |
tree | 77cd4290c190d41b308cfd5df7605ebefa47ad90 /src/egl/main | |
parent | 31e70fa275a48b8020c14017919e08d21f5e982f (diff) | |
download | external_mesa3d-d1a0faffc3fde42b030f3eb18d6f31c10dfdc8f6.zip external_mesa3d-d1a0faffc3fde42b030f3eb18d6f31c10dfdc8f6.tar.gz external_mesa3d-d1a0faffc3fde42b030f3eb18d6f31c10dfdc8f6.tar.bz2 |
egl: use softpipe_egl driver by default
Diffstat (limited to 'src/egl/main')
-rw-r--r-- | src/egl/main/eglx.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/egl/main/eglx.c b/src/egl/main/eglx.c index 4b33080..085da33 100644 --- a/src/egl/main/eglx.c +++ b/src/egl/main/eglx.c @@ -12,6 +12,8 @@ #include "eglx.h" +static const char *DefaultXDriver = "softpipe_egl"; + /** * Given an X Display ptr (at dpy->Xdpy) try to determine the appropriate @@ -21,14 +23,24 @@ const char * _xeglChooseDriver(_EGLDisplay *dpy) { #ifdef _EGL_PLATFORM_X - _XPrivDisplay xdpy = (_XPrivDisplay) dpy->Xdpy; + _XPrivDisplay xdpy; assert(dpy); + + if (!dpy->Xdpy) { + dpy->Xdpy = XOpenDisplay(NULL); + if (!dpy->Xdpy) { + /* can't open X display -> can't use X-based driver */ + return NULL; + } + } + xdpy = (_XPrivDisplay) dpy->Xdpy; + assert(dpy->Xdpy); printf("%s\n", xdpy->display_name); - return "foo"; /* XXX todo */ + return DefaultXDriver; /* XXX temporary */ #else return NULL; #endif |