Skip to contentSkip to conversation

Convert sh scripts to C variants.

PATCH In review Marius Vlad 3 participants 7 messages Dec 1, 2016 – Dec 2, 2016 Library code

lore
Share & tools
lore
#0 lore raw

v7 cover Convert sh scripts to C variants.

Latest changes include addressing comments from previous version and include some notes about driver loading/unloading when using in combination to drm_open_driver().

This series adds some library support to help converting sh scripts to C version. Based on that I've converted drv_module_reload_basic and kms_sysfs_edid_timing. Other tests should follow. drv_module_reload requires the most boilerplate code.

The reason for so many changes is the fact that some code got moved so other users can use it. Secondly wrappers around libkmod in lib/igt_kmod and procps in lib/igt_aux. Thirdly drv_module_reload has embedded tools/gem_info and tests/gem_exec_store in it, with minor modifications to allow running them as subtests. Finally, C is more verbose than sh.

Changes since v6:
- addressed comments (Chris Wilson)
- document the fact that driver loading/unloading used in combination with drm_open_driver() would fail
- print also opened fd from /dev/dri in case driver unloading fails
- minor changes to igt_lsof()

Changes since v5:
- new helper in lib/igt_aux to display info about opened files by processes and a new function to show a list of loaded modules (Petri Latvala)

Changes since v4:
- rebased to include unbinding snd_hda_intel
- added igt_i915_driver_load/unload so it can used in lib/igt_gvt and tests/drv_module_reload (Cris Wilson)
- do not hard fail when loading/reloading in lib/igt_gvt (Chris Wilson)
- remove subgroups in tests/drv_module_reload (Chris Wilson)
- make tests/kms_sysfs_edid_timing intel-agnostic when searching for connectors and use igt_mean (Chris Wilson)

Changes since v3:
- lib/igt_kmod: added libkmod helpers into their own file. There seems to be another user for it: lib/igt_gvt. Fixed a issue with lib/igt_gvt while at it and converted to make use of lib/igt_kmod.
- lib/{igt_kmod, igt_aux}: Fixed gtk-doc documentation formatting (Daniel Vetter)
- tests/drv_module_reload: Re-worked reload() method by splitting into load() and unload() and asserting more.
- replaced SW_FINISH with SET_CACHEING in tests/drv_module_reload (Chris Wilson)

Changes since v2:
- lib/igt_aux: Addressed comments from Chris Wilson
- tests/drv_module_reload: Passed incorrectly boolean instead of uint as flags to igt_kmod_unload().

Changes since v1:
- lib/igt_aux: Addressed comments from Chris Wilson
- tests/drv_module_reload: Addressed comments from Chris Wilson and Petri Latvala
- tests/kms_sysfs_edid_timing: Addressed comments from Chris Wilson
- (Hopefully): Addressed comments from Jani Nikula.

Marius Vlad (4):
lib/igt_kmod: New library to support driver loading/unloading and
additional helpers.
lib/igt_gvt: Make use of libkmod helpers and fix reading gvt
parameter.
tests/drv_module_reload: Convert sh script to C version. tests/kms_sysfs_edid_timing: Convert sh to C version.

 configure.ac                                       |   2 +
 .../intel-gpu-tools/intel-gpu-tools-docs.xml       |   1 +
 lib/Makefile.am                                    |   5 +-
 lib/Makefile.sources                               |   2 +
 lib/igt_aux.c                                      | 260 ++++++++++++++++
 lib/igt_aux.h                                      |   3 +
 lib/igt_gvt.c                                      |  78 ++---
 lib/igt_kmod.c                                     | 328 ++++++++++++++++++++
 lib/igt_kmod.h                                     |  39 +++
 lib/igt_sysfs.c                                    | 106 +++++++
 lib/igt_sysfs.h                                    |   3 +
 tests/Makefile.am                                  |   1 -
 tests/Makefile.sources                             |   4 +-
 tests/drv_module_reload.c                          | 332 +++++++++++++++++++++
 tests/drv_module_reload_basic                      | 111 -------
 tests/gem_alive.c                                  |  35 ---
 tests/gvt_basic.c                                  |   2 +-
 tests/intel-ci/fast-feedback.testlist              |   4 +-
 tests/kms_sysfs_edid_timing                        |  25 --
 tests/kms_sysfs_edid_timing.c                      |  97 ++++++
 tools/Makefile.sources                             |   1 +
 tools/intel_gem_info.c                             |  35 +++
 22 files changed, 1238 insertions(+), 236 deletions(-)
 create mode 100644 lib/igt_kmod.c
 create mode 100644 lib/igt_kmod.h
 create mode 100644 tests/drv_module_reload.c
 delete mode 100755 tests/drv_module_reload_basic
 delete mode 100644 tests/gem_alive.c
 delete mode 100755 tests/kms_sysfs_edid_timing
 create mode 100644 tests/kms_sysfs_edid_timing.c
 create mode 100644 tools/intel_gem_info.c
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v7 1/4 lib/igt_kmod: New library to support driver loading/unloading and additional helpers.

lib/igt_aux: Added igt_pkill and igt_lsof helper.
lib/igt_kmod: Added load/unload kmod helpers.

v7:
- document the case where leaving stray fd from drm_open_driver() might fail reloading the driver.
- list also current opened files from /dev/dri in case we could not unload the driver.
- convert igt_info to igt_warn (Chris Wilson)
- added KMOD_|PROCPS CFLAGS (Chris Wilson)

v6:
- include latest modifications from tests/drv_module_reload:
display all loaded modules and list information about opened files by processes (Petri Latvala)

v5:
- added igt_i915_driver_{load/unload}.
- added kick_snd_hda_intel() to match current
tests/drv_module_reload_basic and integrated into
igt_i915_driver_load/unload.
- added gtk-doc section for lib/igt_kmod

v4:
- decided to split libkmod helpers into their own file as there's another user lib/igt_gvt or tests/gvt_basic.
- fixed some gtk-doc documentation.

v3:
- return -errno (igt_pkill()) in case of failure (Cris Wilson)
- return bool for igt_kmod_is_loaded(), replaced strncasecmp with strncmp (Chris Wilson)
- use igt_debug() instead of igt_info() for igt_kmod_load()/ igt_kmod_unload() and return -err directly from libkmod (Chris Wilson)

v2:
- Renamed libkmod helpers (Chris Wilson)
- Removed SIGTERM/SIGKILL case where we repeatedly tried to terminate the
process: just call kill(2) once (Chris Wilson)
- Removed redundant check in igt_kmod_unload(), igt_module_in_use() (Chris Wilson)
- Pass flags to igt_kmod_unload() from the caller (Chris Wilson)
- Removed useless function igt_kill() which acts just as kill(2) (Chris Wilson)

---
 configure.ac                                       |   2 +
 .../intel-gpu-tools/intel-gpu-tools-docs.xml       |   1 +
 lib/Makefile.am                                    |   5 +-
 lib/Makefile.sources                               |   2 +
 lib/igt_aux.c                                      | 260 ++++++++++++++++
 lib/igt_aux.h                                      |   3 +
 lib/igt_gvt.c                                      |  43 +--
 lib/igt_kmod.c                                     | 328 +++++++++++++++++++++
 lib/igt_kmod.h                                     |  39 +++
 lib/igt_sysfs.c                                    | 106 +++++++
 lib/igt_sysfs.h                                    |   3 +
 11 files changed, 750 insertions(+), 42 deletions(-)
 create mode 100644 lib/igt_kmod.c
 create mode 100644 lib/igt_kmod.h
configure.ac +2 -0
index e181c83..cba312f 100644
@@ -121,6 +121,8 @@ AC_SUBST(ASSEMBLER_WARN_CFLAGS)
 
 PKG_CHECK_MODULES(DRM, [libdrm])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
+PKG_CHECK_MODULES(KMOD, [libkmod])
+PKG_CHECK_MODULES(PROCPS, [libprocps])
 
 case "$target_cpu" in
 	x86*|i?86)
docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml +1 -0
index c862f2a..39061a8 100644
@@ -22,6 +22,7 @@
     <xi:include href="xml/igt_sysfs.xml"/>
     <xi:include href="xml/igt_draw.xml"/>
     <xi:include href="xml/igt_kms.xml"/>
+    <xi:include href="xml/igt_kmod.xml"/>
     <xi:include href="xml/igt_fb.xml"/>
     <xi:include href="xml/igt_aux.xml"/>
     <xi:include href="xml/igt_gt.xml"/>
lib/Makefile.am +4 -1
index 4c0893d..5eec207 100644
@@ -23,7 +23,8 @@ if !HAVE_LIBDRM_INTEL
 endif
 
 AM_CPPFLAGS = -I$(top_srcdir)
-AM_CFLAGS = $(CWARNFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(LIBUNWIND_CFLAGS) $(DEBUG_CFLAGS) \
+AM_CFLAGS = $(CWARNFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(LIBUNWIND_CFLAGS) \
+	    $(DEBUG_CFLAGS) $(KMOD_CFLAGS) $(PROCPS_CFLAGS) \
 	    -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \
 	    -DIGT_DATADIR=\""$(pkgdatadir)"\" \
 	    -DIGT_LOG_DOMAIN=\""$(subst _,-,$*)"\" \
@@ -34,6 +35,8 @@ AM_CFLAGS += $(CAIRO_CFLAGS)
 libintel_tools_la_LIBADD = \
 	$(DRM_LIBS) \
 	$(PCIACCESS_LIBS) \
+	$(PROCPS_LIBS) \
+	$(KMOD_LIBS) \
 	$(CAIRO_LIBS) \
 	$(LIBUDEV_LIBS) \
 	$(LIBUNWIND_LIBS) \
lib/Makefile.sources +2 -0
index e8e277b..2205c86 100644
@@ -77,6 +77,8 @@ lib_source_list =	 	\
 	igt_pm.h		\
 	uwildmat/uwildmat.h	\
 	uwildmat/uwildmat.c	\
+	igt_kmod.c		\
+	igt_kmod.h		\
 	$(NULL)
 
 .PHONY: version.h.tmp
lib/igt_aux.c +260 -0

278 lines not on this page · raw message

lib/igt_aux.h +3 -0
index d30196b..4162527 100644
@@ -264,4 +264,7 @@ double igt_stop_siglatency(struct igt_mean *result);
 void igt_set_module_param(const char *name, const char *val);
 void igt_set_module_param_int(const char *name, int val);
 
+int igt_pkill(int sig, const char *comm);
+void igt_lsof(const char *dpath);
+
 #endif /* IGT_AUX_H */
lib/igt_gvt.c +2 -41

57 lines not on this page · raw message

lib/igt_kmod.c new file +328 -0

328 lines not on this page · raw message

lib/igt_kmod.h new file +39 -0
new file mode 100644
index 0000000..dcf8f67
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2016 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.
+ */
+
+#ifndef IGT_KMOD_H
+#define IGT_KMOD_H
+
+#include <libkmod.h>
+
+bool igt_kmod_is_loaded(const char *mod_name);
+void igt_kmod_list_loaded(void);
+
+int igt_kmod_load(const char *mod_name, const char *opts);
+int igt_kmod_unload(const char *mod_name, unsigned int flags);
+
+int igt_i915_driver_load(const char *opts);
+int igt_i915_driver_unload(void);
+
+
+#endif /* IGT_KMOD_H */
lib/igt_sysfs.c +106 -0

116 lines not on this page · raw message

lib/igt_sysfs.h +3 -0
index 4820066..69b2e5e 100644
@@ -43,4 +43,7 @@ bool igt_sysfs_set_u32(int dir, const char *attr, uint32_t value);
 bool igt_sysfs_get_boolean(int dir, const char *attr);
 bool igt_sysfs_set_boolean(int dir, const char *attr, bool value);
 
+void kick_fbcon(bool enable);
+void kick_snd_hda_intel(void);
+
 #endif /* __IGT_SYSFS_H__ */
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v7 2/4 lib/igt_gvt: Make use of libkmod helpers and fix reading gvt parameter.

In reply to Marius Vlad

v2:
- use igt_sysfs_get_boolean() to get gvt status (Chris Wilson)
- do not hard-fail when i915 module could not be loaded/unloaded (Chris Wilson)

---
 lib/igt_gvt.c     | 37 ++++++++++++++++++-------------------
 tests/gvt_basic.c |  2 +-
 2 files changed, 19 insertions(+), 20 deletions(-)
lib/igt_gvt.c +18 -19
index 8bbf9bd..4ab7433 100644
@@ -24,35 +24,30 @@
 #include "igt.h"
 #include "igt_gvt.h"
 #include "igt_sysfs.h"
+#include "igt_kmod.h"
 
+#include <signal.h>
 #include <dirent.h>
 #include <unistd.h>
 #include <fcntl.h>
 
 static bool is_gvt_enabled(void)
 {
-	FILE *file;
-	int value;
 	bool enabled = false;
+	int dir, fd;
 
-	file = fopen("/sys/module/i915/parameters/enable_gvt", "r");
-	if (!file)
+	fd = __drm_open_driver(DRIVER_INTEL);
+	dir = igt_sysfs_open_parameters(fd);
+	if (dir < 0)
 		return false;
 
-	if (fscanf(file, "%d", &value) == 1)
-		enabled = value;
-	fclose(file);
+	enabled = igt_sysfs_get_boolean(dir, "enable_gvt");
 
-	errno = 0;
-	return enabled;
-}
+	close(dir);
+	close(fd);
 
-static void unload_i915(void)
-{
-	kick_fbcon(false);
-	/* pkill alsact */
+	return enabled;
 
-	igt_ignore_warn(system("/sbin/modprobe -s -r i915"));
 }
 
 bool igt_gvt_load_module(void)
@@ -60,8 +55,11 @@ bool igt_gvt_load_module(void)
 	if (is_gvt_enabled())
 		return true;
 
-	unload_i915();
-	igt_ignore_warn(system("/sbin/modprobe -s i915 enable_gvt=1"));
+	if (igt_i915_driver_unload())
+		return false;
+
+	if (igt_i915_driver_load("enable_gvt=1"))
+		return false;
 
 	return is_gvt_enabled();
 }
@@ -71,8 +69,9 @@ void igt_gvt_unload_module(void)
 	if (!is_gvt_enabled())
 		return;
 
-	unload_i915();
-	igt_ignore_warn(system("/sbin/modprobe -s i915 enable_gvt=0"));
+	igt_i915_driver_unload();
+
+	igt_i915_driver_load(NULL);
 
 	igt_assert(!is_gvt_enabled());
 }
tests/gvt_basic.c +1 -1
index 48b853a..4e909a5 100644
@@ -32,7 +32,7 @@ igt_main
 
 	igt_fixture {
 		igt_require(igt_gvt_load_module());
-		fd = drm_open_driver(DRIVER_INTEL);
+		fd = __drm_open_driver(DRIVER_INTEL);
 	}
 
 	igt_subtest_f("invalid-placeholder-test");
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH v7 3/4 tests/drv_module_reload: Convert sh script to C version.

In reply to Marius Vlad

v5:
- reword gem_info to gem_sanitychecks (Chris Wilson)
- remove subgroups/subtests for gem_exec_store and gem_sanitycheck (Chris Wilson)

v4:
- adjust test to make use of lib/igt_kmod
- replaced SW_FINISH with SET_CACHEING (Chris Wilson)

v3:
- fix passing boolean value as flags to igt_kmod_unload().

v2:
- embedded gem_alive and gem_exec_store into test (Chris Wilson)
- int main() to igt_main (Chris Wilson)
- moved tests/gem_alive -> tools/gem_info (Chris Wilson)
- added to intel-ci/fast-feedback.testlist (Petri Latvala)
- added hda_dynamic_debug() (Petri Latvala)
- renamed from tests/drv_module_reload_basic to tests/drv_module_reload (all subtests are basic and have been added to fast-feedback.testlist)

---
 tests/Makefile.am                     |   1 -
 tests/Makefile.sources                |   2 +-
 tests/drv_module_reload.c             | 332 ++++++++++++++++++++++++++++++++++
 tests/drv_module_reload_basic         | 111 ------------
 tests/gem_alive.c                     |  35 ----
 tests/intel-ci/fast-feedback.testlist |   4 +-
 tools/Makefile.sources                |   1 +
 tools/intel_gem_info.c                |  35 ++++
 8 files changed, 372 insertions(+), 149 deletions(-)
 create mode 100644 tests/drv_module_reload.c
 delete mode 100755 tests/drv_module_reload_basic
 delete mode 100644 tests/gem_alive.c
 create mode 100644 tools/intel_gem_info.c
tests/Makefile.am +0 -1
index a408126..14a41ae 100644
@@ -26,7 +26,6 @@ noinst_PROGRAMS = \
 	$(NULL)
 
 pkglibexec_PROGRAMS = \
-	gem_alive \
 	gem_stress \
 	$(TESTS_progs) \
 	$(TESTS_progs_M) \
tests/Makefile.sources +1 -1
index 65e0792..2d6ed8d 100644
@@ -214,6 +214,7 @@ TESTS_progs = \
 	kms_pwrite_crc \
 	kms_sink_crc_basic \
 	prime_udl \
+	drv_module_reload \
 	$(NULL)
 
 # IMPORTANT: The ZZ_ tests need to be run last!
@@ -224,7 +225,6 @@ TESTS_scripts_M = \
 TESTS_scripts = \
 	debugfs_emon_crash \
 	drv_debugfs_reader \
-	drv_module_reload_basic \
 	kms_sysfs_edid_timing \
 	sysfs_l3_parity \
 	test_rte_check \
tests/drv_module_reload.c new file +332 -0

332 lines not on this page · raw message

tests/drv_module_reload_basic deleted +0 -111

111 lines not on this page · raw message

tests/gem_alive.c deleted +0 -35
deleted file mode 100644
index 7544443..0000000
@@ -1,35 +0,0 @@
-#include "igt.h"
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <i915_drm.h>
-
-
-int main(void)
-{
-	struct drm_i915_gem_sw_finish arg = { 0 };
-	int fd;
-
-	signal(SIGALRM, SIG_IGN);
-
-	fd = __drm_open_driver(DRIVER_INTEL);
-	if (fd < 0)
-		return IGT_EXIT_SKIP;
-
-	alarm(1);
-	if (ioctl(fd, DRM_IOCTL_I915_GEM_SW_FINISH, &arg) == 0)
-		return IGT_EXIT_SKIP;
-
-	switch (errno) {
-	case ENOENT:
-		return 0;
-	case EIO:
-		return 1;
-	case EINTR:
-		return 2;
-	default:
-		return 3;
-	}
-}
tests/intel-ci/fast-feedback.testlist +3 -1
index 6efaaa4..0436ac3 100644
@@ -3,7 +3,9 @@ igt@core_prop_blob@basic
 igt@drv_getparams_basic@basic-eu-total
 igt@drv_getparams_basic@basic-subslice-total
 igt@drv_hangman@error-state-basic
-igt@drv_module_reload_basic
+igt@drv_module_reload@basic-reload
+igt@drv_module_reload@basic-reload-inject
+igt@drv_module_reload@basic-reload-final
 igt@gem_basic@bad-close
 igt@gem_basic@create-close
 igt@gem_basic@create-fd-close
tools/Makefile.sources +1 -0
index be58871..e2451ea 100644
@@ -29,6 +29,7 @@ tools_prog_lists =		\
 	intel_residency		\
 	intel_stepping		\
 	intel_watermark		\
+	intel_gem_info		\
 	$(NULL)
 
 dist_bin_SCRIPTS = intel_gpu_abrt
tools/intel_gem_info.c new file +35 -0
new file mode 100644
index 0000000..7544443
@@ -0,0 +1,35 @@
+#include "igt.h"
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <signal.h>
+#include <i915_drm.h>
+
+
+int main(void)
+{
+	struct drm_i915_gem_sw_finish arg = { 0 };
+	int fd;
+
+	signal(SIGALRM, SIG_IGN);
+
+	fd = __drm_open_driver(DRIVER_INTEL);
+	if (fd < 0)
+		return IGT_EXIT_SKIP;
+
+	alarm(1);
+	if (ioctl(fd, DRM_IOCTL_I915_GEM_SW_FINISH, &arg) == 0)
+		return IGT_EXIT_SKIP;
+
+	switch (errno) {
+	case ENOENT:
+		return 0;
+	case EIO:
+		return 1;
+	case EINTR:
+		return 2;
+	default:
+		return 3;
+	}
+}
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH v7 4/4 tests/kms_sysfs_edid_timing: Convert sh to C version.

In reply to Marius Vlad

The debug output for a HSW machine with two connectors (VGA and HDMI):

DEBUG: card0-VGA-1: mean.max 12896229,00ns, 12896,23us, 12,90ms, mean.avg 12785055,80ns, 12785,06us, 12,79ms
WARNING: card0-VGA-1: probe time exceed 10ms, max=12,90ms, avg=12,79ms
DEBUG: card0-HDMI-A-1: mean.max 781433,00ns, 781,43us, 0,78ms, mean.avg 706643,20ns, 706,64us, 0,71ms

v4:
- do not include the time opening the fd (Chris Wilson)
- include output from debug (Chris Wilson)

v3:
- use igt_mean for accounting (Chris Wilson)
- make it Intel-agnostic when searching for connectors (Chris Wilson)

v2:
- don't read cached values (Chris Wilson)
- warn on per connector, and fail per mean (Chris Wilson)

These are synthetic: 10ms per connector, and 50ms for all.

---
 tests/Makefile.sources        |  2 +-
 tests/kms_sysfs_edid_timing   | 25 -----------
 tests/kms_sysfs_edid_timing.c | 97 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+), 26 deletions(-)
 delete mode 100755 tests/kms_sysfs_edid_timing
 create mode 100644 tests/kms_sysfs_edid_timing.c
tests/Makefile.sources +1 -1
index 2d6ed8d..f835726 100644
@@ -215,6 +215,7 @@ TESTS_progs = \
 	kms_sink_crc_basic \
 	prime_udl \
 	drv_module_reload \
+	kms_sysfs_edid_timing \
 	$(NULL)
 
 # IMPORTANT: The ZZ_ tests need to be run last!
@@ -225,7 +226,6 @@ TESTS_scripts_M = \
 TESTS_scripts = \
 	debugfs_emon_crash \
 	drv_debugfs_reader \
-	kms_sysfs_edid_timing \
 	sysfs_l3_parity \
 	test_rte_check \
 	tools_test \
tests/kms_sysfs_edid_timing deleted +0 -25
deleted file mode 100755
index 46ea540..0000000
@@ -1,25 +0,0 @@
-#!/bin/bash
-#
-# This check the time we take to read the content of all the possible connectors.
-# Without the edid -ENXIO patch (http://permalink.gmane.org/gmane.comp.video.dri.devel/62083),
-# we sometimes take a *really* long time. So let's just check for some reasonable timing here
-#
-
-DRM_LIB_ALLOW_NO_MASTER=1
-
-SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
-. $SOURCE_DIR/drm_lib.sh
-
-TIME1=$(date +%s%N)
-cat $(find /sys/devices/|grep drm | grep /status) > /dev/null
-TIME2=$(date +%s%N)
-
-# time in ms
-RES=$(((TIME2 - TIME1) / 1000000))
-
-if [ $RES -gt 600 ]; then
-	echo "Talking to outputs took ${RES}ms, something is wrong"
-	exit $IGT_EXIT_FAILURE
-fi
-
-exit $IGT_EXIT_SUCCESS
tests/kms_sysfs_edid_timing.c new file +97 -0

97 lines not on this page · raw message

Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
In reply to Marius Vlad
Quoted 3 lines · Marius Vlad

Latest changes include addressing comments from previous version and include some notes about driver loading/unloading when using in combination to drm_open_driver().

Pushed the first 2 since I had an ulterior motive in writing a i915.ko selftest runner. I was going to push the 4th (probe timings), but git refused to apply it.

The actual conversion from sh to C for drv_module_reload_basic needs an ack from Petri after some soak testing. Please rebase (if required). -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx