From: Marcin Ślusarz Date: Mon, 14 Sep 2020 16:43:50 +0000 (+0200) Subject: intel: add INTEL_DEBUG expected value in declaration X-Git-Tag: upstream/21.0.0~4599 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4015e1876a77162e3444eeaa29a0dfbc47efe90e;p=platform%2Fupstream%2Fmesa.git intel: add INTEL_DEBUG expected value in declaration Signed-off-by: Marcin Ślusarz Acked-by: Lionel Landwerlin Reviewed-by: Matt Turner Reviewed-by: Eric Anholt Part-of: --- diff --git a/src/intel/dev/gen_debug.c b/src/intel/dev/gen_debug.c index 3671ba1..a270b9b 100644 --- a/src/intel/dev/gen_debug.c +++ b/src/intel/dev/gen_debug.c @@ -39,7 +39,7 @@ #include "util/debug.h" #include "c11/threads.h" -uint64_t INTEL_DEBUG = 0; +uint64_t intel_debug = 0; static const struct debug_control debug_control[] = { { "tex", DEBUG_TEXTURE}, @@ -117,7 +117,7 @@ intel_debug_flag_for_shader_stage(gl_shader_stage stage) static void brw_process_intel_debug_variable_once(void) { - INTEL_DEBUG = parse_debug_string(getenv("INTEL_DEBUG"), debug_control); + intel_debug = parse_debug_string(getenv("INTEL_DEBUG"), debug_control); } void diff --git a/src/intel/dev/gen_debug.h b/src/intel/dev/gen_debug.h index 616d473..6102e54 100644 --- a/src/intel/dev/gen_debug.h +++ b/src/intel/dev/gen_debug.h @@ -28,6 +28,7 @@ #include #include "compiler/shader_enums.h" +#include "util/macros.h" #ifdef __cplusplus extern "C" { @@ -39,7 +40,9 @@ extern "C" { * list of debugging flags, as well as some macros for handling them. */ -extern uint64_t INTEL_DEBUG; +extern uint64_t intel_debug; + +#define INTEL_DEBUG __builtin_expect(intel_debug, 0) #define DEBUG_TEXTURE (1ull << 0) #define DEBUG_STATE (1ull << 1) diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 1fb4330..2025f51 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -2574,7 +2574,7 @@ __DRIconfig **intelInitScreen2(__DRIscreen *dri_screen) if ((INTEL_DEBUG & DEBUG_SHADER_TIME) && devinfo->gen < 7) { fprintf(stderr, "shader_time debugging requires gen7 (Ivybridge) or better.\n"); - INTEL_DEBUG &= ~DEBUG_SHADER_TIME; + intel_debug &= ~DEBUG_SHADER_TIME; } if (intel_get_integer(screen, I915_PARAM_MMAP_GTT_VERSION) >= 1) {