All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t] tests/i915/module_load: Add probe subtest
Date: Tue, 11 Dec 2018 15:02:06 +0200	[thread overview]
Message-ID: <20181211130206.18804-1-arkadiusz.hiler@intel.com> (raw)

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

             reply	other threads:[~2018-12-11 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 13:02 Arkadiusz Hiler [this message]
2018-12-11 13:32 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/module_load: Add probe subtest 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181211130206.18804-1-arkadiusz.hiler@intel.com \
    --to=arkadiusz.hiler@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.