summaryrefslogtreecommitdiff
path: root/tests/gem_exec_flush.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-05-04 13:51:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-05-04 14:27:18 +0100
commita263a043ecd53a1c15848c51a7b3232878391130 (patch)
treeac4724b9b8e9dea66ef2160f5ad4cab0957afdfa /tests/gem_exec_flush.c
parent8adb5a07f2a3c7eadd9704b83692f72070ef946c (diff)
igt/gem_exec_flush: Also check flushing before the cmdparser
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_exec_flush.c')
-rw-r--r--tests/gem_exec_flush.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c
index bcc539f3..40d98f2a 100644
--- a/tests/gem_exec_flush.c
+++ b/tests/gem_exec_flush.c
@@ -33,6 +33,7 @@ IGT_TEST_DESCRIPTION("Basic check of flushing after batches");
#define KERNEL 4
#define SET_DOMAIN 8
#define INTERRUPTIBLE 16
+#define CMDPARSER 32
static void run(int fd, unsigned ring, int nchild, int timeout,
unsigned flags)
@@ -244,6 +245,16 @@ static void batch(int fd, unsigned ring, int nchild, int timeout,
{
const int gen = intel_gen(intel_get_drm_devid(fd));
+ if (flags & CMDPARSER) {
+ int cmdparser = -1;
+ drm_i915_getparam_t gp;
+
+ gp.param = I915_PARAM_CMD_PARSER_VERSION;
+ gp.value = &cmdparser;
+ drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+ igt_require(cmdparser > 0);
+ }
+
igt_fork(child, nchild) {
const uint32_t bbe = MI_BATCH_BUFFER_END;
struct drm_i915_gem_exec_object2 obj[2];
@@ -354,6 +365,13 @@ static void batch(int fd, unsigned ring, int nchild, int timeout,
*b++ = cycles + i;
*b++ = MI_BATCH_BUFFER_END;
+ if (flags & CMDPARSER) {
+ execbuf.batch_len =
+ (b - start) * sizeof(uint32_t);
+ if (execbuf.batch_len & 4)
+ execbuf.batch_len += 4;
+ }
+
switch (mode) {
case BATCH_KERNEL:
gem_write(fd, obj[1].handle,
@@ -362,7 +380,9 @@ static void batch(int fd, unsigned ring, int nchild, int timeout,
break;
case BATCH_USER:
- igt_clflush_range(start, (b - start) * sizeof(uint32_t));
+ if (!gem_has_llc(fd))
+ igt_clflush_range(start,
+ (b - start) * sizeof(uint32_t));
break;
case BATCH_CPU:
@@ -463,6 +483,12 @@ igt_main
b->name,
e->name)
batch(fd, ring, ncpus, timeout, b->mode, COHERENT);
+ igt_subtest_f("%sbatch-%s-%s-cmd",
+ e->exec_id == 0 ? "basic-" : "",
+ b->name,
+ e->name)
+ batch(fd, ring, ncpus, timeout, b->mode,
+ COHERENT | CMDPARSER);
}
for (const struct mode *m = modes; m->name; m++) {