summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2016-05-03 21:02:41 -0500
committerEmil Velikov <[email protected]>2016-05-23 12:07:46 +0100
commit64a005e3eef2e12b11b2837dc7253020bb5c0e60 (patch)
tree8bfe3700d3c96aca36537a9591e5437e8805fac7 /src
parent7d79eec4561b992ab2e007a67ffd1c34beb60f5d (diff)
gbm: add Android gallium_dri.so library loading support
GBM needs the same special gallium_dri.so loading as EGL for Android, so copy over the same hunk from the EGL code. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 236f2ae979b..0625422aaf3 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -341,6 +341,15 @@ dri_open_driver(struct gbm_dri_device *dri)
/* not need continue to loop all paths once the driver is found */
if (dri->driver != NULL)
break;
+
+#ifdef ANDROID
+ snprintf(path, sizeof path, "%.*s/gallium_dri.so", len, p);
+ dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
+ if (dri->driver == NULL)
+ sprintf("failed to open %s: %s\n", path, dlerror());
+ else
+ break;
+#endif
}
if (dri->driver == NULL) {