xserver: Branch 'master' - 2 commits

Adam Jackson ajax at kemper.freedesktop.org
Tue Sep 12 20:16:21 UTC 2017


 glx/glxdricommon.c |    7 +++++++
 glx/glxscreens.c   |    9 +++++++++
 2 files changed, 16 insertions(+)

New commits:
commit 4486d199bd3bcb5b2b8ad9bc54eb11604d9bd653
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>

diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 37929275e..f000e566d 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -275,6 +275,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 0fc26310d5b09213c65f50bde444a1758172b016
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>

diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index c35dc1d1e..96f28d021 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -158,6 +158,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;


More information about the xorg-commit mailing list