summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-04-19 16:15:10 -0400
committerAdam Jackson <ajax@redhat.com>2016-04-20 16:47:33 -0400
commitf091f8a2c98a87f9681e802c72ba692b927eb9e7 (patch)
treebe4b51989f56f59aedd2312d6b83667d51abe448
parent4997dc713a5da95d6a70f626f1f7b27eb858d16a (diff)
downloadmesa-demos-f091f8a2c98a87f9681e802c72ba692b927eb9e7.zip
mesa-demos-f091f8a2c98a87f9681e802c72ba692b927eb9e7.tar.xz
eglinfo: Factor out a "probe one display" function
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/egl/opengl/eglinfo.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c
index b044eaa..875e407 100644
--- a/src/egl/opengl/eglinfo.c
+++ b/src/egl/opengl/eglinfo.c
@@ -155,19 +155,15 @@ PrintExtensions(EGLDisplay d)
printf("\n");
}
-int
-main(int argc, char *argv[])
+static int
+doOneDisplay(EGLDisplay d, const char *name)
{
int maj, min;
- EGLDisplay d;
-
- PrintExtensions(EGL_NO_DISPLAY);
-
- d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ printf("%s:\n", name);
if (!eglInitialize(d, &maj, &min)) {
printf("eglinfo: eglInitialize failed\n");
- exit(1);
+ return 1;
}
printf("EGL API version: %d.%d\n", maj, min);
@@ -180,8 +176,19 @@ main(int argc, char *argv[])
PrintExtensions(d);
PrintConfigs(d);
+ printf("\n");
+ return 0;
+}
- eglTerminate(d);
+int
+main(int argc, char *argv[])
+{
+ int ret;
- return 0;
+ PrintExtensions(EGL_NO_DISPLAY);
+ printf("\n");
+
+ ret = doOneDisplay(eglGetDisplay(EGL_DEFAULT_DISPLAY), "Default display");
+
+ return ret;
}