summaryrefslogtreecommitdiffstats
path: root/src/gbm
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2016-05-03 21:02:41 -0500
committerEmil Velikov <emil.l.velikov@gmail.com>2016-05-23 12:07:46 +0100
commit64a005e3eef2e12b11b2837dc7253020bb5c0e60 (patch)
tree8bfe3700d3c96aca36537a9591e5437e8805fac7 /src/gbm
parent7d79eec4561b992ab2e007a67ffd1c34beb60f5d (diff)
downloadexternal_mesa3d-64a005e3eef2e12b11b2837dc7253020bb5c0e60.zip
external_mesa3d-64a005e3eef2e12b11b2837dc7253020bb5c0e60.tar.gz
external_mesa3d-64a005e3eef2e12b11b2837dc7253020bb5c0e60.tar.bz2
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 <robh@kernel.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/gbm')
-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 236f2ae..0625422 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) {