intel: Add intel_gem_create_context_engines
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 31 Aug 2021 09:29:41 +0000 (02:29 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Fri, 3 Dec 2021 00:30:38 +0000 (16:30 -0800)
commit0634cb741b55b74b7d673c56bc8fa39204ead621
treed3fef7fe554083c738eca588f711c891e7f286b9
parent9a9042a9049cb88a0ceeab34a0e97bda1947aed5
intel: Add intel_gem_create_context_engines

Engines based contexts operate somewhat different for executing
batches. Previously, we would specify a bitmask value such as
I915_EXEC_RENDER to specify to run the batch on the render ring.

With engines contexts, instead this becomes an array of "engines", and
when the context is created we specify the class and instance of the
engine.

Each index in the array has a separate hardware-context. Previously we
had to create separate kernel level contexts to create multiple
hardware contexts, but now a single kernel context can own multiple
hardware contexts.

Another forward looking advantage to using the engines based contexts
is that the kernel does not plan to add new supported I915_EXEC_FOO
masks, whereas they instead plan to add new I915_ENGINE_CLASS_FOO
engine classes. Therefore some rings may only be usable with an engine
based class.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>
src/intel/common/intel_gem.c
src/intel/common/intel_gem.h
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_gem.c
src/intel/vulkan/anv_gem_stubs.c
src/intel/vulkan/anv_private.h