gbm: add Android gallium_dri.so library loading support
authorRob Herring <robh@kernel.org>
Wed, 4 May 2016 02:02:41 +0000 (21:02 -0500)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 23 May 2016 11:07:46 +0000 (12:07 +0100)
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>
src/gbm/backends/dri/gbm_dri.c

index 236f2ae979b64213d874ae1ee36269288edcbdd8..0625422aaf3b9dad5ad0bb83a18fff162a7eaff7 100644 (file)
@@ -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) {