diff options
author | Antti Koskipaa <antti.koskipaa@linux.intel.com> | 2014-04-10 15:08:06 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-04-25 16:18:15 +0300 |
commit | 7ec631c2426917020ab76d6d305132ab190372ea (patch) | |
tree | e2f638c65cd33d8df52b066ac10f4932d7eb9e30 /tests/kms_cursor_crc.c | |
parent | a593d613f9ccafa5ba95ec4b9542cd00eef1cc7b (diff) |
kms_cursor_crc: Move cursor enable and disable calls where they belong
We can't have the hw cursor enabled during software render tests.
Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
[vsyrjala: collect the crc before disalbing the cursor]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_cursor_crc.c')
-rw-r--r-- | tests/kms_cursor_crc.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c index 52281d04..07bab15b 100644 --- a/tests/kms_cursor_crc.c +++ b/tests/kms_cursor_crc.c @@ -67,6 +67,30 @@ static void draw_cursor(cairo_t *cr, int x, int y, int w) igt_paint_color_alpha(cr, x + w, y + w, w, w, 0.5, 0.5, 0.5, 1.0); } +static void cursor_enable(test_data_t *test_data) +{ + data_t *data = test_data->data; + igt_display_t *display = &data->display; + igt_output_t *output = test_data->output; + igt_plane_t *cursor; + + cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); + igt_plane_set_fb(cursor, &data->fb); + igt_display_commit(display); +} + +static void cursor_disable(test_data_t *test_data) +{ + data_t *data = test_data->data; + igt_display_t *display = &data->display; + igt_output_t *output = test_data->output; + igt_plane_t *cursor; + + cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); + igt_plane_set_fb(cursor, NULL); + igt_display_commit(display); +} + static igt_pipe_crc_t *create_crc(data_t *data, enum pipe pipe) { igt_pipe_crc_t *crc; @@ -85,12 +109,14 @@ static void do_single_test(test_data_t *test_data, int x, int y) printf("."); fflush(stdout); + cursor_enable(test_data); cursor = igt_output_get_plane(test_data->output, IGT_PLANE_CURSOR); igt_plane_set_position(cursor, x, y); igt_display_commit(display); igt_wait_for_vblank(data->drm_fd, test_data->pipe); - igt_pipe_crc_collect_crc(pipe_crc, &crc); + cursor_disable(test_data); + if (test_data->crc_must_match) igt_assert(igt_crc_equal(&crc, &test_data->ref_crc)); else @@ -106,30 +132,6 @@ static void do_test(test_data_t *test_data, do_single_test(test_data, left, bottom); } -static void cursor_enable(test_data_t *test_data) -{ - data_t *data = test_data->data; - igt_display_t *display = &data->display; - igt_output_t *output = test_data->output; - igt_plane_t *cursor; - - cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); - igt_plane_set_fb(cursor, &data->fb); - igt_display_commit(display); -} - -static void cursor_disable(test_data_t *test_data) -{ - data_t *data = test_data->data; - igt_display_t *display = &data->display; - igt_output_t *output = test_data->output; - igt_plane_t *cursor; - - cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); - igt_plane_set_fb(cursor, NULL); - igt_display_commit(display); -} - static void test_crc(test_data_t *test_data, bool onscreen, int cursor_w, int cursor_h) { @@ -138,8 +140,6 @@ static void test_crc(test_data_t *test_data, int top = test_data->top; int bottom = test_data->bottom; - cursor_enable(test_data); - if (onscreen) { /* cursor onscreen, crc should match, except when white visible cursor is used */ test_data->crc_must_match = false; @@ -183,8 +183,6 @@ static void test_crc(test_data_t *test_data, /* go nuts */ do_test(test_data, INT_MIN, INT_MAX, INT_MIN, INT_MAX); } - - cursor_disable(test_data); } static bool prepare_crtc(test_data_t *test_data, igt_output_t *output, |