Commit bc8b56fe authored by Melissa Wen's avatar Melissa Wen Committed by Arkadiusz Hiler

test/kms_cursor_crc: update subtests descriptions and some comments

Add descriptions for some subtests and detail a little more the comments in
test_cursor_alpha.
Signed-off-by: Melissa Wen's avatarMelissa Wen <melissa.srw@gmail.com>
Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent 22737992
Pipeline #177711 passed with stages
in 12 minutes and 25 seconds
......@@ -34,9 +34,10 @@ IGT_TEST_DESCRIPTION(
"Use the display CRC support to validate cursor plane functionality. "
"The test will position the cursor plane either fully onscreen, "
"partially onscreen, or fully offscreen, using either a fully opaque "
"or fully transparent surface. In each case it then reads the PF CRC "
"and compares it with the CRC value obtained when the cursor plane "
"was disabled.");
"or fully transparent surface. In each case, it enables the cursor plane "
"and then reads the PF CRC (hardware test) and compares it with the CRC "
"value obtained when the cursor plane was disabled and its drawing is "
"directly inserted on the PF by software.");
#ifndef DRM_CAP_CURSOR_WIDTH
#define DRM_CAP_CURSOR_WIDTH 0x8
......@@ -483,7 +484,7 @@ static void test_cursor_alpha(data_t *data, double a)
int curw = data->curw;
int curh = data->curh;
/*alpha cursor fb*/
/* Alpha cursor fb with white color */
fb_id = igt_create_fb(data->drm_fd, curw, curh,
DRM_FORMAT_ARGB8888,
LOCAL_DRM_FORMAT_MOD_NONE,
......@@ -493,15 +494,16 @@ static void test_cursor_alpha(data_t *data, double a)
igt_paint_color_alpha(cr, 0, 0, curw, curh, 1.0, 1.0, 1.0, a);
igt_put_cairo_ctx(cr);
/*Hardware Test*/
/* Hardware Test - enable cursor and get PF CRC */
cursor_enable(data);
igt_display_commit(display);
igt_wait_for_vblank(data->drm_fd, data->pipe);
igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
cursor_disable(data);
igt_remove_fb(data->drm_fd, &data->fb);
/*Software Test*/
/* Software Test - render cursor in software, drawn it directly on PF */
cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[FRONTBUFFER]);
igt_paint_color_alpha(cr, 0, 0, curw, curh, 1.0, 1.0, 1.0, a);
igt_put_cairo_ctx(cr);
......@@ -509,6 +511,8 @@ static void test_cursor_alpha(data_t *data, double a)
igt_display_commit(display);
igt_wait_for_vblank(data->drm_fd, data->pipe);
igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
/* Compare CRC from Hardware/Software tests */
igt_assert_crc_equal(&crc, &ref_crc);
/*Clear Screen*/
......@@ -686,13 +690,20 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)
igt_require(data->output);
}
igt_describe("Create a maximum size cursor, then change the size in "
"flight to smaller ones to see that the size is applied "
"correctly.");
igt_subtest_f("pipe-%s-cursor-size-change", kmstest_pipe_name(pipe))
run_test(data, test_cursor_size,
data->cursor_max_w, data->cursor_max_h);
igt_describe("Validates the composition of a fully opaque cursor "
"plane, i.e., alpha channel equal to 1.0.");
igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe))
run_test(data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h);
igt_describe("Validates the composition of a fully transparent cursor "
"plane, i.e., alpha channel equal to 0.0.");
igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe))
run_test(data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h);
......@@ -726,15 +737,24 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)
}
/* Using created cursor FBs to test cursor support */
igt_describe("Check if a given-size cursor is well-positioned inside the screen.");
igt_subtest_f("pipe-%s-cursor-%dx%d-onscreen", kmstest_pipe_name(pipe), w, h)
run_test(data, test_crc_onscreen, w, h);
igt_describe("Check if a given-size cursor is well-positioned outside the screen.");
igt_subtest_f("pipe-%s-cursor-%dx%d-offscreen", kmstest_pipe_name(pipe), w, h)
run_test(data, test_crc_offscreen, w, h);
igt_describe("Check the smooth and pixel-by-pixel given-size cursor movements on"
"horizontal, vertical and diagonal.");
igt_subtest_f("pipe-%s-cursor-%dx%d-sliding", kmstest_pipe_name(pipe), w, h)
run_test(data, test_crc_sliding, w, h);
igt_describe("Check random placement of a cursor with given size.");
igt_subtest_f("pipe-%s-cursor-%dx%d-random", kmstest_pipe_name(pipe), w, h)
run_test(data, test_crc_random, w, h);
igt_describe("Check the rapid update of given-size cursor movements.");
igt_subtest_f("pipe-%s-cursor-%dx%d-rapid-movement", kmstest_pipe_name(pipe), w, h) {
run_test(data, test_rapid_movement, w, h);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment