[PATCH i-g-t] tests/initial_state: Add a test to capture the state of the GPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When running testlist for CI iot would be good to know if
the state of the GPU is as expected. This adds a subtest to check
if the GPU is wedged.

Signed-off-by: Marta Lofstedt <marta.lofstedt@xxxxxxxxx>
---
 tests/Makefile.sources                |  1 +
 tests/initial_state.c                 | 52 +++++++++++++++++++++++++++++++++++
 tests/intel-ci/extended.testlist      |  1 +
 tests/intel-ci/fast-feedback.testlist |  1 +
 4 files changed, 55 insertions(+)
 create mode 100644 tests/initial_state.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 9553e4d9..32431a05 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -152,6 +152,7 @@ TESTS_progs_M = \
 	vgem_basic \
 	vgem_slow \
 	meta_test \
+	initial_state \
 	$(NULL)
 
 if HAVE_CHAMELIUM
diff --git a/tests/initial_state.c b/tests/initial_state.c
new file mode 100644
index 00000000..1c5d9a74
--- /dev/null
+++ b/tests/initial_state.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "igt.h"
+
+/*
+ * The purpose of this test is to capture the
+ * state of the GPU before running a testlist.
+ *
+ * Note, this test currently only checks if
+ * i915 is wedged. But, it could be extended to report
+ * on other bad initial states.
+ */
+
+static void is_wedged(void)
+{
+	char buf[128];
+	int fd = drm_open_driver(DRIVER_INTEL);
+
+	igt_debugfs_read(fd, "i915_wedged", buf);
+	igt_assert(!strstr(buf, "1"));
+}
+
+igt_main
+{
+
+	igt_subtest("is_wedged")
+		is_wedged();
+}
diff --git a/tests/intel-ci/extended.testlist b/tests/intel-ci/extended.testlist
index a16c9c84..2ec08b55 100644
--- a/tests/intel-ci/extended.testlist
+++ b/tests/intel-ci/extended.testlist
@@ -1,3 +1,4 @@
+igt@initial_state@is_wedged
 igt@core_auth@many-magics
 igt@core_getclient
 igt@core_get_client_auth@master-drop
diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index 5ffa2cef..a6a0a810 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -1,3 +1,4 @@
+igt@initial_state@is_wedged
 igt@core_auth@basic-auth
 igt@core_prop_blob@basic
 igt@drv_getparams_basic@basic-eu-total
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux