summaryrefslogtreecommitdiff
path: root/tests/gem_render_copy.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-10-22 14:57:57 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2013-10-24 13:44:32 +0100
commit7ad0cf585b4f4c0391646c0eaea6e7e8e2e88cca (patch)
treea3068902d3079e71bd717fee51471ddf278c805b /tests/gem_render_copy.c
parent145722187c30a60456df046981087f84f3c0b601 (diff)
tests/gem_render_copy: Add aub dump support
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'tests/gem_render_copy.c')
-rw-r--r--tests/gem_render_copy.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
index b844fbb2..40c37f4d 100644
--- a/tests/gem_render_copy.c
+++ b/tests/gem_render_copy.c
@@ -91,6 +91,7 @@ int main(int argc, char **argv)
render_copyfunc_t render_copy = NULL;
int opt;
int opt_dump_png = false;
+ int opt_dump_aub = drmtest_dump_aub();
while ((opt = getopt(argc, argv, "d")) != -1) {
switch (opt) {
@@ -128,15 +129,29 @@ int main(int argc, char **argv)
scratch_buf_write_to_png(&dst, "destination.png");
}
+ if (opt_dump_aub) {
+ drm_intel_bufmgr_gem_set_aub_filename(data.bufmgr,
+ "rendercopy.aub");
+ drm_intel_bufmgr_gem_set_aub_dump(data.bufmgr, true);
+ }
+
render_copy(batch,
&src, 0, 0, WIDTH, HEIGHT,
&dst, WIDTH / 2, HEIGHT / 2);
- scratch_buf_check(&data, &dst, 10, 10, DST_COLOR);
- scratch_buf_check(&data, &dst, WIDTH - 10, HEIGHT - 10, SRC_COLOR);
-
if (opt_dump_png)
scratch_buf_write_to_png(&dst, "result.png");
+ if (opt_dump_aub) {
+ drm_intel_gem_bo_aub_dump_bmp(dst.bo,
+ 0, 0, WIDTH, HEIGHT,
+ AUB_DUMP_BMP_FORMAT_ARGB_8888,
+ STRIDE, 0);
+ drm_intel_bufmgr_gem_set_aub_dump(data.bufmgr, false);
+ } else {
+ scratch_buf_check(&data, &dst, 10, 10, DST_COLOR);
+ scratch_buf_check(&data, &dst, WIDTH - 10, HEIGHT - 10, SRC_COLOR);
+ }
+
return 0;
}