summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2024-04-18 15:42:29 -0400
committerMatt Turner <mattst88@gmail.com>2024-04-18 16:02:54 -0400
commitd4a924d9e31e8ff86f81e885c123888b6d3ba21e (patch)
tree22241ff421736eacfcc44f7c511d68750f34f38d
parent292e6a81e35e3807bf968f0692ea7586056ad2b3 (diff)
eglinfo: Handle EGL_EXT_platform_base without a platform extmain
The proprietary Mali drivers advertise EGL_EXT_platform_base without advertising a platform extension such as EGL_KHR_platform_gbm. This allows the eglinfo to fall back the the older code path in this case. Otherwise, eglinfo only prints the client extensions and nothing more.
-rw-r--r--src/egl/opengl/eglinfo.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c
index fe01917b..929f110f 100644
--- a/src/egl/opengl/eglinfo.c
+++ b/src/egl/opengl/eglinfo.c
@@ -28,6 +28,7 @@
#define EGL_PLATFORM_ANGLE_ANGLE 0x3202
#include <assert.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -873,6 +874,7 @@ doExtExplicitDevice(struct options opts, const char *clientext)
static int
doExtPlatformBase(struct options opts, const char *clientext)
{
+ bool found_platform_ext = false;
int ret = 0;
for (int i = 0; i < ELEMENTS(platforms); i++) {
@@ -890,11 +892,15 @@ doExtPlatformBase(struct options opts, const char *clientext)
EGL_DEFAULT_DISPLAY,
NULL);
ret += doOneDisplay(d, platforms[i].human_name, opts);
+ found_platform_ext = true;
break;
}
}
}
+ if (!found_platform_ext)
+ return -1;
+
if (strstr(clientext, "EGL_EXT_device_enumeration") &&
strstr(clientext, "EGL_EXT_platform_device") &&
opts.platform == ALL)
@@ -925,8 +931,10 @@ main(int argc, char *argv[])
ret += doExtExplicitDevice(opts, clientext);
}
- if (strstr(clientext, "EGL_EXT_platform_base")) {
- ret += doExtPlatformBase(opts, clientext);
+ int platform_base_ret;
+ if (strstr(clientext, "EGL_EXT_platform_base") &&
+ (platform_base_ret = doExtPlatformBase(opts, clientext)) >= 0) {
+ ret += platform_base_ret;
} else {
ret = doOneDisplay(eglGetDisplay(EGL_DEFAULT_DISPLAY), "Default display", opts);
}