summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2015-07-13 17:30:43 -0300
committerPaulo Zanoni <paulo.r.zanoni@intel.com>2015-07-14 13:06:41 -0300
commit7c5a218cc31e95f5b8b74dba80488ca37b9d85fd (patch)
tree67ca8531df3ffc52a7da2cdc987a89159cc10f36
parent1c389f69f0b188edd47eca1901f62ba36a59f37f (diff)
kms_frontbuffer_tracking: implement suspend subtest
Make sure we survive suspend/resume. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
-rw-r--r--tests/kms_frontbuffer_tracking.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index e2299c96..eb8ca192 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -2251,6 +2251,42 @@ static void modesetfrombusy_subtest(const struct test_mode *t)
}
/**
+ * suspend - make sure suspend/resume keeps us on the same state
+ *
+ * METHOD
+ * Set a mode, assert FBC is there, suspend, resume, assert FBC is still
+ * there. Unset modes, assert FBC is disabled, resuspend, resume, assert FBC
+ * is still disabled.
+ *
+ * EXPECTED RESULTS
+ * Suspend/resume doesn't affect the FBC state.
+ *
+ * FAILURES
+ * A lot of different things could lead to a bug here, you'll have to check
+ * the Kernel code.
+ */
+static void suspend_subtest(const struct test_mode *t)
+{
+ struct modeset_params *params = pick_params(t);
+
+ prepare_subtest(t, NULL);
+ sleep(5);
+ igt_system_suspend_autoresume();
+ sleep(5);
+ do_assertions(0);
+
+ unset_all_crtcs();
+ sleep(5);
+ igt_system_suspend_autoresume();
+ sleep(5);
+ do_assertions(ASSERT_FBC_DISABLED | ASSERT_PSR_DISABLED |
+ DONT_ASSERT_CRC);
+
+ set_mode_for_params(params);
+ do_assertions(0);
+}
+
+/**
* farfromfence - test drawing as far from the fence start as possible
*
* METHOD
@@ -2702,6 +2738,9 @@ int main(int argc, char *argv[])
if (t.feature & FEATURE_FBC)
igt_subtest_f("%s-badstride", feature_str(t.feature))
badstride_subtest(&t);
+
+ igt_subtest_f("%s-suspend", feature_str(t.feature))
+ suspend_subtest(&t);
TEST_MODE_ITER_END
/*