[Intel-gfx] [PATCH] tests: Make it easy to tell if rendercopy is doing the right thing

Damien Lespiau damien.lespiau at intel.com
Wed Feb 27 19:28:07 CET 2013


When dumping an .aub file, gem_render_linear_blit samples a texture to
write it in a render target 1:1.

When enabling new platforms, it's really handy to be able to see if you
are actually rendering to the target which is hard to see currently as
all the buffers are initialized with incrementing numbers and look very
much alike.

So, when dumping an .aub file for inspection, let's fill the destination
buffer with a constant color (0xff0000ff) and dump both src and dest bos
into bmp files.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 tests/gem_render_linear_blits.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
index 2def40d..03d3546 100644
--- a/tests/gem_render_linear_blits.c
+++ b/tests/gem_render_linear_blits.c
@@ -52,6 +52,9 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 {
 	int i;
 
+	if (drmtest_dump_aub())
+		return;
+
 	gem_read(fd, handle, 0, linear, sizeof(linear));
 	for (i = 0; i < WIDTH*HEIGHT; i++) {
 		if (linear[i] != val) {
@@ -105,7 +108,12 @@ int main(int argc, char **argv)
 		bo[i] = drm_intel_bo_alloc(bufmgr, "", SIZE, 4096);
 		start_val[i] = start;
 		for (j = 0; j < WIDTH*HEIGHT; j++)
-			linear[j] = start++;
+			/* When dumping an .aub file, fill the destination with blue
+			 * so can easily tell if the source has been copied over */
+			if (drmtest_dump_aub() && i == 1)
+				linear[j] = 0xff0000ff;
+			else
+				linear[j] = start++;
 		gem_write(fd, bo[i]->handle, 0, linear, sizeof(linear));
 	}
 
@@ -134,6 +142,10 @@ int main(int argc, char **argv)
 		/* We're not really here for the test, we just want to dump a
 		 * trace of a call to render_copy() */
 		if (drmtest_dump_aub()) {
+			drm_intel_gem_bo_aub_dump_bmp(src.bo,
+				0, 0, WIDTH, HEIGHT,
+				AUB_DUMP_BMP_FORMAT_ARGB_8888,
+				STRIDE, 0);
 			drm_intel_gem_bo_aub_dump_bmp(dst.bo,
 				0, 0, WIDTH, HEIGHT,
 				AUB_DUMP_BMP_FORMAT_ARGB_8888,
-- 
1.7.7.5




More information about the Intel-gfx mailing list