public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "José Roberto de Souza" <jose.souza@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/2] tests/kms_fbcon_fbt: Reduce execution time by not calling wait_until_enabled()
Date: Wed,  8 Apr 2020 13:19:25 -0700	[thread overview]
Message-ID: <20200408201925.31566-2-jose.souza@intel.com> (raw)
In-Reply-To: <20200408201925.31566-1-jose.souza@intel.com>

After unset all CRTCs is expected that FBC and PSR is disabled,
calling wait_until_enabled() will make it wait until timeout to it
return false and pass the test.

So instead lets implement is_disabled() hook, as the
kmstest_unset_all_crtcs() is a synchronous call, the features will
be already disabled after it, so no need to do any wait.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 lib/igt_psr.c         | 10 ++++++++++
 lib/igt_psr.h         |  1 +
 tests/kms_fbcon_fbt.c | 21 ++++++++++++++++++++-
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 83ccacdd..f92eff6c 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -25,6 +25,16 @@
 #include "igt_sysfs.h"
 #include <errno.h>
 
+bool psr_disabled_check(int debugfs_fd)
+{
+	char buf[PSR_STATUS_MAX_LEN];
+
+	igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
+				sizeof(buf));
+
+	return strstr(buf, "PSR mode: disabled\n");
+}
+
 static bool psr_active_check(int debugfs_fd, enum psr_mode mode)
 {
 	char buf[PSR_STATUS_MAX_LEN];
diff --git a/lib/igt_psr.h b/lib/igt_psr.h
index ca385736..02ce760b 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -35,6 +35,7 @@ enum psr_mode {
 	PSR_MODE_2
 };
 
+bool psr_disabled_check(int debugfs_fd);
 bool psr_wait_entry(int debugfs_fd, enum psr_mode mode);
 bool psr_wait_update(int debugfs_fd, enum psr_mode mode);
 bool psr_long_wait_update(int debugfs_fd, enum psr_mode mode);
diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index 546dff99..143be3e3 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -135,6 +135,14 @@ static bool fbc_wait_until_enabled(int debugfs_fd)
 	return r;
 }
 
+static bool fbc_is_disabled(int debugfs_fd)
+{
+	bool r = fbc_check_status(debugfs_fd, false);
+
+	fbc_print_status(debugfs_fd);
+	return r;
+}
+
 static bool fbc_wait_until_disabled(int debugfs_fd)
 {
 	bool r = igt_wait(fbc_check_status(debugfs_fd, false), 5000, 1);
@@ -250,6 +258,14 @@ static bool psr_wait_until_enabled(int debugfs_fd)
 	return r;
 }
 
+static bool psr_is_disabled(int debugfs_fd)
+{
+	bool r = psr_disabled_check(debugfs_fd);
+
+	psr_print_status(debugfs_fd);
+	return r;
+}
+
 static bool psr_supported_on_chipset(int debugfs_fd)
 {
 	return psr_sink_support(debugfs_fd, PSR_MODE_1);
@@ -280,18 +296,21 @@ static inline void psr_debugfs_enable(int debugfs_fd)
 struct feature {
 	bool (*supported_on_chipset)(int debugfs_fd);
 	bool (*wait_until_enabled)(int debugfs_fd);
+	bool (*is_disabled)(int debugfs_fd);
 	bool (*wait_until_update)(struct drm_info *drm);
 	bool (*connector_possible_fn)(drmModeConnectorPtr connector);
 	void (*enable)(int debugfs_fd);
 } fbc = {
 	.supported_on_chipset = fbc_supported_on_chipset,
 	.wait_until_enabled = fbc_wait_until_enabled,
+	.is_disabled = fbc_is_disabled,
 	.wait_until_update = fbc_wait_until_update,
 	.connector_possible_fn = connector_can_fbc,
 	.enable = fbc_modparam_enable,
 }, psr = {
 	.supported_on_chipset = psr_supported_on_chipset,
 	.wait_until_enabled = psr_wait_until_enabled,
+	.is_disabled = psr_is_disabled,
 	.wait_until_update = psr_wait_until_update,
 	.connector_possible_fn = connector_can_psr,
 	.enable = psr_debugfs_enable,
@@ -310,7 +329,7 @@ static void subtest(struct drm_info *drm, struct feature *feature, bool suspend)
 
 	kmstest_unset_all_crtcs(drm->fd, drm->res);
 	wait_user("Modes unset.");
-	igt_assert(!feature->wait_until_enabled(drm->debugfs_fd));
+	igt_assert(feature->is_disabled(drm->debugfs_fd));
 
 	set_mode_for_one_screen(drm, &fb, feature->connector_possible_fn);
 	wait_user("Screen set.");
-- 
2.26.0

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

  reply	other threads:[~2020-04-08 20:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 20:19 [igt-dev] [PATCH i-g-t 1/2] tests/kms_fbcon_fbt: Make FBC wait_until_update() more reliable José Roberto de Souza
2020-04-08 20:19 ` José Roberto de Souza [this message]
2020-04-29 15:01   ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_fbcon_fbt: Reduce execution time by not calling wait_until_enabled() Imre Deak
2020-04-30  6:43   ` Mun, Gwan-gyeong
2020-04-08 22:13 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] tests/kms_fbcon_fbt: Make FBC wait_until_update() more reliable Patchwork
2020-04-09  0:42 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_fbcon_fbt: Make FBC wait_until_update() more reliable (rev2) Patchwork
2020-04-09 12:41 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-04-11  3:42 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_fbcon_fbt: Make FBC wait_until_update() more reliable (rev3) Patchwork
2020-04-11 10:30 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-04-29 15:00 ` [igt-dev] [PATCH i-g-t 1/2] tests/kms_fbcon_fbt: Make FBC wait_until_update() more reliable Imre Deak

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=20200408201925.31566-2-jose.souza@intel.com \
    --to=jose.souza@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