- 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
This commit is contained in:
parent
c7a90cae07
commit
9b866a43a1
82
U_glamor_egl-Reject-OpenGL-2.1-early-on.patch
Normal file
82
U_glamor_egl-Reject-OpenGL-2.1-early-on.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From 26004df63c25061586a967f3586795a75280acc2 Mon Sep 17 00:00:00 2001
|
||||
From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
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 <lkundrak@v3.sk>
|
||||
---
|
||||
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);
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 4 10:02:58 UTC 2020 - Stefan Dirsch <sndirsch@suse.com>
|
||||
|
||||
- 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 <sndirsch@suse.com>
|
||||
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user