mesa: add bool param to _mesa_free_context_data
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_debug.c
index 3b6f0038037d79c2f41f22da96999b6157e55d05..4ac974473e26aa248c8c02bad450c091a8755fdc 100644 (file)
  *      Pauli Nieminen <suokkos@gmail.com>
  */
 
-#include "utils.h"
+#include "util/debug.h"
 
-#include "radeon_debug.h"
 #include "radeon_common_context.h"
+#include "radeon_debug.h"
 
 #include <stdarg.h>
 #include <stdio.h>
 
-static const struct dri_debug_control debug_control[] = {
+static const struct debug_control debug_control[] = {
        {"fall", RADEON_FALLBACKS},
        {"tex", RADEON_TEXTURE},
        {"ioctl", RADEON_IOCTL},
-       {"verts", RADEON_RENDER},
+       {"verts", RADEON_VERTS},
        {"render", RADEON_RENDER},
        {"swrender", RADEON_SWRENDER},
        {"state", RADEON_STATE},
@@ -57,13 +57,17 @@ static const struct dri_debug_control debug_control[] = {
        {NULL, 0}
 };
 
-radeon_debug_type_t radeon_enabled_debug_types;
+#if defined(RADEON_R200)
+radeon_debug_type_t r200_enabled_debug_types;
+#elif defined(RADEON_R100)
+radeon_debug_type_t r100_enabled_debug_types;
+#endif
 
 void radeon_init_debug(void)
 {
-       radeon_enabled_debug_types = driParseDebugString(getenv("RADEON_DEBUG"), debug_control);
+       RADEON_DEBUG = parse_debug_string(getenv("RADEON_DEBUG"), debug_control);
 
-       radeon_enabled_debug_types |= RADEON_GENERAL;
+       RADEON_DEBUG |= RADEON_GENERAL;
 }
 
 void _radeon_debug_add_indent(void)
@@ -75,7 +79,7 @@ void _radeon_debug_add_indent(void)
        if (radeon->debug.indent_depth < length - 1) {
                radeon->debug.indent[radeon->debug.indent_depth] = '\t';
                ++radeon->debug.indent_depth;
-       };
+       }
 }
 
 void _radeon_debug_remove_indent(void)
@@ -93,6 +97,8 @@ void _radeon_print(const radeon_debug_type_t type,
           const char* message,
           ...)
 {
+       va_list values;
+
        GET_CURRENT_CONTEXT(ctx);
        if (ctx) {
                radeonContextPtr radeon = RADEON_CONTEXT(ctx);
@@ -100,7 +106,6 @@ void _radeon_print(const radeon_debug_type_t type,
                if (radeon->debug.indent_depth)
                        fprintf(stderr, "%s", radeon->debug.indent);
        }
-       va_list values;
        va_start( values, message );
        vfprintf(stderr, message, values);
        va_end( values );