xserver: Branch 'server-1.20-branch'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 4 21:10:57 UTC 2021


 glx/glxdricommon.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 23a53f0d5460eb45f05b0b370dfcec712652598c
Author: Vasily Khoruzhick <anarsoul at gmail.com>
Date:   Fri Mar 20 20:36:25 2020 -0700

    glx: fixup symbol name for get_extensions function
    
    glxProbeDriver() concatenates __DRI_DRIVER_GET_EXTENSIONS with driver name
    to get symbol name for get_extension function. Unfortunately that doesn't
    work for drivers that have hyphen in their name, e.g. sun4i-drm --
    get_extensions() for these uses underscore instead.
    
    As result dlsym() doesn't find get_extension() function and AIGLX
    initialization fails resulting in following message in Xorg.0.log:
    
    (EE) AIGLX error: sun4i-drm does not export required DRI extension
    
    Replace all non-alpha-numeric characters with underscore to fix the issue.
    
    Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
    (cherry picked from commit b56e501092169a9c0a60663d832ee71898a8bc4b)

diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index 1baf082cf..2e00bab03 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -27,6 +27,7 @@
 #include <dix-config.h>
 #endif
 
+#include <ctype.h>
 #include <stdint.h>
 #include <errno.h>
 #include <dlfcn.h>
@@ -322,6 +323,15 @@ glxProbeDriver(const char *driverName,
                  __DRI_DRIVER_GET_EXTENSIONS, driverName) != -1) {
         const __DRIextension **(*get_extensions)(void);
 
+        for (i = 0; i < strlen(get_extensions_name); i++) {
+            /* Replace all non-alphanumeric characters with underscore,
+             * since they are not allowed in C symbol names. That fixes up
+             * symbol name for drivers with '-drm' suffix
+             */
+            if (!isalnum(get_extensions_name[i]))
+                get_extensions_name[i] = '_';
+        }
+
         get_extensions = dlsym(driver, get_extensions_name);
         if (get_extensions)
             extensions = get_extensions();


More information about the xorg-commit mailing list