radeonsi/gfx9: update r600_print_texture_info
authorMarek Olšák <marek.olsak@amd.com>
Sun, 6 Nov 2016 15:40:28 +0000 (16:40 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 30 Mar 2017 12:44:33 +0000 (14:44 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeon/r600_texture.c
src/gallium/drivers/radeonsi/si_debug.c

index 883d5edd48dbfb924af27ebcfa8044041c501d3f..e5748dbef8e5b847c0e44ce65a8eb54e800c80d4 100644 (file)
@@ -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,
index 353e942aaa2e5f3f0856c829cbe58e09e1a337f6..8cc9f2ab126b8f61491451da7a5f72d5110793b5 100644 (file)
@@ -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);
        }
 
index 1a4cadfb8c28f40a1aa4bbf2b16ea60fb3f0679e..9d0c0c554cf0c0a9b754b78a07ba816e848add78 100644 (file)
@@ -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");
        }
 }