android: try to load gallium_dri.so directly
authorChih-Wei Huang <cwhuang@android-x86.org>
Wed, 20 May 2015 03:25:30 +0000 (11:25 +0800)
committerEric Anholt <eric@anholt.net>
Tue, 9 Jun 2015 19:25:15 +0000 (12:25 -0700)
This avoids needing hardlinks between all of the DRI driver .so names,
since we're the only loader on the system.

v2: Add early exit on success (like previous block) and log message on
    failure.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/egl/drivers/dri2/egl_dri2.c

index 82f8843e001a0e846c046a4163d8196631a67967..44a6c96ae9a7fa9ceca77cd4dee715eb6ac0facb 100644 (file)
@@ -419,6 +419,15 @@ dri2_open_driver(_EGLDisplay *disp)
       /* not need continue to loop all paths once the driver is found */
       if (dri2_dpy->driver != NULL)
          break;
+
+#ifdef ANDROID
+      snprintf(path, sizeof path, "%.*s/gallium_dri.so", len, p);
+      dri2_dpy->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
+      if (dri2_dpy->driver == NULL)
+         _eglLog(_EGL_DEBUG, "failed to open %s: %s\n", path, dlerror());
+      else
+         break;
+#endif
    }
 
    if (dri2_dpy->driver == NULL) {