All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/module_load: Add probe subtest
@ 2018-12-11 13:02 Arkadiusz Hiler
  2018-12-11 13:32 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arkadiusz Hiler @ 2018-12-11 13:02 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The subtest is intended to be run as the very first thing on a machine with
i915 blacklisted. It is supposed to be a catch-all for warnings/issues that
happen during the initial module load.

If i915 turns out to be already loaded, the subtest simply skips.

Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 tests/i915/module_load.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/tests/i915/module_load.c b/tests/i915/module_load.c
index 7fe83520..14552990 100644
--- a/tests/i915/module_load.c
+++ b/tests/i915/module_load.c
@@ -324,8 +324,48 @@ hda_dynamic_debug(bool enable)
 	fclose(fp);
 }
 
+static void
+reprobe_connectors(int fd)
+{
+	int i, ret;
+	struct drm_mode_get_connector conn;
+
+	drmModeResPtr res = drmModeGetResources(fd);
+	if (!res)
+		return;
+
+	for (i = 0; i < res->count_connectors; ++i) {
+		memset(&conn, 0, sizeof(conn));
+		conn.connector_id = res->connectors[i];
+		ret = drmIoctl(fd, DRM_IOCTL_MODE_GETCONNECTOR, &conn);
+		igt_assert_neq(ret, -EFAULT);
+	}
+
+	drmModeFreeResources(res);
+}
+
 igt_main
 {
+	/* This subtest is intended to be run as the very first thing on a
+	 * machine with i915 blacklisted. It is supposed to be a catch-all for
+	 * warnings/issues that happen during the initial module load. */
+	igt_subtest("probe") {
+		int fd;
+
+		if (igt_kmod_is_loaded("i915"))
+			igt_skip("i915 already loaded\n");
+
+		/* modprobe happens here */
+		fd = __drm_open_driver(DRIVER_INTEL);
+		igt_assert(fd > 0);
+
+		/* connectors probing happens during boot because vtconsole,
+		 * so let's mimic that */
+		reprobe_connectors(fd);
+
+		close(fd);
+	}
+
 	igt_subtest("reload") {
 		int load_error;
 
-- 
2.19.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-11 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 13:02 [igt-dev] [PATCH i-g-t] tests/i915/module_load: Add probe subtest Arkadiusz Hiler
2018-12-11 13:32 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-12-11 13:41 ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2018-12-11 14:47 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.