From 79b199b3337ed7e9a8fff9523cc85f3b7c3f30a6 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 6 Dec 2021 16:43:36 -0800 Subject: [PATCH] intel: Allow copy engine class in intel_gem_create_context_engines() I want to use I915_ENGINE_CLASS_COPY in iris. Reviewed-by: Caio Oliveira Part-of: --- src/intel/common/intel_gem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/intel/common/intel_gem.c b/src/intel/common/intel_gem.c index 267d0657315..9c9da5ab0cb 100644 --- a/src/intel/common/intel_gem.c +++ b/src/intel/common/intel_gem.c @@ -89,11 +89,14 @@ intel_gem_create_context_engines(int fd, */ int last_engine_idx[] = { [I915_ENGINE_CLASS_RENDER] = -1, + [I915_ENGINE_CLASS_COPY] = -1, }; int i915_engine_counts[] = { [I915_ENGINE_CLASS_RENDER] = intel_gem_count_engines(info, I915_ENGINE_CLASS_RENDER), + [I915_ENGINE_CLASS_COPY] = + intel_gem_count_engines(info, I915_ENGINE_CLASS_COPY), }; /* For each queue, we look for the next instance that matches the class we @@ -101,7 +104,8 @@ intel_gem_create_context_engines(int fd, */ for (int i = 0; i < num_engines; i++) { uint16_t engine_class = engine_classes[i]; - assert(engine_class == I915_ENGINE_CLASS_RENDER); + assert(engine_class == I915_ENGINE_CLASS_RENDER || + engine_class == I915_ENGINE_CLASS_COPY); if (i915_engine_counts[engine_class] <= 0) { free(engines_param); return -1;