From 64a005e3eef2e12b11b2837dc7253020bb5c0e60 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 3 May 2016 21:02:41 -0500 Subject: [PATCH] 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 Reviewed-by: Emil Velikov Reviewed-by: Eric Anholt --- src/gbm/backends/dri/gbm_dri.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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) { -- 2.30.2