softpipe: use CPU flags for mapping
[mesa.git] / progs / egl / eglinfo.c
index a80df6cd9f4110f5589711932cadff5a8afebdd3..f9c24754457f1fd34f8feda54fcb8013c686fdd6 100644 (file)
@@ -33,6 +33,7 @@
 
 #define MAX_CONFIGS 1000
 #define MAX_MODES 1000
+#define MAX_SCREENS 10
 
 
 /**
@@ -47,9 +48,9 @@ PrintConfigs(EGLDisplay d)
    eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
 
    printf("Configurations:\n");
-   printf("     bf lv d st colorbuffer dp st   supported \n");
+   printf("     bf lv d st colorbuffer dp st   supported\n");
    printf("  id sz  l b ro  r  g  b  a th cl   surfaces  \n");
-   printf("----------------------------------------------\n");
+   printf("---------------------------------------------------\n");
    for (i = 0; i < numConfigs; i++) {
       EGLint id, size, level;
       EGLint red, green, blue, alpha;
@@ -76,6 +77,10 @@ PrintConfigs(EGLDisplay d)
          strcat(surfString, "pb,");
       if (surfaces & EGL_PIXMAP_BIT)
          strcat(surfString, "pix,");
+#ifdef EGL_MESA_screen_surface
+      if (surfaces & EGL_SCREEN_BIT_MESA)
+         strcat(surfString, "scrn,");
+#endif
       if (strlen(surfString) > 0)
          surfString[strlen(surfString) - 1] = 0;
 
@@ -97,12 +102,12 @@ PrintModes(EGLDisplay d)
 {
 #ifdef EGL_MESA_screen_surface
    const char *extensions = eglQueryString(d, EGL_EXTENSIONS);
-   if (strstr("EGL_MESA_screen_surface", extensions)) {
-      EGLScreenMESA screens[20];
+   if (strstr(extensions, "EGL_MESA_screen_surface")) {
+      EGLScreenMESA screens[MAX_SCREENS];
       EGLint numScreens = 1, scrn;
       EGLModeMESA modes[MAX_MODES];
 
-      eglGetScreensMESA(d, screens, 20, &numScreens);
+      eglGetScreensMESA(d, screens, MAX_SCREENS, &numScreens);
       printf("Number of Screens: %d\n\n", numScreens);
 
       for (scrn = 0; scrn < numScreens; scrn++) {
@@ -111,15 +116,17 @@ PrintModes(EGLDisplay d)
          eglGetModesMESA(d, screens[scrn], modes, MAX_MODES, &numModes);
 
          printf("Screen %d Modes:\n", scrn);
-         printf("  id width height refresh\n");
-         printf("-------------------------\n");
+         printf("  id  width height refresh  name\n");
+         printf("-----------------------------------------\n");
          for (i = 0; i < numModes; i++) {
             EGLint id, w, h, r;
+            const char *str;
             eglGetModeAttribMESA(d, modes[i], EGL_MODE_ID_MESA, &id);
             eglGetModeAttribMESA(d, modes[i], EGL_WIDTH, &w);
             eglGetModeAttribMESA(d, modes[i], EGL_HEIGHT, &h);
             eglGetModeAttribMESA(d, modes[i], EGL_REFRESH_RATE_MESA, &r);
-            printf("0x%02x %5d  %5d  %.3f\n", id, w, h, r / 1000.0);
+            str = eglQueryModeStringMESA(d, modes[i]);
+            printf("0x%02x %5d  %5d   %.3f  %s\n", id, w, h, r / 1000.0, str);
          }
       }
    }
@@ -132,7 +139,8 @@ int
 main(int argc, char *argv[])
 {
    int maj, min;
-   EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+   /*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/
+   EGLDisplay d = eglGetDisplay(":0");
 
    if (!eglInitialize(d, &maj, &min)) {
       printf("eglinfo: eglInitialize failed\n");