[Intel-gfx] [PATCH i-g-t 25/25] gem_wsim: Support Icelake parts

Tvrtko Ursulin
2019-05-17T11:25:26Z

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(-)

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;
--
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org