[i-g-t,1/2] tests/kms_cursor_crc: Change the way we collect crc's

Submitted by Kahola, Mika on Jan. 9, 2019, 12:55 p.m.

Details

Message ID 20190109125513.17460-2-mika.kahola@intel.com
State New
Headers show
Series "tests/kms_cursor_crc: Change crc collection" ( rev: 2 1 ) in IGT

Not browsing as part of any series.

Commit Message

Kahola, Mika Jan. 9, 2019, 12:55 p.m.
Instead of collecting crc's in one shot i.e. opening crc for reading,
collecting crc and closing the file, let's start crc collection and keep
collecting crc's until we are done. This fixes an issue that we
occasionally read errornous crc, at least with ICL.

The bug can be replicated for example with

kms_cursor_crc --run-subtest cursor-64x64-onscreen

Starting subtest: cursor-64x64-onscreen
Beginning cursor-64x64-onscreen on pipe A, connector eDP-1
.(kms_cursor_crc:19282) igt-debugfs-CRITICAL: Test assertion failure function igt_assert_crc_equal, file igt_debugfs.c:419:
(kms_cursor_crc:19282) igt-debugfs-CRITICAL: Failed assertion: !mismatch
Stack trace:
  #0 /home/testrunner/igt/lib/igt_core.c:1472 __igt_fail_assert()
  #1 /home/testrunner/igt/lib/igt_debugfs.c:419 igt_assert_crc_equal()
  #2 /home/testrunner/igt/tests/kms_cursor_crc.c:213 do_single_test()
  #3 /home/testrunner/igt/tests/kms_cursor_crc.c:248 do_test()
  #4 /home/testrunner/igt/tests/kms_cursor_crc.c:266 test_crc_onscreen()
  #5 /home/testrunner/igt/tests/kms_cursor_crc.c:433 run_test.constprop.8()
  #6 /home/testrunner/igt/tests/kms_cursor_crc.c:594 run_test_generic.constprop.6()
  #7 /home/testrunner/igt/tests/kms_cursor_crc.c:690 __real_main656()
  #8 /home/testrunner/igt/tests/kms_cursor_crc.c:656 main()
  #9 ../csu/libc-start.c:344 __libc_start_main()
  #10 [_start+0x2a]
Subtest cursor-64x64-onscreen failed.
**** DEBUG ****
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.2 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.2 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe B, plane 3
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe B, plane 3, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.3 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.3 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.3 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe B, plane 4
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe B, plane 4, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.4 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.4 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.4 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe B, plane 5
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe B, plane 5, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.5 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.5 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.5 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe B, plane 6
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe B, plane 6, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.6 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.6 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane B.6 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe B, plane 7
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetCursor pipe B, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     MoveCursor pipe B, (0, 0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe C, plane 0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetCrtc pipe C, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe C, plane 1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe C, plane 1, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.1 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.1 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.1 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe C, plane 2
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe C, plane 2, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.2 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.2 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.2 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe C, plane 3
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe C, plane 3, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.3 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.3 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.3 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe C, plane 4
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe C, plane 4, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.4 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.4 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.4 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe C, plane 5
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe C, plane 5, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.5 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.5 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.5 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe C, plane 6
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetPlane pipe C, plane 6, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.6 "rotation" to 0x1/1
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.6 "COLOR_ENCODING" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetProp plane C.6 "COLOR_RANGE" to 0x0/0
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     Fixing up initial rotation pipe C, plane 7
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetCursor pipe C, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     MoveCursor pipe C, (0, 0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: }
(kms_cursor_crc:19282) igt-debugfs-DEBUG: Opening debugfs directory '/sys/kernel/debug/dri/0'
(kms_cursor_crc:19282) igt-debugfs-DEBUG: Opening debugfs directory '/sys/kernel/debug/dri/0'
(kms_cursor_crc:19282) igt-kms-DEBUG: Test requirement passed: plane_idx >= 0 && plane_idx < pipe->n_planes
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: plane_set_fb(0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: plane_set_size (0x0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: fb_set_position(0,0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: fb_set_size(0x0)
(kms_cursor_crc:19282) INFO: Beginning cursor-64x64-onscreen on pipe A, connector eDP-1
(kms_cursor_crc:19282) igt-fb-DEBUG: Test requirement passed: cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS
(kms_cursor_crc:19282) igt-kms-DEBUG: Test requirement passed: plane_idx >= 0 && plane_idx < pipe->n_planes
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: plane_set_fb(227)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: plane_set_size (64x65)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: fb_set_position(0,0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: fb_set_size(64x65)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: plane_set_size (64x64)
(kms_cursor_crc:19282) igt-kms-DEBUG: Test requirement passed: plane_idx >= 0 && plane_idx < pipe->n_planes
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: plane_set_position(0,0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: commit {
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetCursor pipe A, fb 1 64x64
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     MoveCursor pipe A, (0, 0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: }
(kms_cursor_crc:19282) igt-kms-DEBUG: Test requirement passed: plane_idx >= 0 && plane_idx < pipe->n_planes
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: plane_set_fb(0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: plane_set_size (0x0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: fb_set_position(0,0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: A.7: fb_set_size(0x0)
(kms_cursor_crc:19282) igt-kms-DEBUG: display: commit {
(kms_cursor_crc:19282) igt-kms-DEBUG: display:     SetCursor pipe A, disabling
(kms_cursor_crc:19282) igt-kms-DEBUG: display: }
(kms_cursor_crc:19282) igt-fb-DEBUG: Test requirement passed: cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS
(kms_cursor_crc:19282) igt-kms-DEBUG: display: commit {
(kms_cursor_crc:19282) igt-kms-DEBUG: display: }
(kms_cursor_crc:19282) igt-debugfs-DEBUG: CRC mismatch at index 0: 0x2e212a16 != 0x9245e25c
(kms_cursor_crc:19282) igt-debugfs-CRITICAL: Test assertion failure function igt_assert_crc_equal, file igt_debugfs.c:419:
(kms_cursor_crc:19282) igt-debugfs-CRITICAL: Failed assertion: !mismatch
(kms_cursor_crc:19282) igt-core-INFO: Stack trace:
(kms_cursor_crc:19282) igt-core-INFO:   #0 /home/testrunner/igt/lib/igt_core.c:1472 __igt_fail_assert()
(kms_cursor_crc:19282) igt-core-INFO:   #1 /home/testrunner/igt/lib/igt_debugfs.c:419 igt_assert_crc_equal()
(kms_cursor_crc:19282) igt-core-INFO:   #2 /home/testrunner/igt/tests/kms_cursor_crc.c:213 do_single_test()
(kms_cursor_crc:19282) igt-core-INFO:   #3 /home/testrunner/igt/tests/kms_cursor_crc.c:248 do_test()
(kms_cursor_crc:19282) igt-core-INFO:   #4 /home/testrunner/igt/tests/kms_cursor_crc.c:266 test_crc_onscreen()
(kms_cursor_crc:19282) igt-core-INFO:   #5 /home/testrunner/igt/tests/kms_cursor_crc.c:433 run_test.constprop.8()
(kms_cursor_crc:19282) igt-core-INFO:   #6 /home/testrunner/igt/tests/kms_cursor_crc.c:594 run_test_generic.constprop.6()
(kms_cursor_crc:19282) igt-core-INFO:   #7 /home/testrunner/igt/tests/kms_cursor_crc.c:690 __real_main656()
(kms_cursor_crc:19282) igt-core-INFO:   #8 /home/testrunner/igt/tests/kms_cursor_crc.c:656 main()
(kms_cursor_crc:19282) igt-core-INFO:   #9 ../csu/libc-start.c:344 __libc_start_main()
(kms_cursor_crc:19282) igt-core-INFO:   #10 [_start+0x2a]
****  END  ****

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103232
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_cursor_crc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 1514e7f2..9b31414f 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -172,7 +172,8 @@  static void do_single_test(data_t *data, int x, int y)
 	igt_display_commit(display);
 
 	igt_wait_for_vblank(data->drm_fd, data->pipe);
-	igt_pipe_crc_collect_crc(pipe_crc, &crc);
+	igt_pipe_crc_start(pipe_crc);
+	igt_pipe_crc_get_single(pipe_crc, &crc);
 
 	if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
 		igt_crc_t crc_after;
@@ -191,7 +192,7 @@  static void do_single_test(data_t *data, int x, int y)
 			igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
 						      SUSPEND_TEST_NONE);
 
-		igt_pipe_crc_collect_crc(pipe_crc, &crc_after);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc_after);
 		igt_assert_crc_equal(&crc, &crc_after);
 	}
 
@@ -205,7 +206,7 @@  static void do_single_test(data_t *data, int x, int y)
 	igt_display_commit(display);
 
 	igt_wait_for_vblank(data->drm_fd, data->pipe);
-	igt_pipe_crc_collect_crc(pipe_crc, &ref_crc);
+	igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
 	igt_assert_crc_equal(&crc, &ref_crc);
 
 	/* Clear screen afterwards */