From 9b866a43a10381c3e33d07381565d84927d45aae2b6f5a2287184e2c428e8523 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Thu, 4 Jun 2020 10:41:35 +0000 Subject: [PATCH] - U_glamor_egl-Reject-OpenGL-2.1-early-on.patch * GLAMOR: no longer bail out for OpenGL drivers < 2.1 (boo#1172321) OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=766 --- U_glamor_egl-Reject-OpenGL-2.1-early-on.patch | 82 +++++++++++++++++++ xorg-x11-server.changes | 6 ++ xorg-x11-server.spec | 3 + 3 files changed, 91 insertions(+) create mode 100644 U_glamor_egl-Reject-OpenGL-2.1-early-on.patch diff --git a/U_glamor_egl-Reject-OpenGL-2.1-early-on.patch b/U_glamor_egl-Reject-OpenGL-2.1-early-on.patch new file mode 100644 index 0000000..20bcd6b --- /dev/null +++ b/U_glamor_egl-Reject-OpenGL-2.1-early-on.patch @@ -0,0 +1,82 @@ +From 26004df63c25061586a967f3586795a75280acc2 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 25 Dec 2019 18:54:03 +0100 +Subject: [PATCH] glamor_egl: Reject OpenGL < 2.1 early on + +The Etnaviv driver on GC2000 reports desktop OpenGL 1.3 but also OpenGL ES 2.0. +However, with the modesetting driver, GLES2 never gets a chance: + + [ 11233.393] Require OpenGL version 2.1 or later. + [ 11233.393] (EE) modeset(0): Failed to initialize glamor at ScreenInit() time. + [ 11233.393] (EE) + Fatal server error: + [ 11233.395] (EE) AddScreen/ScreenInit failed for driver 0 + +Let's reject old desktop GL early on, just like XWayland seems to do. + +This is perhaps a slightly bit more complicated that one would expect, since we +need to call eglMakeCurrent() before we query the GL version. + +Signed-off-by: Lubomir Rintel +--- + glamor/glamor_egl.c | 39 ++++++++++++++++++++++++++++----------- + 1 file changed, 28 insertions(+), 11 deletions(-) + +Index: xserver-1.20.8+0/glamor/glamor_egl.c +=================================================================== +--- xserver-1.20.8+0.orig/glamor/glamor_egl.c ++++ xserver-1.20.8+0/glamor/glamor_egl.c +@@ -985,6 +985,22 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd + config_attribs); + } + ++ if (glamor_egl->context != EGL_NO_CONTEXT) { ++ if (!eglMakeCurrent(glamor_egl->display, ++ EGL_NO_SURFACE, EGL_NO_SURFACE, glamor_egl->context)) { ++ xf86DrvMsg(scrn->scrnIndex, X_ERROR, ++ "Failed to make GL context current\n"); ++ goto error; ++ } ++ ++ if (epoxy_gl_version() < 21) { ++ xf86DrvMsg(scrn->scrnIndex, X_INFO, ++ "glamor: Ignoring GL < 2.1, falling back to GLES.\n"); ++ eglDestroyContext(glamor_egl->display, glamor_egl->context); ++ glamor_egl->context = EGL_NO_CONTEXT; ++ } ++ } ++ + if (glamor_egl->context == EGL_NO_CONTEXT) { + static const EGLint config_attribs[] = { + EGL_CONTEXT_CLIENT_VERSION, 2, +@@ -999,18 +1015,19 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd + glamor_egl->context = eglCreateContext(glamor_egl->display, + NULL, EGL_NO_CONTEXT, + config_attribs); +- } +- if (glamor_egl->context == EGL_NO_CONTEXT) { +- xf86DrvMsg(scrn->scrnIndex, X_ERROR, +- "glamor: Failed to create GL or GLES2 contexts\n"); +- goto error; +- } + +- if (!eglMakeCurrent(glamor_egl->display, +- EGL_NO_SURFACE, EGL_NO_SURFACE, glamor_egl->context)) { +- xf86DrvMsg(scrn->scrnIndex, X_ERROR, +- "Failed to make EGL context current\n"); +- goto error; ++ if (glamor_egl->context == EGL_NO_CONTEXT) { ++ xf86DrvMsg(scrn->scrnIndex, X_ERROR, ++ "glamor: Failed to create GL or GLES2 contexts\n"); ++ goto error; ++ } ++ ++ if (!eglMakeCurrent(glamor_egl->display, ++ EGL_NO_SURFACE, EGL_NO_SURFACE, glamor_egl->context)) { ++ xf86DrvMsg(scrn->scrnIndex, X_ERROR, ++ "Failed to make GLES2 context current\n"); ++ goto error; ++ } + } + + renderer = glGetString(GL_RENDERER); diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 44639de..e17c722 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 4 10:02:58 UTC 2020 - Stefan Dirsch + +- U_glamor_egl-Reject-OpenGL-2.1-early-on.patch + * GLAMOR: no longer bail out for OpenGL drivers < 2.1 (boo#1172321) + ------------------------------------------------------------------- Wed May 6 14:23:54 UTC 2020 - Stefan Dirsch diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 939c2d1..de4a119 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -248,6 +248,8 @@ Patch1503: u_xfree86-Do-not-claim-pci-slots-if-fb-slot-is-already.patch Patch1505: U_xwayland-Allow-passing-a-fd.patch +Patch1600: U_glamor_egl-Reject-OpenGL-2.1-early-on.patch + %description This package contains the X.Org Server. @@ -395,6 +397,7 @@ sh %{SOURCE92} --verify . %{SOURCE91} %patch1502 -p1 %patch1503 -p1 %patch1505 -p1 +%patch1600 -p1 %build %define _lto_cflags %{nil}