summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-01-27 16:11:17 -0800
committerEric Anholt <eric@anholt.net>2016-01-29 18:12:28 -0800
commit68f236ebd4b268a9e525d623986999d230feb453 (patch)
treebb60a794d1000e3578a37408343516f5fa4ac949 /hw
parent623ff251dd025929f5bb6174ca86580c5e707261 (diff)
ephyr: Make sure we have GLX_ARB_create_context before calling it.
This should fix aborts()s from epoxy on old software stacks. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/ephyr/ephyr_glamor_glx.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c b/hw/kdrive/ephyr/ephyr_glamor_glx.c
index 098114453..636150d6a 100644
--- a/hw/kdrive/ephyr/ephyr_glamor_glx.c
+++ b/hw/kdrive/ephyr/ephyr_glamor_glx.c
@@ -330,20 +330,26 @@ ephyr_glamor_glx_screen_init(xcb_window_t win)
"GLX_EXT_create_context_es2_profile\n");
}
} else {
- static const int context_attribs[] = {
- GLX_CONTEXT_PROFILE_MASK_ARB,
- GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
- GLX_CONTEXT_MAJOR_VERSION_ARB,
- GLAMOR_GL_CORE_VER_MAJOR,
- GLX_CONTEXT_MINOR_VERSION_ARB,
- GLAMOR_GL_CORE_VER_MINOR,
- 0,
- };
- oldErrorHandler = XSetErrorHandler(ephyr_glx_error_handler);
- ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True,
- context_attribs);
- XSync(dpy, False);
- XSetErrorHandler(oldErrorHandler);
+ if (epoxy_has_glx_extension(dpy, DefaultScreen(dpy),
+ "GLX_ARB_create_context")) {
+ static const int context_attribs[] = {
+ GLX_CONTEXT_PROFILE_MASK_ARB,
+ GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+ GLX_CONTEXT_MAJOR_VERSION_ARB,
+ GLAMOR_GL_CORE_VER_MAJOR,
+ GLX_CONTEXT_MINOR_VERSION_ARB,
+ GLAMOR_GL_CORE_VER_MINOR,
+ 0,
+ };
+ oldErrorHandler = XSetErrorHandler(ephyr_glx_error_handler);
+ ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True,
+ context_attribs);
+ XSync(dpy, False);
+ XSetErrorHandler(oldErrorHandler);
+ } else {
+ ctx = NULL;
+ }
+
if (!ctx)
ctx = glXCreateContext(dpy, visual_info, NULL, True);
}