summaryrefslogtreecommitdiff
path: root/lib/igt_dummyload.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-05-17 21:41:30 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-05-17 21:44:00 +0100
commit49e083a29a0942309c877ea8e9275fa985a5bf25 (patch)
tree580ebbd902f5bcd2e316273f7d3f427b12980dfe /lib/igt_dummyload.c
parent8910738e25fa701fcb6a1cebdfc6c7ea7e1213f7 (diff)
igt/gem_spin_batch: Avoid interleave throttle within open spin batches
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101079 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_dummyload.c')
-rw-r--r--lib/igt_dummyload.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index a95b2462..00c6a030 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -61,7 +61,7 @@ fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
}
static void emit_recursive_batch(igt_spin_t *spin,
- int fd, int engine, unsigned int dep_handle)
+ int fd, int engine, unsigned int dep)
{
#define SCRATCH 0
#define BATCH 1
@@ -99,11 +99,11 @@ static void emit_recursive_batch(igt_spin_t *spin,
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
execbuf.buffer_count++;
- if (dep_handle > 0) {
+ if (dep) {
/* dummy write to dependency */
- obj[SCRATCH].handle = dep_handle;
+ obj[SCRATCH].handle = dep;
fill_reloc(&relocs[obj[BATCH].relocation_count++],
- dep_handle, 256,
+ dep, 256,
I915_GEM_DOMAIN_RENDER,
I915_GEM_DOMAIN_RENDER);
execbuf.buffer_count++;
@@ -143,12 +143,28 @@ static void emit_recursive_batch(igt_spin_t *spin,
}
}
+igt_spin_t *
+__igt_spin_batch_new(int fd, int engine, unsigned int dep)
+{
+ igt_spin_t *spin;
+
+ spin = calloc(1, sizeof(struct igt_spin));
+ igt_assert(spin);
+
+ emit_recursive_batch(spin, fd, engine, dep);
+ igt_assert(gem_bo_busy(fd, spin->handle));
+
+ igt_list_add(&spin->link, &spin_list);
+
+ return spin;
+}
+
/**
* igt_spin_batch_new:
* @fd: open i915 drm file descriptor
* @engine: Ring to execute batch OR'd with execbuf flags. If value is less
* than 0, execute on all available rings.
- * @dep_handle: handle to a buffer object dependency. If greater than 0, add a
+ * @dep: handle to a buffer object dependency. If greater than 0, add a
* relocation entry to this buffer within the batch.
*
* Start a recursive batch on a ring. Immediately returns a #igt_spin_t that
@@ -159,21 +175,11 @@ static void emit_recursive_batch(igt_spin_t *spin,
* Structure with helper internal state for igt_spin_batch_free().
*/
igt_spin_t *
-igt_spin_batch_new(int fd, int engine, unsigned int dep_handle)
+igt_spin_batch_new(int fd, int engine, unsigned int dep)
{
- igt_spin_t *spin;
-
igt_require_gem(fd);
- spin = calloc(1, sizeof(struct igt_spin));
- igt_assert(spin);
-
- emit_recursive_batch(spin, fd, engine, dep_handle);
- igt_assert(gem_bo_busy(fd, spin->handle));
-
- igt_list_add(&spin->link, &spin_list);
-
- return spin;
+ return __igt_spin_batch_new(fd, engine, dep);
}
static void notify(union sigval arg)