lib: Be strict in applying verification for spin batch

Submitted by Chris Wilson on Jan. 24, 2019, 7:31 a.m.

Details

Message ID 20190124073141.30284-1-chris@chris-wilson.co.uk
State New
Headers show
Series "lib: Be strict in applying verification for spin batch" ( rev: 1 ) in IGT (deprecated)

Not browsing as part of any series.

Commit Message

Chris Wilson Jan. 24, 2019, 7:31 a.m.
We want to test batch promotion fully, so be strict in asking for it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
---
 lib/i915/gem_submission.c | 12 ++++++++++++
 lib/i915/gem_submission.h |  6 ++++++
 lib/igt_dummyload.c       |  5 +++++
 3 files changed, 23 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
index 2fd460d5e..0550a780a 100644
--- a/lib/i915/gem_submission.c
+++ b/lib/i915/gem_submission.c
@@ -229,3 +229,15 @@  void gem_test_engine(int i915, unsigned int engine)
 	igt_assert(!is_wedged(i915));
 	close(i915);
 }
+
+int gem_cmdparser_version(int i915, uint32_t engine)
+{
+	int version = 0;
+	drm_i915_getparam_t gp = {
+		.param = I915_PARAM_CMD_PARSER_VERSION,
+		.value = &version,
+	};
+
+	ioctl(i915, DRM_IOCTL_I915_GETPARAM, &gp);
+	return version;
+}
diff --git a/lib/i915/gem_submission.h b/lib/i915/gem_submission.h
index f94eabb20..137bce8d1 100644
--- a/lib/i915/gem_submission.h
+++ b/lib/i915/gem_submission.h
@@ -33,6 +33,12 @@  bool gem_has_semaphores(int fd);
 bool gem_has_execlists(int fd);
 bool gem_has_guc_submission(int fd);
 
+int gem_cmdparser_version(int i915, uint32_t engine);
+static inline bool gem_has_cmdparser(int i915, uint32_t engine)
+{
+	return gem_cmdparser_version(i915, engine) > 0;
+}
+
 void gem_test_engine(int fd, unsigned int engine);
 
 int gem_reopen_driver(int fd);
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 982906f29..3bb78503a 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -40,6 +40,8 @@ 
 #include "sw_sync.h"
 #include "igt_vgem.h"
 
+#include "i915/gem_submission.h"
+
 /**
  * SECTION:igt_dummyload
  * @short_description: Library for submitting GPU workloads
@@ -313,6 +315,9 @@  igt_spin_batch_factory(int fd, const struct igt_spin_factory *opts)
 			igt_require(gem_can_store_dword(fd, opts->engine));
 	}
 
+	if (opts->flags & IGT_SPIN_POLL_RUN)
+		igt_require(!gem_cmdparser_version(fd, opts->engine));
+
 	spin = spin_batch_create(fd, opts);
 
 	igt_assert(gem_bo_busy(fd, spin->handle));

Comments

Quoting Chris Wilson (2019-01-24 07:31:41)
> We want to test batch promotion fully, so be strict in asking for it.

Bah, it's not poll per se we need to check. Do we need a new flag?
-Chris