[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg-devel
Subject: [PATCH xserver 01/19] ephyr: Make sure we have GLX_ARB_create_context before calling it.
From: Eric Anholt <eric () anholt ! net>
Date: 2016-01-28 1:56:30
Message-ID: 1453946208-9567-2-git-send-email-eric () anholt ! net
[Download RAW message or body]
This should fix aborts()s from epoxy on old software stacks.
Signed-off-by: Eric Anholt <eric@anholt.net>
---
hw/kdrive/ephyr/ephyr_glamor_glx.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c b/hw/kdrive/ephyr/ephyr_glamor_glx.c
index 0981144..636150d 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);
}
--
2.6.4
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic