st/egl: improve error logging
authorChia-I Wu <olvaffe@gmail.com>
Thu, 4 Aug 2011 02:49:42 +0000 (11:49 +0900)
committerChia-I Wu <olvaffe@gmail.com>
Sat, 20 Aug 2011 18:01:50 +0000 (02:01 +0800)
This helps diagnose problems in EGL initialization.

src/gallium/state_trackers/egl/android/native_android.cpp
src/gallium/targets/egl-static/egl.c

index 2d7ae8b58bdd9a882474b802c70ab91654533ed7..9d2d51fd6d1f78473db26bd59a6c1954aa90bdd7 100644 (file)
@@ -24,7 +24,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#define LOG_TAG "MESA-EGL"
+#define LOG_TAG "EGL-GALLIUM"
 #include <cutils/log.h>
 #include <cutils/properties.h>
 #include <hardware/gralloc.h>
@@ -599,7 +599,8 @@ android_display_init_drm(struct native_display *ndpy)
       return TRUE;
    }
    else {
-      LOGE("failed to create DRM screen");
+      LOGW("failed to create DRM screen");
+      LOGW("will fall back to other EGL drivers if any");
       return FALSE;
    }
 }
index 6e5f6f30b11ac694a8e19ece8250ed1555276000..a7aee27238b100a79c0b0392f0cb4d44f3947b36 100644 (file)
@@ -221,13 +221,21 @@ drm_fd_get_screen_name(int fd)
 static struct pipe_screen *
 create_drm_screen(const char *name, int fd)
 {
+   struct pipe_screen *screen;
+
    if (!name) {
       name = drm_fd_get_screen_name(fd);
       if (!name)
          return NULL;
    }
 
-   return egl_pipe_create_drm_screen(name, fd);
+   screen = egl_pipe_create_drm_screen(name, fd);
+   if (screen)
+      _eglLog(_EGL_INFO, "created a pipe screen for %s", name);
+   else
+      _eglLog(_EGL_WARNING, "failed to create a pipe screen for %s", name);
+
+   return screen;
 }
 
 static struct pipe_screen *