Jogamp
Change BCM VC IV detection to handle presence of vc4 DRI module
authorgohai <gottfried.haider@gmail.com>
Wed, 10 Feb 2016 14:52:13 +0000 (15:52 +0100)
committergohai <gottfried.haider@gmail.com>
Wed, 10 Feb 2016 17:56:21 +0000 (18:56 +0100)
The recent Raspbian release comes with a vc4 kernel module that can be activated with a device tree overlay. In this case, we want to use the DRI & Mesa / Gallium3D driver instead of the BCM VC IV one, whose userspace library remains in /opt/vc.

src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java

index 5da7974..cf3819b 100644 (file)
@@ -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;
http://JogAmp.org git info: FAQ, tutorial and man pages.