summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_debug.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-07-07 19:02:56 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-10-13 00:10:43 -0700
commit832bcc36133107e604a89f1762b9794fa7fc52ca (patch)
treed4d4a1391bba7ac17897967db186bd4a93b7da87 /src/mesa/drivers/dri/i965/intel_debug.c
parent3f7b4e5d04cf9f0274ddcd37d573eb96f835278e (diff)
downloadexternal_mesa3d-832bcc36133107e604a89f1762b9794fa7fc52ca.zip
external_mesa3d-832bcc36133107e604a89f1762b9794fa7fc52ca.tar.gz
external_mesa3d-832bcc36133107e604a89f1762b9794fa7fc52ca.tar.bz2
i965: Pull out INTEL_DEBUG handling into new intel_debug.[ch] files.
Now that there isn't an intel_context structure, the split between brw_context.[ch] and intel_context.[ch] is rather awkward and arbitrary. Removing intel_context.[ch] seems desirable, but not everything really belongs in brw_context.[ch], either. Moving INTEL_DEBUG handling into separate intel_debug.[ch] files should make them relatively easy to find. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_debug.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_debug.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_debug.c b/src/mesa/drivers/dri/i965/intel_debug.c
new file mode 100644
index 0000000..03abdfa
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_debug.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file intel_debug.c
+ *
+ * Support for the INTEL_DEBUG environment variable, along with other
+ * miscellaneous debugging code.
+ */
+
+#include "brw_context.h"
+#include "intel_debug.h"
+#include "utils.h"
+
+int INTEL_DEBUG = 0;
+
+static const struct dri_debug_control debug_control[] = {
+ { "tex", DEBUG_TEXTURE},
+ { "state", DEBUG_STATE},
+ { "ioctl", DEBUG_IOCTL},
+ { "blit", DEBUG_BLIT},
+ { "mip", DEBUG_MIPTREE},
+ { "fall", DEBUG_PERF},
+ { "perf", DEBUG_PERF},
+ { "bat", DEBUG_BATCH},
+ { "pix", DEBUG_PIXEL},
+ { "buf", DEBUG_BUFMGR},
+ { "reg", DEBUG_REGION},
+ { "fbo", DEBUG_FBO},
+ { "fs", DEBUG_WM },
+ { "gs", DEBUG_GS},
+ { "sync", DEBUG_SYNC},
+ { "prim", DEBUG_PRIMS },
+ { "vert", DEBUG_VERTS },
+ { "dri", DEBUG_DRI },
+ { "sf", DEBUG_SF },
+ { "stats", DEBUG_STATS },
+ { "wm", DEBUG_WM },
+ { "urb", DEBUG_URB },
+ { "vs", DEBUG_VS },
+ { "clip", DEBUG_CLIP },
+ { "aub", DEBUG_AUB },
+ { "shader_time", DEBUG_SHADER_TIME },
+ { "no16", DEBUG_NO16 },
+ { "blorp", DEBUG_BLORP },
+ { NULL, 0 }
+};
+
+void
+brw_process_intel_debug_variable(struct brw_context *brw)
+{
+ INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
+ if (INTEL_DEBUG & DEBUG_BUFMGR)
+ dri_bufmgr_set_debug(brw->bufmgr, true);
+
+ if ((INTEL_DEBUG & DEBUG_SHADER_TIME) && brw->gen < 7) {
+ fprintf(stderr,
+ "shader_time debugging requires gen7 (Ivybridge) or better.\n");
+ INTEL_DEBUG &= ~DEBUG_SHADER_TIME;
+ }
+
+ if (INTEL_DEBUG & DEBUG_PERF)
+ brw->perf_debug = true;
+
+ if (INTEL_DEBUG & DEBUG_AUB)
+ drm_intel_bufmgr_gem_set_aub_dump(brw->bufmgr, true);
+}