public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: stanislav.lisovskiy@intel.com
Subject: [igt-dev] [PATCH i-g-t v2 1/2] tests/kms_cursor_crc: Change the way we collect crc's
Date: Thu, 10 Jan 2019 14:51:24 +0200	[thread overview]
Message-ID: <20190110125125.26374-2-mika.kahola@intel.com> (raw)
In-Reply-To: <20190110125125.26374-1-mika.kahola@intel.com>

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  ****

v2: Stop collecting crc's after test completion

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

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 1514e7f2..83dbe0b7 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,8 +206,9 @@ 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);
+	igt_pipe_crc_stop(pipe_crc);
 
 	/* Clear screen afterwards */
 	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb);
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-01-10 12:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 12:51 [igt-dev] [PATCH i-g-t v2 0/2] tests/kms_cursor_crc: Change crc collection Mika Kahola
2019-01-10 12:51 ` Mika Kahola [this message]
2019-01-22  9:20   ` [igt-dev] [PATCH i-g-t v2 1/2] tests/kms_cursor_crc: Change the way we collect crc's Daniel Vetter
2019-01-22 10:45     ` Kahola, Mika
2019-01-22 13:20       ` Daniel Vetter
2019-01-22 13:53         ` Kahola, Mika
2019-01-22 14:08           ` Daniel Vetter
2019-01-10 12:51 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/kms_cursor_crc: Remove unnecessary waits for vblank Mika Kahola
2019-01-10 13:22 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: Change crc collection (rev3) Patchwork
2019-01-10 18:24 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-01-11 10:02 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: Change crc collection (rev4) Patchwork
2019-01-11 16:02 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190110125125.26374-2-mika.kahola@intel.com \
    --to=mika.kahola@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=stanislav.lisovskiy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox