diff mbox series

[i-g-t,25/25] gem_wsim: Support Icelake parts

Message ID 20190517112526.6738-26-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Media scalability tooling | expand

Commit Message

Tvrtko Ursulin May 17, 2019, 11:25 a.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

On Icelake second vcs engine is vcs2 instead of vcs1 so add some logical
to physical instance remapping based on engine discovery to support it.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 benchmarks/gem_wsim.c | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

Comments

Chris Wilson May 17, 2019, 7:51 p.m. UTC | #1
Quoting Tvrtko Ursulin (2019-05-17 12:25:26)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> On Icelake second vcs engine is vcs2 instead of vcs1 so add some logical
> to physical instance remapping based on engine discovery to support it.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

It does the trick for now, but still feels very limited.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 539de243f6e8..aa40c9f0dde5 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -559,6 +559,26 @@  fill_engines_id_class(enum intel_engine_id *list,
 	}
 }
 
+static unsigned int
+find_physical_instance(enum intel_engine_id class, unsigned int logical)
+{
+	unsigned int i, j = 0;
+
+	igt_assert(class == VCS);
+
+	for (i = 0; i < __num_engines; i++) {
+		if (__engines[i].engine_class != I915_ENGINE_CLASS_VIDEO)
+			continue;
+
+		/* Map logical to physical instances. */
+		if (logical == j++)
+			return __engines[i].engine_instance;
+	}
+
+	igt_assert(0);
+	return 0;
+}
+
 static struct i915_engine_class_instance
 get_engine(enum intel_engine_id engine)
 {
@@ -572,12 +592,9 @@  get_engine(enum intel_engine_id engine)
 		ci.engine_instance = 0;
 		break;
 	case VCS1:
-		ci.engine_class = I915_ENGINE_CLASS_VIDEO;
-		ci.engine_instance = 0;
-		break;
 	case VCS2:
 		ci.engine_class = I915_ENGINE_CLASS_VIDEO;
-		ci.engine_instance = 1;
+		ci.engine_instance = find_physical_instance(VCS, engine - VCS1);
 		break;
 	default:
 		igt_assert(0);
@@ -1367,11 +1384,12 @@  static unsigned int
 find_engine(struct i915_engine_class_instance *ci, unsigned int count,
 	    enum intel_engine_id engine)
 {
-	static struct i915_engine_class_instance map[] = {
+	unsigned int vcs1 = find_physical_instance(VCS, 1);
+	struct i915_engine_class_instance map[] = {
 		[RCS] = { I915_ENGINE_CLASS_RENDER, 0 },
 		[BCS] = { I915_ENGINE_CLASS_COPY, 0 },
 		[VCS1] = { I915_ENGINE_CLASS_VIDEO, 0 },
-		[VCS2] = { I915_ENGINE_CLASS_VIDEO, 1 },
+		[VCS2] = { I915_ENGINE_CLASS_VIDEO, vcs1 },
 		[VECS] = { I915_ENGINE_CLASS_VIDEO_ENHANCE, 0 },
 	};
 	unsigned int i;