igt-dev.lists.freedesktop.org archive mirror
 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 v5 3/4] tests/kms_frontbuffer_tracking: Remove redundant modesets for toggling features, v5.
Date: Fri, 17 Aug 2018 10:56:41 +0200	[thread overview]
Message-ID: <20180817085642.19501-3-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180817085642.19501-1-maarten.lankhorst@linux.intel.com>

Disabling PSR and FBC used to require a commit, but now that changes
to FBC take effect after the next commit, and PSR is toggled through
debugfs we can skip those modesets.

Changes since v1:
- Try to avoid modesets for PSR if the kernel supports it, but otherwise force
  a modeset for the changes to take effect.
Changes since v2:
- Rebase on top of previous PSR changes.
Changes since v3:
- Rebase on move to lib/igt_psr.
Changes since v4:
- Split out related changes. (dhnkrn)

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

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 07b70fbfb4b7..a570f93a33a8 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1129,14 +1129,14 @@ static void unset_all_crtcs(void)
 	igt_display_commit(&drm.display);
 }
 
-static void disable_features(const struct test_mode *t)
+static bool disable_features(const struct test_mode *t)
 {
 	if (t->feature == FEATURE_DEFAULT)
-		return;
+		return false;
 
 	fbc_disable();
-	psr_disable(drm.debugfs);
 	drrs_disable();
+	return psr_disable(drm.debugfs);
 }
 
 static void *busy_thread_func(void *data)
@@ -1717,17 +1717,21 @@ static void set_region_for_test(const struct test_mode *t,
 	do_assertions(ASSERT_NO_ACTION_CHANGE);
 }
 
-static void enable_features_for_test(const struct test_mode *t)
+static bool enable_features_for_test(const struct test_mode *t)
 {
+	bool ret = false;
+
 	if (t->feature == FEATURE_DEFAULT)
-		return;
+		return false;
 
 	if (t->feature & FEATURE_FBC)
 		fbc_enable();
 	if (t->feature & FEATURE_PSR)
-		psr_enable(drm.debugfs);
+		ret = psr_enable(drm.debugfs);
 	if (t->feature & FEATURE_DRRS)
 		drrs_enable();
+
+	return ret;
 }
 
 static void check_test_requirements(const struct test_mode *t)
@@ -1809,23 +1813,29 @@ static void set_crtc_fbs(const struct test_mode *t)
 static void prepare_subtest_data(const struct test_mode *t,
 				 struct draw_pattern_info *pattern)
 {
+	bool need_modeset;
+
 	check_test_requirements(t);
 
 	stop_busy_thread();
 
-	disable_features(t);
+	need_modeset = disable_features(t);
 	set_crtc_fbs(t);
 
 	if (t->screen == SCREEN_OFFSCREEN)
 		fill_fb_region(&offscreen_fb, COLOR_OFFSCREEN_BG);
 
-	unset_all_crtcs();
+	igt_display_reset(&drm.display);
+	if (need_modeset)
+		igt_display_commit(&drm.display);
 
 	init_blue_crc(t->format);
 	if (pattern)
 		init_crcs(t->format, pattern);
 
-	enable_features_for_test(t);
+	need_modeset = enable_features_for_test(t);
+	if (need_modeset)
+		igt_display_commit(&drm.display);
 }
 
 static void prepare_subtest_screens(const struct test_mode *t)
-- 
2.18.0

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

  parent reply	other threads:[~2018-08-17  8:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17  8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
2018-08-17  8:56 ` [igt-dev] [PATCH i-g-t v5 2/4] tests/kms_frontbuffer_tracking: Attempt to enable both screens simultaneously Maarten Lankhorst
2018-08-17  8:56 ` Maarten Lankhorst [this message]
2018-08-17  8:56 ` [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC Maarten Lankhorst
2018-08-18  0:04   ` Dhinakaran Pandiyan
2018-08-22 10:17     ` Maarten Lankhorst
2018-08-30  2:02       ` Dhinakaran Pandiyan
2018-08-30  9:12         ` Maarten Lankhorst
2018-08-17 11:04 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Patchwork
2018-08-17 14:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-08-18  0:02 ` [igt-dev] [PATCH i-g-t v5 1/4] " Dhinakaran Pandiyan
2018-09-04 21:41 ` Souza, Jose

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=20180817085642.19501-3-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;
as well as URLs for NNTP newsgroup(s).