i915_scheduler.rst (f587623b78ff538f5d9ef1241e58b91ea70a4daf) i915_scheduler.rst (0454a490bdebea78e93e325a020f9f80908b9ed6)
1=========================================
2I915 GuC Submission/DRM Scheduler Section
3=========================================
4
5Upstream plan
6=============
7For upstream the overall plan for landing GuC submission and integrating the
8i915 with the DRM scheduler is:

--- 74 unchanged lines hidden (view full) ---

83Spec references:
84----------------
85* https://www.khronos.org/registry/EGL/extensions/IMG/EGL_IMG_context_priority.txt
86* https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/chap5.html#devsandqueues-priority
87* https://spec.oneapi.com/level-zero/latest/core/api.html#ze-command-queue-priority-t
88
89New parallel submission uAPI
90============================
1=========================================
2I915 GuC Submission/DRM Scheduler Section
3=========================================
4
5Upstream plan
6=============
7For upstream the overall plan for landing GuC submission and integrating the
8i915 with the DRM scheduler is:

--- 74 unchanged lines hidden (view full) ---

83Spec references:
84----------------
85* https://www.khronos.org/registry/EGL/extensions/IMG/EGL_IMG_context_priority.txt
86* https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/chap5.html#devsandqueues-priority
87* https://spec.oneapi.com/level-zero/latest/core/api.html#ze-command-queue-priority-t
88
89New parallel submission uAPI
90============================
91Details to come in a following patch.
91The existing bonding uAPI is completely broken with GuC submission because
92whether a submission is a single context submit or parallel submit isn't known
93until execbuf time activated via the I915_SUBMIT_FENCE. To submit multiple
94contexts in parallel with the GuC the context must be explicitly registered with
95N contexts and all N contexts must be submitted in a single command to the GuC.
96The GuC interfaces do not support dynamically changing between N contexts as the
97bonding uAPI does. Hence the need for a new parallel submission interface. Also
98the legacy bonding uAPI is quite confusing and not intuitive at all. Furthermore
99I915_SUBMIT_FENCE is by design a future fence, so not really something we should
100continue to support.
101
102The new parallel submission uAPI consists of 3 parts:
103
104* Export engines logical mapping
105* A 'set_parallel' extension to configure contexts for parallel
106 submission
107* Extend execbuf2 IOCTL to support submitting N BBs in a single IOCTL
108
109Export engines logical mapping
110------------------------------
111Certain use cases require BBs to be placed on engine instances in logical order
112(e.g. split-frame on gen11+). The logical mapping of engine instances can change
113based on fusing. Rather than making UMDs be aware of fusing, simply expose the
114logical mapping with the existing query engine info IOCTL. Also the GuC
115submission interface currently only supports submitting multiple contexts to
116engines in logical order which is a new requirement compared to execlists.
117Lastly, all current platforms have at most 2 engine instances and the logical
118order is the same as uAPI order. This will change on platforms with more than 2
119engine instances.
120
121A single bit will be added to drm_i915_engine_info.flags indicating that the
122logical instance has been returned and a new field,
123drm_i915_engine_info.logical_instance, returns the logical instance.
124
125A 'set_parallel' extension to configure contexts for parallel submission
126------------------------------------------------------------------------
127The 'set_parallel' extension configures a slot for parallel submission of N BBs.
128It is a setup step that must be called before using any of the contexts. See
129I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE or I915_CONTEXT_ENGINES_EXT_BOND for
130similar existing examples. Once a slot is configured for parallel submission the
131execbuf2 IOCTL can be called submitting N BBs in a single IOCTL. Initially only
132supports GuC submission. Execlists supports can be added later if needed.
133
134Add I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT and
135drm_i915_context_engines_parallel_submit to the uAPI to implement this
136extension.
137
138.. kernel-doc:: Documentation/gpu/rfc/i915_parallel_execbuf.h
139 :functions: drm_i915_context_engines_parallel_submit
140
141Extend execbuf2 IOCTL to support submitting N BBs in a single IOCTL
142-------------------------------------------------------------------
143Contexts that have been configured with the 'set_parallel' extension can only
144submit N BBs in a single execbuf2 IOCTL. The BBs are either the last N objects
145in the drm_i915_gem_exec_object2 list or the first N if I915_EXEC_BATCH_FIRST is
146set. The number of BBs is implicit based on the slot submitted and how it has
147been configured by 'set_parallel' or other extensions. No uAPI changes are
148required to the execbuf2 IOCTL.