Instrumenting rendercopy, the last bit
This continues (and finishes for now) the series started:
http://lists.freedesktop.org/archives/intel-gfx/2013-February/024954.html
To instrument rendercopy (produce an .aub file) for use with the simulator.
PATCH 1/1 tests: Make it easy to tell if rendercopy is doing the right thing
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.
--- tests/gem_render_linear_blits.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)
tests/gem_render_linear_blits.c +13 -1
@@ -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,
Signature · 1 line
1.7.7.5
Re: [PATCH] tests: Make it easy to tell if rendercopy is doing the right thing
Quoted 11 lines · Damien Lespiau
When dumping an .aub file,
gem_render_linear_blitsamples 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
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre