Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.
Date: Tue, 27 Feb 2018 09:52:32 +0100	[thread overview]
Message-ID: <20180227085232.54025-5-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180227085232.54025-1-maarten.lankhorst@linux.intel.com>

CRC capturing enables the display, then disables it again. With
igt_display we can use igt_display_reset to restore the original state,
without committing it to the hw.

All subtests first set their own state anyway, so we can save up on
the number of commits.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_frontbuffer_tracking.c | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 19a69cca5b37..015d7a7a3948 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1293,7 +1293,7 @@ static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc)
 
 	print_crc("Blue CRC:  ", &blue_crcs[format].crc);
 
-	unset_all_crtcs();
+	igt_display_reset(&drm.display);
 
 	igt_remove_fb(drm.fd, &blue);
 
@@ -1345,7 +1345,7 @@ static void init_crcs(enum pixel_format format,
 		print_crc("", &pattern->crcs[format][r]);
 	}
 
-	unset_all_crtcs();
+	igt_display_reset(&drm.display);
 
 	for (r = 0; r < pattern->n_rects; r++)
 		igt_remove_fb(drm.fd, &tmp_fbs[r]);
@@ -1810,6 +1810,22 @@ static void enable_scnd_screen_and_wait(const struct test_mode *t)
 	do_assertions(ASSERT_NO_ACTION_CHANGE);
 }
 
+static void enable_both_screens_and_wait(const struct test_mode *t)
+{
+	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
+	fill_fb_region(&scnd_mode_params.primary, COLOR_SCND_BG);
+
+	__set_mode_for_params(&prim_mode_params);
+	__set_mode_for_params(&scnd_mode_params);
+
+	igt_display_commit2(&drm.display, drm.display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+	wanted_crc = &blue_crcs[t->format].crc;
+	fbc_update_last_action();
+
+	do_assertions(ASSERT_NO_ACTION_CHANGE);
+}
+
 static void set_region_for_test(const struct test_mode *t,
 				struct fb_region *reg)
 {
@@ -1928,18 +1944,24 @@ static void prepare_subtest_data(const struct test_mode *t,
 	if (t->screen == SCREEN_OFFSCREEN)
 		fill_fb_region(&offscreen_fb, COLOR_OFFSCREEN_BG);
 
-	unset_all_crtcs();
+	igt_display_reset(&drm.display);
 
 	init_blue_crc(t->format, t->feature & FEATURE_PSR);
 	if (pattern)
 		init_crcs(t->format, pattern, t->feature & FEATURE_PSR);
 
+	igt_display_reset(&drm.display);
+
 	enable_features_for_test(t);
 }
 
 static void prepare_subtest_screens(const struct test_mode *t)
 {
-	enable_prim_screen_and_wait(t);
+	if (t->pipes == PIPE_DUAL)
+		enable_both_screens_and_wait(t);
+	else
+		enable_prim_screen_and_wait(t);
+
 	if (t->screen == SCREEN_PRIM) {
 		if (t->plane == PLANE_CUR)
 			set_region_for_test(t, &prim_mode_params.cursor);
@@ -1950,7 +1972,6 @@ static void prepare_subtest_screens(const struct test_mode *t)
 	if (t->pipes == PIPE_SINGLE)
 		return;
 
-	enable_scnd_screen_and_wait(t);
 	if (t->screen == SCREEN_SCND) {
 		if (t->plane == PLANE_CUR)
 			set_region_for_test(t, &scnd_mode_params.cursor);
-- 
2.16.2

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

  parent reply	other threads:[~2018-02-27  8:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 1/4] tests/kms_panel_fitting: Test cleanups Maarten Lankhorst
2018-03-05 13:45   ` Arkadiusz Hiler
2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too Maarten Lankhorst
2018-03-05 13:48   ` Arkadiusz Hiler
2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3 Maarten Lankhorst
2018-03-07 15:17   ` Arkadiusz Hiler
2018-03-07 15:26     ` Arkadiusz Hiler
2018-03-07 16:40       ` Maarten Lankhorst
2018-03-08  8:57   ` Arkadiusz Hiler
2018-03-12 13:09     ` Maarten Lankhorst
2018-02-27  8:52 ` Maarten Lankhorst [this message]
2018-03-01 15:33   ` [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start Maarten Lankhorst
2018-03-21 19:47     ` Paulo Zanoni
2018-04-05 16:31       ` Paulo Zanoni
2018-04-05 19:21         ` Maarten Lankhorst
2018-04-05 19:30           ` Paulo Zanoni
2018-04-05 19:44             ` Daniel Vetter
2018-02-27  9:15 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3) Patchwork
2018-02-27 10:00 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-03-06 11:21 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2018-03-06 15:21 ` [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=20180227085232.54025-5-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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