xserver: Branch 'server-1.19-branch' - 9 commits
Adam Jackson
ajax at kemper.freedesktop.org
Wed Dec 20 20:30:05 UTC 2017
composite/compositeext.h | 2 +
composite/compwindow.c | 9 +-------
configure.ac | 6 ++---
glx/glxcmds.c | 5 ++--
glx/glxdricommon.c | 52 +++++++++++++++++++++++++++++++++++++++++++----
glx/glxscreens.c | 32 +++++++++++++++++++++++++++-
glx/glxscreens.h | 4 +++
7 files changed, 92 insertions(+), 18 deletions(-)
New commits:
commit ebfb06b11955a6c32500b7086be912ab96b753a7
Author: Adam Jackson <ajax at redhat.com>
Date: Wed Dec 20 14:23:57 2017 -0500
xserver 1.19.6
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/configure.ac b/configure.ac
index d65c08e1a..2bfafb140 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.19.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2017-10-12"
-RELEASE_NAME="Shahi Paneer"
+AC_INIT([xorg-server], 1.19.6, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2017-12-20"
+RELEASE_NAME="Lousiana Gumbo"
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
commit 91c42093b248fc61a23cd1f48fec451fa29e122c
Author: Thomas Hellstrom <thellstrom at vmware.com>
Date: Tue Sep 26 17:28:12 2017 -0700
glx: Duplicate relevant fbconfigs for compositing visuals
Previously, before GLX_OML_swap_method was fixed, both the X server and
client ignored the swapMethod fbconfig value, which meant that, if the dri
driver thought it exposed more than one swapMethod, it actually just
exported a duplicated set of fbconfigs. When fixing GLX_OML_swap_method
and restricting the choice for built-in visuals to a single swap method
that meant we didn't have that many fbconfigs to choose from when pairing
the compositing visual with an fbconfig, resulting in the fbconfig paired
with the compositing visual becoming too restrictive for some applications,
(at least for kwin). This problem would also happen if the dri driver
only exposed a single swap method to begin with.
So, to make sure the compositing visual gets a good enough fbconfig,
duplicate fbconfigs that are suitable for compositing visuals and make
sure these duplicated fbconfigs can be used only by compositing visuals.
For duplicated fbconfigs not paired with a compositing visual, construct
new compositing visuals, making compositing clients able to choose visuals
/ fbconfig more adapted to their needs.
This is in some sense equivalent to adding a new "TRUECOLOR_COMPOSITING"
GLX visualtype.
Fixes: 4486d199bd3b ("glx: Fix visual fbconfig matching with respect to
swap method")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102806
Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Tested-By: Nick Sarnie <commendsarnex at gmail.com>
Tested-by: Fredrik Höglund <fredrik at kde.org>
Reviewed-by: Adam Jackson <ajax at redhat.com>
(cherry picked from commit f84e59a4f474d22860bac8aec2947798a86db69b)
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index d374dc753..d3136e87b 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -139,13 +139,15 @@ render_type_is_pbuffer_only(unsigned renderType)
static __GLXconfig *
createModeFromConfig(const __DRIcoreExtension * core,
const __DRIconfig * driConfig,
- unsigned int visualType)
+ unsigned int visualType,
+ GLboolean duplicateForComp)
{
__GLXDRIconfig *config;
GLint renderType = 0;
unsigned int attrib, value, drawableType = GLX_PBUFFER_BIT;
int i;
+
config = calloc(1, sizeof *config);
config->driConfig = driConfig;
@@ -203,6 +205,28 @@ createModeFromConfig(const __DRIcoreExtension * core,
config->config.drawableType = drawableType;
config->config.yInverted = GL_TRUE;
+#ifdef COMPOSITE
+ /*
+ * Here we decide what fbconfigs will be duplicated for compositing.
+ * fgbconfigs marked with duplicatedForConf will be reserved for
+ * compositing visuals.
+ * It might look strange to do this decision this late when translation
+ * from a __DRIConfig is already done, but using the __DRIConfig
+ * accessor function becomes worse both with respect to code complexity
+ * and CPU usage.
+ */
+ if (duplicateForComp &&
+ (render_type_is_pbuffer_only(renderType) ||
+ config->config.rgbBits != 32 ||
+ config->config.visualRating != GLX_NONE ||
+ config->config.sampleBuffers != 0)) {
+ free(config);
+ return NULL;
+ }
+
+ config->config.duplicatedForComp = duplicateForComp;
+#endif
+
return &config->config;
}
@@ -217,21 +241,34 @@ glxConvertConfigs(const __DRIcoreExtension * core,
head.next = NULL;
for (i = 0; configs[i]; i++) {
- tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR);
+ tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR,
+ GL_FALSE);
if (tail->next == NULL)
break;
-
tail = tail->next;
}
for (i = 0; configs[i]; i++) {
- tail->next = createModeFromConfig(core, configs[i], GLX_DIRECT_COLOR);
+ tail->next = createModeFromConfig(core, configs[i], GLX_DIRECT_COLOR,
+ GL_FALSE);
if (tail->next == NULL)
break;
tail = tail->next;
}
+#ifdef COMPOSITE
+ /* Duplicate fbconfigs for use with compositing visuals */
+ for (i = 0; configs[i]; i++) {
+ tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR,
+ GL_TRUE);
+ if (tail->next == NULL)
+ continue;
+
+ tail = tail->next;
+ }
+#endif
+
return head.next;
}
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 00cdce40a..29bacd988 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -278,7 +278,12 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual)
/* Can't use the same FBconfig for multiple X visuals. I think. */
if (config->visualID != 0)
continue;
-
+#ifdef COMPOSITE
+ /* Use only duplicated configs for compIsAlternateVisuals */
+ if (!!compIsAlternateVisual(pGlxScreen->pScreen, visual->vid) !=
+ !!config->duplicatedForComp)
+ continue;
+#endif
/*
* If possible, use the same swapmethod for all built-in visual
* fbconfigs, to avoid getting the 32-bit composite visual when
@@ -369,7 +374,12 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
* set up above is for.
*/
depth = config->redBits + config->greenBits + config->blueBits;
-
+#ifdef COMPOSITE
+ if (config->duplicatedForComp) {
+ depth += config->alphaBits;
+ config->visualSelectGroup++;
+ }
+#endif
/* Make sure that our FBconfig's depth can actually be displayed
* (corresponds to an existing visual).
*/
@@ -392,6 +402,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
if (visual == NULL)
continue;
+#ifdef COMPOSITE
+ if (config->duplicatedForComp)
+ (void) CompositeRegisterAlternateVisuals(pScreen, &visual->vid, 1);
+#endif
pGlxScreen->visuals[pGlxScreen->numVisuals++] = config;
initGlxVisual(visual, config);
}
diff --git a/glx/glxscreens.h b/glx/glxscreens.h
index 0f9a2b9af..c6a0c5021 100644
--- a/glx/glxscreens.h
+++ b/glx/glxscreens.h
@@ -39,7 +39,11 @@
typedef struct __GLXconfig __GLXconfig;
struct __GLXconfig {
+ /* Management */
__GLXconfig *next;
+#ifdef COMPOSITE
+ GLboolean duplicatedForComp;
+#endif
GLuint doubleBufferMode;
GLuint stereoMode;
commit 22b0880df680aee95e21bb8f93d6dd7d3434c681
Author: Thomas Hellstrom <thellstrom at vmware.com>
Date: Wed Sep 6 16:27:54 2017 +0200
glx: Fix visual fbconfig matching with respect to swap method
For the built in visuals, we'd typically select the "best" fbconfig
without considering the swap method. If the client then requests a
specific swap method, say GLX_SWAP_COPY_OML, it may well happen that the
first fbconfig matching requirements would have been paired with the 32-bit
compositing visual, and the client would render a potentially transparent
window.
Fix this so that we try to match fbconfigs with the same swap method to all
built-in visuals. That would guarantee that selecting a specific swap-
method would not influence the chance of getting a compositing visual.
Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
(cherry picked from commit 4486d199bd3bcb5b2b8ad9bc54eb11604d9bd653)
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 78e0aaff9..00cdce40a 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -279,6 +279,15 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual)
if (config->visualID != 0)
continue;
+ /*
+ * If possible, use the same swapmethod for all built-in visual
+ * fbconfigs, to avoid getting the 32-bit composite visual when
+ * requesting, for example, a SWAP_COPY fbconfig.
+ */
+ if (config->swapMethod == GLX_SWAP_UNDEFINED_OML)
+ score += 32;
+ if (config->swapMethod == GLX_SWAP_EXCHANGE_OML)
+ score += 16;
if (config->doubleBufferMode > 0)
score += 8;
if (config->depthBits > 0)
commit 1726badd61358e644b96f7c561ba239a68d87ba6
Author: Thomas Hellstrom <thellstrom at vmware.com>
Date: Wed Sep 6 16:27:53 2017 +0200
glx: Work around a GLX_OML swap method in older dri drivers
The swapMethod config member would typically contain an arbitrary value
on older dri drivers. Fix this so that if we detect an illegal value,
return GLX_SWAP_UNDEFINED_OML.
Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
(cherry picked from commit 0fc26310d5b09213c65f50bde444a1758172b016)
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index f6c6fcdf2..d374dc753 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -181,6 +181,13 @@ createModeFromConfig(const __DRIcoreExtension * core,
config->config.bindToTextureTargets |=
GLX_TEXTURE_RECTANGLE_BIT_EXT;
break;
+ case __DRI_ATTRIB_SWAP_METHOD:
+ /* Workaround for broken dri drivers */
+ if (value != GLX_SWAP_UNDEFINED_OML &&
+ value != GLX_SWAP_COPY_OML &&
+ value != GLX_SWAP_EXCHANGE_OML)
+ value = GLX_SWAP_UNDEFINED_OML;
+ /* Fall through. */
default:
setScalar(&config->config, attrib, value);
break;
commit c64bd21d7a732b6b8de0f8f636e93b1d1bb46135
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Jan 19 17:20:49 2017 -0500
glx: Move Composite's synthetic visuals to a different select group
Should you find yourself using a 16bpp display while also using a
compositor, you poor soul, you may find that your GLX applications
behave strangely; in particular, glxgears will be transparent. This is
because it clears to (0,0,0,0) which is transparent if you honor alpha,
and it will choose the synthetic visual because it has the most
available r/g/b bits.
To avoid this, bump synthetic visuals to a higher (less-preferred)
select group. Unless the client explicitly asks for non-zero alpha bits,
this will prefer any rgb565 visual ahead of the argb8888 visual.
Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
(cherry picked from commit ea483af99a6351323afe00a0b630cd63310efdb1)
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 536c0c495..78e0aaff9 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -43,6 +43,7 @@
#include "glxutil.h"
#include "glxext.h"
#include "protocol-versions.h"
+#include "compositeext.h"
static DevPrivateKeyRec glxScreenPrivateKeyRec;
@@ -336,6 +337,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
if (config) {
pGlxScreen->visuals[pGlxScreen->numVisuals++] = config;
config->visualID = visual->vid;
+#ifdef COMPOSITE
+ if (compIsAlternateVisual(pScreen, visual->vid))
+ config->visualSelectGroup++;
+#endif
}
}
commit 4c64b20a629287472908ae82a05844feed209dd9
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Jan 19 17:20:49 2017 -0500
glx: Send GLX_VISUAL_SELECT_GROUP_SGIX attribute for visuals
We already send this for fbconfigs. Mesa happens to implement
glXChooseVisual relative to the fbconfig data, but that might not be
true of NVIDIA's libGL.
Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
(cherry picked from commit 43efaa6e4fd903229dc9c508da4177ad4bbdd4d8)
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 386a53410..295857b26 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1031,13 +1031,14 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
buf[p++] = modes->samples;
buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
buf[p++] = modes->sampleBuffers;
+ buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX;
+ buf[p++] = modes->visualSelectGroup;
/* Add attribute only if its value is not default. */
if (modes->sRGBCapable != GL_FALSE) {
buf[p++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT;
buf[p++] = modes->sRGBCapable;
}
- /* Don't add visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)?
- * Pad the remaining place with zeroes, so that attributes count is constant. */
+ /* Pad with zeroes, so that attributes count is constant. */
while (p < GLX_VIS_CONFIG_TOTAL) {
buf[p++] = 0;
buf[p++] = 0;
commit 0a73e7bf10d5a9373be5f057fd583c8a5e8e511f
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Jul 27 16:02:28 2017 -0400
composite: Make compIsAlternateVisual safe even if Composite is off
As of ea483af9 we're calling this unconditionally from the GLX code so
the synthetic visual is in a lower select group. If Composite has been
disabled then GetCompScreen() will return NULL, and this would crash.
Rather than force the caller to check first, just always return FALSE if
Composite is disabled (which is correct, since none of the visuals will
be synthetic in that case).
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
(cherry picked from commit f80119120c487581ac050ce741808f7c8f438f35)
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 367f23eb7..f88238146 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -326,7 +326,7 @@ compIsAlternateVisual(ScreenPtr pScreen, XID visual)
CompScreenPtr cs = GetCompScreen(pScreen);
int i;
- for (i = 0; i < cs->numAlternateVisuals; i++)
+ for (i = 0; cs && i < cs->numAlternateVisuals; i++)
if (cs->alternateVisuals[i] == visual)
return TRUE;
return FALSE;
commit 06d1c83d04a53f506ae3c8c3c86df5ae779b9ca9
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Jan 19 17:20:49 2017 -0500
composite: Export compIsAlternateVisual
Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
(cherry picked from commit ef2345aaa28461a76f77c65240ce5facc180f98e)
diff --git a/composite/compositeext.h b/composite/compositeext.h
index b96cb1d68..5aad0735e 100644
--- a/composite/compositeext.h
+++ b/composite/compositeext.h
@@ -39,6 +39,8 @@ extern _X_EXPORT Bool CompositeRegisterImplicitRedirectionException(ScreenPtr pS
VisualID parentVisual,
VisualID winVisual);
+
+extern _X_EXPORT Bool compIsAlternateVisual(ScreenPtr pScreen, XID visual);
extern _X_EXPORT RESTYPE CompositeClientWindowType;
#endif /* _COMPOSITEEXT_H_ */
diff --git a/composite/compwindow.c b/composite/compwindow.c
index fa7d5749f..367f23eb7 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -320,7 +320,7 @@ compClipNotify(WindowPtr pWin, int dx, int dy)
}
}
-static Bool
+Bool
compIsAlternateVisual(ScreenPtr pScreen, XID visual)
{
CompScreenPtr cs = GetCompScreen(pScreen);
commit c70d8e5585ddcd3c9f5b4adac15eca1f9178d3c5
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Jan 19 17:20:49 2017 -0500
composite: Remove a misleading comment
This comment is above compIsAlternateVisual, which used to be the only
thing determining whether implicit redirect was needed. It's not anymore
due to the redirection exception list. That job is now performed by
compImplicitRedirect, whose code is self-explanitory.
Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
(cherry picked from commit bccbaf7c113b1300071601879002682ebbe8b1c1)
diff --git a/composite/compwindow.c b/composite/compwindow.c
index bcd230c37..fa7d5749f 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -320,11 +320,6 @@ compClipNotify(WindowPtr pWin, int dx, int dy)
}
}
-/*
- * Returns TRUE if the window needs server-provided automatic redirect,
- * which is true if the child and parent aren't both regular or ARGB visuals
- */
-
static Bool
compIsAlternateVisual(ScreenPtr pScreen, XID visual)
{
More information about the xorg-commit
mailing list