Mesa (master): eglinfo: Also print visual type, assuming X visual types
Kristian Høgsberg
krh at kemper.freedesktop.org
Wed Feb 10 02:25:31 UTC 2010
Module: Mesa
Branch: master
Commit: 368bb3dc2b640f862b857b2329499cad34a78846
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=368bb3dc2b640f862b857b2329499cad34a78846
Author: Kristian Høgsberg <krh at bitplanet.net>
Date: Tue Feb 9 19:59:33 2010 -0500
eglinfo: Also print visual type, assuming X visual types
This may not make a lot of sense for non-X EGL, but for EGL under X
it's very useful.
---
progs/egl/eglinfo.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c
index 9664667..37bc22e 100644
--- a/progs/egl/eglinfo.c
+++ b/progs/egl/eglinfo.c
@@ -37,6 +37,10 @@
#define MAX_MODES 1000
#define MAX_SCREENS 10
+/* These are X visual types, so if you're running eglinfo under
+ * something not X, they probably don't make sense. */
+static const char *vnames[] = { "SG", "GS", "SC", "PC", "TC", "DC" };
+
/**
* Print table of all available configurations.
*/
@@ -49,15 +53,15 @@ PrintConfigs(EGLDisplay d)
eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
printf("Configurations:\n");
- printf(" bf lv colorbuffer dp st ms vis cav bi renderable supported\n");
- printf(" id sz l r g b a th cl ns b id eat nd gl es es2 vg surfaces \n");
+ printf(" bf lv colorbuffer dp st ms vis cav bi renderable supported\n");
+ printf(" id sz l r g b a th cl ns b id eat nd gl es es2 vg surfaces \n");
printf("---------------------------------------------------------------------\n");
for (i = 0; i < numConfigs; i++) {
EGLint id, size, level;
EGLint red, green, blue, alpha;
EGLint depth, stencil;
EGLint renderable, surfaces;
- EGLint vid, caveat, bindRgb, bindRgba;
+ EGLint vid, vtype, caveat, bindRgb, bindRgba;
EGLint samples, sampleBuffers;
char surfString[100] = "";
@@ -72,6 +76,7 @@ PrintConfigs(EGLDisplay d)
eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil);
eglGetConfigAttrib(d, configs[i], EGL_NATIVE_VISUAL_ID, &vid);
+ eglGetConfigAttrib(d, configs[i], EGL_NATIVE_VISUAL_TYPE, &vtype);
eglGetConfigAttrib(d, configs[i], EGL_CONFIG_CAVEAT, &caveat);
eglGetConfigAttrib(d, configs[i], EGL_BIND_TO_TEXTURE_RGB, &bindRgb);
@@ -95,11 +100,11 @@ PrintConfigs(EGLDisplay d)
if (strlen(surfString) > 0)
surfString[strlen(surfString) - 1] = 0;
- printf("0x%02x %2d %2d %2d %2d %2d %2d %2d %2d %2d%2d 0x%03x ",
+ printf("0x%02x %2d %2d %2d %2d %2d %2d %2d %2d %2d%2d 0x%02x%s ",
id, size, level,
red, green, blue, alpha,
depth, stencil,
- samples, sampleBuffers, vid);
+ samples, sampleBuffers, vid, vtype < 6 ? vnames[vtype] : "--");
printf(" %c %c %c %c %c %c %s\n",
(caveat != EGL_NONE) ? 'y' : ' ',
(bindRgba) ? 'a' : (bindRgb) ? 'y' : ' ',
More information about the mesa-commit
mailing list