diff options
author | gohai <[email protected]> | 2017-02-16 11:47:14 +0100 |
---|---|---|
committer | gohai <[email protected]> | 2017-02-16 11:47:14 +0100 |
commit | 6665ecc942fff70667a2c3ca3d25eba54b909faa (patch) | |
tree | 80f352819b9458448291969fde33b72c3f6d667c /src | |
parent | 93094928489adb0b12889f7b35c75a28303e18e8 (diff) |
Change library search order for Broadcom VC IV graphics
When the VC4 DRM driver isn't loaded, we want to load the VC IV GLES2 driver, which is - unfortunately - only available as libGLESv2.so.
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java index d37efc455..6b4a3ea99 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java @@ -28,6 +28,7 @@ package jogamp.opengl.egl; +import java.io.File; import java.util.ArrayList; import java.util.List; @@ -43,6 +44,15 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl @Override public final List<List<String>> getToolLibNames() { + + // Prefer libGLESv2.so over libGLESv2.so.2 for Broadcom graphics + // when the VC4 DRM driver isn't present + final File vcliblocation = new File( + "/opt/vc/lib/libbcm_host.so"); + final File vc4modlocation = new File( + "/sys/module/vc4"); + final boolean bcm_vc_iv_quirk = vcliblocation.isFile() && !vc4modlocation.isDirectory(); + final List<List<String>> libsList = new ArrayList<List<String>>(); { final List<String> libsGL = new ArrayList<String>(); @@ -63,12 +73,18 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl libsGL.add("libGLES30"); // ES2: This is the default lib name, according to the spec - libsGL.add("libGLESv2.so.2"); + if (!bcm_vc_iv_quirk) { + libsGL.add("libGLESv2.so.2"); + } // ES2: Try these as well, if spec fails libsGL.add("libGLESv2.so"); libsGL.add("GLESv2"); + if (bcm_vc_iv_quirk) { + libsGL.add("libGLESv2.so.2"); + } + // ES2: Alternative names libsGL.add("GLES20"); libsGL.add("GLESv2_CM"); |