1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2021 Intel Corporation
6 #define I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT 2 /* see i915_context_engines_parallel_submit */
9 * struct drm_i915_context_engines_parallel_submit - Configure engine for
10 * parallel submission.
12 * Setup a slot in the context engine map to allow multiple BBs to be submitted
13 * in a single execbuf IOCTL. Those BBs will then be scheduled to run on the GPU
14 * in parallel. Multiple hardware contexts are created internally in the i915
15 * run these BBs. Once a slot is configured for N BBs only N BBs can be
16 * submitted in each execbuf IOCTL and this is implicit behavior e.g. The user
17 * doesn't tell the execbuf IOCTL there are N BBs, the execbuf IOCTL knows how
18 * many BBs there are based on the slot's configuration. The N BBs are the last
19 * N buffer objects or first N if I915_EXEC_BATCH_FIRST is set.
21 * The default placement behavior is to create implicit bonds between each
22 * context if each context maps to more than 1 physical engine (e.g. context is
23 * a virtual engine). Also we only allow contexts of same engine class and these
24 * contexts must be in logically contiguous order. Examples of the placement
25 * behavior described below. Lastly, the default is to not allow BBs to
26 * preempted mid BB rather insert coordinated preemption on all hardware
27 * contexts between each set of BBs. Flags may be added in the future to change
28 * both of these default behaviors.
30 * Returns -EINVAL if hardware context placement configuration is invalid or if
31 * the placement configuration isn't supported on the platform / submission
33 * Returns -ENODEV if extension isn't supported on the platform / submission
36 * .. code-block:: none
38 * Example 1 pseudo code:
39 * CS[X] = generic engine of same class, logical instance X
40 * INVALID = I915_ENGINE_CLASS_INVALID, I915_ENGINE_CLASS_INVALID_NONE
41 * set_engines(INVALID)
42 * set_parallel(engine_index=0, width=2, num_siblings=1,
43 * engines=CS[0],CS[1])
45 * Results in the following valid placement:
48 * Example 2 pseudo code:
49 * CS[X] = generic engine of same class, logical instance X
50 * INVALID = I915_ENGINE_CLASS_INVALID, I915_ENGINE_CLASS_INVALID_NONE
51 * set_engines(INVALID)
52 * set_parallel(engine_index=0, width=2, num_siblings=2,
53 * engines=CS[0],CS[2],CS[1],CS[3])
55 * Results in the following valid placements:
59 * This can also be thought of as 2 virtual engines described by 2-D array
60 * in the engines the field with bonds placed between each index of the
61 * virtual engines. e.g. CS[0] is bonded to CS[1], CS[2] is bonded to
63 * VE[0] = CS[0], CS[2]
64 * VE[1] = CS[1], CS[3]
66 * Example 3 pseudo code:
67 * CS[X] = generic engine of same class, logical instance X
68 * INVALID = I915_ENGINE_CLASS_INVALID, I915_ENGINE_CLASS_INVALID_NONE
69 * set_engines(INVALID)
70 * set_parallel(engine_index=0, width=2, num_siblings=2,
71 * engines=CS[0],CS[1],CS[1],CS[3])
73 * Results in the following valid and invalid placements:
75 * CS[1], CS[3] - Not logical contiguous, return -EINVAL
77 struct drm_i915_context_engines_parallel_submit {
79 * @base: base user extension.
81 struct i915_user_extension base;
84 * @engine_index: slot for parallel engine
89 * @width: number of contexts per parallel engine
94 * @num_siblings: number of siblings per context
99 * @mbz16: reserved for future use; must be zero
104 * @flags: all undefined flags must be zero, currently not defined flags
109 * @mbz64: reserved for future use; must be zero
114 * @engines: 2-d array of engine instances to configure parallel engine
116 * length = width (i) * num_siblings (j)
117 * index = j + i * num_siblings
119 struct i915_engine_class_instance engines[0];