[Mesa-dev] [PATCH 06/15] gbm: Add support for the new __driDriverGetExtensions interface.
Eric Anholt
eric at anholt.net
Sat Oct 12 03:03:37 CEST 2013
---
src/gbm/backends/dri/gbm_dri.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index f7da79c..0cab549 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -171,6 +171,7 @@ dri_load_driver(struct gbm_dri_device *dri)
{
const __DRIextension **extensions;
char path[PATH_MAX], *search_paths, *p, *next, *end;
+ char *get_extensions_name;
search_paths = NULL;
if (geteuid() == getuid()) {
@@ -209,7 +210,19 @@ dri_load_driver(struct gbm_dri_device *dri)
return -1;
}
- extensions = dlsym(dri->driver, __DRI_DRIVER_EXTENSIONS);
+ if (asprintf(&get_extensions_name, "%s_%s",
+ __DRI_DRIVER_GET_EXTENSIONS, dri->base.driver_name) != -1) {
+ const __DRIextension **(*get_extensions)(void);
+
+ get_extensions = dlsym(dri->driver, get_extensions_name);
+ free(get_extensions_name);
+
+ if (get_extensions)
+ extensions = get_extensions();
+ }
+
+ if (!extensions)
+ extensions = dlsym(dri->driver, __DRI_DRIVER_EXTENSIONS);
if (extensions == NULL) {
fprintf(stderr, "gbm: driver exports no extensions (%s)", dlerror());
dlclose(dri->driver);
--
1.8.4.rc3
More information about the mesa-dev
mailing list