|
1
|
+commit 0a9415cf793babed1f28c61f8047d51de04f1528
|
|
2
|
+Author: Adam Jackson <ajax@redhat.com>
|
|
3
|
+Date: Fri Sep 14 11:33:43 2018 -0400
|
|
4
|
+
|
|
5
|
+ glamor_egl: Don't initialize on llvmpipe
|
|
6
|
+
|
|
7
|
+ Mesa started supporting GL_OES_EGL_image on llvmpipe in 17.3, after this
|
|
8
|
+ commit:
|
|
9
|
+
|
|
10
|
+ commit bbdeddd5fd0b797e1e281f058338b3da4d98029d
|
|
11
|
+ Author: Gurchetan Singh <gurchetansingh@chromium.org>
|
|
12
|
+ Date: Tue Aug 1 14:49:33 2017 -0700
|
|
13
|
+
|
|
14
|
+ st/dri: add drisw image extension
|
|
15
|
+
|
|
16
|
+ That's pretty cool, but it means glamor now thinks it can initialize on
|
|
17
|
+ llvmpipe. This is almost certainly not what anyone wants, as glamor on
|
|
18
|
+ llvmpipe is pretty much uniformly slower than fb.
|
|
19
|
+
|
|
20
|
+ This fixes both Xorg and Xwayland to refuse glamor in such a setup.
|
|
21
|
+ Xephyr is left alone, both because glamor is not the default there and
|
|
22
|
+ because Xephyr+glamor+llvmpipe is one of the easier ways to get xts to
|
|
23
|
+ exercise glamor.
|
|
24
|
+
|
|
25
|
+ The (very small) downside of this change is that you lose DRI3 support.
|
|
26
|
+ This wouldn't have helped you very much (since an lp glamor blit is
|
|
27
|
+ slower than a pixman blit), but it would eliminate the PutImage overhead
|
|
28
|
+ for llvmpipe's glXSwapBuffers. A future change should add DRI3 support
|
|
29
|
+ for the fb-only case.
|
|
30
|
+
|
|
31
|
+ Reviewed-by: Eric Anholt <eric@anholt.net>
|
|
32
|
+ Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
33
|
+
|
|
34
|
+diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
|
|
35
|
+index df278b1a1..9b930d603 100644
|
|
36
|
+--- a/glamor/glamor_egl.c
|
|
37
|
++++ b/glamor/glamor_egl.c
|
|
38
|
+@@ -898,6 +898,7 @@ Bool
|
|
39
|
+ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|
40
|
+ {
|
|
41
|
+ struct glamor_egl_screen_private *glamor_egl;
|
|
42
|
++ const GLubyte *renderer;
|
|
43
|
+
|
|
44
|
+ glamor_egl = calloc(sizeof(*glamor_egl), 1);
|
|
45
|
+ if (glamor_egl == NULL)
|
|
46
|
+@@ -992,6 +993,14 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|
47
|
+ "Failed to make EGL context current\n");
|
|
48
|
+ goto error;
|
|
49
|
+ }
|
|
50
|
++
|
|
51
|
++ renderer = glGetString(GL_RENDERER);
|
|
52
|
++ if (strstr((const char *)renderer, "llvmpipe")) {
|
|
53
|
++ xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
|
54
|
++ "Refusing to try glamor on llvmpipe\n");
|
|
55
|
++ goto error;
|
|
56
|
++ }
|
|
57
|
++
|
|
58
|
+ /*
|
|
59
|
+ * Force the next glamor_make_current call to set the right context
|
|
60
|
+ * (in case of multiple GPUs using glamor)
|
|
61
|
+@@ -1005,7 +1014,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|
62
|
+ }
|
|
63
|
+
|
|
64
|
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "glamor X acceleration enabled on %s\n",
|
|
65
|
+- glGetString(GL_RENDERER));
|
|
66
|
++ renderer);
|
|
67
|
+
|
|
68
|
+ #ifdef GBM_BO_WITH_MODIFIERS
|
|
69
|
+ if (epoxy_has_egl_extension(glamor_egl->display,
|
|
70
|
+diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
|
|
71
|
+index 06fcf5239..25a354bf7 100644
|
|
72
|
+--- a/hw/xwayland/xwayland-glamor-gbm.c
|
|
73
|
++++ b/hw/xwayland/xwayland-glamor-gbm.c
|
|
74
|
+@@ -843,6 +843,11 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen)
|
|
75
|
+ goto error;
|
|
76
|
+ }
|
|
77
|
+
|
|
78
|
++ if (strstr((const char *)glGetString(GL_RENDERER), "llvmpipe")) {
|
|
79
|
++ ErrorF("Refusing to try glamor on llvmpipe\n");
|
|
80
|
++ goto error;
|
|
81
|
++ }
|
|
82
|
++
|
|
83
|
+ if (!epoxy_has_gl_extension("GL_OES_EGL_image")) {
|
|
84
|
+ ErrorF("GL_OES_EGL_image not available\n");
|
|
85
|
+ goto error;
|