[Mesa-dev] [PATCH 2/4] r600g: add a debug flag for printing virtual addresses of resources
Marek Olšák
maraeo at gmail.com
Thu Apr 11 03:43:27 PDT 2013
---
src/gallium/drivers/r600/r600_buffer.c | 7 +++++++
src/gallium/drivers/r600/r600_pipe.c | 1 +
src/gallium/drivers/r600/r600_pipe.h | 1 +
src/gallium/drivers/r600/r600_texture.c | 8 ++++++++
4 files changed, 17 insertions(+)
diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c
index e46f7fd..a977b02 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -279,6 +279,13 @@ bool r600_init_resource(struct r600_screen *rscreen,
res->cs_buf = rscreen->ws->buffer_get_cs_handle(res->buf);
res->domains = domains;
util_range_set_empty(&res->valid_buffer_range);
+
+ if (rscreen->debug_flags & DBG_VM && res->b.b.target == PIPE_BUFFER) {
+ fprintf(stderr, "VM start=0x%llX end=0x%llX | Buffer %u bytes\n",
+ r600_resource_va(&rscreen->screen, &res->b.b),
+ r600_resource_va(&rscreen->screen, &res->b.b) + res->buf->size,
+ res->buf->size);
+ }
return true;
}
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index a8c91ff..ed65544 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -43,6 +43,7 @@ static const struct debug_named_value debug_options[] = {
/* logging */
{ "texdepth", DBG_TEX_DEPTH, "Print texture depth info" },
{ "compute", DBG_COMPUTE, "Print compute info" },
+ { "vm", DBG_VM, "Print virtual addresses when creating resources" },
/* shaders */
{ "fs", DBG_FS, "Print fetch shaders" },
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index f3933af..329944d 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -245,6 +245,7 @@ typedef boolean (*r600g_dma_blit_t)(struct pipe_context *ctx,
/* logging */
#define DBG_TEX_DEPTH (1 << 0)
#define DBG_COMPUTE (1 << 1)
+#define DBG_VM (1 << 2)
/* shaders */
#define DBG_FS (1 << 8)
#define DBG_VS (1 << 9)
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 4825592..98cb118 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -510,6 +510,14 @@ r600_texture_create_object(struct pipe_screen *screen,
rscreen->ws->buffer_unmap(resource->cs_buf);
}
+ if (rscreen->debug_flags & DBG_VM) {
+ fprintf(stderr, "VM start=0x%llX end=0x%llX | Texture %ix%ix%i, %i levels, %i samples, %s\n",
+ r600_resource_va(screen, &rtex->resource.b.b),
+ r600_resource_va(screen, &rtex->resource.b.b) + rtex->resource.buf->size,
+ base->width0, base->height0, util_max_layer(base, 0)+1, base->last_level+1,
+ base->nr_samples ? base->nr_samples : 1, util_format_short_name(base->format));
+ }
+
if (rscreen->debug_flags & DBG_TEX_DEPTH && rtex->is_depth && rtex->non_disp_tiling) {
printf("Texture: npix_x=%u, npix_y=%u, npix_z=%u, blk_w=%u, "
"blk_h=%u, blk_d=%u, array_size=%u, last_level=%u, "
--
1.7.10.4
More information about the mesa-dev
mailing list