diff options
author | Sven Gothel <[email protected]> | 2018-01-15 09:46:16 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-01-15 09:46:16 +0100 |
commit | bd80d24b7b4322eacf806740df09801f18d05306 (patch) | |
tree | 4967b60bca1081482e448e552716c2f77ae11e4f | |
parent | 6532bee34f1a91ac1d87f5d105a9caaad8a8f134 (diff) | |
parent | 6665ecc942fff70667a2c3ca3d25eba54b909faa (diff) |
Merge pull request #96 from gohai/vc4-module
Change BCM VC IV detection to handle presence of vc4 DRI module
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java | 18 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java | 4 |
2 files changed, 20 insertions, 2 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"); diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java index 9cc15c650..448c9d2bf 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java @@ -140,9 +140,11 @@ public abstract class NativeWindowFactory { return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { private final File vcliblocation = new File( "/opt/vc/lib/libbcm_host.so"); + private final File vc4modlocation = new File( + "/sys/module/vc4"); @Override public Boolean run() { - if ( vcliblocation.isFile() ) { + if ( vcliblocation.isFile() && !vc4modlocation.isDirectory() ) { return Boolean.TRUE; } return Boolean.FALSE; |