public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v6 1/2] tests/kms_fbcon_fbt: Reduce execution time
@ 2020-04-07 16:35 José Roberto de Souza
  2020-04-07 16:35 ` [igt-dev] [PATCH i-g-t v6 2/2] tests/kms_fbcon_fbt: Handle FBC enabled on fbcon in GEN9+ José Roberto de Souza
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: José Roberto de Souza @ 2020-04-07 16:35 UTC (permalink / raw)
  To: igt-dev

Every time fbc_wait_until_enabled() is called from
fbc_wait_until_update() it was waiting the whole 5 seconds of timeout
to return false as expected.
To save most 99% of this adding here fbc_wait_until_disabled().

v5:
- Fixed fbc_wait_until_update() test

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 tests/kms_fbcon_fbt.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index ed4cccbe..b8000a24 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -113,18 +113,28 @@ static void fbc_print_status(int debugfs_fd)
 	igt_debug("FBC status: %s\n", buf);
 }
 
-static bool fbc_is_enabled(int debugfs_fd)
+static bool fbc_check_status(int debugfs_fd, bool enabled)
 {
 	char buf[128];
 
 	igt_debugfs_simple_read(debugfs_fd, "i915_fbc_status", buf,
 				sizeof(buf));
-	return strstr(buf, "FBC enabled\n");
+	if (enabled)
+		return strstr(buf, "FBC enabled\n");
+	else
+		return strstr(buf, "FBC disabled");
 }
 
 static bool fbc_wait_until_enabled(int debugfs_fd)
 {
-	bool r = igt_wait(fbc_is_enabled(debugfs_fd), 5000, 1);
+	bool r = igt_wait(fbc_check_status(debugfs_fd, true), 5000, 1);
+	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);
 	fbc_print_status(debugfs_fd);
 	return r;
 }
@@ -141,7 +151,7 @@ static bool fbc_wait_until_update(int debugfs)
 	 * If one day fbcon starts to use a tiled framebuffer we would need to
 	 * check the 'Compressing' status as in each blink it would be disabled.
 	 */
-	return !fbc_wait_until_enabled(debugfs);
+	return fbc_wait_until_disabled(debugfs);
 }
 
 typedef bool (*connector_possible_fn)(drmModeConnectorPtr connector);
-- 
2.26.0

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-08  5:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-07 16:35 [igt-dev] [PATCH i-g-t v6 1/2] tests/kms_fbcon_fbt: Reduce execution time José Roberto de Souza
2020-04-07 16:35 ` [igt-dev] [PATCH i-g-t v6 2/2] tests/kms_fbcon_fbt: Handle FBC enabled on fbcon in GEN9+ José Roberto de Souza
2020-04-07 18:12   ` Ville Syrjälä
2020-04-08  5:44     ` Souza, Jose
2020-04-07 18:11 ` [igt-dev] [PATCH i-g-t v6 1/2] tests/kms_fbcon_fbt: Reduce execution time Ville Syrjälä
2020-04-07 18:14 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v6,1/2] " Patchwork
2020-04-08  1:04 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox