diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-20 08:28:32 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-20 15:08:56 +0100 |
commit | 8d7e7010e33d73a7d99948403b62d859d7a4dfaa (patch) | |
tree | 721db4bd37f35093ea3f38d830a0015d84b2c78a /test/basic-fillrect.c | |
parent | db6dfc3227155a4792ba3831681daf16839b14bb (diff) |
test: Increase number of tiled sources
Significantly improve the stress impose upon the tiled BLT operations.
Also start dumping pngs of the failures.
References: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'test/basic-fillrect.c')
-rw-r--r-- | test/basic-fillrect.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/test/basic-fillrect.c b/test/basic-fillrect.c index a2aeec8f..80c219c7 100644 --- a/test/basic-fillrect.c +++ b/test/basic-fillrect.c @@ -9,7 +9,7 @@ static void show_cells(char *buf, - const uint32_t *real, const uint32_t *ref, + const uint32_t *out, const uint32_t *ref, int x, int y, int w, int h) { int i, j, len = 0; @@ -22,7 +22,7 @@ show_cells(char *buf, if (i < 0 || i >= w) continue; - len += sprintf(buf+len, "%08x ", real[j*w+i]); + len += sprintf(buf+len, "%08x ", out[j*w+i]); } len += sprintf(buf+len, "\t"); @@ -56,13 +56,13 @@ static void pixel_tests(struct test *t, int reps, int sets, enum target target) { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s): ", test_target_name(target)); @@ -74,7 +74,7 @@ static void pixel_tests(struct test *t, int reps, int sets, enum target target) int y = rand() % (tt.height - 1); uint32_t fg = rand(); - fill_rect(&t->real, tt.draw, GXcopy, + fill_rect(&t->out, tt.draw, GXcopy, x, y, 1, 1, fg); pixels[r].x = x; @@ -82,14 +82,14 @@ static void pixel_tests(struct test *t, int reps, int sets, enum target target) cells[y*tt.width+x] = fg; } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; uint32_t result; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -108,7 +108,7 @@ static void pixel_tests(struct test *t, int reps, int sets, enum target target) } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -124,16 +124,16 @@ static void area_tests(struct test *t, int reps, int sets, enum target target) { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -144,7 +144,7 @@ static void area_tests(struct test *t, int reps, int sets, enum target target) x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.draw, GXcopy, + fill_rect(&t->out, tt.draw, GXcopy, x, y, w, h, fg); if (x < 0) @@ -164,7 +164,7 @@ static void area_tests(struct test *t, int reps, int sets, enum target target) pixman_fill(cells, tt.width, 32, x, y, w, h, fg); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -192,49 +192,49 @@ static void area_tests(struct test *t, int reps, int sets, enum target target) printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % (2*real.width); - int h = rand() % (2*real.height); + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % (2*out.width); + int h = rand() % (2*out.height); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); - fill_rect(&t->real, real.draw, alu, + fill_rect(&t->out, out.draw, alu, x, y, w, h, fg); fill_rect(&t->ref, ref.draw, alu, x, y, w, h, fg); } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } |