Commit b56e5010 authored by Vasily Khoruzhick's avatar Vasily Khoruzhick Committed by Adam Jackson
Browse files

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's avatarVasily Khoruzhick <>
parent 5e915873
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <dix-config.h> #include <dix-config.h>
#endif #endif
#include <ctype.h>
#include <stdint.h> #include <stdint.h>
#include <errno.h> #include <errno.h>
#include <dlfcn.h> #include <dlfcn.h>
...@@ -322,6 +323,15 @@ glxProbeDriver(const char *driverName, ...@@ -322,6 +323,15 @@ glxProbeDriver(const char *driverName,
__DRI_DRIVER_GET_EXTENSIONS, driverName) != -1) { __DRI_DRIVER_GET_EXTENSIONS, driverName) != -1) {
const __DRIextension **(*get_extensions)(void); 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); get_extensions = dlsym(driver, get_extensions_name);
if (get_extensions) if (get_extensions)
extensions = get_extensions(); extensions = get_extensions();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment