Skip to contentSkip to conversation

igt/gem_exec_capture: Exercise readback of userptr

PATCH New Chris Wilson 2 participants 3 messages Nov 14, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igt/gem_exec_capture: Exercise readback of userptr

EXEC_OBJECT_CAPTURE extends the type of buffers we may read during error capture. Previously we knew that we would only see batch buffers (which limited the objects to being from gem_create()), but now we need to check that any buffer the user can create can be read. The first alternate buffer type is a userptr.

---
 tests/gem_exec_capture.c | 35 ++++++++++++++++++++++++++++++++---
 1 file changed, 32 insertions(+), 3 deletions(-)
tests/gem_exec_capture.c +32 -3
index a73ece5d..1c7d1e7c 100644
@@ -56,7 +56,7 @@ static void check_error_state(int dir, struct drm_i915_gem_exec_object2 *obj)
 	igt_assert(found);
 }
 
-static void capture(int fd, int dir, unsigned ring)
+static void __capture(int fd, int dir, unsigned ring, uint32_t target)
 {
 	const int gen = intel_gen(intel_get_drm_devid(fd));
 	struct drm_i915_gem_exec_object2 obj[4];
@@ -71,7 +71,7 @@ static void capture(int fd, int dir, unsigned ring)
 
 	memset(obj, 0, sizeof(obj));
 	obj[SCRATCH].handle = gem_create(fd, 4096);
-	obj[CAPTURE].handle = gem_create(fd, 4096);
+	obj[CAPTURE].handle = target;
 	obj[CAPTURE].flags = LOCAL_OBJECT_CAPTURE;
 	obj[NOCAPTURE].handle = gem_create(fd, 4096);
 
@@ -156,10 +156,32 @@ static void capture(int fd, int dir, unsigned ring)
 
 	gem_close(fd, obj[BATCH].handle);
 	gem_close(fd, obj[NOCAPTURE].handle);
-	gem_close(fd, obj[CAPTURE].handle);
 	gem_close(fd, obj[SCRATCH].handle);
 }
 
+static void capture(int fd, int dir, unsigned ring)
+{
+	uint32_t handle;
+
+	handle = gem_create(fd, 4096);
+	__capture(fd, dir, ring, handle);
+	gem_close(fd, handle);
+}
+
+static void userptr(int fd, int dir)
+{
+	uint32_t handle;
+	void *ptr;
+
+	igt_assert(posix_memalign(&ptr, 4096, 4096) == 0);
+	igt_require(__gem_userptr(fd, ptr, 4096, 0, 0, &handle) == 0);
+
+	__capture(fd, dir, 0, handle);
+
+	gem_close(fd, handle);
+	free(ptr);
+}
+
 static bool has_capture(int fd)
 {
 	drm_i915_getparam_t gp;
@@ -204,6 +226,13 @@ igt_main
 		}
 	}
 
+	/* And check we can read from different types of objects */
+
+	igt_subtest_f("userptr") {
+		igt_require(gem_can_store_dword(fd, 0));
+		userptr(fd, dir);
+	}
+
 	igt_fixture {
 		close(dir);
 		igt_disallow_hang(fd, hang);
Signature · 6 lines
2.15.0

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

✓ Fi.CI.BAT: success for igt/gem_exec_capture: Exercise readback of userptr (rev2)

== Series Details ==

== Series Details ==

Series: igt/gem_exec_capture: Exercise readback of userptr (rev2)
URL : https://patchwork.freedesktop.org/series/31480/
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_3344
712af85519b2 drm-tip: 2017y-11m-14d-12h-27m-40s UTC integration manifest

Testlist changes:
+igt@gem_exec_capture@userptr

Test chamelium:

        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test gem_exec_reloc:
        Subgroup basic-cpu-active:
                pass       -> DMESG-FAIL (fi-gdg-551) fdo#102582 +1
        Subgroup basic-write-cpu-active:
                pass       -> DMESG-FAIL (fi-gdg-551) fdo#102582
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
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:442s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:454s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:385s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:542s
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:512s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:500s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:502s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:492s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:432s
fi-gdg-551       total:289  pass:175  dwarn:1   dfail:3   fail:1   skip:109 time:305s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:537s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:433s
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:426s
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:466s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:475s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:526s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:533s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:459s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:547s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:563s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:530s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:497s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:466s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:567s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:427s
Blacklisted hosts:
fi-cfl-s         total:289  pass:254  dwarn:3   dfail:0   fail:0   skip:32  time:540s
fi-cnl-y         total:236  pass:210  dwarn:0   dfail:0   fail:1   skip:24 

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_500/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.IGT: warning for igt/gem_exec_capture: Exercise readback of userptr (rev2)

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: igt/gem_exec_capture: Exercise readback of userptr (rev2)
URL : https://patchwork.freedesktop.org/series/31480/
State : warning

== Summary ==

Test drv_module_reload:

        Subgroup basic-reload:
                dmesg-warn -> PASS       (shard-hsw) fdo#102707
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-b:
                dmesg-warn -> PASS       (shard-hsw) fdo#103038
        Subgroup extended-modeset-hang-oldfb-with-reset-render-b:
                pass       -> DMESG-WARN (shard-hsw) fdo#102249 +2
Test kms_atomic_transition:
        Subgroup plane-all-transition-nonblocking-fencing:
                pass       -> SKIP       (shard-hsw)
Test kms_cursor_legacy:
        Subgroup basic-flip-before-cursor-varying-size:
                pass       -> SKIP       (shard-hsw)
Test kms_flip:
        Subgroup dpms-vs-vblank-race-interruptible:
                pass       -> SKIP       (shard-hsw) fdo#103060
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-mmap-cpu:
                pass       -> SKIP       (shard-hsw)
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-hsw) fdo#100047

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

shard-hsw total:2585 pass:1465 dwarn:6 dfail:1 fail:9 skip:1103 time:9349s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_500/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx