From 4f8d1af0f6f45e4f62c9456b018e9945df1e6054 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 15 Sep 2017 17:47:07 -0700 Subject: [PATCH] i965: Add an INTEL_DEBUG=reemit option. Jason and I use this for debugging all the time. Recompiling the driver to enable it is kind of annoying. It's a great thing to try along with always_flush_batch=true and always_flush_cache=true to detect a class of problems - namely, atoms listening to an insufficient set of dirty bits. Reviewed-by: Matt Turner --- docs/envvars.html | 1 + src/intel/common/gen_debug.c | 1 + src/intel/common/gen_debug.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/envvars.html b/docs/envvars.html index 6c2bdab1554..ea42a50779b 100644 --- a/docs/envvars.html +++ b/docs/envvars.html @@ -192,6 +192,7 @@ See the Xlib software driver page for details.
  • perfmon - emit messages about AMD_performance_monitor
  • pix - emit messages about pixel operations
  • prim - emit messages about drawing primitives
  • +
  • reemit - mark all state dirty on each draw call
  • sf - emit messages about the strips & fans unit (for old gens, includes the SF program)
  • shader_time - record how much GPU time is spent in each shader
  • spill_fs - force spilling of all registers in the scalar backend (useful to debug spilling code)
  • diff --git a/src/intel/common/gen_debug.c b/src/intel/common/gen_debug.c index 4677bfd582b..f58c593c44c 100644 --- a/src/intel/common/gen_debug.c +++ b/src/intel/common/gen_debug.c @@ -83,6 +83,7 @@ static const struct debug_control debug_control[] = { { "norbc", DEBUG_NO_RBC }, { "nohiz", DEBUG_NO_HIZ }, { "color", DEBUG_COLOR }, + { "reemit", DEBUG_REEMIT }, { NULL, 0 } }; diff --git a/src/intel/common/gen_debug.h b/src/intel/common/gen_debug.h index da98f852a4b..e418e3fb166 100644 --- a/src/intel/common/gen_debug.h +++ b/src/intel/common/gen_debug.h @@ -82,6 +82,7 @@ extern uint64_t INTEL_DEBUG; #define DEBUG_NO_RBC (1ull << 38) #define DEBUG_NO_HIZ (1ull << 39) #define DEBUG_COLOR (1ull << 40) +#define DEBUG_REEMIT (1ull << 41) #ifdef HAVE_ANDROID_PLATFORM #define LOG_TAG "INTEL-MESA" diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 7b31aad170a..2834cca6392 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -480,7 +480,7 @@ brw_upload_pipeline_state(struct brw_context *brw, brw_select_pipeline(brw, pipeline); - if (0) { + if (unlikely(INTEL_DEBUG & DEBUG_REEMIT)) { /* Always re-emit all state. */ brw->NewGLState = ~0; ctx->NewDriverState = ~0ull; -- 2.30.2