From a0e8b735947769ead204669dd58d6e452f72bf64 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 6 Nov 2016 16:40:28 +0100 Subject: radeonsi/gfx9: update r600_print_texture_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeon/r600_pipe_common.h | 3 +- src/gallium/drivers/radeon/r600_texture.c | 63 ++++++++++++++++++++++++++- src/gallium/drivers/radeonsi/si_debug.c | 4 +- 3 files changed, 65 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 883d5edd48d..e5748dbef8e 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -788,7 +788,8 @@ void r600_texture_get_cmask_info(struct r600_common_screen *rscreen, bool r600_init_flushed_depth_texture(struct pipe_context *ctx, struct pipe_resource *texture, struct r600_texture **staging); -void r600_print_texture_info(struct r600_texture *rtex, FILE *f); +void r600_print_texture_info(struct r600_common_screen *rscreen, + struct r600_texture *rtex, FILE *f); struct pipe_resource *r600_texture_create(struct pipe_screen *screen, const struct pipe_resource *templ); bool vi_dcc_formats_compatible(enum pipe_format format1, diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 353e942aaa2..8cc9f2ab126 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -900,10 +900,12 @@ static void r600_texture_allocate_htile(struct r600_common_screen *rscreen, } } -void r600_print_texture_info(struct r600_texture *rtex, FILE *f) +void r600_print_texture_info(struct r600_common_screen *rscreen, + struct r600_texture *rtex, FILE *f) { int i; + /* Common parameters. */ fprintf(f, " Info: npix_x=%u, npix_y=%u, npix_z=%u, blk_w=%u, " "blk_h=%u, array_size=%u, last_level=%u, " "bpe=%u, nsamples=%u, flags=0x%x, %s\n", @@ -914,6 +916,63 @@ void r600_print_texture_info(struct r600_texture *rtex, FILE *f) rtex->surface.bpe, rtex->resource.b.b.nr_samples, rtex->surface.flags, util_format_short_name(rtex->resource.b.b.format)); + if (rscreen->chip_class >= GFX9) { + fprintf(f, " Surf: size=%"PRIu64", slice_size=%"PRIu64", " + "alignment=%u, swmode=%u, epitch=%u, pitch=%u\n", + rtex->surface.surf_size, + rtex->surface.u.gfx9.surf_slice_size, + rtex->surface.surf_alignment, + rtex->surface.u.gfx9.surf.swizzle_mode, + rtex->surface.u.gfx9.surf.epitch, + rtex->surface.u.gfx9.surf_pitch); + + if (rtex->fmask.size) { + fprintf(f, " FMASK: offset=%"PRIu64", size=%"PRIu64", " + "alignment=%u, swmode=%u, epitch=%u\n", + rtex->fmask.offset, + rtex->surface.u.gfx9.fmask_size, + rtex->surface.u.gfx9.fmask_alignment, + rtex->surface.u.gfx9.fmask.swizzle_mode, + rtex->surface.u.gfx9.fmask.epitch); + } + + if (rtex->cmask.size) { + fprintf(f, " CMask: offset=%"PRIu64", size=%"PRIu64", " + "alignment=%u, rb_aligned=%u, pipe_aligned=%u\n", + rtex->cmask.offset, + rtex->surface.u.gfx9.cmask_size, + rtex->surface.u.gfx9.cmask_alignment, + rtex->surface.u.gfx9.cmask.rb_aligned, + rtex->surface.u.gfx9.cmask.pipe_aligned); + } + + if (rtex->htile_buffer) { + fprintf(f, " HTile: size=%u, alignment=%u, " + "rb_aligned=%u, pipe_aligned=%u\n", + rtex->htile_buffer->b.b.width0, + rtex->htile_buffer->buf->alignment, + rtex->surface.u.gfx9.htile.rb_aligned, + rtex->surface.u.gfx9.htile.pipe_aligned); + } + + if (rtex->dcc_offset) { + fprintf(f, " DCC: offset=%"PRIu64", size=%"PRIu64", " + "alignment=%u, pitch_max=%u, num_dcc_levels=%u\n", + rtex->dcc_offset, rtex->surface.dcc_size, + rtex->surface.dcc_alignment, + rtex->surface.u.gfx9.dcc_pitch_max, + rtex->surface.num_dcc_levels); + } + + if (rtex->surface.u.gfx9.stencil_offset) { + fprintf(f, " Stencil: offset=%"PRIu64", swmode=%u, epitch=%u\n", + rtex->surface.u.gfx9.stencil_offset, + rtex->surface.u.gfx9.stencil.swizzle_mode, + rtex->surface.u.gfx9.stencil.epitch); + } + return; + } + fprintf(f, " Layout: size=%"PRIu64", alignment=%u, bankw=%u, " "bankh=%u, nbanks=%u, mtilea=%u, tilesplit=%u, pipeconfig=%u, scanout=%u\n", rtex->surface.surf_size, rtex->surface.surf_alignment, rtex->surface.u.legacy.bankw, @@ -1143,7 +1202,7 @@ r600_texture_create_object(struct pipe_screen *screen, if (rscreen->debug_flags & DBG_TEX) { puts("Texture:"); - r600_print_texture_info(rtex, stdout); + r600_print_texture_info(rscreen, rtex, stdout); fflush(stdout); } diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index 1a4cadfb8c2..9d0c0c554cf 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -352,14 +352,14 @@ static void si_dump_framebuffer(struct si_context *sctx, FILE *f) rtex = (struct r600_texture*)state->cbufs[i]->texture; fprintf(f, COLOR_YELLOW "Color buffer %i:" COLOR_RESET "\n", i); - r600_print_texture_info(rtex, f); + r600_print_texture_info(sctx->b.screen, rtex, f); fprintf(f, "\n"); } if (state->zsbuf) { rtex = (struct r600_texture*)state->zsbuf->texture; fprintf(f, COLOR_YELLOW "Depth-stencil buffer:" COLOR_RESET "\n"); - r600_print_texture_info(rtex, f); + r600_print_texture_info(sctx->b.screen, rtex, f); fprintf(f, "\n"); } } -- cgit v1.2.3