All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/3] i915: Skip if secure batches is not available
@ 2019-11-13 18:28 ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Kuoppala, Kuoppala,  Mika

From: "Kuoppala, Mika" <mika.kuoppala@intel.com>

If we can't do secure execbuf, there is no point in trying.

Signed-off-by: Kuoppala, Mika <mika.kuoppala@intel.com>
---
 tests/i915/gem_exec_params.c   | 22 ++++++++++++++++++++--
 tests/i915/gem_mocs_settings.c | 14 ++++++++++++++
 tests/perf_pmu.c               | 14 ++++++++++++++
 3 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c
index 8f15e6454..9c3525698 100644
--- a/tests/i915/gem_exec_params.c
+++ b/tests/i915/gem_exec_params.c
@@ -193,6 +193,19 @@ static void test_batch_first(int fd)
 	gem_close(fd, obj[0].handle);
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 struct drm_i915_gem_execbuffer2 execbuf;
 struct drm_i915_gem_exec_object2 gem_exec[1];
 uint32_t batch[2] = {MI_BATCH_BUFFER_END};
@@ -340,6 +353,8 @@ igt_main
 	}
 
 	igt_subtest("secure-non-root") {
+		igt_require(has_secure_batches(fd));
+
 		igt_fork(child, 1) {
 			igt_drop_root();
 
@@ -351,9 +366,12 @@ igt_main
 	}
 
 	igt_subtest("secure-non-master") {
-		igt_require(__igt_device_set_master(fd) == 0); /* Requires root privilege */
+		igt_require(has_secure_batches(fd));
+
+		/* Requires root privilege... */
+		igt_require(__igt_device_set_master(fd) == 0);
+		igt_device_drop_master(fd); /* ... to drop master! */
 
-		igt_device_drop_master(fd);
 		execbuf.flags = I915_EXEC_RENDER | I915_EXEC_SECURE;
 		RUN_FAIL(EPERM);
 
diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index fc2ccb216..9627d828f 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -225,6 +225,19 @@ static uint32_t get_engine_base(int fd, uint32_t engine)
 	}
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 #define MI_STORE_REGISTER_MEM_64_BIT_ADDR	((0x24 << 23) | 2)
 
 static int create_read_batch(struct drm_i915_gem_relocation_entry *reloc,
@@ -566,6 +579,7 @@ igt_main
 		igt_require_gem(fd);
 		gem_require_mocs_registers(fd);
 		igt_require(get_mocs_settings(fd, &table, false));
+		igt_require(has_secure_batches(fd));
 	}
 
 	for (e = intel_execution_engines; e->name; e++) {
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index e2bd2cc55..54842784c 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -893,6 +893,19 @@ static int wait_vblank(int fd, union drm_wait_vblank *vbl)
 	return err;
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 static void
 event_wait(int gem_fd, const struct intel_execution_engine2 *e)
 {
@@ -910,6 +923,7 @@ event_wait(int gem_fd, const struct intel_execution_engine2 *e)
 
 	devid = intel_get_drm_devid(gem_fd);
 	igt_require(intel_gen(devid) >= 7);
+	igt_require(has_secure_batches(fd));
 	igt_skip_on(IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid));
 
 	kmstest_set_vt_graphics_mode();
-- 
2.24.0

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

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

* [Intel-gfx] [PATCH i-g-t 1/3] i915: Skip if secure batches is not available
@ 2019-11-13 18:28 ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Kuoppala, Kuoppala,  Mika

From: "Kuoppala, Mika" <mika.kuoppala@intel.com>

If we can't do secure execbuf, there is no point in trying.

Signed-off-by: Kuoppala, Mika <mika.kuoppala@intel.com>
---
 tests/i915/gem_exec_params.c   | 22 ++++++++++++++++++++--
 tests/i915/gem_mocs_settings.c | 14 ++++++++++++++
 tests/perf_pmu.c               | 14 ++++++++++++++
 3 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c
index 8f15e6454..9c3525698 100644
--- a/tests/i915/gem_exec_params.c
+++ b/tests/i915/gem_exec_params.c
@@ -193,6 +193,19 @@ static void test_batch_first(int fd)
 	gem_close(fd, obj[0].handle);
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 struct drm_i915_gem_execbuffer2 execbuf;
 struct drm_i915_gem_exec_object2 gem_exec[1];
 uint32_t batch[2] = {MI_BATCH_BUFFER_END};
@@ -340,6 +353,8 @@ igt_main
 	}
 
 	igt_subtest("secure-non-root") {
+		igt_require(has_secure_batches(fd));
+
 		igt_fork(child, 1) {
 			igt_drop_root();
 
@@ -351,9 +366,12 @@ igt_main
 	}
 
 	igt_subtest("secure-non-master") {
-		igt_require(__igt_device_set_master(fd) == 0); /* Requires root privilege */
+		igt_require(has_secure_batches(fd));
+
+		/* Requires root privilege... */
+		igt_require(__igt_device_set_master(fd) == 0);
+		igt_device_drop_master(fd); /* ... to drop master! */
 
-		igt_device_drop_master(fd);
 		execbuf.flags = I915_EXEC_RENDER | I915_EXEC_SECURE;
 		RUN_FAIL(EPERM);
 
diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index fc2ccb216..9627d828f 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -225,6 +225,19 @@ static uint32_t get_engine_base(int fd, uint32_t engine)
 	}
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 #define MI_STORE_REGISTER_MEM_64_BIT_ADDR	((0x24 << 23) | 2)
 
 static int create_read_batch(struct drm_i915_gem_relocation_entry *reloc,
@@ -566,6 +579,7 @@ igt_main
 		igt_require_gem(fd);
 		gem_require_mocs_registers(fd);
 		igt_require(get_mocs_settings(fd, &table, false));
+		igt_require(has_secure_batches(fd));
 	}
 
 	for (e = intel_execution_engines; e->name; e++) {
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index e2bd2cc55..54842784c 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -893,6 +893,19 @@ static int wait_vblank(int fd, union drm_wait_vblank *vbl)
 	return err;
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 static void
 event_wait(int gem_fd, const struct intel_execution_engine2 *e)
 {
@@ -910,6 +923,7 @@ event_wait(int gem_fd, const struct intel_execution_engine2 *e)
 
 	devid = intel_get_drm_devid(gem_fd);
 	igt_require(intel_gen(devid) >= 7);
+	igt_require(has_secure_batches(fd));
 	igt_skip_on(IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid));
 
 	kmstest_set_vt_graphics_mode();
-- 
2.24.0

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

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

* [igt-dev] [PATCH i-g-t 1/3] i915: Skip if secure batches is not available
@ 2019-11-13 18:28 ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Kuoppala, Kuoppala,  Mika

From: "Kuoppala, Mika" <mika.kuoppala@intel.com>

If we can't do secure execbuf, there is no point in trying.

Signed-off-by: Kuoppala, Mika <mika.kuoppala@intel.com>
---
 tests/i915/gem_exec_params.c   | 22 ++++++++++++++++++++--
 tests/i915/gem_mocs_settings.c | 14 ++++++++++++++
 tests/perf_pmu.c               | 14 ++++++++++++++
 3 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c
index 8f15e6454..9c3525698 100644
--- a/tests/i915/gem_exec_params.c
+++ b/tests/i915/gem_exec_params.c
@@ -193,6 +193,19 @@ static void test_batch_first(int fd)
 	gem_close(fd, obj[0].handle);
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 struct drm_i915_gem_execbuffer2 execbuf;
 struct drm_i915_gem_exec_object2 gem_exec[1];
 uint32_t batch[2] = {MI_BATCH_BUFFER_END};
@@ -340,6 +353,8 @@ igt_main
 	}
 
 	igt_subtest("secure-non-root") {
+		igt_require(has_secure_batches(fd));
+
 		igt_fork(child, 1) {
 			igt_drop_root();
 
@@ -351,9 +366,12 @@ igt_main
 	}
 
 	igt_subtest("secure-non-master") {
-		igt_require(__igt_device_set_master(fd) == 0); /* Requires root privilege */
+		igt_require(has_secure_batches(fd));
+
+		/* Requires root privilege... */
+		igt_require(__igt_device_set_master(fd) == 0);
+		igt_device_drop_master(fd); /* ... to drop master! */
 
-		igt_device_drop_master(fd);
 		execbuf.flags = I915_EXEC_RENDER | I915_EXEC_SECURE;
 		RUN_FAIL(EPERM);
 
diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index fc2ccb216..9627d828f 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -225,6 +225,19 @@ static uint32_t get_engine_base(int fd, uint32_t engine)
 	}
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 #define MI_STORE_REGISTER_MEM_64_BIT_ADDR	((0x24 << 23) | 2)
 
 static int create_read_batch(struct drm_i915_gem_relocation_entry *reloc,
@@ -566,6 +579,7 @@ igt_main
 		igt_require_gem(fd);
 		gem_require_mocs_registers(fd);
 		igt_require(get_mocs_settings(fd, &table, false));
+		igt_require(has_secure_batches(fd));
 	}
 
 	for (e = intel_execution_engines; e->name; e++) {
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index e2bd2cc55..54842784c 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -893,6 +893,19 @@ static int wait_vblank(int fd, union drm_wait_vblank *vbl)
 	return err;
 }
 
+static int has_secure_batches(const int fd)
+{
+	int v = -1;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_HAS_SECURE_BATCHES,
+		.value = &v,
+	};
+
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return v > 0;
+}
+
 static void
 event_wait(int gem_fd, const struct intel_execution_engine2 *e)
 {
@@ -910,6 +923,7 @@ event_wait(int gem_fd, const struct intel_execution_engine2 *e)
 
 	devid = intel_get_drm_devid(gem_fd);
 	igt_require(intel_gen(devid) >= 7);
+	igt_require(has_secure_batches(fd));
 	igt_skip_on(IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid));
 
 	kmstest_set_vt_graphics_mode();
-- 
2.24.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [PATCH i-g-t 2/3] lib/igt_dummyload: Send batch as first
@ 2019-11-13 18:28   ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

From: Mika Kuoppala <mika.kuoppala@linux.intel.com>

To simplify emitting the recursive batch, make batch
always the first object on the execbuf list.

This will require kernel v4.13 or greater.

v2: set handles early, poll_ptr indecency (Chris)
v3: allow dep with poll
v4: fix gem_exec_schedule
v5: rebase
v6: rebase
v6: gem_ctx_shared
v7: conditional close of poll handle
v8: bw compat note (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 lib/igt_dummyload.c            | 115 +++++++++++++++++----------------
 lib/igt_dummyload.h            |   8 ++-
 tests/i915/gem_exec_balancer.c |   8 +--
 tests/i915/gem_spin_batch.c    |  13 ++--
 4 files changed, 75 insertions(+), 69 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index b9e239db3..c079bd045 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -63,6 +63,7 @@
 #define MI_ARB_CHK (0x5 << 23)
 
 static const int BATCH_SIZE = 4096;
+static const int POLL_SIZE = 4096;
 static const int LOOP_START_OFFSET = 64;
 
 static IGT_LIST_HEAD(spin_list);
@@ -72,16 +73,23 @@ static int
 emit_recursive_batch(igt_spin_t *spin,
 		     int fd, const struct igt_spin_factory *opts)
 {
-#define SCRATCH 0
+
 #define BATCH IGT_SPIN_BATCH
+#define POLL 1
+#define DEP     2
 	const int gen = intel_gen(intel_get_drm_devid(fd));
-	struct drm_i915_gem_relocation_entry relocs[2], *r;
+	struct drm_i915_gem_exec_object2 * const batch =
+		&spin->obj[BATCH];
+	struct drm_i915_gem_exec_object2 * const poll =
+		&spin->obj[POLL];
+	struct drm_i915_gem_exec_object2 * const dep =
+		&spin->obj[DEP];
+	struct drm_i915_gem_relocation_entry relocs[4], *r;
 	struct drm_i915_gem_execbuffer2 *execbuf;
-	struct drm_i915_gem_exec_object2 *obj;
 	unsigned int flags[GEM_MAX_ENGINES];
 	unsigned int nengine;
 	int fence_fd = -1;
-	uint32_t *cs, *batch;
+	uint32_t *cs, *batch_start;
 	int i;
 
 	nengine = 0;
@@ -103,64 +111,48 @@ emit_recursive_batch(igt_spin_t *spin,
 	memset(&spin->execbuf, 0, sizeof(spin->execbuf));
 	execbuf = &spin->execbuf;
 	memset(spin->obj, 0, sizeof(spin->obj));
-	obj = spin->obj;
 	memset(relocs, 0, sizeof(relocs));
 
-	obj[BATCH].handle = gem_create(fd, BATCH_SIZE);
-	batch = __gem_mmap__wc(fd, obj[BATCH].handle,
-			       0, BATCH_SIZE, PROT_WRITE);
-	if (!batch)
-		batch = gem_mmap__gtt(fd, obj[BATCH].handle,
-				      BATCH_SIZE, PROT_WRITE);
+	batch->handle = gem_create(fd, BATCH_SIZE);
+	spin->handle = batch->handle;
 
-	gem_set_domain(fd, obj[BATCH].handle,
+	batch_start = __gem_mmap__wc(fd, batch->handle,
+				     0, BATCH_SIZE, PROT_WRITE);
+	if (!batch_start)
+		batch_start = gem_mmap__gtt(fd, batch->handle,
+					    BATCH_SIZE, PROT_WRITE);
+	gem_set_domain(fd, batch->handle,
 		       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 	execbuf->buffer_count++;
-	cs = batch;
-
-	if (opts->dependency) {
-		igt_assert(!(opts->flags & IGT_SPIN_POLL_RUN));
-
-		r = &relocs[obj[BATCH].relocation_count++];
+	cs = batch_start;
 
-		/* dummy write to dependency */
-		obj[SCRATCH].handle = opts->dependency;
-		r->presumed_offset = 0;
-		r->target_handle = obj[SCRATCH].handle;
-		r->offset = sizeof(uint32_t) * 1020;
-		r->delta = 0;
-		r->read_domains = I915_GEM_DOMAIN_RENDER;
-		r->write_domain = I915_GEM_DOMAIN_RENDER;
-
-		execbuf->buffer_count++;
-	} else if (opts->flags & IGT_SPIN_POLL_RUN) {
-		r = &relocs[obj[BATCH].relocation_count++];
+	poll->handle = gem_create(fd, POLL_SIZE);
+	spin->poll_handle = poll->handle;
+	execbuf->buffer_count++;
 
-		igt_assert(!opts->dependency);
+	if (opts->flags & IGT_SPIN_POLL_RUN) {
+		r = &relocs[batch->relocation_count++];
 
 		if (gen == 4 || gen == 5) {
 			execbuf->flags |= I915_EXEC_SECURE;
 			igt_require(__igt_device_set_master(fd) == 0);
 		}
 
-		spin->poll_handle = gem_create(fd, 4096);
-		obj[SCRATCH].handle = spin->poll_handle;
-
-		if (__gem_set_caching(fd, spin->poll_handle,
+		if (__gem_set_caching(fd, poll->handle,
 				      I915_CACHING_CACHED) == 0)
-			spin->poll = gem_mmap__cpu(fd, spin->poll_handle,
-						   0, 4096,
+			spin->poll = gem_mmap__cpu(fd, poll->handle,
+						   0, POLL_SIZE,
 						   PROT_READ | PROT_WRITE);
 		else
-			spin->poll = gem_mmap__wc(fd, spin->poll_handle,
-						  0, 4096,
+			spin->poll = gem_mmap__wc(fd, poll->handle,
+						  0, POLL_SIZE,
 						  PROT_READ | PROT_WRITE);
 
 		igt_assert_eq(spin->poll[SPIN_POLL_START_IDX], 0);
 
 		/* batch is first */
-		r->presumed_offset = 4096;
-		r->target_handle = obj[SCRATCH].handle;
+		r->presumed_offset = BATCH_SIZE;
+		r->target_handle = poll->handle;
 		r->offset = sizeof(uint32_t) * 1;
 		r->delta = sizeof(uint32_t) * SPIN_POLL_START_IDX;
 
@@ -179,14 +171,25 @@ emit_recursive_batch(igt_spin_t *spin,
 		}
 
 		*cs++ = 1;
+	}
+
+	if (opts->dependency) {
+		r = &relocs[batch->relocation_count++];
+
+		/* dummy write to dependency */
+		dep->handle = opts->dependency;
+		r->presumed_offset = BATCH_SIZE + POLL_SIZE;
+		r->target_handle = dep->handle;
+		r->offset = sizeof(uint32_t) * 1020;
+		r->delta = 0;
+		r->read_domains = I915_GEM_DOMAIN_RENDER;
+		r->write_domain = I915_GEM_DOMAIN_RENDER;
 
 		execbuf->buffer_count++;
 	}
 
-	spin->handle = obj[BATCH].handle;
-
-	igt_assert_lt(cs - batch, LOOP_START_OFFSET / sizeof(*cs));
-	spin->condition = batch + LOOP_START_OFFSET / sizeof(*cs);
+	igt_assert_lt(cs - batch_start, LOOP_START_OFFSET / sizeof(*cs));
+	spin->condition = batch_start + LOOP_START_OFFSET / sizeof(*cs);
 	cs = spin->condition;
 
 	/* Allow ourselves to be preempted */
@@ -208,9 +211,9 @@ emit_recursive_batch(igt_spin_t *spin,
 		cs += 1000;
 
 	/* recurse */
-	r = &relocs[obj[BATCH].relocation_count++];
-	r->target_handle = obj[BATCH].handle;
-	r->offset = (cs + 1 - batch) * sizeof(*cs);
+	r = &relocs[batch->relocation_count++];
+	r->target_handle = batch->handle;
+	r->offset = (cs + 1 - batch_start) * sizeof(*cs);
 	r->read_domains = I915_GEM_DOMAIN_COMMAND;
 	r->delta = LOOP_START_OFFSET;
 	if (gen >= 8) {
@@ -227,10 +230,10 @@ emit_recursive_batch(igt_spin_t *spin,
 		*cs = r->delta;
 		cs++;
 	}
-	obj[BATCH].relocs_ptr = to_user_pointer(relocs);
+	batch->relocs_ptr = to_user_pointer(relocs);
 
-	execbuf->buffers_ptr = to_user_pointer(obj +
-					       (2 - execbuf->buffer_count));
+	execbuf->buffers_ptr = to_user_pointer(spin->obj);
+	execbuf->flags |= I915_EXEC_BATCH_FIRST;
 	execbuf->rsvd1 = opts->ctx;
 
 	if (opts->flags & IGT_SPIN_FENCE_OUT)
@@ -264,10 +267,9 @@ emit_recursive_batch(igt_spin_t *spin,
 		}
 	}
 
-	igt_assert_lt(cs - batch, BATCH_SIZE / sizeof(*cs));
+	igt_assert_lt(cs - batch_start, BATCH_SIZE / sizeof(*cs));
 
-	/* Make it easier for callers to resubmit. */
-	for (i = 0; i < ARRAY_SIZE(spin->obj); i++) {
+	for (i = 0; i < execbuf->buffer_count; i++) {
 		spin->obj[i].relocation_count = 0;
 		spin->obj[i].relocs_ptr = 0;
 		spin->obj[i].flags = EXEC_OBJECT_PINNED;
@@ -445,10 +447,11 @@ void igt_spin_free(int fd, igt_spin_t *spin)
 	gem_munmap((void *)((unsigned long)spin->condition & (~4095UL)),
 		   BATCH_SIZE);
 
-	if (spin->poll) {
+	if (spin->poll)
 		gem_munmap(spin->poll, 4096);
+
+	if (spin->poll_handle)
 		gem_close(fd, spin->poll_handle);
-	}
 
 	if (spin->handle)
 		gem_close(fd, spin->handle);
diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
index 421ca183b..de5781d7d 100644
--- a/lib/igt_dummyload.h
+++ b/lib/igt_dummyload.h
@@ -34,6 +34,7 @@
 
 typedef struct igt_spin {
 	unsigned int handle;
+
 	timer_t timer;
 	struct igt_list_head link;
 
@@ -41,9 +42,12 @@ typedef struct igt_spin {
 	uint32_t cmd_precondition;
 
 	int out_fence;
-	struct drm_i915_gem_exec_object2 obj[2];
-#define IGT_SPIN_BATCH   1
+	struct drm_i915_gem_exec_object2 obj[3];
+#define IGT_SPIN_BATCH   0
+#define IGT_SPIN_POLL    1
+
 	struct drm_i915_gem_execbuffer2 execbuf;
+
 	uint32_t poll_handle;
 	uint32_t *poll;
 #define SPIN_POLL_START_IDX 0
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index 70c4529b4..19df406cf 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -718,7 +718,7 @@ static uint32_t create_semaphore_to_spinner(int i915, igt_spin_t *spin)
 	cs = map = gem_mmap__cpu(i915, handle, 0, 4096, PROT_WRITE);
 
 	/* Wait until the spinner is running */
-	addr = spin->obj[0].offset + 4 * SPIN_POLL_START_IDX;
+	addr = spin->obj[IGT_SPIN_POLL].offset + 4 * SPIN_POLL_START_IDX;
 	*cs++ = MI_SEMAPHORE_WAIT |
 		MI_SEMAPHORE_POLL |
 		MI_SEMAPHORE_SAD_NEQ_SDD |
@@ -797,9 +797,9 @@ static void bonded_slice(int i915)
 		igt_spin_reset(spin);
 
 		/* igt_spin_t poll and batch obj must be laid out as we expect */
-		igt_assert_eq(IGT_SPIN_BATCH, 1);
-		obj[0] = spin->obj[0];
-		obj[1] = spin->obj[1];
+		igt_assert_eq(IGT_SPIN_BATCH, 0);
+		obj[0] = spin->obj[IGT_SPIN_POLL];
+		obj[1] = spin->obj[IGT_SPIN_BATCH];
 		obj[2].handle = create_semaphore_to_spinner(i915, spin);
 
 		eb.buffers_ptr = to_user_pointer(obj);
diff --git a/tests/i915/gem_spin_batch.c b/tests/i915/gem_spin_batch.c
index c67f015ff..04707fdc2 100644
--- a/tests/i915/gem_spin_batch.c
+++ b/tests/i915/gem_spin_batch.c
@@ -78,12 +78,9 @@ static void spin_resubmit(int fd, const struct intel_execution_engine2 *e2,
 		gem_context_create(fd) : ctx0;
 	igt_spin_t *spin = __igt_spin_new(fd, .ctx = ctx0, .engine = e2->flags);
 	const struct intel_execution_engine2 *other;
+	struct drm_i915_gem_execbuffer2 eb = spin->execbuf;
 
-	struct drm_i915_gem_execbuffer2 eb = {
-		.buffer_count = 1,
-		.buffers_ptr = to_user_pointer(&spin->obj[IGT_SPIN_BATCH]),
-		.rsvd1 = ctx1,
-	};
+	eb.rsvd1 = ctx1;
 
 	igt_assert(gem_context_has_engine_map(fd, 0) ||
 		   !(flags & RESUBMIT_ALL_ENGINES));
@@ -97,11 +94,13 @@ static void spin_resubmit(int fd, const struct intel_execution_engine2 *e2,
 			if (gem_engine_is_equal(other, e2))
 				continue;
 
-			eb.flags = other->flags;
+			eb.flags &= ~(I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK);
+			eb.flags |= other->flags;
 			gem_execbuf(fd, &eb);
 		}
 	} else {
-		eb.flags = e2->flags;
+		eb.flags &= ~(I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK);
+		eb.flags |= e2->flags;
 		gem_execbuf(fd, &eb);
 	}
 
-- 
2.24.0

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

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

* [Intel-gfx] [PATCH i-g-t 2/3] lib/igt_dummyload: Send batch as first
@ 2019-11-13 18:28   ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

From: Mika Kuoppala <mika.kuoppala@linux.intel.com>

To simplify emitting the recursive batch, make batch
always the first object on the execbuf list.

This will require kernel v4.13 or greater.

v2: set handles early, poll_ptr indecency (Chris)
v3: allow dep with poll
v4: fix gem_exec_schedule
v5: rebase
v6: rebase
v6: gem_ctx_shared
v7: conditional close of poll handle
v8: bw compat note (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 lib/igt_dummyload.c            | 115 +++++++++++++++++----------------
 lib/igt_dummyload.h            |   8 ++-
 tests/i915/gem_exec_balancer.c |   8 +--
 tests/i915/gem_spin_batch.c    |  13 ++--
 4 files changed, 75 insertions(+), 69 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index b9e239db3..c079bd045 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -63,6 +63,7 @@
 #define MI_ARB_CHK (0x5 << 23)
 
 static const int BATCH_SIZE = 4096;
+static const int POLL_SIZE = 4096;
 static const int LOOP_START_OFFSET = 64;
 
 static IGT_LIST_HEAD(spin_list);
@@ -72,16 +73,23 @@ static int
 emit_recursive_batch(igt_spin_t *spin,
 		     int fd, const struct igt_spin_factory *opts)
 {
-#define SCRATCH 0
+
 #define BATCH IGT_SPIN_BATCH
+#define POLL 1
+#define DEP     2
 	const int gen = intel_gen(intel_get_drm_devid(fd));
-	struct drm_i915_gem_relocation_entry relocs[2], *r;
+	struct drm_i915_gem_exec_object2 * const batch =
+		&spin->obj[BATCH];
+	struct drm_i915_gem_exec_object2 * const poll =
+		&spin->obj[POLL];
+	struct drm_i915_gem_exec_object2 * const dep =
+		&spin->obj[DEP];
+	struct drm_i915_gem_relocation_entry relocs[4], *r;
 	struct drm_i915_gem_execbuffer2 *execbuf;
-	struct drm_i915_gem_exec_object2 *obj;
 	unsigned int flags[GEM_MAX_ENGINES];
 	unsigned int nengine;
 	int fence_fd = -1;
-	uint32_t *cs, *batch;
+	uint32_t *cs, *batch_start;
 	int i;
 
 	nengine = 0;
@@ -103,64 +111,48 @@ emit_recursive_batch(igt_spin_t *spin,
 	memset(&spin->execbuf, 0, sizeof(spin->execbuf));
 	execbuf = &spin->execbuf;
 	memset(spin->obj, 0, sizeof(spin->obj));
-	obj = spin->obj;
 	memset(relocs, 0, sizeof(relocs));
 
-	obj[BATCH].handle = gem_create(fd, BATCH_SIZE);
-	batch = __gem_mmap__wc(fd, obj[BATCH].handle,
-			       0, BATCH_SIZE, PROT_WRITE);
-	if (!batch)
-		batch = gem_mmap__gtt(fd, obj[BATCH].handle,
-				      BATCH_SIZE, PROT_WRITE);
+	batch->handle = gem_create(fd, BATCH_SIZE);
+	spin->handle = batch->handle;
 
-	gem_set_domain(fd, obj[BATCH].handle,
+	batch_start = __gem_mmap__wc(fd, batch->handle,
+				     0, BATCH_SIZE, PROT_WRITE);
+	if (!batch_start)
+		batch_start = gem_mmap__gtt(fd, batch->handle,
+					    BATCH_SIZE, PROT_WRITE);
+	gem_set_domain(fd, batch->handle,
 		       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 	execbuf->buffer_count++;
-	cs = batch;
-
-	if (opts->dependency) {
-		igt_assert(!(opts->flags & IGT_SPIN_POLL_RUN));
-
-		r = &relocs[obj[BATCH].relocation_count++];
+	cs = batch_start;
 
-		/* dummy write to dependency */
-		obj[SCRATCH].handle = opts->dependency;
-		r->presumed_offset = 0;
-		r->target_handle = obj[SCRATCH].handle;
-		r->offset = sizeof(uint32_t) * 1020;
-		r->delta = 0;
-		r->read_domains = I915_GEM_DOMAIN_RENDER;
-		r->write_domain = I915_GEM_DOMAIN_RENDER;
-
-		execbuf->buffer_count++;
-	} else if (opts->flags & IGT_SPIN_POLL_RUN) {
-		r = &relocs[obj[BATCH].relocation_count++];
+	poll->handle = gem_create(fd, POLL_SIZE);
+	spin->poll_handle = poll->handle;
+	execbuf->buffer_count++;
 
-		igt_assert(!opts->dependency);
+	if (opts->flags & IGT_SPIN_POLL_RUN) {
+		r = &relocs[batch->relocation_count++];
 
 		if (gen == 4 || gen == 5) {
 			execbuf->flags |= I915_EXEC_SECURE;
 			igt_require(__igt_device_set_master(fd) == 0);
 		}
 
-		spin->poll_handle = gem_create(fd, 4096);
-		obj[SCRATCH].handle = spin->poll_handle;
-
-		if (__gem_set_caching(fd, spin->poll_handle,
+		if (__gem_set_caching(fd, poll->handle,
 				      I915_CACHING_CACHED) == 0)
-			spin->poll = gem_mmap__cpu(fd, spin->poll_handle,
-						   0, 4096,
+			spin->poll = gem_mmap__cpu(fd, poll->handle,
+						   0, POLL_SIZE,
 						   PROT_READ | PROT_WRITE);
 		else
-			spin->poll = gem_mmap__wc(fd, spin->poll_handle,
-						  0, 4096,
+			spin->poll = gem_mmap__wc(fd, poll->handle,
+						  0, POLL_SIZE,
 						  PROT_READ | PROT_WRITE);
 
 		igt_assert_eq(spin->poll[SPIN_POLL_START_IDX], 0);
 
 		/* batch is first */
-		r->presumed_offset = 4096;
-		r->target_handle = obj[SCRATCH].handle;
+		r->presumed_offset = BATCH_SIZE;
+		r->target_handle = poll->handle;
 		r->offset = sizeof(uint32_t) * 1;
 		r->delta = sizeof(uint32_t) * SPIN_POLL_START_IDX;
 
@@ -179,14 +171,25 @@ emit_recursive_batch(igt_spin_t *spin,
 		}
 
 		*cs++ = 1;
+	}
+
+	if (opts->dependency) {
+		r = &relocs[batch->relocation_count++];
+
+		/* dummy write to dependency */
+		dep->handle = opts->dependency;
+		r->presumed_offset = BATCH_SIZE + POLL_SIZE;
+		r->target_handle = dep->handle;
+		r->offset = sizeof(uint32_t) * 1020;
+		r->delta = 0;
+		r->read_domains = I915_GEM_DOMAIN_RENDER;
+		r->write_domain = I915_GEM_DOMAIN_RENDER;
 
 		execbuf->buffer_count++;
 	}
 
-	spin->handle = obj[BATCH].handle;
-
-	igt_assert_lt(cs - batch, LOOP_START_OFFSET / sizeof(*cs));
-	spin->condition = batch + LOOP_START_OFFSET / sizeof(*cs);
+	igt_assert_lt(cs - batch_start, LOOP_START_OFFSET / sizeof(*cs));
+	spin->condition = batch_start + LOOP_START_OFFSET / sizeof(*cs);
 	cs = spin->condition;
 
 	/* Allow ourselves to be preempted */
@@ -208,9 +211,9 @@ emit_recursive_batch(igt_spin_t *spin,
 		cs += 1000;
 
 	/* recurse */
-	r = &relocs[obj[BATCH].relocation_count++];
-	r->target_handle = obj[BATCH].handle;
-	r->offset = (cs + 1 - batch) * sizeof(*cs);
+	r = &relocs[batch->relocation_count++];
+	r->target_handle = batch->handle;
+	r->offset = (cs + 1 - batch_start) * sizeof(*cs);
 	r->read_domains = I915_GEM_DOMAIN_COMMAND;
 	r->delta = LOOP_START_OFFSET;
 	if (gen >= 8) {
@@ -227,10 +230,10 @@ emit_recursive_batch(igt_spin_t *spin,
 		*cs = r->delta;
 		cs++;
 	}
-	obj[BATCH].relocs_ptr = to_user_pointer(relocs);
+	batch->relocs_ptr = to_user_pointer(relocs);
 
-	execbuf->buffers_ptr = to_user_pointer(obj +
-					       (2 - execbuf->buffer_count));
+	execbuf->buffers_ptr = to_user_pointer(spin->obj);
+	execbuf->flags |= I915_EXEC_BATCH_FIRST;
 	execbuf->rsvd1 = opts->ctx;
 
 	if (opts->flags & IGT_SPIN_FENCE_OUT)
@@ -264,10 +267,9 @@ emit_recursive_batch(igt_spin_t *spin,
 		}
 	}
 
-	igt_assert_lt(cs - batch, BATCH_SIZE / sizeof(*cs));
+	igt_assert_lt(cs - batch_start, BATCH_SIZE / sizeof(*cs));
 
-	/* Make it easier for callers to resubmit. */
-	for (i = 0; i < ARRAY_SIZE(spin->obj); i++) {
+	for (i = 0; i < execbuf->buffer_count; i++) {
 		spin->obj[i].relocation_count = 0;
 		spin->obj[i].relocs_ptr = 0;
 		spin->obj[i].flags = EXEC_OBJECT_PINNED;
@@ -445,10 +447,11 @@ void igt_spin_free(int fd, igt_spin_t *spin)
 	gem_munmap((void *)((unsigned long)spin->condition & (~4095UL)),
 		   BATCH_SIZE);
 
-	if (spin->poll) {
+	if (spin->poll)
 		gem_munmap(spin->poll, 4096);
+
+	if (spin->poll_handle)
 		gem_close(fd, spin->poll_handle);
-	}
 
 	if (spin->handle)
 		gem_close(fd, spin->handle);
diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
index 421ca183b..de5781d7d 100644
--- a/lib/igt_dummyload.h
+++ b/lib/igt_dummyload.h
@@ -34,6 +34,7 @@
 
 typedef struct igt_spin {
 	unsigned int handle;
+
 	timer_t timer;
 	struct igt_list_head link;
 
@@ -41,9 +42,12 @@ typedef struct igt_spin {
 	uint32_t cmd_precondition;
 
 	int out_fence;
-	struct drm_i915_gem_exec_object2 obj[2];
-#define IGT_SPIN_BATCH   1
+	struct drm_i915_gem_exec_object2 obj[3];
+#define IGT_SPIN_BATCH   0
+#define IGT_SPIN_POLL    1
+
 	struct drm_i915_gem_execbuffer2 execbuf;
+
 	uint32_t poll_handle;
 	uint32_t *poll;
 #define SPIN_POLL_START_IDX 0
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index 70c4529b4..19df406cf 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -718,7 +718,7 @@ static uint32_t create_semaphore_to_spinner(int i915, igt_spin_t *spin)
 	cs = map = gem_mmap__cpu(i915, handle, 0, 4096, PROT_WRITE);
 
 	/* Wait until the spinner is running */
-	addr = spin->obj[0].offset + 4 * SPIN_POLL_START_IDX;
+	addr = spin->obj[IGT_SPIN_POLL].offset + 4 * SPIN_POLL_START_IDX;
 	*cs++ = MI_SEMAPHORE_WAIT |
 		MI_SEMAPHORE_POLL |
 		MI_SEMAPHORE_SAD_NEQ_SDD |
@@ -797,9 +797,9 @@ static void bonded_slice(int i915)
 		igt_spin_reset(spin);
 
 		/* igt_spin_t poll and batch obj must be laid out as we expect */
-		igt_assert_eq(IGT_SPIN_BATCH, 1);
-		obj[0] = spin->obj[0];
-		obj[1] = spin->obj[1];
+		igt_assert_eq(IGT_SPIN_BATCH, 0);
+		obj[0] = spin->obj[IGT_SPIN_POLL];
+		obj[1] = spin->obj[IGT_SPIN_BATCH];
 		obj[2].handle = create_semaphore_to_spinner(i915, spin);
 
 		eb.buffers_ptr = to_user_pointer(obj);
diff --git a/tests/i915/gem_spin_batch.c b/tests/i915/gem_spin_batch.c
index c67f015ff..04707fdc2 100644
--- a/tests/i915/gem_spin_batch.c
+++ b/tests/i915/gem_spin_batch.c
@@ -78,12 +78,9 @@ static void spin_resubmit(int fd, const struct intel_execution_engine2 *e2,
 		gem_context_create(fd) : ctx0;
 	igt_spin_t *spin = __igt_spin_new(fd, .ctx = ctx0, .engine = e2->flags);
 	const struct intel_execution_engine2 *other;
+	struct drm_i915_gem_execbuffer2 eb = spin->execbuf;
 
-	struct drm_i915_gem_execbuffer2 eb = {
-		.buffer_count = 1,
-		.buffers_ptr = to_user_pointer(&spin->obj[IGT_SPIN_BATCH]),
-		.rsvd1 = ctx1,
-	};
+	eb.rsvd1 = ctx1;
 
 	igt_assert(gem_context_has_engine_map(fd, 0) ||
 		   !(flags & RESUBMIT_ALL_ENGINES));
@@ -97,11 +94,13 @@ static void spin_resubmit(int fd, const struct intel_execution_engine2 *e2,
 			if (gem_engine_is_equal(other, e2))
 				continue;
 
-			eb.flags = other->flags;
+			eb.flags &= ~(I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK);
+			eb.flags |= other->flags;
 			gem_execbuf(fd, &eb);
 		}
 	} else {
-		eb.flags = e2->flags;
+		eb.flags &= ~(I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK);
+		eb.flags |= e2->flags;
 		gem_execbuf(fd, &eb);
 	}
 
-- 
2.24.0

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

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

* [igt-dev] [PATCH i-g-t 2/3] lib/igt_dummyload: Send batch as first
@ 2019-11-13 18:28   ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

From: Mika Kuoppala <mika.kuoppala@linux.intel.com>

To simplify emitting the recursive batch, make batch
always the first object on the execbuf list.

This will require kernel v4.13 or greater.

v2: set handles early, poll_ptr indecency (Chris)
v3: allow dep with poll
v4: fix gem_exec_schedule
v5: rebase
v6: rebase
v6: gem_ctx_shared
v7: conditional close of poll handle
v8: bw compat note (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 lib/igt_dummyload.c            | 115 +++++++++++++++++----------------
 lib/igt_dummyload.h            |   8 ++-
 tests/i915/gem_exec_balancer.c |   8 +--
 tests/i915/gem_spin_batch.c    |  13 ++--
 4 files changed, 75 insertions(+), 69 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index b9e239db3..c079bd045 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -63,6 +63,7 @@
 #define MI_ARB_CHK (0x5 << 23)
 
 static const int BATCH_SIZE = 4096;
+static const int POLL_SIZE = 4096;
 static const int LOOP_START_OFFSET = 64;
 
 static IGT_LIST_HEAD(spin_list);
@@ -72,16 +73,23 @@ static int
 emit_recursive_batch(igt_spin_t *spin,
 		     int fd, const struct igt_spin_factory *opts)
 {
-#define SCRATCH 0
+
 #define BATCH IGT_SPIN_BATCH
+#define POLL 1
+#define DEP     2
 	const int gen = intel_gen(intel_get_drm_devid(fd));
-	struct drm_i915_gem_relocation_entry relocs[2], *r;
+	struct drm_i915_gem_exec_object2 * const batch =
+		&spin->obj[BATCH];
+	struct drm_i915_gem_exec_object2 * const poll =
+		&spin->obj[POLL];
+	struct drm_i915_gem_exec_object2 * const dep =
+		&spin->obj[DEP];
+	struct drm_i915_gem_relocation_entry relocs[4], *r;
 	struct drm_i915_gem_execbuffer2 *execbuf;
-	struct drm_i915_gem_exec_object2 *obj;
 	unsigned int flags[GEM_MAX_ENGINES];
 	unsigned int nengine;
 	int fence_fd = -1;
-	uint32_t *cs, *batch;
+	uint32_t *cs, *batch_start;
 	int i;
 
 	nengine = 0;
@@ -103,64 +111,48 @@ emit_recursive_batch(igt_spin_t *spin,
 	memset(&spin->execbuf, 0, sizeof(spin->execbuf));
 	execbuf = &spin->execbuf;
 	memset(spin->obj, 0, sizeof(spin->obj));
-	obj = spin->obj;
 	memset(relocs, 0, sizeof(relocs));
 
-	obj[BATCH].handle = gem_create(fd, BATCH_SIZE);
-	batch = __gem_mmap__wc(fd, obj[BATCH].handle,
-			       0, BATCH_SIZE, PROT_WRITE);
-	if (!batch)
-		batch = gem_mmap__gtt(fd, obj[BATCH].handle,
-				      BATCH_SIZE, PROT_WRITE);
+	batch->handle = gem_create(fd, BATCH_SIZE);
+	spin->handle = batch->handle;
 
-	gem_set_domain(fd, obj[BATCH].handle,
+	batch_start = __gem_mmap__wc(fd, batch->handle,
+				     0, BATCH_SIZE, PROT_WRITE);
+	if (!batch_start)
+		batch_start = gem_mmap__gtt(fd, batch->handle,
+					    BATCH_SIZE, PROT_WRITE);
+	gem_set_domain(fd, batch->handle,
 		       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 	execbuf->buffer_count++;
-	cs = batch;
-
-	if (opts->dependency) {
-		igt_assert(!(opts->flags & IGT_SPIN_POLL_RUN));
-
-		r = &relocs[obj[BATCH].relocation_count++];
+	cs = batch_start;
 
-		/* dummy write to dependency */
-		obj[SCRATCH].handle = opts->dependency;
-		r->presumed_offset = 0;
-		r->target_handle = obj[SCRATCH].handle;
-		r->offset = sizeof(uint32_t) * 1020;
-		r->delta = 0;
-		r->read_domains = I915_GEM_DOMAIN_RENDER;
-		r->write_domain = I915_GEM_DOMAIN_RENDER;
-
-		execbuf->buffer_count++;
-	} else if (opts->flags & IGT_SPIN_POLL_RUN) {
-		r = &relocs[obj[BATCH].relocation_count++];
+	poll->handle = gem_create(fd, POLL_SIZE);
+	spin->poll_handle = poll->handle;
+	execbuf->buffer_count++;
 
-		igt_assert(!opts->dependency);
+	if (opts->flags & IGT_SPIN_POLL_RUN) {
+		r = &relocs[batch->relocation_count++];
 
 		if (gen == 4 || gen == 5) {
 			execbuf->flags |= I915_EXEC_SECURE;
 			igt_require(__igt_device_set_master(fd) == 0);
 		}
 
-		spin->poll_handle = gem_create(fd, 4096);
-		obj[SCRATCH].handle = spin->poll_handle;
-
-		if (__gem_set_caching(fd, spin->poll_handle,
+		if (__gem_set_caching(fd, poll->handle,
 				      I915_CACHING_CACHED) == 0)
-			spin->poll = gem_mmap__cpu(fd, spin->poll_handle,
-						   0, 4096,
+			spin->poll = gem_mmap__cpu(fd, poll->handle,
+						   0, POLL_SIZE,
 						   PROT_READ | PROT_WRITE);
 		else
-			spin->poll = gem_mmap__wc(fd, spin->poll_handle,
-						  0, 4096,
+			spin->poll = gem_mmap__wc(fd, poll->handle,
+						  0, POLL_SIZE,
 						  PROT_READ | PROT_WRITE);
 
 		igt_assert_eq(spin->poll[SPIN_POLL_START_IDX], 0);
 
 		/* batch is first */
-		r->presumed_offset = 4096;
-		r->target_handle = obj[SCRATCH].handle;
+		r->presumed_offset = BATCH_SIZE;
+		r->target_handle = poll->handle;
 		r->offset = sizeof(uint32_t) * 1;
 		r->delta = sizeof(uint32_t) * SPIN_POLL_START_IDX;
 
@@ -179,14 +171,25 @@ emit_recursive_batch(igt_spin_t *spin,
 		}
 
 		*cs++ = 1;
+	}
+
+	if (opts->dependency) {
+		r = &relocs[batch->relocation_count++];
+
+		/* dummy write to dependency */
+		dep->handle = opts->dependency;
+		r->presumed_offset = BATCH_SIZE + POLL_SIZE;
+		r->target_handle = dep->handle;
+		r->offset = sizeof(uint32_t) * 1020;
+		r->delta = 0;
+		r->read_domains = I915_GEM_DOMAIN_RENDER;
+		r->write_domain = I915_GEM_DOMAIN_RENDER;
 
 		execbuf->buffer_count++;
 	}
 
-	spin->handle = obj[BATCH].handle;
-
-	igt_assert_lt(cs - batch, LOOP_START_OFFSET / sizeof(*cs));
-	spin->condition = batch + LOOP_START_OFFSET / sizeof(*cs);
+	igt_assert_lt(cs - batch_start, LOOP_START_OFFSET / sizeof(*cs));
+	spin->condition = batch_start + LOOP_START_OFFSET / sizeof(*cs);
 	cs = spin->condition;
 
 	/* Allow ourselves to be preempted */
@@ -208,9 +211,9 @@ emit_recursive_batch(igt_spin_t *spin,
 		cs += 1000;
 
 	/* recurse */
-	r = &relocs[obj[BATCH].relocation_count++];
-	r->target_handle = obj[BATCH].handle;
-	r->offset = (cs + 1 - batch) * sizeof(*cs);
+	r = &relocs[batch->relocation_count++];
+	r->target_handle = batch->handle;
+	r->offset = (cs + 1 - batch_start) * sizeof(*cs);
 	r->read_domains = I915_GEM_DOMAIN_COMMAND;
 	r->delta = LOOP_START_OFFSET;
 	if (gen >= 8) {
@@ -227,10 +230,10 @@ emit_recursive_batch(igt_spin_t *spin,
 		*cs = r->delta;
 		cs++;
 	}
-	obj[BATCH].relocs_ptr = to_user_pointer(relocs);
+	batch->relocs_ptr = to_user_pointer(relocs);
 
-	execbuf->buffers_ptr = to_user_pointer(obj +
-					       (2 - execbuf->buffer_count));
+	execbuf->buffers_ptr = to_user_pointer(spin->obj);
+	execbuf->flags |= I915_EXEC_BATCH_FIRST;
 	execbuf->rsvd1 = opts->ctx;
 
 	if (opts->flags & IGT_SPIN_FENCE_OUT)
@@ -264,10 +267,9 @@ emit_recursive_batch(igt_spin_t *spin,
 		}
 	}
 
-	igt_assert_lt(cs - batch, BATCH_SIZE / sizeof(*cs));
+	igt_assert_lt(cs - batch_start, BATCH_SIZE / sizeof(*cs));
 
-	/* Make it easier for callers to resubmit. */
-	for (i = 0; i < ARRAY_SIZE(spin->obj); i++) {
+	for (i = 0; i < execbuf->buffer_count; i++) {
 		spin->obj[i].relocation_count = 0;
 		spin->obj[i].relocs_ptr = 0;
 		spin->obj[i].flags = EXEC_OBJECT_PINNED;
@@ -445,10 +447,11 @@ void igt_spin_free(int fd, igt_spin_t *spin)
 	gem_munmap((void *)((unsigned long)spin->condition & (~4095UL)),
 		   BATCH_SIZE);
 
-	if (spin->poll) {
+	if (spin->poll)
 		gem_munmap(spin->poll, 4096);
+
+	if (spin->poll_handle)
 		gem_close(fd, spin->poll_handle);
-	}
 
 	if (spin->handle)
 		gem_close(fd, spin->handle);
diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
index 421ca183b..de5781d7d 100644
--- a/lib/igt_dummyload.h
+++ b/lib/igt_dummyload.h
@@ -34,6 +34,7 @@
 
 typedef struct igt_spin {
 	unsigned int handle;
+
 	timer_t timer;
 	struct igt_list_head link;
 
@@ -41,9 +42,12 @@ typedef struct igt_spin {
 	uint32_t cmd_precondition;
 
 	int out_fence;
-	struct drm_i915_gem_exec_object2 obj[2];
-#define IGT_SPIN_BATCH   1
+	struct drm_i915_gem_exec_object2 obj[3];
+#define IGT_SPIN_BATCH   0
+#define IGT_SPIN_POLL    1
+
 	struct drm_i915_gem_execbuffer2 execbuf;
+
 	uint32_t poll_handle;
 	uint32_t *poll;
 #define SPIN_POLL_START_IDX 0
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index 70c4529b4..19df406cf 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -718,7 +718,7 @@ static uint32_t create_semaphore_to_spinner(int i915, igt_spin_t *spin)
 	cs = map = gem_mmap__cpu(i915, handle, 0, 4096, PROT_WRITE);
 
 	/* Wait until the spinner is running */
-	addr = spin->obj[0].offset + 4 * SPIN_POLL_START_IDX;
+	addr = spin->obj[IGT_SPIN_POLL].offset + 4 * SPIN_POLL_START_IDX;
 	*cs++ = MI_SEMAPHORE_WAIT |
 		MI_SEMAPHORE_POLL |
 		MI_SEMAPHORE_SAD_NEQ_SDD |
@@ -797,9 +797,9 @@ static void bonded_slice(int i915)
 		igt_spin_reset(spin);
 
 		/* igt_spin_t poll and batch obj must be laid out as we expect */
-		igt_assert_eq(IGT_SPIN_BATCH, 1);
-		obj[0] = spin->obj[0];
-		obj[1] = spin->obj[1];
+		igt_assert_eq(IGT_SPIN_BATCH, 0);
+		obj[0] = spin->obj[IGT_SPIN_POLL];
+		obj[1] = spin->obj[IGT_SPIN_BATCH];
 		obj[2].handle = create_semaphore_to_spinner(i915, spin);
 
 		eb.buffers_ptr = to_user_pointer(obj);
diff --git a/tests/i915/gem_spin_batch.c b/tests/i915/gem_spin_batch.c
index c67f015ff..04707fdc2 100644
--- a/tests/i915/gem_spin_batch.c
+++ b/tests/i915/gem_spin_batch.c
@@ -78,12 +78,9 @@ static void spin_resubmit(int fd, const struct intel_execution_engine2 *e2,
 		gem_context_create(fd) : ctx0;
 	igt_spin_t *spin = __igt_spin_new(fd, .ctx = ctx0, .engine = e2->flags);
 	const struct intel_execution_engine2 *other;
+	struct drm_i915_gem_execbuffer2 eb = spin->execbuf;
 
-	struct drm_i915_gem_execbuffer2 eb = {
-		.buffer_count = 1,
-		.buffers_ptr = to_user_pointer(&spin->obj[IGT_SPIN_BATCH]),
-		.rsvd1 = ctx1,
-	};
+	eb.rsvd1 = ctx1;
 
 	igt_assert(gem_context_has_engine_map(fd, 0) ||
 		   !(flags & RESUBMIT_ALL_ENGINES));
@@ -97,11 +94,13 @@ static void spin_resubmit(int fd, const struct intel_execution_engine2 *e2,
 			if (gem_engine_is_equal(other, e2))
 				continue;
 
-			eb.flags = other->flags;
+			eb.flags &= ~(I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK);
+			eb.flags |= other->flags;
 			gem_execbuf(fd, &eb);
 		}
 	} else {
-		eb.flags = e2->flags;
+		eb.flags &= ~(I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK);
+		eb.flags |= e2->flags;
 		gem_execbuf(fd, &eb);
 	}
 
-- 
2.24.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 18:28   ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Joonas Lahtinen, Mika Kuoppala

From: Jon Bloomfield <jon.bloomfield@intel.com>

gen9+ introduces a cmdparser for the BLT engine which copies the
incoming BB to a kmd owned buffer for submission (to prevent changes
being made after the bb has been safely scanned). This breaks the
spin functionality because it relies on changing the submitted spin
buffers in order to terminate them.

Instead, for gen9+, we change the semantics by introducing a COND_BB_END
into the infinite loop, to wait until a memory flag (in anothe bo) is
cleared.

v2: Correct nop length to avoid overwriting bb_end instr when using
    a dependency bo (cork)
v3: fix conflicts on igt_dummyload (Mika)
v4: s/bool running/uint32_t running, fix r->delta (Mika)
v5: remove overzealous assert (Mika)
v6: rebase on top of lib changes (Mika)
v7: rework on top of public igt lib changes (Mika)
v8: rebase
v9: simplify by using bb end as conditional (Chris)

Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 lib/i830_reg.h                          |  2 +-
 lib/igt_dummyload.c                     | 17 ++++++++++++++++-
 lib/intel_reg.h                         |  3 +++
 tests/i915/gem_double_irq_loop.c        |  2 --
 tests/i915/gem_write_read_ring_switch.c |  2 +-
 5 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/lib/i830_reg.h b/lib/i830_reg.h
index a57691c7e..410202567 100644
--- a/lib/i830_reg.h
+++ b/lib/i830_reg.h
@@ -43,7 +43,7 @@
 /* broadwater flush bits */
 #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
 
-#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
+#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
 #define MI_DO_COMPARE			(1<<21)
 
 #define MI_BATCH_BUFFER_END	(0xA << 23)
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index c079bd045..652d469a0 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -208,7 +208,22 @@ emit_recursive_batch(igt_spin_t *spin,
 	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
 	 */
 	if (!(opts->flags & IGT_SPIN_FAST))
-		cs += 1000;
+		cs += 960;
+
+	if (gen >= 8) {
+		r = &relocs[batch->relocation_count++];
+
+		r->presumed_offset = 0;
+		r->target_handle = batch->handle;
+		r->offset = (cs + 2 - batch_start) * sizeof(*cs);
+		r->read_domains = I915_GEM_DOMAIN_COMMAND;
+		r->delta = (spin->condition - batch_start) * sizeof(*cs);
+
+		*cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 | 2;
+		*cs++ = MI_BATCH_BUFFER_END;
+		*cs++ = r->delta;
+		*cs++ = 0;
+	}
 
 	/* recurse */
 	r = &relocs[batch->relocation_count++];
diff --git a/lib/intel_reg.h b/lib/intel_reg.h
index 069440cb7..10ca760a2 100644
--- a/lib/intel_reg.h
+++ b/lib/intel_reg.h
@@ -2593,6 +2593,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define MI_BATCH_BUFFER		((0x30 << 23) | 1)
 #define MI_BATCH_BUFFER_START	(0x31 << 23)
 #define MI_BATCH_BUFFER_END	(0xA << 23)
+#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
+#define MI_DO_COMPARE                   (1<<21)
+
 #define MI_BATCH_NON_SECURE		(1)
 #define MI_BATCH_NON_SECURE_I965	(1 << 8)
 #define MI_BATCH_NON_SECURE_HSW		(1<<13) /* Additional bit for RCS */
diff --git a/tests/i915/gem_double_irq_loop.c b/tests/i915/gem_double_irq_loop.c
index b326fc58a..f17f61c19 100644
--- a/tests/i915/gem_double_irq_loop.c
+++ b/tests/i915/gem_double_irq_loop.c
@@ -52,8 +52,6 @@ static drm_intel_bo *target_buffer, *blt_bo;
 IGT_TEST_DESCRIPTION("Basic check for missed IRQs on blt ring.");
 
 
-#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
-#define MI_DO_COMPARE			(1<<21)
 static void
 dummy_reloc_loop(void)
 {
diff --git a/tests/i915/gem_write_read_ring_switch.c b/tests/i915/gem_write_read_ring_switch.c
index ef229cc59..095c13c34 100644
--- a/tests/i915/gem_write_read_ring_switch.c
+++ b/tests/i915/gem_write_read_ring_switch.c
@@ -115,7 +115,7 @@ static void run_test(int ring)
 	 * otherwise the obj->last_write_seqno will be updated. */
 	if (ring == I915_EXEC_RENDER) {
 		BEGIN_BATCH(4, 1);
-		OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE);
+		OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE | 1);
 		OUT_BATCH(0xffffffff); /* compare dword */
 		OUT_RELOC(target_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
 		OUT_BATCH(MI_NOOP);
-- 
2.24.0

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

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

* [Intel-gfx] [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 18:28   ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Joonas Lahtinen, Mika Kuoppala

From: Jon Bloomfield <jon.bloomfield@intel.com>

gen9+ introduces a cmdparser for the BLT engine which copies the
incoming BB to a kmd owned buffer for submission (to prevent changes
being made after the bb has been safely scanned). This breaks the
spin functionality because it relies on changing the submitted spin
buffers in order to terminate them.

Instead, for gen9+, we change the semantics by introducing a COND_BB_END
into the infinite loop, to wait until a memory flag (in anothe bo) is
cleared.

v2: Correct nop length to avoid overwriting bb_end instr when using
    a dependency bo (cork)
v3: fix conflicts on igt_dummyload (Mika)
v4: s/bool running/uint32_t running, fix r->delta (Mika)
v5: remove overzealous assert (Mika)
v6: rebase on top of lib changes (Mika)
v7: rework on top of public igt lib changes (Mika)
v8: rebase
v9: simplify by using bb end as conditional (Chris)

Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 lib/i830_reg.h                          |  2 +-
 lib/igt_dummyload.c                     | 17 ++++++++++++++++-
 lib/intel_reg.h                         |  3 +++
 tests/i915/gem_double_irq_loop.c        |  2 --
 tests/i915/gem_write_read_ring_switch.c |  2 +-
 5 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/lib/i830_reg.h b/lib/i830_reg.h
index a57691c7e..410202567 100644
--- a/lib/i830_reg.h
+++ b/lib/i830_reg.h
@@ -43,7 +43,7 @@
 /* broadwater flush bits */
 #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
 
-#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
+#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
 #define MI_DO_COMPARE			(1<<21)
 
 #define MI_BATCH_BUFFER_END	(0xA << 23)
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index c079bd045..652d469a0 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -208,7 +208,22 @@ emit_recursive_batch(igt_spin_t *spin,
 	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
 	 */
 	if (!(opts->flags & IGT_SPIN_FAST))
-		cs += 1000;
+		cs += 960;
+
+	if (gen >= 8) {
+		r = &relocs[batch->relocation_count++];
+
+		r->presumed_offset = 0;
+		r->target_handle = batch->handle;
+		r->offset = (cs + 2 - batch_start) * sizeof(*cs);
+		r->read_domains = I915_GEM_DOMAIN_COMMAND;
+		r->delta = (spin->condition - batch_start) * sizeof(*cs);
+
+		*cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 | 2;
+		*cs++ = MI_BATCH_BUFFER_END;
+		*cs++ = r->delta;
+		*cs++ = 0;
+	}
 
 	/* recurse */
 	r = &relocs[batch->relocation_count++];
diff --git a/lib/intel_reg.h b/lib/intel_reg.h
index 069440cb7..10ca760a2 100644
--- a/lib/intel_reg.h
+++ b/lib/intel_reg.h
@@ -2593,6 +2593,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define MI_BATCH_BUFFER		((0x30 << 23) | 1)
 #define MI_BATCH_BUFFER_START	(0x31 << 23)
 #define MI_BATCH_BUFFER_END	(0xA << 23)
+#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
+#define MI_DO_COMPARE                   (1<<21)
+
 #define MI_BATCH_NON_SECURE		(1)
 #define MI_BATCH_NON_SECURE_I965	(1 << 8)
 #define MI_BATCH_NON_SECURE_HSW		(1<<13) /* Additional bit for RCS */
diff --git a/tests/i915/gem_double_irq_loop.c b/tests/i915/gem_double_irq_loop.c
index b326fc58a..f17f61c19 100644
--- a/tests/i915/gem_double_irq_loop.c
+++ b/tests/i915/gem_double_irq_loop.c
@@ -52,8 +52,6 @@ static drm_intel_bo *target_buffer, *blt_bo;
 IGT_TEST_DESCRIPTION("Basic check for missed IRQs on blt ring.");
 
 
-#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
-#define MI_DO_COMPARE			(1<<21)
 static void
 dummy_reloc_loop(void)
 {
diff --git a/tests/i915/gem_write_read_ring_switch.c b/tests/i915/gem_write_read_ring_switch.c
index ef229cc59..095c13c34 100644
--- a/tests/i915/gem_write_read_ring_switch.c
+++ b/tests/i915/gem_write_read_ring_switch.c
@@ -115,7 +115,7 @@ static void run_test(int ring)
 	 * otherwise the obj->last_write_seqno will be updated. */
 	if (ring == I915_EXEC_RENDER) {
 		BEGIN_BATCH(4, 1);
-		OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE);
+		OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE | 1);
 		OUT_BATCH(0xffffffff); /* compare dword */
 		OUT_RELOC(target_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
 		OUT_BATCH(MI_NOOP);
-- 
2.24.0

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

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

* Re: [PATCH i-g-t 1/3] i915: Skip if secure batches is not available
@ 2019-11-13 18:33   ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:33 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Kuoppala, Kuoppala, Mika

Quoting Chris Wilson (2019-11-13 18:28:06)
> From: "Kuoppala, Mika" <mika.kuoppala@intel.com>
> 
> If we can't do secure execbuf, there is no point in trying.
> 
> Signed-off-by: Kuoppala, Mika <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

There are a few more I915_EXEC_SECURE users, as MI_STORE_DWORD requires
it on gen4/5; but they are off the beaten path.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t 1/3] i915: Skip if secure batches is not available
@ 2019-11-13 18:33   ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:33 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Kuoppala, Kuoppala, Mika

Quoting Chris Wilson (2019-11-13 18:28:06)
> From: "Kuoppala, Mika" <mika.kuoppala@intel.com>
> 
> If we can't do secure execbuf, there is no point in trying.
> 
> Signed-off-by: Kuoppala, Mika <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

There are a few more I915_EXEC_SECURE users, as MI_STORE_DWORD requires
it on gen4/5; but they are off the beaten path.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 2/3] lib/igt_dummyload: Send batch as first
@ 2019-11-13 18:38     ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:38 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Quoting Chris Wilson (2019-11-13 18:28:07)
> From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> 
> To simplify emitting the recursive batch, make batch
> always the first object on the execbuf list.
> 
> This will require kernel v4.13 or greater.
> 
> v2: set handles early, poll_ptr indecency (Chris)
> v3: allow dep with poll
> v4: fix gem_exec_schedule
> v5: rebase
> v6: rebase
> v6: gem_ctx_shared
> v7: conditional close of poll handle
> v8: bw compat note (Chris)
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Do we still require it?

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t 2/3] lib/igt_dummyload: Send batch as first
@ 2019-11-13 18:38     ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:38 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Quoting Chris Wilson (2019-11-13 18:28:07)
> From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> 
> To simplify emitting the recursive batch, make batch
> always the first object on the execbuf list.
> 
> This will require kernel v4.13 or greater.
> 
> v2: set handles early, poll_ptr indecency (Chris)
> v3: allow dep with poll
> v4: fix gem_exec_schedule
> v5: rebase
> v6: rebase
> v6: gem_ctx_shared
> v7: conditional close of poll handle
> v8: bw compat note (Chris)
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Do we still require it?

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 18:42     ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:42 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Joonas Lahtinen, Mika Kuoppala

Quoting Chris Wilson (2019-11-13 18:28:08)
> From: Jon Bloomfield <jon.bloomfield@intel.com>
> 
> gen9+ introduces a cmdparser for the BLT engine which copies the
> incoming BB to a kmd owned buffer for submission (to prevent changes
> being made after the bb has been safely scanned). This breaks the
> spin functionality because it relies on changing the submitted spin
> buffers in order to terminate them.
> 
> Instead, for gen9+, we change the semantics by introducing a COND_BB_END
> into the infinite loop, to wait until a memory flag (in anothe bo) is
> cleared.
> 
> v2: Correct nop length to avoid overwriting bb_end instr when using
>     a dependency bo (cork)
> v3: fix conflicts on igt_dummyload (Mika)
> v4: s/bool running/uint32_t running, fix r->delta (Mika)
> v5: remove overzealous assert (Mika)
> v6: rebase on top of lib changes (Mika)
> v7: rework on top of public igt lib changes (Mika)
> v8: rebase
> v9: simplify by using bb end as conditional (Chris)
> 
> Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
> Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  lib/i830_reg.h                          |  2 +-
>  lib/igt_dummyload.c                     | 17 ++++++++++++++++-
>  lib/intel_reg.h                         |  3 +++
>  tests/i915/gem_double_irq_loop.c        |  2 --
>  tests/i915/gem_write_read_ring_switch.c |  2 +-
>  5 files changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/i830_reg.h b/lib/i830_reg.h
> index a57691c7e..410202567 100644
> --- a/lib/i830_reg.h
> +++ b/lib/i830_reg.h
> @@ -43,7 +43,7 @@
>  /* broadwater flush bits */
>  #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
>  
> -#define MI_COND_BATCH_BUFFER_END       (0x36<<23 | 1)
> +#define MI_COND_BATCH_BUFFER_END       (0x36 << 23)
>  #define MI_DO_COMPARE                  (1<<21)
>  
>  #define MI_BATCH_BUFFER_END    (0xA << 23)
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index c079bd045..652d469a0 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -208,7 +208,22 @@ emit_recursive_batch(igt_spin_t *spin,
>          * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
>          */
>         if (!(opts->flags & IGT_SPIN_FAST))
> -               cs += 1000;
> +               cs += 960;
> +
> +       if (gen >= 8) {

If we push this back to gen>7 it will allow us to use it with its
cmdparser as well.

Hmm? I guess we could just do gen>6 so that there's some systematic
cutoff point.

> +               r = &relocs[batch->relocation_count++];
> +
> +               r->presumed_offset = 0;
> +               r->target_handle = batch->handle;
> +               r->offset = (cs + 2 - batch_start) * sizeof(*cs);
> +               r->read_domains = I915_GEM_DOMAIN_COMMAND;
> +               r->delta = (spin->condition - batch_start) * sizeof(*cs);
> +
> +               *cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 | 2;
> +               *cs++ = MI_BATCH_BUFFER_END;
> +               *cs++ = r->delta;
> +               *cs++ = 0;

I think this approach should do the trick even for my attempts to
frustrate you.

With consensus on when to use COND_BB_END and verification I haven't
caused havoc...

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 18:42     ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:42 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Joonas Lahtinen, Mika Kuoppala

Quoting Chris Wilson (2019-11-13 18:28:08)
> From: Jon Bloomfield <jon.bloomfield@intel.com>
> 
> gen9+ introduces a cmdparser for the BLT engine which copies the
> incoming BB to a kmd owned buffer for submission (to prevent changes
> being made after the bb has been safely scanned). This breaks the
> spin functionality because it relies on changing the submitted spin
> buffers in order to terminate them.
> 
> Instead, for gen9+, we change the semantics by introducing a COND_BB_END
> into the infinite loop, to wait until a memory flag (in anothe bo) is
> cleared.
> 
> v2: Correct nop length to avoid overwriting bb_end instr when using
>     a dependency bo (cork)
> v3: fix conflicts on igt_dummyload (Mika)
> v4: s/bool running/uint32_t running, fix r->delta (Mika)
> v5: remove overzealous assert (Mika)
> v6: rebase on top of lib changes (Mika)
> v7: rework on top of public igt lib changes (Mika)
> v8: rebase
> v9: simplify by using bb end as conditional (Chris)
> 
> Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
> Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  lib/i830_reg.h                          |  2 +-
>  lib/igt_dummyload.c                     | 17 ++++++++++++++++-
>  lib/intel_reg.h                         |  3 +++
>  tests/i915/gem_double_irq_loop.c        |  2 --
>  tests/i915/gem_write_read_ring_switch.c |  2 +-
>  5 files changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/i830_reg.h b/lib/i830_reg.h
> index a57691c7e..410202567 100644
> --- a/lib/i830_reg.h
> +++ b/lib/i830_reg.h
> @@ -43,7 +43,7 @@
>  /* broadwater flush bits */
>  #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
>  
> -#define MI_COND_BATCH_BUFFER_END       (0x36<<23 | 1)
> +#define MI_COND_BATCH_BUFFER_END       (0x36 << 23)
>  #define MI_DO_COMPARE                  (1<<21)
>  
>  #define MI_BATCH_BUFFER_END    (0xA << 23)
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index c079bd045..652d469a0 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -208,7 +208,22 @@ emit_recursive_batch(igt_spin_t *spin,
>          * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
>          */
>         if (!(opts->flags & IGT_SPIN_FAST))
> -               cs += 1000;
> +               cs += 960;
> +
> +       if (gen >= 8) {

If we push this back to gen>7 it will allow us to use it with its
cmdparser as well.

Hmm? I guess we could just do gen>6 so that there's some systematic
cutoff point.

> +               r = &relocs[batch->relocation_count++];
> +
> +               r->presumed_offset = 0;
> +               r->target_handle = batch->handle;
> +               r->offset = (cs + 2 - batch_start) * sizeof(*cs);
> +               r->read_domains = I915_GEM_DOMAIN_COMMAND;
> +               r->delta = (spin->condition - batch_start) * sizeof(*cs);
> +
> +               *cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 | 2;
> +               *cs++ = MI_BATCH_BUFFER_END;
> +               *cs++ = r->delta;
> +               *cs++ = 0;

I think this approach should do the trick even for my attempts to
frustrate you.

With consensus on when to use COND_BB_END and verification I haven't
caused havoc...

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [Intel-gfx] [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 18:42     ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 18:42 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Joonas Lahtinen, Mika Kuoppala

Quoting Chris Wilson (2019-11-13 18:28:08)
> From: Jon Bloomfield <jon.bloomfield@intel.com>
> 
> gen9+ introduces a cmdparser for the BLT engine which copies the
> incoming BB to a kmd owned buffer for submission (to prevent changes
> being made after the bb has been safely scanned). This breaks the
> spin functionality because it relies on changing the submitted spin
> buffers in order to terminate them.
> 
> Instead, for gen9+, we change the semantics by introducing a COND_BB_END
> into the infinite loop, to wait until a memory flag (in anothe bo) is
> cleared.
> 
> v2: Correct nop length to avoid overwriting bb_end instr when using
>     a dependency bo (cork)
> v3: fix conflicts on igt_dummyload (Mika)
> v4: s/bool running/uint32_t running, fix r->delta (Mika)
> v5: remove overzealous assert (Mika)
> v6: rebase on top of lib changes (Mika)
> v7: rework on top of public igt lib changes (Mika)
> v8: rebase
> v9: simplify by using bb end as conditional (Chris)
> 
> Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
> Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  lib/i830_reg.h                          |  2 +-
>  lib/igt_dummyload.c                     | 17 ++++++++++++++++-
>  lib/intel_reg.h                         |  3 +++
>  tests/i915/gem_double_irq_loop.c        |  2 --
>  tests/i915/gem_write_read_ring_switch.c |  2 +-
>  5 files changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/i830_reg.h b/lib/i830_reg.h
> index a57691c7e..410202567 100644
> --- a/lib/i830_reg.h
> +++ b/lib/i830_reg.h
> @@ -43,7 +43,7 @@
>  /* broadwater flush bits */
>  #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
>  
> -#define MI_COND_BATCH_BUFFER_END       (0x36<<23 | 1)
> +#define MI_COND_BATCH_BUFFER_END       (0x36 << 23)
>  #define MI_DO_COMPARE                  (1<<21)
>  
>  #define MI_BATCH_BUFFER_END    (0xA << 23)
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index c079bd045..652d469a0 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -208,7 +208,22 @@ emit_recursive_batch(igt_spin_t *spin,
>          * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
>          */
>         if (!(opts->flags & IGT_SPIN_FAST))
> -               cs += 1000;
> +               cs += 960;
> +
> +       if (gen >= 8) {

If we push this back to gen>7 it will allow us to use it with its
cmdparser as well.

Hmm? I guess we could just do gen>6 so that there's some systematic
cutoff point.

> +               r = &relocs[batch->relocation_count++];
> +
> +               r->presumed_offset = 0;
> +               r->target_handle = batch->handle;
> +               r->offset = (cs + 2 - batch_start) * sizeof(*cs);
> +               r->read_domains = I915_GEM_DOMAIN_COMMAND;
> +               r->delta = (spin->condition - batch_start) * sizeof(*cs);
> +
> +               *cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 | 2;
> +               *cs++ = MI_BATCH_BUFFER_END;
> +               *cs++ = r->delta;
> +               *cs++ = 0;

I think this approach should do the trick even for my attempts to
frustrate you.

With consensus on when to use COND_BB_END and verification I haven't
caused havoc...

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] i915: Skip if secure batches is not available
  2019-11-13 18:28 ` [Intel-gfx] " Chris Wilson
                   ` (4 preceding siblings ...)
  (?)
@ 2019-11-13 19:14 ` Patchwork
  -1 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-11-13 19:14 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/3] i915: Skip if secure batches is not available
URL   : https://patchwork.freedesktop.org/series/69417/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7332 -> IGTPW_3695
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_3695 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3695, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_3695:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_busy@busy-all:
    - fi-bdw-5557u:       [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7332/fi-bdw-5557u/igt@gem_busy@busy-all.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/fi-bdw-5557u/igt@gem_busy@busy-all.html

  
Known issues
------------

  Here are the changes found in IGTPW_3695 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rpm@module-reload:
    - fi-skl-6770hq:      [PASS][3] -> [DMESG-WARN][4] ([fdo#112261])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7332/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live_gem_contexts:
    - fi-bsw-nick:        [PASS][5] -> [INCOMPLETE][6] ([fdo# 111542])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7332/fi-bsw-nick/igt@i915_selftest@live_gem_contexts.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/fi-bsw-nick/igt@i915_selftest@live_gem_contexts.html

  
#### Possible fixes ####

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-hsw-4770:        [SKIP][7] ([fdo#109271]) -> [PASS][8] +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7332/fi-hsw-4770/igt@i915_pm_rpm@basic-pci-d3-state.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/fi-hsw-4770/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@i915_selftest@live_hangcheck:
    - fi-hsw-4770r:       [DMESG-FAIL][9] ([fdo#111991]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7332/fi-hsw-4770r/igt@i915_selftest@live_hangcheck.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/fi-hsw-4770r/igt@i915_selftest@live_hangcheck.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][11] ([fdo#111407]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7332/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
  [fdo# 111542]: https://bugs.freedesktop.org/show_bug.cgi?id= 111542
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
  [fdo#111991]: https://bugs.freedesktop.org/show_bug.cgi?id=111991
  [fdo#112261]: https://bugs.freedesktop.org/show_bug.cgi?id=112261


Participating hosts (52 -> 44)
------------------------------

  Missing    (8): fi-ilk-m540 fi-tgl-u fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-skl-lmem fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5276 -> IGTPW_3695

  CI-20190529: 20190529
  CI_DRM_7332: e8c9ce4930c1451ad4a43449fdf2c882da8921e8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3695: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/index.html
  IGT_5276: 868d38c2bc075b6756ebed486db6e7152ed2c5be @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3695/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 19:43       ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 19:43 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Joonas Lahtinen, Mika Kuoppala

Quoting Chris Wilson (2019-11-13 18:42:06)
> Quoting Chris Wilson (2019-11-13 18:28:08)
> > From: Jon Bloomfield <jon.bloomfield@intel.com>
> > 
> > gen9+ introduces a cmdparser for the BLT engine which copies the
> > incoming BB to a kmd owned buffer for submission (to prevent changes
> > being made after the bb has been safely scanned). This breaks the
> > spin functionality because it relies on changing the submitted spin
> > buffers in order to terminate them.
> > 
> > Instead, for gen9+, we change the semantics by introducing a COND_BB_END
> > into the infinite loop, to wait until a memory flag (in anothe bo) is
> > cleared.
> > 
> > v2: Correct nop length to avoid overwriting bb_end instr when using
> >     a dependency bo (cork)
> > v3: fix conflicts on igt_dummyload (Mika)
> > v4: s/bool running/uint32_t running, fix r->delta (Mika)
> > v5: remove overzealous assert (Mika)
> > v6: rebase on top of lib changes (Mika)
> > v7: rework on top of public igt lib changes (Mika)
> > v8: rebase
> > v9: simplify by using bb end as conditional (Chris)
> > 
> > Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
> > Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > ---
> >  lib/i830_reg.h                          |  2 +-
> >  lib/igt_dummyload.c                     | 17 ++++++++++++++++-
> >  lib/intel_reg.h                         |  3 +++
> >  tests/i915/gem_double_irq_loop.c        |  2 --
> >  tests/i915/gem_write_read_ring_switch.c |  2 +-
> >  5 files changed, 21 insertions(+), 5 deletions(-)
> > 
> > diff --git a/lib/i830_reg.h b/lib/i830_reg.h
> > index a57691c7e..410202567 100644
> > --- a/lib/i830_reg.h
> > +++ b/lib/i830_reg.h
> > @@ -43,7 +43,7 @@
> >  /* broadwater flush bits */
> >  #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
> >  
> > -#define MI_COND_BATCH_BUFFER_END       (0x36<<23 | 1)
> > +#define MI_COND_BATCH_BUFFER_END       (0x36 << 23)
> >  #define MI_DO_COMPARE                  (1<<21)
> >  
> >  #define MI_BATCH_BUFFER_END    (0xA << 23)
> > diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> > index c079bd045..652d469a0 100644
> > --- a/lib/igt_dummyload.c
> > +++ b/lib/igt_dummyload.c
> > @@ -208,7 +208,22 @@ emit_recursive_batch(igt_spin_t *spin,
> >          * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
> >          */
> >         if (!(opts->flags & IGT_SPIN_FAST))
> > -               cs += 1000;
> > +               cs += 960;
> > +
> > +       if (gen >= 8) {
> 
> If we push this back to gen>7 it will allow us to use it with its
> cmdparser as well.
> 
> Hmm? I guess we could just do gen>6 so that there's some systematic
> cutoff point.

Oh, well, it appears the magic compare mode doesn't exist until Skylake.
Fortunately, it exists!
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 19:43       ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 19:43 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Joonas Lahtinen, Mika Kuoppala

Quoting Chris Wilson (2019-11-13 18:42:06)
> Quoting Chris Wilson (2019-11-13 18:28:08)
> > From: Jon Bloomfield <jon.bloomfield@intel.com>
> > 
> > gen9+ introduces a cmdparser for the BLT engine which copies the
> > incoming BB to a kmd owned buffer for submission (to prevent changes
> > being made after the bb has been safely scanned). This breaks the
> > spin functionality because it relies on changing the submitted spin
> > buffers in order to terminate them.
> > 
> > Instead, for gen9+, we change the semantics by introducing a COND_BB_END
> > into the infinite loop, to wait until a memory flag (in anothe bo) is
> > cleared.
> > 
> > v2: Correct nop length to avoid overwriting bb_end instr when using
> >     a dependency bo (cork)
> > v3: fix conflicts on igt_dummyload (Mika)
> > v4: s/bool running/uint32_t running, fix r->delta (Mika)
> > v5: remove overzealous assert (Mika)
> > v6: rebase on top of lib changes (Mika)
> > v7: rework on top of public igt lib changes (Mika)
> > v8: rebase
> > v9: simplify by using bb end as conditional (Chris)
> > 
> > Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
> > Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > ---
> >  lib/i830_reg.h                          |  2 +-
> >  lib/igt_dummyload.c                     | 17 ++++++++++++++++-
> >  lib/intel_reg.h                         |  3 +++
> >  tests/i915/gem_double_irq_loop.c        |  2 --
> >  tests/i915/gem_write_read_ring_switch.c |  2 +-
> >  5 files changed, 21 insertions(+), 5 deletions(-)
> > 
> > diff --git a/lib/i830_reg.h b/lib/i830_reg.h
> > index a57691c7e..410202567 100644
> > --- a/lib/i830_reg.h
> > +++ b/lib/i830_reg.h
> > @@ -43,7 +43,7 @@
> >  /* broadwater flush bits */
> >  #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
> >  
> > -#define MI_COND_BATCH_BUFFER_END       (0x36<<23 | 1)
> > +#define MI_COND_BATCH_BUFFER_END       (0x36 << 23)
> >  #define MI_DO_COMPARE                  (1<<21)
> >  
> >  #define MI_BATCH_BUFFER_END    (0xA << 23)
> > diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> > index c079bd045..652d469a0 100644
> > --- a/lib/igt_dummyload.c
> > +++ b/lib/igt_dummyload.c
> > @@ -208,7 +208,22 @@ emit_recursive_batch(igt_spin_t *spin,
> >          * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
> >          */
> >         if (!(opts->flags & IGT_SPIN_FAST))
> > -               cs += 1000;
> > +               cs += 960;
> > +
> > +       if (gen >= 8) {
> 
> If we push this back to gen>7 it will allow us to use it with its
> cmdparser as well.
> 
> Hmm? I guess we could just do gen>6 so that there's some systematic
> cutoff point.

Oh, well, it appears the magic compare mode doesn't exist until Skylake.
Fortunately, it exists!
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [Intel-gfx] [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 19:43       ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 19:43 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Joonas Lahtinen, Mika Kuoppala

Quoting Chris Wilson (2019-11-13 18:42:06)
> Quoting Chris Wilson (2019-11-13 18:28:08)
> > From: Jon Bloomfield <jon.bloomfield@intel.com>
> > 
> > gen9+ introduces a cmdparser for the BLT engine which copies the
> > incoming BB to a kmd owned buffer for submission (to prevent changes
> > being made after the bb has been safely scanned). This breaks the
> > spin functionality because it relies on changing the submitted spin
> > buffers in order to terminate them.
> > 
> > Instead, for gen9+, we change the semantics by introducing a COND_BB_END
> > into the infinite loop, to wait until a memory flag (in anothe bo) is
> > cleared.
> > 
> > v2: Correct nop length to avoid overwriting bb_end instr when using
> >     a dependency bo (cork)
> > v3: fix conflicts on igt_dummyload (Mika)
> > v4: s/bool running/uint32_t running, fix r->delta (Mika)
> > v5: remove overzealous assert (Mika)
> > v6: rebase on top of lib changes (Mika)
> > v7: rework on top of public igt lib changes (Mika)
> > v8: rebase
> > v9: simplify by using bb end as conditional (Chris)
> > 
> > Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
> > Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > ---
> >  lib/i830_reg.h                          |  2 +-
> >  lib/igt_dummyload.c                     | 17 ++++++++++++++++-
> >  lib/intel_reg.h                         |  3 +++
> >  tests/i915/gem_double_irq_loop.c        |  2 --
> >  tests/i915/gem_write_read_ring_switch.c |  2 +-
> >  5 files changed, 21 insertions(+), 5 deletions(-)
> > 
> > diff --git a/lib/i830_reg.h b/lib/i830_reg.h
> > index a57691c7e..410202567 100644
> > --- a/lib/i830_reg.h
> > +++ b/lib/i830_reg.h
> > @@ -43,7 +43,7 @@
> >  /* broadwater flush bits */
> >  #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
> >  
> > -#define MI_COND_BATCH_BUFFER_END       (0x36<<23 | 1)
> > +#define MI_COND_BATCH_BUFFER_END       (0x36 << 23)
> >  #define MI_DO_COMPARE                  (1<<21)
> >  
> >  #define MI_BATCH_BUFFER_END    (0xA << 23)
> > diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> > index c079bd045..652d469a0 100644
> > --- a/lib/igt_dummyload.c
> > +++ b/lib/igt_dummyload.c
> > @@ -208,7 +208,22 @@ emit_recursive_batch(igt_spin_t *spin,
> >          * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
> >          */
> >         if (!(opts->flags & IGT_SPIN_FAST))
> > -               cs += 1000;
> > +               cs += 960;
> > +
> > +       if (gen >= 8) {
> 
> If we push this back to gen>7 it will allow us to use it with its
> cmdparser as well.
> 
> Hmm? I guess we could just do gen>6 so that there's some systematic
> cutoff point.

Oh, well, it appears the magic compare mode doesn't exist until Skylake.
Fortunately, it exists!
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [PATCH i-g-t] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 19:46     ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 19:46 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala, Joonas Lahtinen

From: Jon Bloomfield <jon.bloomfield@intel.com>

gen9+ introduces a cmdparser for the BLT engine which copies the
incoming BB to a kmd owned buffer for submission (to prevent changes
being made after the bb has been safely scanned). This breaks the
spin functionality because it relies on changing the submitted spin
buffers in order to terminate them.

Instead, for gen9+, we change the semantics by introducing a COND_BB_END
into the infinite loop, to wait until a memory flag (in anothe bo) is
cleared.

v2: Correct nop length to avoid overwriting bb_end instr when using
    a dependency bo (cork)
v3: fix conflicts on igt_dummyload (Mika)
v4: s/bool running/uint32_t running, fix r->delta (Mika)
v5: remove overzealous assert (Mika)
v6: rebase on top of lib changes (Mika)
v7: rework on top of public igt lib changes (Mika)
v8: rebase
v9: simplify by using bb end as conditional (Chris)

Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 lib/i830_reg.h                          |  2 +-
 lib/igt_dummyload.c                     | 24 +++++++++++++++++++++++-
 lib/intel_reg.h                         |  3 +++
 tests/i915/gem_double_irq_loop.c        |  2 --
 tests/i915/gem_write_read_ring_switch.c |  2 +-
 5 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/lib/i830_reg.h b/lib/i830_reg.h
index a57691c7e..410202567 100644
--- a/lib/i830_reg.h
+++ b/lib/i830_reg.h
@@ -43,7 +43,7 @@
 /* broadwater flush bits */
 #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
 
-#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
+#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
 #define MI_DO_COMPARE			(1<<21)
 
 #define MI_BATCH_BUFFER_END	(0xA << 23)
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index c079bd045..93b8b6bc6 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -208,7 +208,29 @@ emit_recursive_batch(igt_spin_t *spin,
 	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
 	 */
 	if (!(opts->flags & IGT_SPIN_FAST))
-		cs += 1000;
+		cs += 960;
+
+	/*
+	 * When using a cmdparser, the batch is copied into a read only location
+	 * and validated. We are then unable to alter the executing batch,
+	 * breaking the older *spin->condition = MI_BB_END termination.
+	 * Instead we can use a conditional MI_BB_END here that looks at
+	 * the user's copy of the batch and terminates when they modified it.
+	 */
+	if (gen >= 9) {
+		r = &relocs[batch->relocation_count++];
+
+		r->presumed_offset = 0;
+		r->target_handle = batch->handle;
+		r->offset = (cs + 2 - batch_start) * sizeof(*cs);
+		r->read_domains = I915_GEM_DOMAIN_COMMAND;
+		r->delta = (spin->condition - batch_start) * sizeof(*cs);
+
+		*cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 | 2;
+		*cs++ = MI_BATCH_BUFFER_END;
+		*cs++ = r->delta;
+		*cs++ = 0;
+	}
 
 	/* recurse */
 	r = &relocs[batch->relocation_count++];
diff --git a/lib/intel_reg.h b/lib/intel_reg.h
index 069440cb7..10ca760a2 100644
--- a/lib/intel_reg.h
+++ b/lib/intel_reg.h
@@ -2593,6 +2593,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define MI_BATCH_BUFFER		((0x30 << 23) | 1)
 #define MI_BATCH_BUFFER_START	(0x31 << 23)
 #define MI_BATCH_BUFFER_END	(0xA << 23)
+#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
+#define MI_DO_COMPARE                   (1<<21)
+
 #define MI_BATCH_NON_SECURE		(1)
 #define MI_BATCH_NON_SECURE_I965	(1 << 8)
 #define MI_BATCH_NON_SECURE_HSW		(1<<13) /* Additional bit for RCS */
diff --git a/tests/i915/gem_double_irq_loop.c b/tests/i915/gem_double_irq_loop.c
index b326fc58a..f17f61c19 100644
--- a/tests/i915/gem_double_irq_loop.c
+++ b/tests/i915/gem_double_irq_loop.c
@@ -52,8 +52,6 @@ static drm_intel_bo *target_buffer, *blt_bo;
 IGT_TEST_DESCRIPTION("Basic check for missed IRQs on blt ring.");
 
 
-#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
-#define MI_DO_COMPARE			(1<<21)
 static void
 dummy_reloc_loop(void)
 {
diff --git a/tests/i915/gem_write_read_ring_switch.c b/tests/i915/gem_write_read_ring_switch.c
index ef229cc59..095c13c34 100644
--- a/tests/i915/gem_write_read_ring_switch.c
+++ b/tests/i915/gem_write_read_ring_switch.c
@@ -115,7 +115,7 @@ static void run_test(int ring)
 	 * otherwise the obj->last_write_seqno will be updated. */
 	if (ring == I915_EXEC_RENDER) {
 		BEGIN_BATCH(4, 1);
-		OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE);
+		OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE | 1);
 		OUT_BATCH(0xffffffff); /* compare dword */
 		OUT_RELOC(target_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
 		OUT_BATCH(MI_NOOP);
-- 
2.24.0

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

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

* [Intel-gfx] [PATCH i-g-t] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 19:46     ` Chris Wilson
  0 siblings, 0 replies; 25+ messages in thread
From: Chris Wilson @ 2019-11-13 19:46 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala, Joonas Lahtinen

From: Jon Bloomfield <jon.bloomfield@intel.com>

gen9+ introduces a cmdparser for the BLT engine which copies the
incoming BB to a kmd owned buffer for submission (to prevent changes
being made after the bb has been safely scanned). This breaks the
spin functionality because it relies on changing the submitted spin
buffers in order to terminate them.

Instead, for gen9+, we change the semantics by introducing a COND_BB_END
into the infinite loop, to wait until a memory flag (in anothe bo) is
cleared.

v2: Correct nop length to avoid overwriting bb_end instr when using
    a dependency bo (cork)
v3: fix conflicts on igt_dummyload (Mika)
v4: s/bool running/uint32_t running, fix r->delta (Mika)
v5: remove overzealous assert (Mika)
v6: rebase on top of lib changes (Mika)
v7: rework on top of public igt lib changes (Mika)
v8: rebase
v9: simplify by using bb end as conditional (Chris)

Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 lib/i830_reg.h                          |  2 +-
 lib/igt_dummyload.c                     | 24 +++++++++++++++++++++++-
 lib/intel_reg.h                         |  3 +++
 tests/i915/gem_double_irq_loop.c        |  2 --
 tests/i915/gem_write_read_ring_switch.c |  2 +-
 5 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/lib/i830_reg.h b/lib/i830_reg.h
index a57691c7e..410202567 100644
--- a/lib/i830_reg.h
+++ b/lib/i830_reg.h
@@ -43,7 +43,7 @@
 /* broadwater flush bits */
 #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
 
-#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
+#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
 #define MI_DO_COMPARE			(1<<21)
 
 #define MI_BATCH_BUFFER_END	(0xA << 23)
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index c079bd045..93b8b6bc6 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -208,7 +208,29 @@ emit_recursive_batch(igt_spin_t *spin,
 	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
 	 */
 	if (!(opts->flags & IGT_SPIN_FAST))
-		cs += 1000;
+		cs += 960;
+
+	/*
+	 * When using a cmdparser, the batch is copied into a read only location
+	 * and validated. We are then unable to alter the executing batch,
+	 * breaking the older *spin->condition = MI_BB_END termination.
+	 * Instead we can use a conditional MI_BB_END here that looks at
+	 * the user's copy of the batch and terminates when they modified it.
+	 */
+	if (gen >= 9) {
+		r = &relocs[batch->relocation_count++];
+
+		r->presumed_offset = 0;
+		r->target_handle = batch->handle;
+		r->offset = (cs + 2 - batch_start) * sizeof(*cs);
+		r->read_domains = I915_GEM_DOMAIN_COMMAND;
+		r->delta = (spin->condition - batch_start) * sizeof(*cs);
+
+		*cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 | 2;
+		*cs++ = MI_BATCH_BUFFER_END;
+		*cs++ = r->delta;
+		*cs++ = 0;
+	}
 
 	/* recurse */
 	r = &relocs[batch->relocation_count++];
diff --git a/lib/intel_reg.h b/lib/intel_reg.h
index 069440cb7..10ca760a2 100644
--- a/lib/intel_reg.h
+++ b/lib/intel_reg.h
@@ -2593,6 +2593,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define MI_BATCH_BUFFER		((0x30 << 23) | 1)
 #define MI_BATCH_BUFFER_START	(0x31 << 23)
 #define MI_BATCH_BUFFER_END	(0xA << 23)
+#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
+#define MI_DO_COMPARE                   (1<<21)
+
 #define MI_BATCH_NON_SECURE		(1)
 #define MI_BATCH_NON_SECURE_I965	(1 << 8)
 #define MI_BATCH_NON_SECURE_HSW		(1<<13) /* Additional bit for RCS */
diff --git a/tests/i915/gem_double_irq_loop.c b/tests/i915/gem_double_irq_loop.c
index b326fc58a..f17f61c19 100644
--- a/tests/i915/gem_double_irq_loop.c
+++ b/tests/i915/gem_double_irq_loop.c
@@ -52,8 +52,6 @@ static drm_intel_bo *target_buffer, *blt_bo;
 IGT_TEST_DESCRIPTION("Basic check for missed IRQs on blt ring.");
 
 
-#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
-#define MI_DO_COMPARE			(1<<21)
 static void
 dummy_reloc_loop(void)
 {
diff --git a/tests/i915/gem_write_read_ring_switch.c b/tests/i915/gem_write_read_ring_switch.c
index ef229cc59..095c13c34 100644
--- a/tests/i915/gem_write_read_ring_switch.c
+++ b/tests/i915/gem_write_read_ring_switch.c
@@ -115,7 +115,7 @@ static void run_test(int ring)
 	 * otherwise the obj->last_write_seqno will be updated. */
 	if (ring == I915_EXEC_RENDER) {
 		BEGIN_BATCH(4, 1);
-		OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE);
+		OUT_BATCH(MI_COND_BATCH_BUFFER_END | MI_DO_COMPARE | 1);
 		OUT_BATCH(0xffffffff); /* compare dword */
 		OUT_RELOC(target_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
 		OUT_BATCH(MI_NOOP);
-- 
2.24.0

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

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

* Re: [PATCH i-g-t] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 20:11       ` Bloomfield, Jon
  0 siblings, 0 replies; 25+ messages in thread
From: Bloomfield, Jon @ 2019-11-13 20:11 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Lahtinen, Joonas, Kuoppala, Mika

> -----Original Message-----
> From: Chris Wilson <chris@chris-wilson.co.uk>
> Sent: Wednesday, November 13, 2019 11:47 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Bloomfield, Jon <jon.bloomfield@intel.com>; Lahtinen, Joonas
> <joonas.lahtinen@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>;
> Kuoppala, Mika <mika.kuoppala@intel.com>; Mika Kuoppala
> <mika.kuoppala@linux.intel.com>
> Subject: [PATCH i-g-t] igt: Use COND_BBEND for busy spinning on gen9
> 
> From: Jon Bloomfield <jon.bloomfield@intel.com>
> 
> gen9+ introduces a cmdparser for the BLT engine which copies the
> incoming BB to a kmd owned buffer for submission (to prevent changes
> being made after the bb has been safely scanned). This breaks the
> spin functionality because it relies on changing the submitted spin
> buffers in order to terminate them.
> 
> Instead, for gen9+, we change the semantics by introducing a COND_BB_END
> into the infinite loop, to wait until a memory flag (in anothe bo) is
> cleared.
> 
> v2: Correct nop length to avoid overwriting bb_end instr when using
>     a dependency bo (cork)
> v3: fix conflicts on igt_dummyload (Mika)
> v4: s/bool running/uint32_t running, fix r->delta (Mika)
> v5: remove overzealous assert (Mika)
> v6: rebase on top of lib changes (Mika)
> v7: rework on top of public igt lib changes (Mika)
> v8: rebase
> v9: simplify by using bb end as conditional (Chris)
> 
> Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
> Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  lib/i830_reg.h                          |  2 +-
>  lib/igt_dummyload.c                     | 24 +++++++++++++++++++++++-
>  lib/intel_reg.h                         |  3 +++
>  tests/i915/gem_double_irq_loop.c        |  2 --
>  tests/i915/gem_write_read_ring_switch.c |  2 +-
>  5 files changed, 28 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/i830_reg.h b/lib/i830_reg.h
> index a57691c7e..410202567 100644
> --- a/lib/i830_reg.h
> +++ b/lib/i830_reg.h
> @@ -43,7 +43,7 @@
>  /* broadwater flush bits */
>  #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
> 
> -#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
> +#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
>  #define MI_DO_COMPARE			(1<<21)
> 
>  #define MI_BATCH_BUFFER_END	(0xA << 23)
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index c079bd045..93b8b6bc6 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -208,7 +208,29 @@ emit_recursive_batch(igt_spin_t *spin,
>  	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
>  	 */
>  	if (!(opts->flags & IGT_SPIN_FAST))
> -		cs += 1000;
> +		cs += 960;
> +
> +	/*
> +	 * When using a cmdparser, the batch is copied into a read only
> location
> +	 * and validated. We are then unable to alter the executing batch,
> +	 * breaking the older *spin->condition = MI_BB_END termination.
> +	 * Instead we can use a conditional MI_BB_END here that looks at
> +	 * the user's copy of the batch and terminates when they modified it.
> +	 */
> +	if (gen >= 9) {
> +		r = &relocs[batch->relocation_count++];
> +
> +		r->presumed_offset = 0;
> +		r->target_handle = batch->handle;
> +		r->offset = (cs + 2 - batch_start) * sizeof(*cs);
> +		r->read_domains = I915_GEM_DOMAIN_COMMAND;
> +		r->delta = (spin->condition - batch_start) * sizeof(*cs);
> +
> +		*cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 |
> 2;
> +		*cs++ = MI_BATCH_BUFFER_END;
> +		*cs++ = r->delta;
> +		*cs++ = 0;
> +	}
> 
>  	/* recurse */
>  	r = &relocs[batch->relocation_count++];
> diff --git a/lib/intel_reg.h b/lib/intel_reg.h
> index 069440cb7..10ca760a2 100644
> --- a/lib/intel_reg.h
> +++ b/lib/intel_reg.h
> @@ -2593,6 +2593,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
>  #define MI_BATCH_BUFFER		((0x30 << 23) | 1)
>  #define MI_BATCH_BUFFER_START	(0x31 << 23)
>  #define MI_BATCH_BUFFER_END	(0xA << 23)
> +#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
> +#define MI_DO_COMPARE                   (1<<21)
> +
>  #define MI_BATCH_NON_SECURE		(1)
>  #define MI_BATCH_NON_SECURE_I965	(1 << 8)
>  #define MI_BATCH_NON_SECURE_HSW		(1<<13) /* Additional
> bit for RCS */
> diff --git a/tests/i915/gem_double_irq_loop.c
> b/tests/i915/gem_double_irq_loop.c
> index b326fc58a..f17f61c19 100644
> --- a/tests/i915/gem_double_irq_loop.c
> +++ b/tests/i915/gem_double_irq_loop.c
> @@ -52,8 +52,6 @@ static drm_intel_bo *target_buffer, *blt_bo;
>  IGT_TEST_DESCRIPTION("Basic check for missed IRQs on blt ring.");
> 
> 
> -#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
> -#define MI_DO_COMPARE			(1<<21)
>  static void
>  dummy_reloc_loop(void)
>  {
> diff --git a/tests/i915/gem_write_read_ring_switch.c
> b/tests/i915/gem_write_read_ring_switch.c
> index ef229cc59..095c13c34 100644
> --- a/tests/i915/gem_write_read_ring_switch.c
> +++ b/tests/i915/gem_write_read_ring_switch.c
> @@ -115,7 +115,7 @@ static void run_test(int ring)
>  	 * otherwise the obj->last_write_seqno will be updated. */
>  	if (ring == I915_EXEC_RENDER) {
>  		BEGIN_BATCH(4, 1);
> -		OUT_BATCH(MI_COND_BATCH_BUFFER_END |
> MI_DO_COMPARE);
> +		OUT_BATCH(MI_COND_BATCH_BUFFER_END |
> MI_DO_COMPARE | 1);
>  		OUT_BATCH(0xffffffff); /* compare dword */
>  		OUT_RELOC(target_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
>  		OUT_BATCH(MI_NOOP);
> --
> 2.24.0

Nice!

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

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

* Re: [Intel-gfx] [PATCH i-g-t] igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 20:11       ` Bloomfield, Jon
  0 siblings, 0 replies; 25+ messages in thread
From: Bloomfield, Jon @ 2019-11-13 20:11 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Lahtinen, Joonas, Kuoppala, Mika

> -----Original Message-----
> From: Chris Wilson <chris@chris-wilson.co.uk>
> Sent: Wednesday, November 13, 2019 11:47 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Bloomfield, Jon <jon.bloomfield@intel.com>; Lahtinen, Joonas
> <joonas.lahtinen@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>;
> Kuoppala, Mika <mika.kuoppala@intel.com>; Mika Kuoppala
> <mika.kuoppala@linux.intel.com>
> Subject: [PATCH i-g-t] igt: Use COND_BBEND for busy spinning on gen9
> 
> From: Jon Bloomfield <jon.bloomfield@intel.com>
> 
> gen9+ introduces a cmdparser for the BLT engine which copies the
> incoming BB to a kmd owned buffer for submission (to prevent changes
> being made after the bb has been safely scanned). This breaks the
> spin functionality because it relies on changing the submitted spin
> buffers in order to terminate them.
> 
> Instead, for gen9+, we change the semantics by introducing a COND_BB_END
> into the infinite loop, to wait until a memory flag (in anothe bo) is
> cleared.
> 
> v2: Correct nop length to avoid overwriting bb_end instr when using
>     a dependency bo (cork)
> v3: fix conflicts on igt_dummyload (Mika)
> v4: s/bool running/uint32_t running, fix r->delta (Mika)
> v5: remove overzealous assert (Mika)
> v6: rebase on top of lib changes (Mika)
> v7: rework on top of public igt lib changes (Mika)
> v8: rebase
> v9: simplify by using bb end as conditional (Chris)
> 
> Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com> (v2)
> Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  lib/i830_reg.h                          |  2 +-
>  lib/igt_dummyload.c                     | 24 +++++++++++++++++++++++-
>  lib/intel_reg.h                         |  3 +++
>  tests/i915/gem_double_irq_loop.c        |  2 --
>  tests/i915/gem_write_read_ring_switch.c |  2 +-
>  5 files changed, 28 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/i830_reg.h b/lib/i830_reg.h
> index a57691c7e..410202567 100644
> --- a/lib/i830_reg.h
> +++ b/lib/i830_reg.h
> @@ -43,7 +43,7 @@
>  /* broadwater flush bits */
>  #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
> 
> -#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
> +#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
>  #define MI_DO_COMPARE			(1<<21)
> 
>  #define MI_BATCH_BUFFER_END	(0xA << 23)
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index c079bd045..93b8b6bc6 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -208,7 +208,29 @@ emit_recursive_batch(igt_spin_t *spin,
>  	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
>  	 */
>  	if (!(opts->flags & IGT_SPIN_FAST))
> -		cs += 1000;
> +		cs += 960;
> +
> +	/*
> +	 * When using a cmdparser, the batch is copied into a read only
> location
> +	 * and validated. We are then unable to alter the executing batch,
> +	 * breaking the older *spin->condition = MI_BB_END termination.
> +	 * Instead we can use a conditional MI_BB_END here that looks at
> +	 * the user's copy of the batch and terminates when they modified it.
> +	 */
> +	if (gen >= 9) {
> +		r = &relocs[batch->relocation_count++];
> +
> +		r->presumed_offset = 0;
> +		r->target_handle = batch->handle;
> +		r->offset = (cs + 2 - batch_start) * sizeof(*cs);
> +		r->read_domains = I915_GEM_DOMAIN_COMMAND;
> +		r->delta = (spin->condition - batch_start) * sizeof(*cs);
> +
> +		*cs++ = MI_COND_BATCH_BUFFER_END | 1 << 21 | 5 << 12 |
> 2;
> +		*cs++ = MI_BATCH_BUFFER_END;
> +		*cs++ = r->delta;
> +		*cs++ = 0;
> +	}
> 
>  	/* recurse */
>  	r = &relocs[batch->relocation_count++];
> diff --git a/lib/intel_reg.h b/lib/intel_reg.h
> index 069440cb7..10ca760a2 100644
> --- a/lib/intel_reg.h
> +++ b/lib/intel_reg.h
> @@ -2593,6 +2593,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
>  #define MI_BATCH_BUFFER		((0x30 << 23) | 1)
>  #define MI_BATCH_BUFFER_START	(0x31 << 23)
>  #define MI_BATCH_BUFFER_END	(0xA << 23)
> +#define MI_COND_BATCH_BUFFER_END	(0x36 << 23)
> +#define MI_DO_COMPARE                   (1<<21)
> +
>  #define MI_BATCH_NON_SECURE		(1)
>  #define MI_BATCH_NON_SECURE_I965	(1 << 8)
>  #define MI_BATCH_NON_SECURE_HSW		(1<<13) /* Additional
> bit for RCS */
> diff --git a/tests/i915/gem_double_irq_loop.c
> b/tests/i915/gem_double_irq_loop.c
> index b326fc58a..f17f61c19 100644
> --- a/tests/i915/gem_double_irq_loop.c
> +++ b/tests/i915/gem_double_irq_loop.c
> @@ -52,8 +52,6 @@ static drm_intel_bo *target_buffer, *blt_bo;
>  IGT_TEST_DESCRIPTION("Basic check for missed IRQs on blt ring.");
> 
> 
> -#define MI_COND_BATCH_BUFFER_END	(0x36<<23 | 1)
> -#define MI_DO_COMPARE			(1<<21)
>  static void
>  dummy_reloc_loop(void)
>  {
> diff --git a/tests/i915/gem_write_read_ring_switch.c
> b/tests/i915/gem_write_read_ring_switch.c
> index ef229cc59..095c13c34 100644
> --- a/tests/i915/gem_write_read_ring_switch.c
> +++ b/tests/i915/gem_write_read_ring_switch.c
> @@ -115,7 +115,7 @@ static void run_test(int ring)
>  	 * otherwise the obj->last_write_seqno will be updated. */
>  	if (ring == I915_EXEC_RENDER) {
>  		BEGIN_BATCH(4, 1);
> -		OUT_BATCH(MI_COND_BATCH_BUFFER_END |
> MI_DO_COMPARE);
> +		OUT_BATCH(MI_COND_BATCH_BUFFER_END |
> MI_DO_COMPARE | 1);
>  		OUT_BATCH(0xffffffff); /* compare dword */
>  		OUT_RELOC(target_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
>  		OUT_BATCH(MI_NOOP);
> --
> 2.24.0

Nice!

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

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

* ✗ GitLab.Pipeline: warning for igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 23:13   ` Patchwork
  0 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-11-13 23:13 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt: Use COND_BBEND for busy spinning on gen9
URL   : https://patchwork.freedesktop.org/series/69423/
State : warning

== Summary ==

Did not get list of undocumented tests for this run, something is wrong!

Other than that, pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/78836 for the overview.

build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941381):
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
    218 |   r = &relocs[batch->relocation_count++];
        |                    ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
    221 |   r->target_handle = batch->handle;
        |                           ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function); did you mean ‘va_start’?
    222 |   r->offset = (cs + 2 - batch_start) * sizeof(*cs);
        |                         ^~~~~~~~~~~
        |                         va_start
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686639:build_script
  ^[[0Ksection_start:1573686639:after_script
  ^[[0Ksection_end:1573686640:after_script
  ^[[0Ksection_start:1573686640:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686642:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941382):
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
    218 |   r = &relocs[batch->relocation_count++];
        |                    ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
    221 |   r->target_handle = batch->handle;
        |                           ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function); did you mean ‘va_start’?
    222 |   r->offset = (cs + 2 - batch_start) * sizeof(*cs);
        |                         ^~~~~~~~~~~
        |                         va_start
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686660:build_script
  ^[[0Ksection_start:1573686660:after_script
  ^[[0Ksection_end:1573686662:after_script
  ^[[0Ksection_start:1573686662:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686663:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941383):
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
    218 |   r = &relocs[batch->relocation_count++];
        |                    ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
    221 |   r->target_handle = batch->handle;
        |                           ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function); did you mean ‘va_start’?
    222 |   r->offset = (cs + 2 - batch_start) * sizeof(*cs);
        |                         ^~~~~~~~~~~
        |                         va_start
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686689:build_script
  ^[[0Ksection_start:1573686689:after_script
  ^[[0Ksection_end:1573686691:after_script
  ^[[0Ksection_start:1573686691:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686692:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941384):
                  r = &relocs[batch->relocation_count++];
                              ~~~~~^ ~~~~~~~~~~~~~~~~
  ../lib/igt_dummyload.c:221:27: error: member reference base type 'uint32_t' (aka 'unsigned int') is not a structure or union
                  r->target_handle = batch->handle;
                                     ~~~~~^ ~~~~~~
  ../lib/igt_dummyload.c:222:25: error: use of undeclared identifier 'batch_start'
                  r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                                        ^
  ../lib/igt_dummyload.c:224:33: error: use of undeclared identifier 'batch_start'
                  r->delta = (spin->condition - batch_start) * sizeof(*cs);
                                                ^
  4 errors generated.
  ninja: build stopped: subcommand failed.
  section_end:1573686680:build_script
  ^[[0Ksection_start:1573686680:after_script
  ^[[0Ksection_end:1573686681:after_script
  ^[[0Ksection_start:1573686681:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686683:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941385):
  cc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/valgrind -I/usr/include/alsa -I/usr/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686680:build_script
  ^[[0Ksection_start:1573686680:after_script
  ^[[0Ksection_end:1573686682:after_script
  ^[[0Ksection_start:1573686682:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686683:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-minimal has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941386):
  cc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I../lib/stubs/drm -I../lib/stubs/libunwind -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686688:build_script
  ^[[0Ksection_start:1573686688:after_script
  ^[[0Ksection_end:1573686690:after_script
  ^[[0Ksection_start:1573686690:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686691:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-meson-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941387):
  /usr/bin/arm-linux-gnueabihf-gcc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I../lib/stubs/drm -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/valgrind -I/usr/include/alsa -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686693:build_script
  ^[[0Ksection_start:1573686693:after_script
  ^[[0Ksection_end:1573686694:after_script
  ^[[0Ksection_start:1573686694:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686695:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-meson-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941388):
  /usr/bin/aarch64-linux-gnu-gcc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I../lib/stubs/drm -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/valgrind -I/usr/include/alsa -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686709:build_script
  ^[[0Ksection_start:1573686709:after_script
  ^[[0Ksection_end:1573686711:after_script
  ^[[0Ksection_start:1573686711:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686712:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-meson-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941389):
  /usr/bin/mips-linux-gnu-gcc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I../lib/stubs/drm -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/mips-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/valgrind -I/usr/include/alsa -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686702:build_script
  ^[[0Ksection_start:1573686702:after_script
  ^[[0Ksection_end:1573686703:after_script
  ^[[0Ksection_start:1573686703:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686705:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-autotools has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941390):
                           ^~~~~~~~~~~
  igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  make[3]: *** [igt_dummyload.lo] Error 1
  Makefile:739: recipe for target 'igt_dummyload.lo' failed
  make[3]: Leaving directory '/builds/gfx-ci/igt-ci-tags/lib'
  Makefile:555: recipe for target 'all' failed
  make[2]: Leaving directory '/builds/gfx-ci/igt-ci-tags/lib'
  make[2]: *** [all] Error 2
  make[1]: *** [all-recursive] Error 1
  Makefile:514: recipe for target 'all-recursive' failed
  make[1]: Leaving directory '/builds/gfx-ci/igt-ci-tags'
  make: *** [all] Error 2
  Makefile:446: recipe for target 'all' failed
  section_end:1573686718:build_script
  ^[[0Ksection_start:1573686718:after_script
  ^[[0Ksection_end:1573686719:after_script
  ^[[0Ksection_start:1573686719:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686721:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/78836
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [Intel-gfx] ✗ GitLab.Pipeline: warning for igt: Use COND_BBEND for busy spinning on gen9
@ 2019-11-13 23:13   ` Patchwork
  0 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2019-11-13 23:13 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt: Use COND_BBEND for busy spinning on gen9
URL   : https://patchwork.freedesktop.org/series/69423/
State : warning

== Summary ==

Did not get list of undocumented tests for this run, something is wrong!

Other than that, pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/78836 for the overview.

build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941381):
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
    218 |   r = &relocs[batch->relocation_count++];
        |                    ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
    221 |   r->target_handle = batch->handle;
        |                           ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function); did you mean ‘va_start’?
    222 |   r->offset = (cs + 2 - batch_start) * sizeof(*cs);
        |                         ^~~~~~~~~~~
        |                         va_start
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686639:build_script
  ^[[0Ksection_start:1573686639:after_script
  ^[[0Ksection_end:1573686640:after_script
  ^[[0Ksection_start:1573686640:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686642:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941382):
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
    218 |   r = &relocs[batch->relocation_count++];
        |                    ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
    221 |   r->target_handle = batch->handle;
        |                           ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function); did you mean ‘va_start’?
    222 |   r->offset = (cs + 2 - batch_start) * sizeof(*cs);
        |                         ^~~~~~~~~~~
        |                         va_start
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686660:build_script
  ^[[0Ksection_start:1573686660:after_script
  ^[[0Ksection_end:1573686662:after_script
  ^[[0Ksection_start:1573686662:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686663:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941383):
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
    218 |   r = &relocs[batch->relocation_count++];
        |                    ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
    221 |   r->target_handle = batch->handle;
        |                           ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function); did you mean ‘va_start’?
    222 |   r->offset = (cs + 2 - batch_start) * sizeof(*cs);
        |                         ^~~~~~~~~~~
        |                         va_start
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686689:build_script
  ^[[0Ksection_start:1573686689:after_script
  ^[[0Ksection_end:1573686691:after_script
  ^[[0Ksection_start:1573686691:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686692:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941384):
                  r = &relocs[batch->relocation_count++];
                              ~~~~~^ ~~~~~~~~~~~~~~~~
  ../lib/igt_dummyload.c:221:27: error: member reference base type 'uint32_t' (aka 'unsigned int') is not a structure or union
                  r->target_handle = batch->handle;
                                     ~~~~~^ ~~~~~~
  ../lib/igt_dummyload.c:222:25: error: use of undeclared identifier 'batch_start'
                  r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                                        ^
  ../lib/igt_dummyload.c:224:33: error: use of undeclared identifier 'batch_start'
                  r->delta = (spin->condition - batch_start) * sizeof(*cs);
                                                ^
  4 errors generated.
  ninja: build stopped: subcommand failed.
  section_end:1573686680:build_script
  ^[[0Ksection_start:1573686680:after_script
  ^[[0Ksection_end:1573686681:after_script
  ^[[0Ksection_start:1573686681:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686683:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941385):
  cc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/valgrind -I/usr/include/alsa -I/usr/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686680:build_script
  ^[[0Ksection_start:1573686680:after_script
  ^[[0Ksection_end:1573686682:after_script
  ^[[0Ksection_start:1573686682:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686683:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-minimal has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941386):
  cc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I../lib/stubs/drm -I../lib/stubs/libunwind -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686688:build_script
  ^[[0Ksection_start:1573686688:after_script
  ^[[0Ksection_end:1573686690:after_script
  ^[[0Ksection_start:1573686690:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686691:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-meson-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941387):
  /usr/bin/arm-linux-gnueabihf-gcc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I../lib/stubs/drm -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/valgrind -I/usr/include/alsa -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686693:build_script
  ^[[0Ksection_start:1573686693:after_script
  ^[[0Ksection_end:1573686694:after_script
  ^[[0Ksection_start:1573686694:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686695:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-meson-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941388):
  /usr/bin/aarch64-linux-gnu-gcc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I../lib/stubs/drm -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/valgrind -I/usr/include/alsa -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686709:build_script
  ^[[0Ksection_start:1573686709:after_script
  ^[[0Ksection_end:1573686711:after_script
  ^[[0Ksection_start:1573686711:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686712:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-meson-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941389):
  /usr/bin/mips-linux-gnu-gcc -Ilib/76b5a35@@igt-igt_dummyload_c@sta -Ilib -I../lib -I../include/drm-uapi -I../lib/stubs/syscalls -I. -I../ -I../lib/stubs/drm -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/mips-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/valgrind -I/usr/include/alsa -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fPIC -pthread '-DIGT_DATADIR="/usr/local/share/igt-gpu-tools"' '-DIGT_SRCDIR="/builds/gfx-ci/igt-ci-tags/tests"' '-DIGT_LOG_DOMAIN="igt_dummyload"'  -MD -MQ 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -MF 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o.d' -o 'lib/76b5a35@@igt-igt_dummyload_c@sta/igt_dummyload.c.o' -c ../lib/igt_dummyload.c
  ../lib/igt_dummyload.c: In function ‘emit_recursive_batch’:
  ../lib/igt_dummyload.c:218:20: error: request for member ‘relocation_count’ in something not a structure or union
     r = &relocs[batch->relocation_count++];
                      ^~
  ../lib/igt_dummyload.c:221:27: error: request for member ‘handle’ in something not a structure or union
     r->target_handle = batch->handle;
                             ^~
  ../lib/igt_dummyload.c:222:25: error: ‘batch_start’ undeclared (first use in this function)
     r->offset = (cs + 2 - batch_start) * sizeof(*cs);
                           ^~~~~~~~~~~
  ../lib/igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  ninja: build stopped: subcommand failed.
  section_end:1573686702:build_script
  ^[[0Ksection_start:1573686702:after_script
  ^[[0Ksection_end:1573686703:after_script
  ^[[0Ksection_start:1573686703:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686705:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

build:tests-debian-autotools has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/941390):
                           ^~~~~~~~~~~
  igt_dummyload.c:222:25: note: each undeclared identifier is reported only once for each function it appears in
  make[3]: *** [igt_dummyload.lo] Error 1
  Makefile:739: recipe for target 'igt_dummyload.lo' failed
  make[3]: Leaving directory '/builds/gfx-ci/igt-ci-tags/lib'
  Makefile:555: recipe for target 'all' failed
  make[2]: Leaving directory '/builds/gfx-ci/igt-ci-tags/lib'
  make[2]: *** [all] Error 2
  make[1]: *** [all-recursive] Error 1
  Makefile:514: recipe for target 'all-recursive' failed
  make[1]: Leaving directory '/builds/gfx-ci/igt-ci-tags'
  make: *** [all] Error 2
  Makefile:446: recipe for target 'all' failed
  section_end:1573686718:build_script
  ^[[0Ksection_start:1573686718:after_script
  ^[[0Ksection_end:1573686719:after_script
  ^[[0Ksection_start:1573686719:upload_artifacts_on_failure
  ^[[0Ksection_end:1573686721:upload_artifacts_on_failure
  ^[[0K^[[31;1mERROR: Job failed: exit code 1
  ^[[0;m

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/78836
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2019-11-13 23:13 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 18:28 [PATCH i-g-t 1/3] i915: Skip if secure batches is not available Chris Wilson
2019-11-13 18:28 ` [igt-dev] " Chris Wilson
2019-11-13 18:28 ` [Intel-gfx] " Chris Wilson
2019-11-13 18:28 ` [PATCH i-g-t 2/3] lib/igt_dummyload: Send batch as first Chris Wilson
2019-11-13 18:28   ` [igt-dev] " Chris Wilson
2019-11-13 18:28   ` [Intel-gfx] " Chris Wilson
2019-11-13 18:38   ` Chris Wilson
2019-11-13 18:38     ` [Intel-gfx] " Chris Wilson
2019-11-13 18:28 ` [PATCH i-g-t 3/3] igt: Use COND_BBEND for busy spinning on gen9 Chris Wilson
2019-11-13 18:28   ` [Intel-gfx] " Chris Wilson
2019-11-13 18:42   ` Chris Wilson
2019-11-13 18:42     ` [igt-dev] [Intel-gfx] " Chris Wilson
2019-11-13 18:42     ` Chris Wilson
2019-11-13 19:43     ` Chris Wilson
2019-11-13 19:43       ` [igt-dev] [Intel-gfx] " Chris Wilson
2019-11-13 19:43       ` Chris Wilson
2019-11-13 19:46   ` [PATCH i-g-t] " Chris Wilson
2019-11-13 19:46     ` [Intel-gfx] " Chris Wilson
2019-11-13 20:11     ` Bloomfield, Jon
2019-11-13 20:11       ` [Intel-gfx] " Bloomfield, Jon
2019-11-13 18:33 ` [PATCH i-g-t 1/3] i915: Skip if secure batches is not available Chris Wilson
2019-11-13 18:33   ` [Intel-gfx] " Chris Wilson
2019-11-13 19:14 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] " Patchwork
2019-11-13 23:13 ` ✗ GitLab.Pipeline: warning for igt: Use COND_BBEND for busy spinning on gen9 Patchwork
2019-11-13 23:13   ` [Intel-gfx] " 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.