glhd: Re-integrate with the debug system
authorJakob Bornecrantz <jakob@vmware.com>
Mon, 28 Jun 2010 19:50:51 +0000 (21:50 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Mon, 28 Jun 2010 19:52:03 +0000 (21:52 +0200)
src/gallium/auxiliary/target-helpers/inline_debug_helper.h
src/gallium/drivers/galahad/glhd_screen.c

index 1bc329c9f0caaf3ea40ffc1d0e230619d41d27ab..0433da6141d3c757aac8fd89062e876f46c0b118 100644 (file)
 #include "rbug/rbug_public.h"
 #endif
 
+#ifdef GALLIUM_GALAHAD
+#include "galahad/glhd_public.h"
+#endif
+
 static INLINE struct pipe_screen *
 debug_screen_wrap(struct pipe_screen *screen)
 {
@@ -30,6 +34,10 @@ debug_screen_wrap(struct pipe_screen *screen)
    screen = trace_screen_create(screen);
 #endif
 
+#if defined(GALLIUM_GALAHAD)
+   screen = galahad_screen_create(screen);
+#endif
+
    return screen;
 }
 
index bcc37cb633a7afbdb842afd8a7e5fdcb33f572b9..4117485702efdcfe9462eecd734e9494810b8e02 100644 (file)
@@ -36,6 +36,7 @@
 #include "glhd_context.h"
 #include "glhd_objects.h"
 
+DEBUG_GET_ONCE_BOOL_OPTION(galahad, "GALLIUM_GALAHAD", FALSE)
 
 static void
 galahad_screen_destroy(struct pipe_screen *_screen)
@@ -298,9 +299,12 @@ galahad_screen_create(struct pipe_screen *screen)
 {
    struct galahad_screen *glhd_screen;
 
+   if (!debug_get_option_galahad())
+      return screen;
+
    glhd_screen = CALLOC_STRUCT(galahad_screen);
    if (!glhd_screen) {
-      return NULL;
+      return screen;
    }
 
    glhd_screen->base.winsys = NULL;