summaryrefslogtreecommitdiff
path: root/tests/kms_cursor_crc.c
diff options
context:
space:
mode:
authorMamta Shukla <mamtashukla555@gmail.com>2019-02-03 20:08:03 +0530
committerPetri Latvala <petri.latvala@intel.com>2019-02-04 15:03:20 +0200
commit7d65ed2f230fd5cd0e2670d26db971cea885c493 (patch)
treec8ae5daabaa3ca10ef00fafa3ccdda84494bbb05 /tests/kms_cursor_crc.c
parentcb6610f5a91a08b1d7f8ae910875891003c6f67c (diff)
tests/kms_cursor_crc.c: Improve test_cursor_alpha()
In the kms_cursor_crc, the subtest to check exterme alpha values failed due to different CRCs observed in hardware and software rendering. This patch fixes CRC mismatch error in cursor-alpha-opaque and cursor-alpha-transparent subtests by improving the order in which cursor was rendered in hardware test. Changes made in test_cursor_alpha() to ensure cursor rendering in hardware test and acquire CRC value: - Add drmModeSetCursor() to set cursor image. - Remove igt_display_commit() to reduce the chance of getting crc values cleared before it is acquired. - Add igt_remove_fb() to remove locally created framebuffer after disabling the cursor plane in HW test Also, aligned this function with test_cursor_size and after these changes got passing results for alpha blending support added in VKMS CRC API. Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109350
Diffstat (limited to 'tests/kms_cursor_crc.c')
-rw-r--r--tests/kms_cursor_crc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 3c9856d9..144b44b0 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -411,26 +411,28 @@ static void test_cursor_alpha(data_t *data, double a)
igt_crc_t crc, ref_crc;
cairo_t *cr;
uint32_t fb_id;
- int curw=data->curw;
- int curh=data->curh;
+ int curw = data->curw;
+ int curh = data->curh;
+ int ret;
/*alpha cursor fb*/
- fb_id = igt_create_color_fb(data->drm_fd, curw, curh,
+ fb_id = igt_create_fb(data->drm_fd, curw, curh,
DRM_FORMAT_ARGB8888,
LOCAL_DRM_FORMAT_MOD_NONE,
- 1.0, 1.0, 1.0,
&data->fb);
igt_assert(fb_id);
cr = igt_get_cairo_ctx(data->drm_fd, &data->fb);
- draw_cursor(cr, 0, 0, curw, curh, a);
+ igt_paint_color_alpha(cr, 0, 0, curw, curh, 1.0, 1.0, 1.0, a);
igt_put_cairo_ctx(data->drm_fd, &data->fb, cr);
/*Hardware Test*/
cursor_enable(data);
- igt_display_commit(display);
+ ret = drmModeSetCursor(data->drm_fd, data->output->config.crtc->crtc_id, data->fb.gem_handle, curw, curh);
+ igt_assert_eq(ret, 0);
igt_wait_for_vblank(data->drm_fd, data->pipe);
igt_pipe_crc_collect_crc(pipe_crc, &crc);
cursor_disable(data);
+ igt_remove_fb(data->drm_fd, &data->fb);
/*Software Test*/
cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb);
@@ -447,7 +449,6 @@ static void test_cursor_alpha(data_t *data, double a)
igt_paint_color(cr, 0, 0, data->screenw, data->screenh,
0.0, 0.0, 0.0);
igt_put_cairo_ctx(data->drm_fd, &data->primary_fb, cr);
- igt_remove_fb(data->drm_fd, &data->fb);
}
static void test_cursor_transparent(data_t *data)