summaryrefslogtreecommitdiff
path: root/test/render-fill-copy.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-20 08:28:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-20 15:08:56 +0100
commit8d7e7010e33d73a7d99948403b62d859d7a4dfaa (patch)
tree721db4bd37f35093ea3f38d830a0015d84b2c78a /test/render-fill-copy.c
parentdb6dfc3227155a4792ba3831681daf16839b14bb (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/render-fill-copy.c')
-rw-r--r--test/render-fill-copy.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/test/render-fill-copy.c b/test/render-fill-copy.c
index 45551b22..b5b475a0 100644
--- a/test/render-fill-copy.c
+++ b/test/render-fill-copy.c
@@ -57,13 +57,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));
@@ -78,7 +78,7 @@ static void pixel_tests(struct test *t, int reps, int sets, enum target target)
int blue = rand() % 0xff;
int alpha = rand() % 0xff;
- fill_rect(&t->real, tt.picture, tt.format,
+ fill_rect(&t->out, tt.picture, tt.format,
PictOpSrc, x, y, 1, 1,
red, green, blue, alpha);
@@ -87,14 +87,14 @@ static void pixel_tests(struct test *t, int reps, int sets, enum target target)
cells[y*tt.width+x] = color(red, green, blue, alpha);
}
- 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 result;
uint32_t x = pixels[r].x;
uint32_t y = pixels[r].y;
- XShmGetImage(t->real.dpy, tt.draw, &image,
+ XShmGetImage(t->out.dpy, tt.draw, &image,
x, y, AllPlanes);
result = *(uint32_t *)image.data;
@@ -115,7 +115,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);
}
@@ -131,16 +131,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++) {
@@ -154,7 +154,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.picture, tt.format,
+ fill_rect(&t->out, tt.picture, tt.format,
PictOpSrc, x, y, w, h,
red, green, blue, alpha);
@@ -176,7 +176,7 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
color(red, green, blue, alpha));
}
- 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++) {
@@ -203,37 +203,37 @@ 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() % real.width;
- int h = rand() % real.height;
+ int x = rand() % (2*out.width) - out.width;
+ int y = rand() % (2*out.height) - out.height;
+ int w = rand() % out.width;
+ int h = rand() % out.height;
int op = ops[rand() % sizeof(ops)];
int red = rand() % 0xff;
int green = rand() % 0xff;
int blue = rand() % 0xff;
int alpha = rand() % 0xff;
- fill_rect(&t->real, real.picture, real.format,
+ fill_rect(&t->out, out.picture, out.format,
op, x, y, w, h,
red, green, blue, alpha);
fill_rect(&t->ref, ref.picture, ref.format,
@@ -242,15 +242,15 @@ static void rect_tests(struct test *t, int reps, int sets, enum target target)
}
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);
}