xserver: Branch 'master' - 2 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Dec 19 10:43:36 UTC 2019
hw/xwayland/xwayland-glx.c | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
New commits:
commit 846e81ecb83f30b555ce71a32cd6965d7b9939a5
Author: Michel Dänzer <mdaenzer at redhat.com>
Date: Tue Dec 17 18:39:17 2019 +0100
xwayland: Create duplicate TrueColor GLXFBConfigs for Composite
Similar to what is done in Xorg. Not doing this prevented apps from
using GLX with a Composite visual, e.g. Firefox WebRender or Chromium.
v2:
* Fix inverted direct_color test, fixes Chromium as well.
* Drop Composite extension guards, since other Xwayland code calls
compRedirectWindow/compUnredirectWindow unconditionally anyway.
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/921
Fixes: 8469241592b94b "xwayland: Add EGL-backed GLX provider"
Reviewed-by: Adam Jackson <ajax at redhat.com> # v1
diff --git a/hw/xwayland/xwayland-glx.c b/hw/xwayland/xwayland-glx.c
index 89527cd8b..0fc2a7d01 100644
--- a/hw/xwayland/xwayland-glx.c
+++ b/hw/xwayland/xwayland-glx.c
@@ -144,7 +144,7 @@ egl_create_glx_drawable(ClientPtr client, __GLXscreen *screen,
static struct egl_config *
translate_eglconfig(struct egl_screen *screen, EGLConfig hc,
struct egl_config *chain, Bool direct_color,
- Bool double_buffer)
+ Bool double_buffer, Bool duplicate_for_composite)
{
EGLint value;
struct egl_config *c = calloc(1, sizeof *c);
@@ -280,6 +280,28 @@ translate_eglconfig(struct egl_screen *screen, EGLConfig hc,
}
}
+ /*
+ * Here we decide which fbconfigs will be duplicated for compositing.
+ * fgbconfigs marked with duplicatedForComp will be reserved for
+ * compositing visuals.
+ * It might look strange to do this decision this late when translation
+ * from an EGLConfig is already done, but using the EGLConfig
+ * accessor functions becomes worse both with respect to code complexity
+ * and CPU usage.
+ */
+ if (duplicate_for_composite &&
+ (c->base.renderType == GLX_RGBA_FLOAT_BIT_ARB ||
+ c->base.rgbBits != 32 ||
+ c->base.redBits != 8 ||
+ c->base.greenBits != 8 ||
+ c->base.blueBits != 8 ||
+ c->base.visualRating != GLX_NONE ||
+ c->base.sampleBuffers != 0)) {
+ free(c);
+ return chain;
+ }
+ c->base.duplicatedForComp = duplicate_for_composite;
+
c->base.next = chain ? &chain->base : NULL;
return c;
}
@@ -290,7 +312,6 @@ egl_mirror_configs(ScreenPtr pScreen, struct egl_screen *screen)
int i, j, k, nconfigs;
struct egl_config *c = NULL;
EGLConfig *host_configs = NULL;
- Bool offon[] = { FALSE, TRUE };
eglGetConfigs(screen->display, NULL, 0, &nconfigs);
if (!(host_configs = calloc(nconfigs, sizeof *host_configs)))
@@ -302,12 +323,12 @@ egl_mirror_configs(ScreenPtr pScreen, struct egl_screen *screen)
* ->next chain easier.
*/
for (i = nconfigs - 1; i > 0; i--)
- for (j = 0; j < 2; j++) /* direct_color */
+ for (j = 0; j < 3; j++) /* direct_color */
for (k = 0; k < 2; k++) /* double_buffer */
c = translate_eglconfig(screen, host_configs[i], c,
- /* direct_color */ offon[j],
- /* double_buffer */ offon[k]
- );
+ /* direct_color */ j == 1,
+ /* double_buffer */ k > 0,
+ /* duplicate_for_composite */ j == 0);
screen->configs = host_configs;
return c ? &c->base : NULL;
commit 02e7a497ceacef490921a8ae7115cd9f28a66dec
Author: Michel Dänzer <mdaenzer at redhat.com>
Date: Tue Dec 17 18:43:07 2019 +0100
xwayland: Fix duplicate "direct_color" comment to say "double_buffer"
Fixes: 8469241592b94b "xwayland: Add EGL-backed GLX provider"
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xwayland/xwayland-glx.c b/hw/xwayland/xwayland-glx.c
index b0b227d87..89527cd8b 100644
--- a/hw/xwayland/xwayland-glx.c
+++ b/hw/xwayland/xwayland-glx.c
@@ -303,7 +303,7 @@ egl_mirror_configs(ScreenPtr pScreen, struct egl_screen *screen)
*/
for (i = nconfigs - 1; i > 0; i--)
for (j = 0; j < 2; j++) /* direct_color */
- for (k = 0; k < 2; k++) /* direct_color */
+ for (k = 0; k < 2; k++) /* double_buffer */
c = translate_eglconfig(screen, host_configs[i], c,
/* direct_color */ offon[j],
/* double_buffer */ offon[k]
More information about the xorg-commit
mailing list