summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java18
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java4
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;