aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2018-01-15 09:46:16 +0100
committerGitHub <[email protected]>2018-01-15 09:46:16 +0100
commitbd80d24b7b4322eacf806740df09801f18d05306 (patch)
tree4967b60bca1081482e448e552716c2f77ae11e4f /src/jogl/classes/jogamp
parent6532bee34f1a91ac1d87f5d105a9caaad8a8f134 (diff)
parent6665ecc942fff70667a2c3ca3d25eba54b909faa (diff)
Merge pull request #96 from gohai/vc4-module
Change BCM VC IV detection to handle presence of vc4 DRI module
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java18
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");