diff options
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-05-23 09:05:30 +0100 |
|---|---|---|
| committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-05-23 12:23:12 +0100 |
| commit | 34a2d27d5b681e6f75d8aa76f75c20e56c287671 (patch) | |
| tree | e1d6afe06ea1cf9adbe6f292376808c7ffdea93b /lib | |
| parent | ed4a5515109ee83556f505a9519e33acd9518279 (diff) | |
i915: Improve static engine map for legacy
We need to keep igt working on linus and dif, or Joonas gets very upset.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/i915/gem_context.c | 2 | ||||
| -rw-r--r-- | lib/i915/gem_engine_topology.c | 15 | ||||
| -rw-r--r-- | lib/igt_gt.c | 54 | ||||
| -rw-r--r-- | lib/igt_gt.h | 17 |
4 files changed, 11 insertions, 77 deletions
diff --git a/lib/i915/gem_context.c b/lib/i915/gem_context.c index f94d89cb..07ab7817 100644 --- a/lib/i915/gem_context.c +++ b/lib/i915/gem_context.c @@ -290,7 +290,7 @@ bool gem_context_has_engine(int fd, uint32_t ctx, uint64_t engine) * wouldn't produce any result. */ if ((engine & ~(3<<13)) == I915_EXEC_BSD) { - if (engine & (3 << 13) && !gem_has_bsd2(fd)) + if (engine & (2 << 13) && !gem_has_bsd2(fd)) return false; } diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c index d0c8bd5a..fdd1b951 100644 --- a/lib/i915/gem_engine_topology.c +++ b/lib/i915/gem_engine_topology.c @@ -223,22 +223,15 @@ struct intel_engine_data intel_init_engine_list(int fd, uint32_t ctx_id) struct intel_execution_engine2 *__e2 = &engine_data.engines[engine_data.nengines]; - if (!igt_only_list_subtests()) { - __e2->flags = gem_class_instance_to_eb_flags(fd, - e2->class, e2->instance); - - if (!gem_has_ring(fd, __e2->flags)) - continue; - } else { - __e2->flags = -1; /* 0xfff... */ - } - __e2->name = e2->name; __e2->instance = e2->instance; __e2->class = e2->class; + __e2->flags = e2->flags; __e2->is_virtual = false; - engine_data.nengines++; + if (igt_only_list_subtests() || + gem_has_ring(fd, e2->flags)) + engine_data.nengines++; } return engine_data; } diff --git a/lib/igt_gt.c b/lib/igt_gt.c index 6b7c037e..78e3cd08 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -585,12 +585,12 @@ bool gem_can_store_dword(int fd, unsigned int engine) } const struct intel_execution_engine2 intel_execution_engines2[] = { - { "rcs0", I915_ENGINE_CLASS_RENDER, 0 }, - { "bcs0", I915_ENGINE_CLASS_COPY, 0 }, - { "vcs0", I915_ENGINE_CLASS_VIDEO, 0 }, - { "vcs1", I915_ENGINE_CLASS_VIDEO, 1 }, - { "vcs2", I915_ENGINE_CLASS_VIDEO, 2 }, - { "vecs0", I915_ENGINE_CLASS_VIDEO_ENHANCE, 0 }, + { "rcs0", I915_ENGINE_CLASS_RENDER, 0, I915_EXEC_RENDER }, + { "bcs0", I915_ENGINE_CLASS_COPY, 0, I915_EXEC_BLT }, + { "vcs0", I915_ENGINE_CLASS_VIDEO, 0, I915_EXEC_BSD | I915_EXEC_BSD_RING1 }, + { "vcs1", I915_ENGINE_CLASS_VIDEO, 1, I915_EXEC_BSD | I915_EXEC_BSD_RING2 }, + { "vcs2", I915_ENGINE_CLASS_VIDEO, 2, -1 }, + { "vecs0", I915_ENGINE_CLASS_VIDEO_ENHANCE, 0, I915_EXEC_VEBOX }, { } }; @@ -611,48 +611,6 @@ int gem_execbuf_flags_to_engine_class(unsigned int flags) } } -unsigned int -gem_class_instance_to_eb_flags(int gem_fd, - enum drm_i915_gem_engine_class class, - unsigned int instance) -{ - if (class != I915_ENGINE_CLASS_VIDEO) - igt_assert(instance == 0); - else - igt_assert(instance >= 0 && instance <= 1); - - switch (class) { - case I915_ENGINE_CLASS_RENDER: - return I915_EXEC_RENDER; - case I915_ENGINE_CLASS_COPY: - return I915_EXEC_BLT; - case I915_ENGINE_CLASS_VIDEO: - if (instance == 0) { - if (gem_has_bsd2(gem_fd)) - return I915_EXEC_BSD | I915_EXEC_BSD_RING1; - else - return I915_EXEC_BSD; - - } else { - return I915_EXEC_BSD | I915_EXEC_BSD_RING2; - } - case I915_ENGINE_CLASS_VIDEO_ENHANCE: - return I915_EXEC_VEBOX; - case I915_ENGINE_CLASS_INVALID: - default: - igt_assert(0); - }; -} - -bool gem_has_engine(int gem_fd, - enum drm_i915_gem_engine_class class, - unsigned int instance) -{ - return gem_has_ring(gem_fd, - gem_class_instance_to_eb_flags(gem_fd, class, - instance)); -} - bool gem_ring_is_physical_engine(int fd, unsigned ring) { if (ring == I915_EXEC_DEFAULT) diff --git a/lib/igt_gt.h b/lib/igt_gt.h index 77318e2a..73b5002a 100644 --- a/lib/igt_gt.h +++ b/lib/igt_gt.h @@ -102,21 +102,4 @@ extern const struct intel_execution_engine2 { int gem_execbuf_flags_to_engine_class(unsigned int flags); -unsigned int -gem_class_instance_to_eb_flags(int gem_fd, - enum drm_i915_gem_engine_class class, - unsigned int instance); - -bool gem_has_engine(int gem_fd, - enum drm_i915_gem_engine_class class, - unsigned int instance); - -static inline -void gem_require_engine(int gem_fd, - enum drm_i915_gem_engine_class class, - unsigned int instance) -{ - igt_require(gem_has_engine(gem_fd, class, instance)); -} - #endif /* IGT_GT_H */ |
