Mesa (master): vc4: Make the miptree debug code available under VC4_DEBUG= surf
Eric Anholt
anholt at kemper.freedesktop.org
Wed Jul 12 18:06:09 UTC 2017
Module: Mesa
Branch: master
Commit: 111b6b77cb3147b12fd7907d75309e0bf023ced0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=111b6b77cb3147b12fd7907d75309e0bf023ced0
Author: Eric Anholt <eric at anholt.net>
Date: Wed Jun 28 17:39:34 2017 -0700
vc4: Make the miptree debug code available under VC4_DEBUG=surf
I kept flipping the bool on for debug, so let's just make it available.
Reviewed-by: Daniel Stone <daniels at collabora.com>
---
src/gallium/drivers/vc4/vc4_resource.c | 8 +++-----
src/gallium/drivers/vc4/vc4_screen.c | 2 ++
src/gallium/drivers/vc4/vc4_screen.h | 1 +
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index f13b1da931..30d3231850 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -34,8 +34,6 @@
#include "vc4_resource.h"
#include "vc4_tiling.h"
-static bool miptree_debug = false;
-
static bool
vc4_resource_bo_alloc(struct vc4_resource *rsc)
{
@@ -43,7 +41,7 @@ vc4_resource_bo_alloc(struct vc4_resource *rsc)
struct pipe_screen *pscreen = prsc->screen;
struct vc4_bo *bo;
- if (miptree_debug) {
+ if (vc4_debug & VC4_DEBUG_SURFACE) {
fprintf(stderr, "alloc %p: size %d + offset %d -> %d\n",
rsc,
rsc->slices[0].size,
@@ -482,7 +480,7 @@ vc4_setup_slices(struct vc4_resource *rsc)
offset += slice->size;
- if (miptree_debug) {
+ if (vc4_debug & VC4_DEBUG_SURFACE) {
static const char tiling_chars[] = {
[VC4_TILING_FORMAT_LINEAR] = 'R',
[VC4_TILING_FORMAT_LT] = 'L',
@@ -680,7 +678,7 @@ vc4_resource_from_handle(struct pipe_screen *pscreen,
goto fail;
}
- if (miptree_debug) {
+ if (vc4_debug & VC4_DEBUG_SURFACE) {
fprintf(stderr,
"rsc import %p (format %d), %dx%d: "
"level 0 (R) -> stride %d at 0x%08x\n",
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index cbeb6830de..07395487d7 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -43,6 +43,8 @@
static const struct debug_named_value debug_options[] = {
{ "cl", VC4_DEBUG_CL,
"Dump command list during creation" },
+ { "surf", VC4_DEBUG_SURFACE,
+ "Dump surface layouts" },
{ "qpu", VC4_DEBUG_QPU,
"Dump generated QPU instructions" },
{ "qir", VC4_DEBUG_QIR,
diff --git a/src/gallium/drivers/vc4/vc4_screen.h b/src/gallium/drivers/vc4/vc4_screen.h
index 295633db46..7887adee94 100644
--- a/src/gallium/drivers/vc4/vc4_screen.h
+++ b/src/gallium/drivers/vc4/vc4_screen.h
@@ -48,6 +48,7 @@ struct vc4_bo;
#define VC4_DEBUG_ALWAYS_SYNC 0x0100
#define VC4_DEBUG_NIR 0x0200
#define VC4_DEBUG_DUMP 0x0400
+#define VC4_DEBUG_SURFACE 0x0800
#define VC4_MAX_MIP_LEVELS 12
#define VC4_MAX_TEXTURE_SAMPLERS 16
More information about the mesa-commit
mailing list