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 2/3] tests/i915_load: Add 'load' subtest
Date: Wed, 17 Oct 2018 15:15:44 +0300 [thread overview]
Message-ID: <20181017121545.29096-2-arkadiusz.hiler@intel.com> (raw)
In-Reply-To: <20181017121545.29096-1-arkadiusz.hiler@intel.com>
This subtest is meant to be run as a first thing on your system, making
it a catch-all for all the issues we can hit during the HW init, so the
runner can do its magic by looking for dragons in the dmesg and
overriding the final result if any were spotted.
To have full "normal boot" experience it also probes all the connectors.
The subtest warns if the driver is already loaded, so we know that
there's something off with the environment configuration.
It's already blacklisted for Intel's CI, along the other
module-wrangling subtests.
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
tests/i915_load.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/tests/i915_load.c b/tests/i915_load.c
index cf4aea80..4f61d280 100644
--- a/tests/i915_load.c
+++ b/tests/i915_load.c
@@ -35,6 +35,7 @@
#include <signal.h>
#include <sys/ioctl.h>
#include <fcntl.h>
+#include <xf86drmMode.h>
#define LOCAL_I915_EXEC_BSD_SHIFT (13)
@@ -324,8 +325,46 @@ hda_dynamic_debug(bool enable)
fclose(fp);
}
+static void
+reprobe_connectors(int fd)
+{
+ int i;
+ drmModeConnectorPtr conn;
+
+ drmModeResPtr res = drmModeGetResources(fd);
+ if (!res)
+ return;
+
+ for (i = 0; i < res->count_connectors; ++i) {
+ /* drmModeGetConnector forces probe */
+ conn = drmModeGetConnector(fd, res->connectors[i]);
+ igt_assert(conn);
+ drmModeFreeConnector(conn);
+ }
+
+ drmModeFreeResources(res);
+}
+
igt_main
{
+ igt_subtest("load") {
+ int fd, load_error;
+ bool i915_already_loaded;
+
+ i915_already_loaded = igt_kmod_is_loaded("i915");
+ igt_warn_on(i915_already_loaded);
+
+ if (!i915_already_loaded) {
+ load_error = igt_i915_driver_load(NULL);
+ igt_assert_eq(load_error, 0);
+ }
+
+ fd = __drm_open_driver(DRIVER_INTEL);
+ igt_assert(fd > 0);
+ reprobe_connectors(fd);
+ close(fd);
+ }
+
igt_subtest("basic-reload") {
int load_error;
--
2.17.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-10-17 12:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 12:15 [igt-dev] [PATCH i-g-t 1/3] tests: Rename drv_module_reload to i915_load Arkadiusz Hiler
2018-10-17 12:15 ` Arkadiusz Hiler [this message]
2018-10-17 12:31 ` [igt-dev] [PATCH i-g-t 2/3] tests/i915_load: Add 'load' subtest Chris Wilson
2018-10-18 13:28 ` Arkadiusz Hiler
2018-10-17 12:15 ` [igt-dev] [PATCH i-g-t 3/3] intel-ci: Prepend fast-feedback with i915_load@load Arkadiusz Hiler
2018-10-17 12:34 ` [igt-dev] [PATCH i-g-t 1/3] tests: Rename drv_module_reload to i915_load Chris Wilson
2018-10-17 15:30 ` Arkadiusz Hiler
2018-10-17 15:50 ` Chris Wilson
2018-10-17 16:06 ` Arkadiusz Hiler
2018-10-17 14:26 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] " Patchwork
2018-10-17 17:40 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20181017121545.29096-2-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox