<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 16, 2016 at 12:56 AM, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Enabling this option causes the source and destination surfaces to be<br>
dumped out to debug files. The destination is dumped both before and<br>
after the blit operation.<br>
<br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
---<br>
src/intel/blorp/blorp_blit.c | 53 ++++++++++++++++++++++++++++++<wbr>++++++++++++++<br>
1 file changed, 53 insertions(+)<br>
<br>
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c<br>
index c0b56c3..c1c4219 100644<br>
--- a/src/intel/blorp/blorp_blit.c<br>
+++ b/src/intel/blorp/blorp_blit.c<br>
@@ -28,6 +28,8 @@<br>
<br>
#define FILE_DEBUG_FLAG DEBUG_BLORP<br>
<br>
+static const bool isl_surface_debug_dump = false;<br>
+<br>
/**<br>
* Enum to specify the order of arguments in a sampler message<br>
*/<br>
@@ -1428,6 +1430,41 @@ surf_retile_w_to_y(const struct isl_device *isl_dev,<br>
}<br>
<br>
static void<br>
+dump_blorp_surf(const struct blorp_context *blorp,<br>
+ const struct brw_blorp_surface_info *surf,<br>
+ const char *basename)<br>
+{<br>
+ void *map, *aux_map;<br>
+ unsigned int size, aux_size;<br>
+ bool was_mapped, aux_was_mapped;<br>
+<br>
+ blorp->map(blorp, &surf->addr, &map, &size, &was_mapped);<br>
+ if (map == NULL)<br>
+ return;<br>
+<br>
+ if (surf->aux_addr.buffer) {<br>
+ blorp->map(blorp, &surf->aux_addr, &aux_map, &aux_size, &aux_was_mapped);<br>
+ if (aux_map == NULL) {<br>
+ if (!was_mapped)<br>
+ blorp->unmap(blorp, &surf->addr);<br>
+ return;<br>
+ }<br>
+ } else {<br>
+ aux_map = NULL;<br>
+ aux_size = 0;<br>
+ }<br>
+<br>
+ isl_dump_surf(blorp->isl_dev, &surf->surf, map, size,<br>
+ aux_map ? &surf->aux_surf : NULL, aux_map, aux_size,<br>
+ basename);<br>
+<br>
+ if (!was_mapped)<br>
+ blorp->unmap(blorp, &surf->addr);<br>
+ if (surf->aux_addr.buffer && !aux_was_mapped)<br>
+ blorp->unmap(blorp, &surf->aux_addr);<br></blockquote><div><br></div><div>Never mind my earlier comments. You already thought about it!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+}<br>
+<br>
+static void<br>
do_blorp_blit(struct blorp_batch *batch,<br>
struct blorp_params *params,<br>
struct brw_blorp_blit_prog_key *wm_prog_key,<br>
@@ -1657,6 +1694,11 @@ blorp_blit(struct blorp_batch *batch,<br>
brw_blorp_surface_info_init(<wbr>batch->blorp, ¶ms.dst, dst_surf, dst_level,<br>
dst_layer, dst_format, true);<br>
<br>
+ if (isl_surface_debug_dump) {<br>
+ dump_blorp_surf(batch->blorp, ¶ms.src, "blorp-blit-src");<br>
+ dump_blorp_surf(batch->blorp, ¶ms.dst, "blorp-blit-dst-before");<br>
+ }<br>
+<br>
params.src.view.swizzle = src_swizzle;<br>
params.dst.view.swizzle = dst_swizzle;<br>
<br>
@@ -1708,6 +1750,9 @@ blorp_blit(struct blorp_batch *batch,<br>
src_x0, src_y0, src_x1, src_y1,<br>
dst_x0, dst_y0, dst_x1, dst_y1,<br>
mirror_x, mirror_y);<br>
+<br>
+ if (isl_surface_debug_dump)<br>
+ dump_blorp_surf(batch->blorp, ¶ms.dst, "blorp-blit-dst-after");<br>
}<br>
<br>
static enum isl_format<br>
@@ -1850,6 +1895,11 @@ blorp_copy(struct blorp_batch *batch,<br>
brw_blorp_surface_info_init(<wbr>batch->blorp, ¶ms.dst, dst_surf, dst_level,<br>
dst_layer, ISL_FORMAT_UNSUPPORTED, true);<br>
<br>
+ if (isl_surface_debug_dump) {<br>
+ dump_blorp_surf(batch->blorp, ¶ms.src, "blorp-copy-src");<br>
+ dump_blorp_surf(batch->blorp, ¶ms.dst, "blorp-copy-dst-before");<br>
+ }<br>
+<br>
struct brw_blorp_blit_prog_key wm_prog_key;<br>
memset(&wm_prog_key, 0, sizeof(wm_prog_key));<br>
<br>
@@ -1889,4 +1939,7 @@ blorp_copy(struct blorp_batch *batch,<br>
src_x, src_y, src_x + src_width, src_y + src_height,<br>
dst_x, dst_y, dst_x + dst_width, dst_y + dst_height,<br>
false, false);<br>
+<br>
+ if (isl_surface_debug_dump)<br>
+ dump_blorp_surf(batch->blorp, ¶ms.dst, "blorp-copy-dst-after");<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.10.2<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>