Re: [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]

 



The commit name "Add a test to capture the state of the GPU" should likely be renamed to "Add a test that checks the current state of the driver".

On 12/05/17 14:07, Marta Lofstedt wrote:
When running testlist for CI iot would be good to know if

iot -> it

the state of the GPU is as expected. This adds a subtest to check
if the GPU is wedged.

This is not mandatory, but how about adding:

"When coupled with piglit's abort-on feature, this makes the piglit results contain the reason for the abort when the driver's initial state is unacceptable, improving debuggability"

With the commit title and the typo fixed, the patch is:
Acked-by: Martin Peres <martin.peres@xxxxxxxxxxxxxxx>


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

_______________________________________________
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