Skip to content

Commit

Permalink
VC4: Only load Broadcom EGL driver when guessVCIVUsed
Browse files Browse the repository at this point in the history
Broadcom VC IV can be used from
both console and from inside X11

When used from inside X11
rendering is done on an DispmanX overlay surface
while keeping an X11 nativewindow under as input.

When Broadcom VC IV is guessed
only the Broadcom DispmanX EGL driver is loaded.
Therefore standard TYPE_X11 EGL can not be used.
  • Loading branch information
xranby committed Dec 3, 2019
1 parent d3f454a commit 164db66
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 44 deletions.
Expand Up @@ -105,22 +105,20 @@ protected final List<String> getEGLLibNamesList() {
*/
final boolean bcm_vc_iv_quirk = BcmVCArtifacts.guessVCIVUsed(false);

// this is the default EGL lib name, according to the spec
if(!bcm_vc_iv_quirk) {
// this is the default EGL lib name, according to the spec
eglLibNames.add("libEGL.so.1");
}

// try these as well, if spec fails
eglLibNames.add("libEGL.so");
eglLibNames.add("EGL");

// for windows distributions using the 'unlike' lib prefix,
// where our tool does not add it.
eglLibNames.add("libEGL");
// try these as well, if spec fails
eglLibNames.add("libEGL.so");
eglLibNames.add("EGL");

if(bcm_vc_iv_quirk) {
// for windows distributions using the 'unlike' lib prefix,
// where our tool does not add it.
eglLibNames.add("libEGL");
} else {
eglLibNames.add("libbrcmEGL.so");
}
}

return eglLibNames;
}
Expand Down
Expand Up @@ -57,43 +57,41 @@ public final List<List<String>> getToolLibNames() {
*/
final boolean bcm_vc_iv_quirk = BcmVCArtifacts.guessVCIVUsed(false);

// ES3: This is the default lib name, according to the spec
libsGL.add("libGLESv3.so.3");
if (bcm_vc_iv_quirk) {
libsGL.add("libbrcmGLESv2.so");
} else {
// ES3: This is the default lib name, according to the spec
libsGL.add("libGLESv3.so.3");

// ES3: Try these as well, if spec fails
libsGL.add("libGLESv3.so");
libsGL.add("GLESv3");
// ES3: Try these as well, if spec fails
libsGL.add("libGLESv3.so");
libsGL.add("GLESv3");

// ES3: Alternative names
libsGL.add("GLES30");
// ES3: Alternative names
libsGL.add("GLES30");

// ES3: For windows distributions using the 'unlike' lib prefix
// where our tool does not add it.
libsGL.add("libGLESv3");
libsGL.add("libGLES30");
// ES3: For windows distributions using the 'unlike' lib prefix
// where our tool does not add it.
libsGL.add("libGLESv3");
libsGL.add("libGLES30");

// ES2: This is the default lib name, according to the spec
if (!bcm_vc_iv_quirk) {
// ES2: This is the default lib name, according to the spec
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("libbrcmGLESv2.so");
}
// ES2: Try these as well, if spec fails
libsGL.add("libGLESv2.so");
libsGL.add("GLESv2");

// ES2: Alternative names
libsGL.add("GLES20");
libsGL.add("GLESv2_CM");
// ES2: Alternative names
libsGL.add("GLES20");
libsGL.add("GLESv2_CM");

// ES2: For windows distributions using the 'unlike' lib prefix
// where our tool does not add it.
libsGL.add("libGLESv2");
libsGL.add("libGLESv2_CM");
libsGL.add("libGLES20");
// ES2: For windows distributions using the 'unlike' lib prefix
// where our tool does not add it.
libsGL.add("libGLESv2");
libsGL.add("libGLESv2_CM");
libsGL.add("libGLES20");
}

libsList.add(libsGL);
}
Expand Down
Expand Up @@ -174,7 +174,20 @@ private static String _getNativeWindowingType(final boolean debug) {
guessGBM(true);
BcmVCArtifacts.guessVCIVUsed(true);
}

if( BcmVCArtifacts.guessVCIVUsed(false) ) {
/* Broadcom VC IV can be used from
* both console and from inside X11
*
* When used from inside X11
* rendering is done on an DispmanX overlay surface
* while keeping an X11 nativewindow under as input.
*
* When Broadcom VC IV is guessed
* only the Broadcom DispmanX EGL driver is loaded.
* Therefore standard TYPE_X11 EGL can not be used.
*/
return TYPE_BCM_VC_IV;
}
if( guessX(false) ) {
return TYPE_X11;
}
Expand All @@ -185,9 +198,6 @@ private static String _getNativeWindowingType(final boolean debug) {
if( guessGBM(false) ) {
return TYPE_DRM_GBM;
}
if( BcmVCArtifacts.guessVCIVUsed(false) ) {
return TYPE_BCM_VC_IV;
}
return TYPE_X11;
}
}
Expand Down

0 comments on commit 164db66

Please sign in to comment.