Message ID | 1361989687-12989-2-git-send-email-damien.lespiau@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Feb 27, 2013 at 06:28:07PM +0000, Damien Lespiau wrote: > 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. Just create a new target that just does this extremely simple operation. Arbtrarily reusing gem_render_linear_blits and making it perform differently under tracing is going to a source of major confusion later. Something like gem_render_copy and a note in the README about how you use it during bringup. -Chris
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,
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@intel.com> --- tests/gem_render_linear_blits.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)