X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi965%2Fintel_debug.c;h=33e840293a21d8bd7ca69d03e87f79d3409f9f7c;hb=0e657b7b55bc7c83c8eb5258cd9522b0e5e581b7;hp=58f41bfd55dd842f231e489a77abbf4e454ffb9f;hpb=9b387b5d3f4103c51079ea5298d33086af6da433;p=mesa.git diff --git a/src/mesa/drivers/dri/i965/intel_debug.c b/src/mesa/drivers/dri/i965/intel_debug.c index 58f41bfd55d..33e840293a2 100644 --- a/src/mesa/drivers/dri/i965/intel_debug.c +++ b/src/mesa/drivers/dri/i965/intel_debug.c @@ -31,12 +31,12 @@ #include "brw_context.h" #include "intel_debug.h" -#include "utils.h" #include "util/u_atomic.h" /* for p_atomic_cmpxchg */ +#include "util/debug.h" uint64_t INTEL_DEBUG = 0; -static const struct dri_debug_control debug_control[] = { +static const struct debug_control debug_control[] = { { "tex", DEBUG_TEXTURE}, { "state", DEBUG_STATE}, { "blit", DEBUG_BLIT}, @@ -60,7 +60,7 @@ static const struct dri_debug_control debug_control[] = { { "urb", DEBUG_URB }, { "vs", DEBUG_VS }, { "clip", DEBUG_CLIP }, - { "foob", DEBUG_AUB }, /* disable aub dumbing in the dri driver */ + { "aub", DEBUG_AUB }, { "shader_time", DEBUG_SHADER_TIME }, { "no16", DEBUG_NO16 }, { "blorp", DEBUG_BLORP }, @@ -68,9 +68,19 @@ static const struct dri_debug_control debug_control[] = { { "optimizer", DEBUG_OPTIMIZER }, { "ann", DEBUG_ANNOTATION }, { "no8", DEBUG_NO8 }, - { "vec4vs", DEBUG_VEC4VS }, - { "spill", DEBUG_SPILL }, + { "vec4", DEBUG_VEC4VS }, + { "spill_fs", DEBUG_SPILL_FS }, + { "spill_vec4", DEBUG_SPILL_VEC4 }, { "cs", DEBUG_CS }, + { "hex", DEBUG_HEX }, + { "nocompact", DEBUG_NO_COMPACTION }, + { "hs", DEBUG_TCS }, + { "tcs", DEBUG_TCS }, + { "ds", DEBUG_TES }, + { "tes", DEBUG_TES }, + { "l3", DEBUG_L3 }, + { "do32", DEBUG_DO32 }, + { "norbc", DEBUG_NO_RBC }, { NULL, 0 } }; @@ -79,8 +89,8 @@ intel_debug_flag_for_shader_stage(gl_shader_stage stage) { uint64_t flags[] = { [MESA_SHADER_VERTEX] = DEBUG_VS, - [MESA_SHADER_TESS_CTRL] = 0, - [MESA_SHADER_TESS_EVAL] = 0, + [MESA_SHADER_TESS_CTRL] = DEBUG_TCS, + [MESA_SHADER_TESS_EVAL] = DEBUG_TES, [MESA_SHADER_GEOMETRY] = DEBUG_GS, [MESA_SHADER_FRAGMENT] = DEBUG_WM, [MESA_SHADER_COMPUTE] = DEBUG_CS, @@ -90,45 +100,8 @@ intel_debug_flag_for_shader_stage(gl_shader_stage stage) } void -brw_process_intel_debug_variable(struct intel_screen *screen) +brw_process_intel_debug_variable(void) { - uint64_t intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control); + uint64_t intel_debug = parse_debug_string(getenv("INTEL_DEBUG"), debug_control); (void) p_atomic_cmpxchg(&INTEL_DEBUG, 0, intel_debug); - - if (INTEL_DEBUG & DEBUG_BUFMGR) - dri_bufmgr_set_debug(screen->bufmgr, true); - - if ((INTEL_DEBUG & DEBUG_SHADER_TIME) && screen->devinfo->gen < 7) { - fprintf(stderr, - "shader_time debugging requires gen7 (Ivybridge) or better.\n"); - INTEL_DEBUG &= ~DEBUG_SHADER_TIME; - } - - if (INTEL_DEBUG & DEBUG_AUB) - drm_intel_bufmgr_gem_set_aub_dump(screen->bufmgr, true); -} - -/** - * Reads an environment variable and interprets its value as a boolean. - * - * Recognizes 0/false/no and 1/true/yes. Other values result in the default value. - */ -bool -brw_env_var_as_boolean(const char *var_name, bool default_value) -{ - const char *str = getenv(var_name); - if (str == NULL) - return default_value; - - if (strcmp(str, "1") == 0 || - strcasecmp(str, "true") == 0 || - strcasecmp(str, "yes") == 0) { - return true; - } else if (strcmp(str, "0") == 0 || - strcasecmp(str, "false") == 0 || - strcasecmp(str, "no") == 0) { - return false; - } else { - return default_value; - } }