All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt 1/2] lib: Attempt to load the module for a missing device
@ 2017-11-14 13:18 Chris Wilson
  2017-11-14 13:18 ` [PATCH igt 2/2] lib/kmod: Stop reloading i915 after every kselftest Chris Wilson
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Chris Wilson @ 2017-11-14 13:18 UTC (permalink / raw)
  To: intel-gfx

If we asked to open a particular chipset and we find no matching device,
try again after attempting to load its module. Previously we only did
this for vgem, which is not automatically probed during boot, but if we
want to leave the module unloaded we have to try harder when we need the
device.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/drmtest.c | 68 +++++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 50 insertions(+), 18 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index e6bdbc35..3a2a6343 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -235,20 +235,14 @@ static int modprobe(const char *driver)
 	return igt_kmod_load(driver, "");
 }
 
-/**
- * __drm_open_driver:
- * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
- *
- * Open the first DRM device we can find, searching up to 16 device nodes
- *
- * Returns:
- * An open DRM fd or -1 on error
- */
-int __drm_open_driver(int chipset)
+static void modprobe_i915(const char *name)
 {
-	if (chipset & DRIVER_VGEM)
-		modprobe("vgem");
+	/* When loading i915, we also want to load snd-hda et al */
+	igt_i915_driver_load(NULL);
+}
 
+static int __open_device(unsigned int chipset)
+{
 	for (int i = 0; i < 16; i++) {
 		char name[80];
 		int fd;
@@ -262,16 +256,13 @@ int __drm_open_driver(int chipset)
 		    has_known_intel_chipset(fd))
 			return fd;
 
-		if (chipset & DRIVER_VC4 &&
-		    is_vc4_device(fd))
+		if (chipset & DRIVER_VC4 && is_vc4_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VGEM &&
-		    is_vgem_device(fd))
+		if (chipset & DRIVER_VGEM && is_vgem_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VIRTIO &&
-		    is_virtio_device(fd))
+		if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
 			return fd;
 
 		if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
@@ -287,6 +278,47 @@ int __drm_open_driver(int chipset)
 	return -1;
 }
 
+/**
+ * __drm_open_driver:
+ * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
+ *
+ * Open the first DRM device we can find, searching up to 16 device nodes
+ *
+ * Returns:
+ * An open DRM fd or -1 on error
+ */
+int __drm_open_driver(int chipset)
+{
+	static const struct {
+		unsigned int bit;
+		const char *module;
+		void (*modprobe)(const char *name);
+	} modules[] = {
+		{ DRIVER_AMDGPU, "amdgpu" },
+		{ DRIVER_INTEL, "i915", modprobe_i915 },
+		{ DRIVER_VC4, "vc4" },
+		{ DRIVER_VGEM, "vgem" },
+		{ DRIVER_VIRTIO, "virtio-gpu" },
+		{}
+	}, *m;
+	int fd;
+
+	fd = __open_device(chipset);
+	if (fd != -1)
+		return fd;
+
+	for (m = modules; m->module; m++) {
+		if (chipset & (1ul << m->bit)) {
+			if (m->modprobe)
+				m->modprobe(m->module);
+			else
+				modprobe(m->module);
+		}
+	}
+
+	return __open_device(chipset);
+}
+
 static int __drm_open_driver_render(int chipset)
 {
 	char *name;
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH igt 2/2] lib/kmod: Stop reloading i915 after every kselftest
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
@ 2017-11-14 13:18 ` Chris Wilson
  2017-11-14 13:51 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] lib: Attempt to load the module for a missing device Patchwork
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2017-11-14 13:18 UTC (permalink / raw)
  To: intel-gfx

Since CI runs each subtest individually, we do not get the batching of
tests and execute every fixture around each subtest. The consequence of
this for CI is that we quickly exhaust static allocations like lockdep's
array of lockclasses, or causing hash conflicts with new locks being
reallocation into existing addresses, the result is a warning from
lockdep and ts disabling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_kmod.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index f468a4da..bc1ace23 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -519,9 +519,6 @@ void igt_kselftest_end(struct igt_kselftest *tst)
 {
 	kmod_module_remove_module(tst->kmod, KMOD_REMOVE_FORCE);
 	close(tst->kmsg);
-
-	if (strcmp(tst->module_name, "i915") == 0)
-		igt_i915_driver_load(NULL);
 }
 
 void igt_kselftest_fini(struct igt_kselftest *tst)
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: warning for series starting with [1/2] lib: Attempt to load the module for a missing device
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
  2017-11-14 13:18 ` [PATCH igt 2/2] lib/kmod: Stop reloading i915 after every kselftest Chris Wilson
@ 2017-11-14 13:51 ` Patchwork
  2017-11-14 13:56 ` [PATCH igt 1/2] " Chris Wilson
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2017-11-14 13:51 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] lib: Attempt to load the module for a missing device
URL   : https://patchwork.freedesktop.org/series/33774/
State : warning

== Summary ==

IGT patchset tested on top of latest successful build
f370d5903689f37620e006f004a91d6bdeac7c16 lib/i915: Query semaphore status using GETPARAM

with latest DRM-Tip kernel build CI_DRM_3343
150c0315ce44 drm-tip: 2017y-11m-14d-10h-02m-23s UTC integration manifest

No testlist changes.

Test chamelium:
        Subgroup dp-crc-fast:
                fail       -> PASS       (fi-kbl-7500u) fdo#102514
Test gem_ringfill:
        Subgroup basic-default:
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-default-interruptible:
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-default-forked:
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-default-fd:
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-default-hang:
                dmesg-warn -> SKIP       (fi-blb-e6850) fdo#101600 +1
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
Test gem_wait:
        Subgroup basic-await-all:
                pass       -> SKIP       (fi-gdg-551)
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-bwr-2160)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
Test prime_vgem:
        Subgroup basic-busy-default:
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-fence-flip:
                pass       -> SKIP       (fi-gdg-551)
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-bwr-2160) fdo#103182
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7567u) fdo#103165 +2
        Subgroup basic-fence-mmap:
                pass       -> SKIP       (fi-gdg-551)
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-bwr-2160)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-fence-read:
                pass       -> SKIP       (fi-gdg-551)
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-bwr-2160)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-fence-wait-default:
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-gtt:
                pass       -> SKIP       (fi-gdg-551)
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-bwr-2160)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-6700k)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-bxt-dsi)
                pass       -> SKIP       (fi-kbl-7500u)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
                pass       -> SKIP       (fi-kbl-r)
                pass       -> SKIP       (fi-glk-1)
        Subgroup basic-read:
                pass       -> SKIP       (fi-gdg-551)
                pass       -> SKIP       (fi-blb-e6850)
                pass       -> SKIP       (fi-pnv-d510)
                pass       -> SKIP       (fi-bwr-2160)
                pass       -> SKIP       (fi-elk-e7500)
                pass       -> SKIP       (fi-ilk-650)
                pass       -> SKIP       (fi-snb-2520m)
                pass       -> SKIP       (fi-snb-2600)
                pass       -> SKIP       (fi-ivb-3520m)
                pass       -> SKIP       (fi-ivb-3770)
                pass       -> SKIP       (fi-byt-j1900)
                pass       -> SKIP       (fi-byt-n2820)
                pass       -> SKIP       (fi-hsw-4770)
                pass       -> SKIP       (fi-hsw-4770r)
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-bsw-n3050)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6600u)
                pass       -> SKIP       (fi-skl-6700hq)
                pass       -> SKIP       (fi-skl-

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_495/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt 1/2] lib: Attempt to load the module for a missing device
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
  2017-11-14 13:18 ` [PATCH igt 2/2] lib/kmod: Stop reloading i915 after every kselftest Chris Wilson
  2017-11-14 13:51 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] lib: Attempt to load the module for a missing device Patchwork
@ 2017-11-14 13:56 ` Chris Wilson
  2017-11-14 14:10   ` Petri Latvala
  2017-11-14 14:07 ` [PATCH igt v2] " Chris Wilson
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: Chris Wilson @ 2017-11-14 13:56 UTC (permalink / raw)
  To: intel-gfx

Quoting Chris Wilson (2017-11-14 13:18:44)
> If we asked to open a particular chipset and we find no matching device,
> try again after attempting to load its module. Previously we only did
> this for vgem, which is not automatically probed during boot, but if we
> want to leave the module unloaded we have to try harder when we need the
> device.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/drmtest.c | 68 +++++++++++++++++++++++++++++++++++++++++++----------------
>  1 file changed, 50 insertions(+), 18 deletions(-)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index e6bdbc35..3a2a6343 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -235,20 +235,14 @@ static int modprobe(const char *driver)
>         return igt_kmod_load(driver, "");
>  }
>  
> -/**
> - * __drm_open_driver:
> - * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> - *
> - * Open the first DRM device we can find, searching up to 16 device nodes
> - *
> - * Returns:
> - * An open DRM fd or -1 on error
> - */
> -int __drm_open_driver(int chipset)
> +static void modprobe_i915(const char *name)
>  {
> -       if (chipset & DRIVER_VGEM)
> -               modprobe("vgem");
> +       /* When loading i915, we also want to load snd-hda et al */
> +       igt_i915_driver_load(NULL);
> +}
>  
> +static int __open_device(unsigned int chipset)
> +{
>         for (int i = 0; i < 16; i++) {
>                 char name[80];
>                 int fd;
> @@ -262,16 +256,13 @@ int __drm_open_driver(int chipset)
>                     has_known_intel_chipset(fd))
>                         return fd;
>  
> -               if (chipset & DRIVER_VC4 &&
> -                   is_vc4_device(fd))
> +               if (chipset & DRIVER_VC4 && is_vc4_device(fd))
>                         return fd;
>  
> -               if (chipset & DRIVER_VGEM &&
> -                   is_vgem_device(fd))
> +               if (chipset & DRIVER_VGEM && is_vgem_device(fd))
>                         return fd;
>  
> -               if (chipset & DRIVER_VIRTIO &&
> -                   is_virtio_device(fd))
> +               if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
>                         return fd;
>  
>                 if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
> @@ -287,6 +278,47 @@ int __drm_open_driver(int chipset)
>         return -1;
>  }
>  
> +/**
> + * __drm_open_driver:
> + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> + *
> + * Open the first DRM device we can find, searching up to 16 device nodes
> + *
> + * Returns:
> + * An open DRM fd or -1 on error
> + */
> +int __drm_open_driver(int chipset)
> +{
> +       static const struct {
> +               unsigned int bit;
> +               const char *module;
> +               void (*modprobe)(const char *name);
> +       } modules[] = {
> +               { DRIVER_AMDGPU, "amdgpu" },
> +               { DRIVER_INTEL, "i915", modprobe_i915 },
> +               { DRIVER_VC4, "vc4" },
> +               { DRIVER_VGEM, "vgem" },
> +               { DRIVER_VIRTIO, "virtio-gpu" },
> +               {}
> +       }, *m;
> +       int fd;
> +
> +       fd = __open_device(chipset);
> +       if (fd != -1)
> +               return fd;
> +
> +       for (m = modules; m->module; m++) {
> +               if (chipset & (1ul << m->bit)) {

Eek, m->bit is already a bit and not a shift.

Still puzzled where the device went between tests though, no sign of it
being unloaded.
-Chris
 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH igt v2] lib: Attempt to load the module for a missing device
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (2 preceding siblings ...)
  2017-11-14 13:56 ` [PATCH igt 1/2] " Chris Wilson
@ 2017-11-14 14:07 ` Chris Wilson
  2017-11-14 18:17 ` ✗ Fi.CI.BAT: failure for series starting with [v2] lib: Attempt to load the module for a missing device (rev2) Patchwork
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2017-11-14 14:07 UTC (permalink / raw)
  To: intel-gfx

If we asked to open a particular chipset and we find no matching device,
try again after attempting to load its module. Previously we only did
this for vgem, which is not automatically probed during boot, but if we
want to leave the module unloaded we have to try harder when we need the
device.

v2: DRIVER_* are already masks (and not shifts). Use a common
driver_open for both /dev/dri/cardX and /dev/dri/renderDX.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/drmtest.c | 93 ++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 53 insertions(+), 40 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index e6bdbc35..94e7c676 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -235,25 +235,19 @@ static int modprobe(const char *driver)
 	return igt_kmod_load(driver, "");
 }
 
-/**
- * __drm_open_driver:
- * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
- *
- * Open the first DRM device we can find, searching up to 16 device nodes
- *
- * Returns:
- * An open DRM fd or -1 on error
- */
-int __drm_open_driver(int chipset)
+static void modprobe_i915(const char *name)
 {
-	if (chipset & DRIVER_VGEM)
-		modprobe("vgem");
+	/* When loading i915, we also want to load snd-hda et al */
+	igt_i915_driver_load(NULL);
+}
 
+static int __open_device(const char *base, int offset, unsigned int chipset)
+{
 	for (int i = 0; i < 16; i++) {
 		char name[80];
 		int fd;
 
-		sprintf(name, "/dev/dri/card%u", i);
+		sprintf(name, "%s%u", base, i + offset);
 		fd = open(name, O_RDWR);
 		if (fd == -1)
 			continue;
@@ -262,16 +256,13 @@ int __drm_open_driver(int chipset)
 		    has_known_intel_chipset(fd))
 			return fd;
 
-		if (chipset & DRIVER_VC4 &&
-		    is_vc4_device(fd))
+		if (chipset & DRIVER_VC4 && is_vc4_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VGEM &&
-		    is_vgem_device(fd))
+		if (chipset & DRIVER_VGEM && is_vgem_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VIRTIO &&
-		    is_virtio_device(fd))
+		if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
 			return fd;
 
 		if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
@@ -287,33 +278,55 @@ int __drm_open_driver(int chipset)
 	return -1;
 }
 
-static int __drm_open_driver_render(int chipset)
+static int __open_driver(const char *base, int offset, unsigned int chipset)
 {
-	char *name;
-	int i, fd;
-
-	for (i = 128; i < (128 + 16); i++) {
-		int ret;
-
-		ret = asprintf(&name, "/dev/dri/renderD%u", i);
-		igt_assert(ret != -1);
-
-		fd = open(name, O_RDWR);
-		free(name);
+	static const struct {
+		unsigned int bit;
+		const char *module;
+		void (*modprobe)(const char *name);
+	} modules[] = {
+		{ DRIVER_AMDGPU, "amdgpu" },
+		{ DRIVER_INTEL, "i915", modprobe_i915 },
+		{ DRIVER_VC4, "vc4" },
+		{ DRIVER_VGEM, "vgem" },
+		{ DRIVER_VIRTIO, "virtio-gpu" },
+		{}
+	}, *m;
+	int fd;
 
-		if (fd == -1)
-			continue;
+	fd = __open_device(base, offset, chipset);
+	if (fd != -1)
+		return fd;
 
-		if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) {
-			close(fd);
-			fd = -1;
-			continue;
+	for (m = modules; m->module; m++) {
+		if (chipset & m->bit) {
+			if (m->modprobe)
+				m->modprobe(m->module);
+			else
+				modprobe(m->module);
 		}
-
-		return fd;
 	}
 
-	return fd;
+	return __open_device(base, offset, chipset);
+}
+
+/**
+ * __drm_open_driver:
+ * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
+ *
+ * Open the first DRM device we can find, searching up to 16 device nodes
+ *
+ * Returns:
+ * An open DRM fd or -1 on error
+ */
+int __drm_open_driver(int chipset)
+{
+	return __open_driver("/dev/dri/card", 0, chipset);
+}
+
+static int __drm_open_driver_render(int chipset)
+{
+	return __open_driver("/dev/dri/renerD", 128, chipset);
 }
 
 static int at_exit_drm_fd = -1;
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt 1/2] lib: Attempt to load the module for a missing device
  2017-11-14 13:56 ` [PATCH igt 1/2] " Chris Wilson
@ 2017-11-14 14:10   ` Petri Latvala
  2017-11-14 14:28     ` Chris Wilson
  0 siblings, 1 reply; 18+ messages in thread
From: Petri Latvala @ 2017-11-14 14:10 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Tue, Nov 14, 2017 at 01:56:22PM +0000, Chris Wilson wrote:
> Quoting Chris Wilson (2017-11-14 13:18:44)
> > If we asked to open a particular chipset and we find no matching device,
> > try again after attempting to load its module. Previously we only did
> > this for vgem, which is not automatically probed during boot, but if we
> > want to leave the module unloaded we have to try harder when we need the
> > device.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  lib/drmtest.c | 68 +++++++++++++++++++++++++++++++++++++++++++----------------
> >  1 file changed, 50 insertions(+), 18 deletions(-)
> > 
> > diff --git a/lib/drmtest.c b/lib/drmtest.c
> > index e6bdbc35..3a2a6343 100644
> > --- a/lib/drmtest.c
> > +++ b/lib/drmtest.c
> > @@ -235,20 +235,14 @@ static int modprobe(const char *driver)
> >         return igt_kmod_load(driver, "");
> >  }
> >  
> > -/**
> > - * __drm_open_driver:
> > - * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> > - *
> > - * Open the first DRM device we can find, searching up to 16 device nodes
> > - *
> > - * Returns:
> > - * An open DRM fd or -1 on error
> > - */
> > -int __drm_open_driver(int chipset)
> > +static void modprobe_i915(const char *name)
> >  {
> > -       if (chipset & DRIVER_VGEM)
> > -               modprobe("vgem");
> > +       /* When loading i915, we also want to load snd-hda et al */
> > +       igt_i915_driver_load(NULL);
> > +}
> >  
> > +static int __open_device(unsigned int chipset)
> > +{
> >         for (int i = 0; i < 16; i++) {
> >                 char name[80];
> >                 int fd;
> > @@ -262,16 +256,13 @@ int __drm_open_driver(int chipset)
> >                     has_known_intel_chipset(fd))
> >                         return fd;
> >  
> > -               if (chipset & DRIVER_VC4 &&
> > -                   is_vc4_device(fd))
> > +               if (chipset & DRIVER_VC4 && is_vc4_device(fd))
> >                         return fd;
> >  
> > -               if (chipset & DRIVER_VGEM &&
> > -                   is_vgem_device(fd))
> > +               if (chipset & DRIVER_VGEM && is_vgem_device(fd))
> >                         return fd;
> >  
> > -               if (chipset & DRIVER_VIRTIO &&
> > -                   is_virtio_device(fd))
> > +               if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
> >                         return fd;
> >  
> >                 if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
> > @@ -287,6 +278,47 @@ int __drm_open_driver(int chipset)
> >         return -1;
> >  }
> >  
> > +/**
> > + * __drm_open_driver:
> > + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> > + *
> > + * Open the first DRM device we can find, searching up to 16 device nodes
> > + *
> > + * Returns:
> > + * An open DRM fd or -1 on error
> > + */
> > +int __drm_open_driver(int chipset)
> > +{
> > +       static const struct {
> > +               unsigned int bit;
> > +               const char *module;
> > +               void (*modprobe)(const char *name);
> > +       } modules[] = {
> > +               { DRIVER_AMDGPU, "amdgpu" },
> > +               { DRIVER_INTEL, "i915", modprobe_i915 },
> > +               { DRIVER_VC4, "vc4" },
> > +               { DRIVER_VGEM, "vgem" },
> > +               { DRIVER_VIRTIO, "virtio-gpu" },
> > +               {}
> > +       }, *m;
> > +       int fd;
> > +
> > +       fd = __open_device(chipset);
> > +       if (fd != -1)
> > +               return fd;
> > +
> > +       for (m = modules; m->module; m++) {
> > +               if (chipset & (1ul << m->bit)) {
> 
> Eek, m->bit is already a bit and not a shift.
> 
> Still puzzled where the device went between tests though, no sign of it
> being unloaded.


I don't see any signs of it being loaded in the first
place. Assuming I'm reading right and this is the correct line to look
for (from the base run):


<6>[  265.406984] [drm] Initialized vgem 1.0.0 20120112 for virtual device on minor 1



-- 
Petri Latvala
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt 1/2] lib: Attempt to load the module for a missing device
  2017-11-14 14:10   ` Petri Latvala
@ 2017-11-14 14:28     ` Chris Wilson
  0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2017-11-14 14:28 UTC (permalink / raw)
  To: Petri Latvala; +Cc: intel-gfx

Quoting Petri Latvala (2017-11-14 14:10:27)
> On Tue, Nov 14, 2017 at 01:56:22PM +0000, Chris Wilson wrote:
> > Quoting Chris Wilson (2017-11-14 13:18:44)
> > > If we asked to open a particular chipset and we find no matching device,
> > > try again after attempting to load its module. Previously we only did
> > > this for vgem, which is not automatically probed during boot, but if we
> > > want to leave the module unloaded we have to try harder when we need the
> > > device.
> > > 
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > ---
> > >  lib/drmtest.c | 68 +++++++++++++++++++++++++++++++++++++++++++----------------
> > >  1 file changed, 50 insertions(+), 18 deletions(-)
> > > 
> > > diff --git a/lib/drmtest.c b/lib/drmtest.c
> > > index e6bdbc35..3a2a6343 100644
> > > --- a/lib/drmtest.c
> > > +++ b/lib/drmtest.c
> > > @@ -235,20 +235,14 @@ static int modprobe(const char *driver)
> > >         return igt_kmod_load(driver, "");
> > >  }
> > >  
> > > -/**
> > > - * __drm_open_driver:
> > > - * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> > > - *
> > > - * Open the first DRM device we can find, searching up to 16 device nodes
> > > - *
> > > - * Returns:
> > > - * An open DRM fd or -1 on error
> > > - */
> > > -int __drm_open_driver(int chipset)
> > > +static void modprobe_i915(const char *name)
> > >  {
> > > -       if (chipset & DRIVER_VGEM)
> > > -               modprobe("vgem");
> > > +       /* When loading i915, we also want to load snd-hda et al */
> > > +       igt_i915_driver_load(NULL);
> > > +}
> > >  
> > > +static int __open_device(unsigned int chipset)
> > > +{
> > >         for (int i = 0; i < 16; i++) {
> > >                 char name[80];
> > >                 int fd;
> > > @@ -262,16 +256,13 @@ int __drm_open_driver(int chipset)
> > >                     has_known_intel_chipset(fd))
> > >                         return fd;
> > >  
> > > -               if (chipset & DRIVER_VC4 &&
> > > -                   is_vc4_device(fd))
> > > +               if (chipset & DRIVER_VC4 && is_vc4_device(fd))
> > >                         return fd;
> > >  
> > > -               if (chipset & DRIVER_VGEM &&
> > > -                   is_vgem_device(fd))
> > > +               if (chipset & DRIVER_VGEM && is_vgem_device(fd))
> > >                         return fd;
> > >  
> > > -               if (chipset & DRIVER_VIRTIO &&
> > > -                   is_virtio_device(fd))
> > > +               if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
> > >                         return fd;
> > >  
> > >                 if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
> > > @@ -287,6 +278,47 @@ int __drm_open_driver(int chipset)
> > >         return -1;
> > >  }
> > >  
> > > +/**
> > > + * __drm_open_driver:
> > > + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> > > + *
> > > + * Open the first DRM device we can find, searching up to 16 device nodes
> > > + *
> > > + * Returns:
> > > + * An open DRM fd or -1 on error
> > > + */
> > > +int __drm_open_driver(int chipset)
> > > +{
> > > +       static const struct {
> > > +               unsigned int bit;
> > > +               const char *module;
> > > +               void (*modprobe)(const char *name);
> > > +       } modules[] = {
> > > +               { DRIVER_AMDGPU, "amdgpu" },
> > > +               { DRIVER_INTEL, "i915", modprobe_i915 },
> > > +               { DRIVER_VC4, "vc4" },
> > > +               { DRIVER_VGEM, "vgem" },
> > > +               { DRIVER_VIRTIO, "virtio-gpu" },
> > > +               {}
> > > +       }, *m;
> > > +       int fd;
> > > +
> > > +       fd = __open_device(chipset);
> > > +       if (fd != -1)
> > > +               return fd;
> > > +
> > > +       for (m = modules; m->module; m++) {
> > > +               if (chipset & (1ul << m->bit)) {
> > 
> > Eek, m->bit is already a bit and not a shift.
> > 
> > Still puzzled where the device went between tests though, no sign of it
> > being unloaded.
> 
> 
> I don't see any signs of it being loaded in the first
> place. Assuming I'm reading right and this is the correct line to look
> for (from the base run):
> 
> 
> <6>[  265.406984] [drm] Initialized vgem 1.0.0 20120112 for virtual device on minor 1

Ah, right; looking for the wrong thing and didn't click that it was
erroring out on vgem. In which case, fixing m->bit should explain it.
-chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: failure for series starting with [v2] lib: Attempt to load the module for a missing device (rev2)
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (3 preceding siblings ...)
  2017-11-14 14:07 ` [PATCH igt v2] " Chris Wilson
@ 2017-11-14 18:17 ` Patchwork
  2017-11-14 18:45 ` [PATCH igt v3] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2017-11-14 18:17 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2] lib: Attempt to load the module for a missing device (rev2)
URL   : https://patchwork.freedesktop.org/series/33774/
State : failure

== Summary ==

IGT patchset tested on top of latest successful build
f370d5903689f37620e006f004a91d6bdeac7c16 lib/i915: Query semaphore status using GETPARAM

with latest DRM-Tip kernel build CI_DRM_3344
712af85519b2 drm-tip: 2017y-11m-14d-12h-27m-40s UTC integration manifest

No testlist changes.

Test chamelium:
        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test gem_ctx_basic:
                skip       -> FAIL       (fi-gdg-551) fdo#103641
                skip       -> FAIL       (fi-bwr-2160)
                skip       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bsw-n3050)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6600u)
                pass       -> FAIL       (fi-skl-6700hq)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-7567u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#103641 https://bugs.freedesktop.org/show_bug.cgi?id=103641

fi-bdw-5557u     total:289  pass:267  dwarn:0   dfail:0   fail:1   skip:21  time:450s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:464s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:384s
fi-bsw-n3050     total:289  pass:242  dwarn:0   dfail:0   fail:1   skip:46  time:522s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:1   skip:105 time:275s
fi-bxt-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  time:495s
fi-bxt-j4205     total:289  pass:259  dwarn:0   dfail:0   fail:1   skip:29  time:501s
fi-byt-j1900     total:289  pass:253  dwarn:0   dfail:0   fail:1   skip:35  time:492s
fi-byt-n2820     total:289  pass:249  dwarn:0   dfail:0   fail:1   skip:39  time:476s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:440s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:2   skip:108 time:263s
fi-glk-1         total:289  pass:260  dwarn:0   dfail:0   fail:1   skip:28  time:535s
fi-hsw-4770      total:289  pass:261  dwarn:0   dfail:0   fail:1   skip:27  time:433s
fi-hsw-4770r     total:289  pass:261  dwarn:0   dfail:0   fail:1   skip:27  time:437s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:1   skip:60  time:430s
fi-ivb-3520m     total:289  pass:259  dwarn:0   dfail:0   fail:1   skip:29  time:481s
fi-ivb-3770      total:289  pass:259  dwarn:0   dfail:0   fail:1   skip:29  time:465s
fi-kbl-7500u     total:289  pass:262  dwarn:1   dfail:0   fail:2   skip:24  time:479s
fi-kbl-7560u     total:289  pass:269  dwarn:0   dfail:0   fail:1   skip:19  time:531s
fi-kbl-7567u     total:289  pass:268  dwarn:0   dfail:0   fail:1   skip:20  time:476s
fi-kbl-r         total:289  pass:261  dwarn:0   dfail:0   fail:1   skip:27  time:525s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:568s
fi-skl-6260u     total:289  pass:268  dwarn:0   dfail:0   fail:1   skip:20  time:456s
fi-skl-6600u     total:289  pass:261  dwarn:0   dfail:0   fail:1   skip:27  time:547s
fi-skl-6700hq    total:289  pass:262  dwarn:0   dfail:0   fail:1   skip:26  time:564s
fi-skl-6700k     total:289  pass:264  dwarn:0   dfail:0   fail:1   skip:24  time:521s
fi-skl-6770hq    total:289  pass:268  dwarn:0   dfail:0   fail:1   skip:20  time:494s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:460s
fi-snb-2520m     total:246  pass:211  dwarn:0   dfail:0   fail:1   skip:33 
fi-snb-2600      total:289  pass:248  dwarn:0   dfail:0   fail:1   skip:40  time:423s
Blacklisted hosts:
fi-cfl-s         total:289  pass:252  dwarn:4   dfail:0   fail:1   skip:32  time:523s
fi-cnl-y         total:289  pass:260  dwarn:0   dfail:0   fail:2   skip:27  time:549s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_501/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH igt v3] lib: Attempt to load the module for a missing device
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (4 preceding siblings ...)
  2017-11-14 18:17 ` ✗ Fi.CI.BAT: failure for series starting with [v2] lib: Attempt to load the module for a missing device (rev2) Patchwork
@ 2017-11-14 18:45 ` Chris Wilson
  2017-11-14 21:22 ` ✗ Fi.CI.BAT: failure for series starting with [v3] lib: Attempt to load the module for a missing device (rev3) Patchwork
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2017-11-14 18:45 UTC (permalink / raw)
  To: intel-gfx

If we asked to open a particular chipset and we find no matching device,
try again after attempting to load its module. Previously we only did
this for vgem, which is not automatically probed during boot, but if we
want to leave the module unloaded we have to try harder when we need the
device.

v2: DRIVER_* are already masks (and not shifts). Use a common
driver_open for both /dev/dri/cardX and /dev/dri/renderDX.
v3: Beware making local variables accidentally static scoped.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/drmtest.c | 93 ++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 53 insertions(+), 40 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index e6bdbc35..44fb5357 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -235,25 +235,19 @@ static int modprobe(const char *driver)
 	return igt_kmod_load(driver, "");
 }
 
-/**
- * __drm_open_driver:
- * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
- *
- * Open the first DRM device we can find, searching up to 16 device nodes
- *
- * Returns:
- * An open DRM fd or -1 on error
- */
-int __drm_open_driver(int chipset)
+static void modprobe_i915(const char *name)
 {
-	if (chipset & DRIVER_VGEM)
-		modprobe("vgem");
+	/* When loading i915, we also want to load snd-hda et al */
+	igt_i915_driver_load(NULL);
+}
 
+static int __open_device(const char *base, int offset, unsigned int chipset)
+{
 	for (int i = 0; i < 16; i++) {
 		char name[80];
 		int fd;
 
-		sprintf(name, "/dev/dri/card%u", i);
+		sprintf(name, "%s%u", base, i + offset);
 		fd = open(name, O_RDWR);
 		if (fd == -1)
 			continue;
@@ -262,16 +256,13 @@ int __drm_open_driver(int chipset)
 		    has_known_intel_chipset(fd))
 			return fd;
 
-		if (chipset & DRIVER_VC4 &&
-		    is_vc4_device(fd))
+		if (chipset & DRIVER_VC4 && is_vc4_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VGEM &&
-		    is_vgem_device(fd))
+		if (chipset & DRIVER_VGEM && is_vgem_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VIRTIO &&
-		    is_virtio_device(fd))
+		if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
 			return fd;
 
 		if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
@@ -287,33 +278,55 @@ int __drm_open_driver(int chipset)
 	return -1;
 }
 
-static int __drm_open_driver_render(int chipset)
+static int __open_driver(const char *base, int offset, unsigned int chipset)
 {
-	char *name;
-	int i, fd;
-
-	for (i = 128; i < (128 + 16); i++) {
-		int ret;
-
-		ret = asprintf(&name, "/dev/dri/renderD%u", i);
-		igt_assert(ret != -1);
-
-		fd = open(name, O_RDWR);
-		free(name);
+	static const struct module {
+		unsigned int bit;
+		const char *module;
+		void (*modprobe)(const char *name);
+	} modules[] = {
+		{ DRIVER_AMDGPU, "amdgpu" },
+		{ DRIVER_INTEL, "i915", modprobe_i915 },
+		{ DRIVER_VC4, "vc4" },
+		{ DRIVER_VGEM, "vgem" },
+		{ DRIVER_VIRTIO, "virtio-gpu" },
+		{}
+	};
+	int fd;
 
-		if (fd == -1)
-			continue;
+	fd = __open_device(base, offset, chipset);
+	if (fd != -1)
+		return fd;
 
-		if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) {
-			close(fd);
-			fd = -1;
-			continue;
+	for (const struct module *m = modules; m->module; m++) {
+		if (chipset & m->bit) {
+			if (m->modprobe)
+				m->modprobe(m->module);
+			else
+				modprobe(m->module);
 		}
-
-		return fd;
 	}
 
-	return fd;
+	return __open_device(base, offset, chipset);
+}
+
+/**
+ * __drm_open_driver:
+ * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
+ *
+ * Open the first DRM device we can find, searching up to 16 device nodes
+ *
+ * Returns:
+ * An open DRM fd or -1 on error
+ */
+int __drm_open_driver(int chipset)
+{
+	return __open_driver("/dev/dri/card", 0, chipset);
+}
+
+static int __drm_open_driver_render(int chipset)
+{
+	return __open_driver("/dev/dri/renerD", 128, chipset);
 }
 
 static int at_exit_drm_fd = -1;
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: failure for series starting with [v3] lib: Attempt to load the module for a missing device (rev3)
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (5 preceding siblings ...)
  2017-11-14 18:45 ` [PATCH igt v3] lib: Attempt to load the module for a missing device Chris Wilson
@ 2017-11-14 21:22 ` Patchwork
  2017-11-14 21:33 ` [PATCH igt v4] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2017-11-14 21:22 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v3] lib: Attempt to load the module for a missing device (rev3)
URL   : https://patchwork.freedesktop.org/series/33774/
State : failure

== Summary ==

IGT patchset tested on top of latest successful build
f370d5903689f37620e006f004a91d6bdeac7c16 lib/i915: Query semaphore status using GETPARAM

with latest DRM-Tip kernel build CI_DRM_3345
c46476e24d64 drm-tip: 2017y-11m-14d-17h-03m-32s UTC integration manifest

No testlist changes.

Test chamelium:
        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test gem_ctx_basic:
                pass       -> FAIL       (fi-bdw-gvtdvm)
Test gem_sync:
        Subgroup basic-store-all:
                pass       -> FAIL       (fi-ivb-3520m) fdo#100007

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:442s
fi-bdw-gvtdvm    total:289  pass:264  dwarn:0   dfail:0   fail:1   skip:24  time:447s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:389s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:541s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:274s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:503s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:509s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:500s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:490s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:429s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:268s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:536s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:429s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:440s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:427s
fi-ivb-3520m     total:289  pass:259  dwarn:0   dfail:0   fail:1   skip:29  time:478s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:464s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:472s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:537s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:473s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:537s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:569s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:463s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:553s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:562s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:522s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:503s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:461s
fi-snb-2520m     total:246  pass:212  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:431s
Blacklisted hosts:
fi-cfl-s         total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  time:532s
fi-cnl-y         total:289  pass:261  dwarn:0   dfail:0   fail:1   skip:27  time:551s
fi-glk-dsi       total:289  pass:154  dwarn:0   dfail:10  fail:4   skip:121 time:406s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_503/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH igt v4] lib: Attempt to load the module for a missing device
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (6 preceding siblings ...)
  2017-11-14 21:22 ` ✗ Fi.CI.BAT: failure for series starting with [v3] lib: Attempt to load the module for a missing device (rev3) Patchwork
@ 2017-11-14 21:33 ` Chris Wilson
  2017-11-15 11:06   ` Petri Latvala
  2017-11-14 22:35 ` ✓ Fi.CI.BAT: success for series starting with [v4] lib: Attempt to load the module for a missing device (rev4) Patchwork
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: Chris Wilson @ 2017-11-14 21:33 UTC (permalink / raw)
  To: intel-gfx

If we asked to open a particular chipset and we find no matching device,
try again after attempting to load its module. Previously we only did
this for vgem, which is not automatically probed during boot, but if we
want to leave the module unloaded we have to try harder when we need the
device.

v2: DRIVER_* are already masks (and not shifts). Use a common
driver_open for both /dev/dri/cardX and /dev/dri/renderDX.
v3: Beware making local variables accidentally static scoped.
v4: Beware multiple threads trying and failing to open a device

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/drmtest.c | 97 +++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 57 insertions(+), 40 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index e6bdbc35..37cabd58 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -44,6 +44,7 @@
 #include <sys/syscall.h>
 #include <sys/utsname.h>
 #include <termios.h>
+#include <pthread.h>
 
 #include "drmtest.h"
 #include "i915_drm.h"
@@ -235,25 +236,19 @@ static int modprobe(const char *driver)
 	return igt_kmod_load(driver, "");
 }
 
-/**
- * __drm_open_driver:
- * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
- *
- * Open the first DRM device we can find, searching up to 16 device nodes
- *
- * Returns:
- * An open DRM fd or -1 on error
- */
-int __drm_open_driver(int chipset)
+static void modprobe_i915(const char *name)
 {
-	if (chipset & DRIVER_VGEM)
-		modprobe("vgem");
+	/* When loading i915, we also want to load snd-hda et al */
+	igt_i915_driver_load(NULL);
+}
 
+static int __open_device(const char *base, int offset, unsigned int chipset)
+{
 	for (int i = 0; i < 16; i++) {
 		char name[80];
 		int fd;
 
-		sprintf(name, "/dev/dri/card%u", i);
+		sprintf(name, "%s%u", base, i + offset);
 		fd = open(name, O_RDWR);
 		if (fd == -1)
 			continue;
@@ -262,16 +257,13 @@ int __drm_open_driver(int chipset)
 		    has_known_intel_chipset(fd))
 			return fd;
 
-		if (chipset & DRIVER_VC4 &&
-		    is_vc4_device(fd))
+		if (chipset & DRIVER_VC4 && is_vc4_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VGEM &&
-		    is_vgem_device(fd))
+		if (chipset & DRIVER_VGEM && is_vgem_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VIRTIO &&
-		    is_virtio_device(fd))
+		if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
 			return fd;
 
 		if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
@@ -287,33 +279,58 @@ int __drm_open_driver(int chipset)
 	return -1;
 }
 
-static int __drm_open_driver_render(int chipset)
+static int __open_driver(const char *base, int offset, unsigned int chipset)
 {
-	char *name;
-	int i, fd;
-
-	for (i = 128; i < (128 + 16); i++) {
-		int ret;
-
-		ret = asprintf(&name, "/dev/dri/renderD%u", i);
-		igt_assert(ret != -1);
-
-		fd = open(name, O_RDWR);
-		free(name);
+	static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+	static const struct module {
+		unsigned int bit;
+		const char *module;
+		void (*modprobe)(const char *name);
+	} modules[] = {
+		{ DRIVER_AMDGPU, "amdgpu" },
+		{ DRIVER_INTEL, "i915", modprobe_i915 },
+		{ DRIVER_VC4, "vc4" },
+		{ DRIVER_VGEM, "vgem" },
+		{ DRIVER_VIRTIO, "virtio-gpu" },
+		{}
+	};
+	int fd;
 
-		if (fd == -1)
-			continue;
+	fd = __open_device(base, offset, chipset);
+	if (fd != -1)
+		return fd;
 
-		if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) {
-			close(fd);
-			fd = -1;
-			continue;
+	pthread_mutex_lock(&mutex);
+	for (const struct module *m = modules; m->module; m++) {
+		if (chipset & m->bit) {
+			if (m->modprobe)
+				m->modprobe(m->module);
+			else
+				modprobe(m->module);
 		}
-
-		return fd;
 	}
+	pthread_mutex_unlock(&mutex);
 
-	return fd;
+	return __open_device(base, offset, chipset);
+}
+
+/**
+ * __drm_open_driver:
+ * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
+ *
+ * Open the first DRM device we can find, searching up to 16 device nodes
+ *
+ * Returns:
+ * An open DRM fd or -1 on error
+ */
+int __drm_open_driver(int chipset)
+{
+	return __open_driver("/dev/dri/card", 0, chipset);
+}
+
+static int __drm_open_driver_render(int chipset)
+{
+	return __open_driver("/dev/dri/renerD", 128, chipset);
 }
 
 static int at_exit_drm_fd = -1;
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for series starting with [v4] lib: Attempt to load the module for a missing device (rev4)
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (7 preceding siblings ...)
  2017-11-14 21:33 ` [PATCH igt v4] lib: Attempt to load the module for a missing device Chris Wilson
@ 2017-11-14 22:35 ` Patchwork
  2017-11-15  1:54 ` ✗ Fi.CI.IGT: warning " Patchwork
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2017-11-14 22:35 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v4] lib: Attempt to load the module for a missing device (rev4)
URL   : https://patchwork.freedesktop.org/series/33774/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
f370d5903689f37620e006f004a91d6bdeac7c16 lib/i915: Query semaphore status using GETPARAM

with latest DRM-Tip kernel build CI_DRM_3345
c46476e24d64 drm-tip: 2017y-11m-14d-17h-03m-32s UTC integration manifest

No testlist changes.

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:447s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:458s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:381s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:556s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:276s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:509s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:506s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:505s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:496s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:429s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:267s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:538s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:428s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:436s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:425s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:488s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:463s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:486s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:536s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:476s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:534s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:571s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:545s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:572s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:527s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:492s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:460s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:559s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:424s
Blacklisted hosts:
fi-cfl-s         total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  time:534s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:558s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_504/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: warning for series starting with [v4] lib: Attempt to load the module for a missing device (rev4)
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (8 preceding siblings ...)
  2017-11-14 22:35 ` ✓ Fi.CI.BAT: success for series starting with [v4] lib: Attempt to load the module for a missing device (rev4) Patchwork
@ 2017-11-15  1:54 ` Patchwork
  2017-11-15 11:30 ` [PATCH igt v5] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2017-11-15  1:54 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v4] lib: Attempt to load the module for a missing device (rev4)
URL   : https://patchwork.freedesktop.org/series/33774/
State : warning

== Summary ==

Test drv_module_reload:
        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (shard-hsw) fdo#102707 +1
Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-varying-size:
                fail       -> PASS       (shard-hsw)
Test kms_flip:
        Subgroup flip-vs-dpms-interruptible:
                pass       -> DMESG-WARN (shard-hsw)
        Subgroup flip-vs-absolute-wf_vblank:
                pass       -> FAIL       (shard-hsw) fdo#100368
        Subgroup modeset-vs-vblank-race-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#103060
Test perf:
        Subgroup polling:
                fail       -> PASS       (shard-hsw) fdo#102252

fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw        total:2584 pass:1469 dwarn:3   dfail:1   fail:12  skip:1099 time:9445s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_504/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt v4] lib: Attempt to load the module for a missing device
  2017-11-14 21:33 ` [PATCH igt v4] lib: Attempt to load the module for a missing device Chris Wilson
@ 2017-11-15 11:06   ` Petri Latvala
  2017-11-15 11:22     ` Chris Wilson
  0 siblings, 1 reply; 18+ messages in thread
From: Petri Latvala @ 2017-11-15 11:06 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Tue, Nov 14, 2017 at 09:33:51PM +0000, Chris Wilson wrote:
> If we asked to open a particular chipset and we find no matching device,
> try again after attempting to load its module. Previously we only did
> this for vgem, which is not automatically probed during boot, but if we
> want to leave the module unloaded we have to try harder when we need the
> device.
> 
> v2: DRIVER_* are already masks (and not shifts). Use a common
> driver_open for both /dev/dri/cardX and /dev/dri/renderDX.
> v3: Beware making local variables accidentally static scoped.
> v4: Beware multiple threads trying and failing to open a device
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/drmtest.c | 97 +++++++++++++++++++++++++++++++++++------------------------
>  1 file changed, 57 insertions(+), 40 deletions(-)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index e6bdbc35..37cabd58 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -44,6 +44,7 @@
>  #include <sys/syscall.h>
>  #include <sys/utsname.h>
>  #include <termios.h>
> +#include <pthread.h>
>  
>  #include "drmtest.h"
>  #include "i915_drm.h"
> @@ -235,25 +236,19 @@ static int modprobe(const char *driver)
>  	return igt_kmod_load(driver, "");
>  }
>  
> -/**
> - * __drm_open_driver:
> - * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> - *
> - * Open the first DRM device we can find, searching up to 16 device nodes
> - *
> - * Returns:
> - * An open DRM fd or -1 on error
> - */
> -int __drm_open_driver(int chipset)
> +static void modprobe_i915(const char *name)
>  {
> -	if (chipset & DRIVER_VGEM)
> -		modprobe("vgem");
> +	/* When loading i915, we also want to load snd-hda et al */
> +	igt_i915_driver_load(NULL);
> +}
>  
> +static int __open_device(const char *base, int offset, unsigned int chipset)
> +{
>  	for (int i = 0; i < 16; i++) {
>  		char name[80];
>  		int fd;
>  
> -		sprintf(name, "/dev/dri/card%u", i);
> +		sprintf(name, "%s%u", base, i + offset);
>  		fd = open(name, O_RDWR);
>  		if (fd == -1)
>  			continue;
> @@ -262,16 +257,13 @@ int __drm_open_driver(int chipset)
>  		    has_known_intel_chipset(fd))
>  			return fd;
>  
> -		if (chipset & DRIVER_VC4 &&
> -		    is_vc4_device(fd))
> +		if (chipset & DRIVER_VC4 && is_vc4_device(fd))
>  			return fd;
>  
> -		if (chipset & DRIVER_VGEM &&
> -		    is_vgem_device(fd))
> +		if (chipset & DRIVER_VGEM && is_vgem_device(fd))
>  			return fd;
>  
> -		if (chipset & DRIVER_VIRTIO &&
> -		    is_virtio_device(fd))
> +		if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
>  			return fd;
>  
>  		if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
> @@ -287,33 +279,58 @@ int __drm_open_driver(int chipset)
>  	return -1;
>  }
>  
> -static int __drm_open_driver_render(int chipset)
> +static int __open_driver(const char *base, int offset, unsigned int chipset)
>  {
> -	char *name;
> -	int i, fd;
> -
> -	for (i = 128; i < (128 + 16); i++) {
> -		int ret;
> -
> -		ret = asprintf(&name, "/dev/dri/renderD%u", i);
> -		igt_assert(ret != -1);
> -
> -		fd = open(name, O_RDWR);
> -		free(name);
> +	static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
> +	static const struct module {
> +		unsigned int bit;
> +		const char *module;
> +		void (*modprobe)(const char *name);
> +	} modules[] = {
> +		{ DRIVER_AMDGPU, "amdgpu" },
> +		{ DRIVER_INTEL, "i915", modprobe_i915 },
> +		{ DRIVER_VC4, "vc4" },
> +		{ DRIVER_VGEM, "vgem" },
> +		{ DRIVER_VIRTIO, "virtio-gpu" },
> +		{}
> +	};
> +	int fd;
>  
> -		if (fd == -1)
> -			continue;
> +	fd = __open_device(base, offset, chipset);
> +	if (fd != -1)
> +		return fd;
>  
> -		if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) {
> -			close(fd);
> -			fd = -1;
> -			continue;
> +	pthread_mutex_lock(&mutex);
> +	for (const struct module *m = modules; m->module; m++) {
> +		if (chipset & m->bit) {
> +			if (m->modprobe)
> +				m->modprobe(m->module);
> +			else
> +				modprobe(m->module);
>  		}
> -
> -		return fd;
>  	}
> +	pthread_mutex_unlock(&mutex);
>  
> -	return fd;
> +	return __open_device(base, offset, chipset);
> +}
> +
> +/**
> + * __drm_open_driver:
> + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> + *
> + * Open the first DRM device we can find, searching up to 16 device nodes
> + *
> + * Returns:
> + * An open DRM fd or -1 on error
> + */
> +int __drm_open_driver(int chipset)
> +{
> +	return __open_driver("/dev/dri/card", 0, chipset);
> +}
> +
> +static int __drm_open_driver_render(int chipset)
> +{
> +	return __open_driver("/dev/dri/renerD", 128, chipset);

s/rener/render/


-- 
Petri Latvala
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt v4] lib: Attempt to load the module for a missing device
  2017-11-15 11:06   ` Petri Latvala
@ 2017-11-15 11:22     ` Chris Wilson
  0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2017-11-15 11:22 UTC (permalink / raw)
  To: Petri Latvala; +Cc: intel-gfx

Quoting Petri Latvala (2017-11-15 11:06:02)
> On Tue, Nov 14, 2017 at 09:33:51PM +0000, Chris Wilson wrote:
> > If we asked to open a particular chipset and we find no matching device,
> > try again after attempting to load its module. Previously we only did
> > this for vgem, which is not automatically probed during boot, but if we
> > want to leave the module unloaded we have to try harder when we need the
> > device.
> > 
> > v2: DRIVER_* are already masks (and not shifts). Use a common
> > driver_open for both /dev/dri/cardX and /dev/dri/renderDX.
> > v3: Beware making local variables accidentally static scoped.
> > v4: Beware multiple threads trying and failing to open a device
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  lib/drmtest.c | 97 +++++++++++++++++++++++++++++++++++------------------------
> >  1 file changed, 57 insertions(+), 40 deletions(-)
> > 
> > diff --git a/lib/drmtest.c b/lib/drmtest.c
> > index e6bdbc35..37cabd58 100644
> > --- a/lib/drmtest.c
> > +++ b/lib/drmtest.c
> > @@ -44,6 +44,7 @@
> >  #include <sys/syscall.h>
> >  #include <sys/utsname.h>
> >  #include <termios.h>
> > +#include <pthread.h>
> >  
> >  #include "drmtest.h"
> >  #include "i915_drm.h"
> > @@ -235,25 +236,19 @@ static int modprobe(const char *driver)
> >       return igt_kmod_load(driver, "");
> >  }
> >  
> > -/**
> > - * __drm_open_driver:
> > - * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> > - *
> > - * Open the first DRM device we can find, searching up to 16 device nodes
> > - *
> > - * Returns:
> > - * An open DRM fd or -1 on error
> > - */
> > -int __drm_open_driver(int chipset)
> > +static void modprobe_i915(const char *name)
> >  {
> > -     if (chipset & DRIVER_VGEM)
> > -             modprobe("vgem");
> > +     /* When loading i915, we also want to load snd-hda et al */
> > +     igt_i915_driver_load(NULL);
> > +}
> >  
> > +static int __open_device(const char *base, int offset, unsigned int chipset)
> > +{
> >       for (int i = 0; i < 16; i++) {
> >               char name[80];
> >               int fd;
> >  
> > -             sprintf(name, "/dev/dri/card%u", i);
> > +             sprintf(name, "%s%u", base, i + offset);
> >               fd = open(name, O_RDWR);
> >               if (fd == -1)
> >                       continue;
> > @@ -262,16 +257,13 @@ int __drm_open_driver(int chipset)
> >                   has_known_intel_chipset(fd))
> >                       return fd;
> >  
> > -             if (chipset & DRIVER_VC4 &&
> > -                 is_vc4_device(fd))
> > +             if (chipset & DRIVER_VC4 && is_vc4_device(fd))
> >                       return fd;
> >  
> > -             if (chipset & DRIVER_VGEM &&
> > -                 is_vgem_device(fd))
> > +             if (chipset & DRIVER_VGEM && is_vgem_device(fd))
> >                       return fd;
> >  
> > -             if (chipset & DRIVER_VIRTIO &&
> > -                 is_virtio_device(fd))
> > +             if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
> >                       return fd;
> >  
> >               if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
> > @@ -287,33 +279,58 @@ int __drm_open_driver(int chipset)
> >       return -1;
> >  }
> >  
> > -static int __drm_open_driver_render(int chipset)
> > +static int __open_driver(const char *base, int offset, unsigned int chipset)
> >  {
> > -     char *name;
> > -     int i, fd;
> > -
> > -     for (i = 128; i < (128 + 16); i++) {
> > -             int ret;
> > -
> > -             ret = asprintf(&name, "/dev/dri/renderD%u", i);
> > -             igt_assert(ret != -1);
> > -
> > -             fd = open(name, O_RDWR);
> > -             free(name);
> > +     static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
> > +     static const struct module {
> > +             unsigned int bit;
> > +             const char *module;
> > +             void (*modprobe)(const char *name);
> > +     } modules[] = {
> > +             { DRIVER_AMDGPU, "amdgpu" },
> > +             { DRIVER_INTEL, "i915", modprobe_i915 },
> > +             { DRIVER_VC4, "vc4" },
> > +             { DRIVER_VGEM, "vgem" },
> > +             { DRIVER_VIRTIO, "virtio-gpu" },
> > +             {}
> > +     };
> > +     int fd;
> >  
> > -             if (fd == -1)
> > -                     continue;
> > +     fd = __open_device(base, offset, chipset);
> > +     if (fd != -1)
> > +             return fd;
> >  
> > -             if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) {
> > -                     close(fd);
> > -                     fd = -1;
> > -                     continue;
> > +     pthread_mutex_lock(&mutex);
> > +     for (const struct module *m = modules; m->module; m++) {
> > +             if (chipset & m->bit) {
> > +                     if (m->modprobe)
> > +                             m->modprobe(m->module);
> > +                     else
> > +                             modprobe(m->module);
> >               }
> > -
> > -             return fd;
> >       }
> > +     pthread_mutex_unlock(&mutex);
> >  
> > -     return fd;
> > +     return __open_device(base, offset, chipset);
> > +}
> > +
> > +/**
> > + * __drm_open_driver:
> > + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> > + *
> > + * Open the first DRM device we can find, searching up to 16 device nodes
> > + *
> > + * Returns:
> > + * An open DRM fd or -1 on error
> > + */
> > +int __drm_open_driver(int chipset)
> > +{
> > +     return __open_driver("/dev/dri/card", 0, chipset);
> > +}
> > +
> > +static int __drm_open_driver_render(int chipset)
> > +{
> > +     return __open_driver("/dev/dri/renerD", 128, chipset);
> 
> s/rener/render/

Hmm, I would have expected to have seen a SKIP. Ah, it fallsback to
/dev/dri/cardN on failure. Thanks,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH igt v5] lib: Attempt to load the module for a missing device
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (9 preceding siblings ...)
  2017-11-15  1:54 ` ✗ Fi.CI.IGT: warning " Patchwork
@ 2017-11-15 11:30 ` Chris Wilson
  2017-11-15 11:53 ` ✓ Fi.CI.BAT: success for series starting with [v5] lib: Attempt to load the module for a missing device (rev5) Patchwork
  2017-11-15 12:55 ` ✓ Fi.CI.IGT: " Patchwork
  12 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2017-11-15 11:30 UTC (permalink / raw)
  To: intel-gfx

If we asked to open a particular chipset and we find no matching device,
try again after attempting to load its module. Previously we only did
this for vgem, which is not automatically probed during boot, but if we
want to leave the module unloaded we have to try harder when we need the
device.

v2: DRIVER_* are already masks (and not shifts). Use a common
driver_open for both /dev/dri/cardX and /dev/dri/renderDX.
v3: Beware making local variables accidentally static scoped.
v4: Beware multiple threads trying and failing to open a device
v5: Fixed spelling of render (Petri)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
---
 lib/drmtest.c | 97 +++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 57 insertions(+), 40 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index e6bdbc35..ef2f772e 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -44,6 +44,7 @@
 #include <sys/syscall.h>
 #include <sys/utsname.h>
 #include <termios.h>
+#include <pthread.h>
 
 #include "drmtest.h"
 #include "i915_drm.h"
@@ -235,25 +236,19 @@ static int modprobe(const char *driver)
 	return igt_kmod_load(driver, "");
 }
 
-/**
- * __drm_open_driver:
- * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
- *
- * Open the first DRM device we can find, searching up to 16 device nodes
- *
- * Returns:
- * An open DRM fd or -1 on error
- */
-int __drm_open_driver(int chipset)
+static void modprobe_i915(const char *name)
 {
-	if (chipset & DRIVER_VGEM)
-		modprobe("vgem");
+	/* When loading i915, we also want to load snd-hda et al */
+	igt_i915_driver_load(NULL);
+}
 
+static int __open_device(const char *base, int offset, unsigned int chipset)
+{
 	for (int i = 0; i < 16; i++) {
 		char name[80];
 		int fd;
 
-		sprintf(name, "/dev/dri/card%u", i);
+		sprintf(name, "%s%u", base, i + offset);
 		fd = open(name, O_RDWR);
 		if (fd == -1)
 			continue;
@@ -262,16 +257,13 @@ int __drm_open_driver(int chipset)
 		    has_known_intel_chipset(fd))
 			return fd;
 
-		if (chipset & DRIVER_VC4 &&
-		    is_vc4_device(fd))
+		if (chipset & DRIVER_VC4 && is_vc4_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VGEM &&
-		    is_vgem_device(fd))
+		if (chipset & DRIVER_VGEM && is_vgem_device(fd))
 			return fd;
 
-		if (chipset & DRIVER_VIRTIO &&
-		    is_virtio_device(fd))
+		if (chipset & DRIVER_VIRTIO && is_virtio_device(fd))
 			return fd;
 
 		if (chipset & DRIVER_AMDGPU && is_amd_device(fd))
@@ -287,33 +279,58 @@ int __drm_open_driver(int chipset)
 	return -1;
 }
 
-static int __drm_open_driver_render(int chipset)
+static int __open_driver(const char *base, int offset, unsigned int chipset)
 {
-	char *name;
-	int i, fd;
-
-	for (i = 128; i < (128 + 16); i++) {
-		int ret;
-
-		ret = asprintf(&name, "/dev/dri/renderD%u", i);
-		igt_assert(ret != -1);
-
-		fd = open(name, O_RDWR);
-		free(name);
+	static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+	static const struct module {
+		unsigned int bit;
+		const char *module;
+		void (*modprobe)(const char *name);
+	} modules[] = {
+		{ DRIVER_AMDGPU, "amdgpu" },
+		{ DRIVER_INTEL, "i915", modprobe_i915 },
+		{ DRIVER_VC4, "vc4" },
+		{ DRIVER_VGEM, "vgem" },
+		{ DRIVER_VIRTIO, "virtio-gpu" },
+		{}
+	};
+	int fd;
 
-		if (fd == -1)
-			continue;
+	fd = __open_device(base, offset, chipset);
+	if (fd != -1)
+		return fd;
 
-		if (!is_i915_device(fd) || !has_known_intel_chipset(fd)) {
-			close(fd);
-			fd = -1;
-			continue;
+	pthread_mutex_lock(&mutex);
+	for (const struct module *m = modules; m->module; m++) {
+		if (chipset & m->bit) {
+			if (m->modprobe)
+				m->modprobe(m->module);
+			else
+				modprobe(m->module);
 		}
-
-		return fd;
 	}
+	pthread_mutex_unlock(&mutex);
 
-	return fd;
+	return __open_device(base, offset, chipset);
+}
+
+/**
+ * __drm_open_driver:
+ * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
+ *
+ * Open the first DRM device we can find, searching up to 16 device nodes
+ *
+ * Returns:
+ * An open DRM fd or -1 on error
+ */
+int __drm_open_driver(int chipset)
+{
+	return __open_driver("/dev/dri/card", 0, chipset);
+}
+
+static int __drm_open_driver_render(int chipset)
+{
+	return __open_driver("/dev/dri/renderD", 128, chipset);
 }
 
 static int at_exit_drm_fd = -1;
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for series starting with [v5] lib: Attempt to load the module for a missing device (rev5)
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (10 preceding siblings ...)
  2017-11-15 11:30 ` [PATCH igt v5] lib: Attempt to load the module for a missing device Chris Wilson
@ 2017-11-15 11:53 ` Patchwork
  2017-11-15 12:55 ` ✓ Fi.CI.IGT: " Patchwork
  12 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2017-11-15 11:53 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v5] lib: Attempt to load the module for a missing device (rev5)
URL   : https://patchwork.freedesktop.org/series/33774/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
88d6550795fad3974d77e4db2f563c5e2e8872e1 Revert "tests/kms_flip: Make flip-vs-panning-vs-hang change DSPSURF"

with latest DRM-Tip kernel build CI_DRM_3348
2cac5c93bc94 drm-tip: 2017y-11m-15d-09h-10m-41s UTC integration manifest

No testlist changes.

Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-c:
                skip       -> PASS       (fi-hsw-4770r)

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:446s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:453s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:380s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:546s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:277s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:505s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:502s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:498s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:491s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:428s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:543s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:429s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:439s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:435s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:481s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:468s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:484s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:528s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:478s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:535s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:567s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:461s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:549s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:561s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:528s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:500s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:459s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:559s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:422s
Blacklisted hosts:
fi-cfl-s         total:34   pass:24   dwarn:0   dfail:0   fail:0   skip:9  
fi-cnl-y         total:231  pass:206  dwarn:0   dfail:0   fail:0   skip:24 

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_506/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for series starting with [v5] lib: Attempt to load the module for a missing device (rev5)
  2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
                   ` (11 preceding siblings ...)
  2017-11-15 11:53 ` ✓ Fi.CI.BAT: success for series starting with [v5] lib: Attempt to load the module for a missing device (rev5) Patchwork
@ 2017-11-15 12:55 ` Patchwork
  12 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2017-11-15 12:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v5] lib: Attempt to load the module for a missing device (rev5)
URL   : https://patchwork.freedesktop.org/series/33774/
State : success

== Summary ==

Test kms_busy:
        Subgroup extended-modeset-hang-oldfb-with-reset-render-c:
                dmesg-warn -> PASS       (shard-hsw) fdo#102249 +2
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test drv_module_reload:
        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (shard-hsw) fdo#102707

fdo#102249 https://bugs.freedesktop.org/show_bug.cgi?id=102249
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707

shard-hsw        total:2511 pass:1425 dwarn:2   dfail:1   fail:10  skip:1073 time:9158s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_506/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-11-15 12:55 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 13:18 [PATCH igt 1/2] lib: Attempt to load the module for a missing device Chris Wilson
2017-11-14 13:18 ` [PATCH igt 2/2] lib/kmod: Stop reloading i915 after every kselftest Chris Wilson
2017-11-14 13:51 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] lib: Attempt to load the module for a missing device Patchwork
2017-11-14 13:56 ` [PATCH igt 1/2] " Chris Wilson
2017-11-14 14:10   ` Petri Latvala
2017-11-14 14:28     ` Chris Wilson
2017-11-14 14:07 ` [PATCH igt v2] " Chris Wilson
2017-11-14 18:17 ` ✗ Fi.CI.BAT: failure for series starting with [v2] lib: Attempt to load the module for a missing device (rev2) Patchwork
2017-11-14 18:45 ` [PATCH igt v3] lib: Attempt to load the module for a missing device Chris Wilson
2017-11-14 21:22 ` ✗ Fi.CI.BAT: failure for series starting with [v3] lib: Attempt to load the module for a missing device (rev3) Patchwork
2017-11-14 21:33 ` [PATCH igt v4] lib: Attempt to load the module for a missing device Chris Wilson
2017-11-15 11:06   ` Petri Latvala
2017-11-15 11:22     ` Chris Wilson
2017-11-14 22:35 ` ✓ Fi.CI.BAT: success for series starting with [v4] lib: Attempt to load the module for a missing device (rev4) Patchwork
2017-11-15  1:54 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-11-15 11:30 ` [PATCH igt v5] lib: Attempt to load the module for a missing device Chris Wilson
2017-11-15 11:53 ` ✓ Fi.CI.BAT: success for series starting with [v5] lib: Attempt to load the module for a missing device (rev5) Patchwork
2017-11-15 12:55 ` ✓ Fi.CI.IGT: " 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.