Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 8758eb80ff7cdd7ef1f5642d8da327050691ab77
- Author: Imre Deak <imre.deak@intel.com>
- Date: Thu Jan 29 14:32:24 2015 -0800
- gem_render_copy: check whole dst area
- Signed-off-by: Imre Deak <imre.deak@intel.com>
- diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
- index 006b6f5..691dcb5 100644
- --- a/tests/gem_render_copy.c
- +++ b/tests/gem_render_copy.c
- @@ -119,6 +119,25 @@ scratch_buf_check(data_t *data, struct igt_buf *buf, int x, int y,
- color, val, x, y);
- }
- +static void
- +scratch_buf_check_area(data_t *data, struct igt_buf *buf, int x, int y,
- + int w, int h, uint32_t color)
- +{
- + int row, col;
- + uint32_t val;
- +
- + gem_read(data->drm_fd, buf->bo->handle, 0,
- + data->linear, sizeof(data->linear));
- + for (row = y; row < y + h; row++) {
- + for (col = x; col < x + w; col++) {
- + val = data->linear[y * WIDTH + x];
- + igt_assert_f(val == color,
- + "Expected 0x%08x, found 0x%08x at (%d,%d)\n",
- + color, val, x, y);
- + }
- + }
- +}
- +
- static int opt_handler(int opt, int opt_index)
- {
- if (opt == 'd') {
- @@ -184,8 +203,10 @@ int main(int argc, char **argv)
- 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);
- + scratch_buf_check_area(&data, &dst, 0, 0, WIDTH / 2, HEIGHT / 2,
- + DST_COLOR);
- + scratch_buf_check_area(&data, &dst, WIDTH / 2, HEIGHT / 2,
- + WIDTH / 2, HEIGHT / 2, SRC_COLOR);
- }
- igt_exit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement