summaryrefslogtreecommitdiff
path: root/tests/kms_frontbuffer_tracking.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-03-15 11:57:09 +0100
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-03-15 19:41:45 +0100
commit2e92134b4e4f754239f9721b8781ce2fc0aab07c (patch)
treeb6bddf3a8040ebfb91d95da196dbdbad37c66e14 /tests/kms_frontbuffer_tracking.c
parent17ae4da9059464b9386dd56b07f29322c914ff7b (diff)
tests/kms_frontbuffer_tracking: Reduce fbc status spam, v2.
When FBC cannot be enabled in one of the tests, we get a lot of repeated spam at DEBUG level, which overwrites any good debug level data that you can hope to get out of the test. When running at the debug level, output FBC info only if changed from last time, so we don't get the repeated spam. This makes the debug info from CI slightly more useful. Changes since v1: - Clear last_fbc_buf in fbc_wait_until_enabled. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Remove stray from igt_core.c] Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/kms_frontbuffer_tracking.c')
-rw-r--r--tests/kms_frontbuffer_tracking.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 06b34ddb..2b85392d 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -755,12 +755,24 @@ static int __debugfs_write(const char *param, char *buf, int len)
#define debugfs_read(p, arr) __debugfs_read(p, arr, sizeof(arr))
#define debugfs_write(p, arr) __debugfs_write(p, arr, sizeof(arr))
+static char last_fbc_buf[128];
+
static bool fbc_is_enabled(int lvl)
{
char buf[128];
+ bool print = true;
debugfs_read("i915_fbc_status", buf);
- igt_log(IGT_LOG_DOMAIN, lvl, "fbc_is_enabled()?\n%s", buf);
+ if (lvl != IGT_LOG_DEBUG)
+ last_fbc_buf[0] = '\0';
+ else if (strcmp(last_fbc_buf, buf))
+ strcpy(last_fbc_buf, buf);
+ else
+ print = false;
+
+ if (print)
+ igt_log(IGT_LOG_DOMAIN, lvl, "fbc_is_enabled()?\n%s", buf);
+
return strstr(buf, "FBC enabled\n");
}
@@ -945,6 +957,8 @@ static bool fbc_stride_not_supported(void)
static bool fbc_wait_until_enabled(void)
{
+ last_fbc_buf[0] = '\0';
+
return igt_wait(fbc_is_enabled(IGT_LOG_DEBUG), 2000, 1);
}