|
|
4af910 |
From 687ec347d2fa0bca227e3a583a3a47f9bbc10bb0 Mon Sep 17 00:00:00 2001
|
|
|
4af910 |
From: Adam Jackson <ajax@redhat.com>
|
|
|
4af910 |
Date: Tue, 4 Oct 2016 13:15:39 -0400
|
|
|
4af910 |
Subject: [PATCH] check-accelerated-gles: Use eglGetPlatformDisplay{,EXT}
|
|
|
4af910 |
|
|
|
4af910 |
eglGetDisplay forces the implementation to guess, and in general it
|
|
|
4af910 |
can't guess correctly. Be explicit.
|
|
|
4af910 |
|
|
|
4af910 |
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
|
4af910 |
---
|
|
|
4af910 |
.../gnome-session-check-accelerated-gles-helper.c | 36 +++++++++++++++++++++-
|
|
|
4af910 |
1 file changed, 35 insertions(+), 1 deletion(-)
|
|
|
4af910 |
|
|
|
4af910 |
diff --git a/tools/gnome-session-check-accelerated-gles-helper.c b/tools/gnome-session-check-accelerated-gles-helper.c
|
|
|
4af910 |
index 2a38d9e..472d1ad 100644
|
|
|
4af910 |
--- a/tools/gnome-session-check-accelerated-gles-helper.c
|
|
|
4af910 |
+++ b/tools/gnome-session-check-accelerated-gles-helper.c
|
|
|
4af910 |
@@ -34,11 +34,43 @@
|
|
|
4af910 |
#include <GLES2/gl2.h>
|
|
|
4af910 |
#include <GLES2/gl2ext.h>
|
|
|
4af910 |
#include <EGL/egl.h>
|
|
|
4af910 |
+#include <EGL/eglext.h>
|
|
|
4af910 |
#endif
|
|
|
4af910 |
|
|
|
4af910 |
#include "gnome-session-check-accelerated-common.h"
|
|
|
4af910 |
|
|
|
4af910 |
#ifdef GDK_WINDOWING_X11
|
|
|
4af910 |
+static EGLDisplay
|
|
|
4af910 |
+get_display (void *native)
|
|
|
4af910 |
+{
|
|
|
4af910 |
+ EGLDisplay dpy = NULL;
|
|
|
4af910 |
+ const char *client_exts = eglQueryString (NULL, EGL_EXTENSIONS);
|
|
|
4af910 |
+
|
|
|
4af910 |
+ if (g_strstr_len (client_exts, -1, "EGL_KHR_platform_base")) {
|
|
|
4af910 |
+ PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
|
|
|
4af910 |
+ (void *) eglGetProcAddress ("eglGetPlatformDisplay");
|
|
|
4af910 |
+
|
|
|
4af910 |
+ if (get_platform_display)
|
|
|
4af910 |
+ dpy = get_platform_display (EGL_PLATFORM_X11_KHR, native, NULL);
|
|
|
4af910 |
+
|
|
|
4af910 |
+ if (dpy)
|
|
|
4af910 |
+ return dpy;
|
|
|
4af910 |
+ }
|
|
|
4af910 |
+
|
|
|
4af910 |
+ if (g_strstr_len (client_exts, -1, "EGL_EXT_platform_base")) {
|
|
|
4af910 |
+ PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
|
|
|
4af910 |
+ (void *) eglGetProcAddress ("eglGetPlatformDisplayEXT");
|
|
|
4af910 |
+
|
|
|
4af910 |
+ if (get_platform_display)
|
|
|
4af910 |
+ dpy = get_platform_display (EGL_PLATFORM_X11_KHR, native, NULL);
|
|
|
4af910 |
+
|
|
|
4af910 |
+ if (dpy)
|
|
|
4af910 |
+ return dpy;
|
|
|
4af910 |
+ }
|
|
|
4af910 |
+
|
|
|
4af910 |
+ return eglGetDisplay ((EGLNativeDisplayType) native);
|
|
|
4af910 |
+}
|
|
|
4af910 |
+
|
|
|
4af910 |
static char *
|
|
|
4af910 |
get_gles_renderer (void)
|
|
|
4af910 |
{
|
|
|
4af910 |
@@ -67,7 +99,9 @@ get_gles_renderer (void)
|
|
|
4af910 |
gdk_error_trap_push ();
|
|
|
4af910 |
|
|
|
4af910 |
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
|
4af910 |
- egl_dpy = eglGetDisplay (display);
|
|
|
4af910 |
+
|
|
|
4af910 |
+ egl_dpy = get_display (display);
|
|
|
4af910 |
+
|
|
|
4af910 |
if (!egl_dpy) {
|
|
|
4af910 |
g_warning ("eglGetDisplay() failed");
|
|
|
4af910 |
goto out;
|
|
|
4af910 |
--
|
|
|
4af910 |
2.9.3
|
|
|
4af910 |
|