Mesa (master): r300g: Surface debug.
Corbin Simpson
csimpson at kemper.freedesktop.org
Tue Oct 13 07:12:40 UTC 2009
Module: Mesa
Branch: master
Commit: a4a4f7abc2137754646a811007696321c7714f1b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4a4f7abc2137754646a811007696321c7714f1b
Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date: Mon Oct 12 20:55:57 2009 -0700
r300g: Surface debug.
It gets really annoying watching r300g tell me how it's filling surfaces.
Or falling back during filling surfaces.
---
src/gallium/drivers/r300/r300_context.h | 1 +
src/gallium/drivers/r300/r300_debug.c | 1 +
src/gallium/drivers/r300/r300_surface.c | 12 ++++++------
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 52b1c9a..a817459 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -312,6 +312,7 @@ void r300_init_surface_functions(struct r300_context* r300);
#define DBG_VP 0x0000004
#define DBG_CS 0x0000008
#define DBG_DRAW 0x0000010
+#define DBG_SURF 0x0000020
/*@}*/
static INLINE boolean DBG_ON(struct r300_context * ctx, unsigned flags)
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c
index 85d69c0..4a55a0c 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -37,6 +37,7 @@ static struct debug_option debug_options[] = {
{ "vp", DBG_VP, "Vertex program handling" },
{ "cs", DBG_CS, "Command submissions" },
{ "draw", DBG_DRAW, "Draw and emit" },
+ { "surf", DBG_SURF, "Surface drawing" },
{ "all", ~0, "Convenience option that enables all debug flags" },
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index 4d0ccd6..a263b26 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -108,7 +108,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
r = (float)((color >> 16) & 0xff) / 255.0f;
g = (float)((color >> 8) & 0xff) / 255.0f;
b = (float)((color >> 0) & 0xff) / 255.0f;
- debug_printf("r300: Filling surface %p at (%d,%d),"
+ DBG(r300, DBG_SURF, "r300: Filling surface %p at (%d,%d),"
" dimensions %dx%d (pixel pitch %d), color 0x%x\n",
dest, x, y, w, h, pixpitch, color);
@@ -116,7 +116,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
if (!pipe->screen->is_format_supported(pipe->screen, dest->format,
PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
fallback:
- debug_printf("r300: Falling back on surface clear...\n");
+ DBG(r300, DBG_SURF, "r300: Falling back on surface clear...\n");
util_surface_fill(pipe, dest, x, y, w, h, color);
return;
}
@@ -131,7 +131,7 @@ validate:
if (!r300->winsys->validate(r300->winsys)) {
r300->context.flush(&r300->context, 0, NULL);
if (invalid) {
- debug_printf("r300: Stuck in validation loop, gonna fallback.");
+ DBG(r300, DBG_SURF, "r300: Stuck in validation loop, gonna fallback.");
goto fallback;
}
invalid = TRUE;
@@ -239,7 +239,7 @@ static void r300_surface_copy(struct pipe_context* pipe,
float fsrcx = srcx, fsrcy = srcy, fdestx = destx, fdesty = desty;
CS_LOCALS(r300);
- debug_printf("r300: Copying surface %p at (%d,%d) to %p at (%d, %d),"
+ DBG(r300, DBG_SURF, "r300: Copying surface %p at (%d,%d) to %p at (%d, %d),"
" dimensions %dx%d (pixel pitch %d)\n",
src, srcx, srcy, dest, destx, desty, w, h, pixpitch);
@@ -254,7 +254,7 @@ static void r300_surface_copy(struct pipe_context* pipe,
!pipe->screen->is_format_supported(pipe->screen, dest->format,
PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
fallback:
- debug_printf("r300: Falling back on surface_copy\n");
+ DBG(r300, DBG_SURF, "r300: Falling back on surface_copy\n");
util_surface_copy(pipe, FALSE, dest, destx, desty, src,
srcx, srcy, w, h);
return;
@@ -275,7 +275,7 @@ validate:
if (!r300->winsys->validate(r300->winsys)) {
r300->context.flush(&r300->context, 0, NULL);
if (invalid) {
- debug_printf("r300: Stuck in validation loop, gonna fallback.");
+ DBG(r300, DBG_SURF, "r300: Stuck in validation loop, gonna fallback.");
goto fallback;
}
invalid = TRUE;
More information about the mesa-commit
mailing list