Lines Matching +full:class +full:- +full:d
1 // SPDX-License-Identifier: MIT
17 intel_engine_lookup_user(struct drm_i915_private *i915, u8 class, u8 instance) in intel_engine_lookup_user() argument
19 struct rb_node *p = i915->uabi_engines.rb_node; in intel_engine_lookup_user()
25 if (class < it->uabi_class) in intel_engine_lookup_user()
26 p = p->rb_left; in intel_engine_lookup_user()
27 else if (class > it->uabi_class || in intel_engine_lookup_user()
28 instance > it->uabi_instance) in intel_engine_lookup_user()
29 p = p->rb_right; in intel_engine_lookup_user()
30 else if (instance < it->uabi_instance) in intel_engine_lookup_user()
31 p = p->rb_left; in intel_engine_lookup_user()
41 llist_add(&engine->uabi_llist, &engine->i915->uabi_engines_llist); in intel_engine_add_user()
44 #define I915_NO_UABI_CLASS ((u16)(-1))
52 [OTHER_CLASS] = I915_NO_UABI_CLASS, /* Not exposed to users, no uabi class. */
63 if (uabi_classes[a->class] < uabi_classes[b->class]) in engine_cmp()
64 return -1; in engine_cmp()
65 if (uabi_classes[a->class] > uabi_classes[b->class]) in engine_cmp()
68 if (a->instance < b->instance) in engine_cmp()
69 return -1; in engine_cmp()
70 if (a->instance > b->instance) in engine_cmp()
78 return llist_del_all(&i915->uabi_engines_llist); in get_engines()
89 list_add(&engine->uabi_list, engines); in sort_engines()
114 if (engine->sched_engine->schedule) in set_scheduler_caps()
121 if (intel_uc_uses_guc_submission(&engine->gt->uc)) in set_scheduler_caps()
125 if (engine->flags & BIT(map[i].engine)) in set_scheduler_caps()
132 i915->caps.scheduler = enabled & ~disabled; in set_scheduler_caps()
133 if (!(i915->caps.scheduler & I915_SCHEDULER_CAP_ENABLED)) in set_scheduler_caps()
134 i915->caps.scheduler = 0; in set_scheduler_caps()
137 const char *intel_engine_class_repr(u8 class) in intel_engine_class_repr() argument
148 if (class >= ARRAY_SIZE(uabi_names) || !uabi_names[class]) in intel_engine_class_repr()
151 return uabi_names[class]; in intel_engine_class_repr()
156 u8 class; member
172 if (GEM_DEBUG_WARN_ON(ring->class >= ARRAY_SIZE(map))) in legacy_ring_idx()
175 if (GEM_DEBUG_WARN_ON(ring->instance >= map[ring->class].max)) in legacy_ring_idx()
178 return map[ring->class].base + ring->instance; in legacy_ring_idx()
184 if (engine->gt != ring->gt || engine->class != ring->class) { in add_legacy_ring()
185 ring->gt = engine->gt; in add_legacy_ring()
186 ring->class = engine->class; in add_legacy_ring()
187 ring->instance = 0; in add_legacy_ring()
190 engine->legacy_idx = legacy_ring_idx(ring); in add_legacy_ring()
191 if (engine->legacy_idx != INVALID_ENGINE) in add_legacy_ring()
192 ring->instance++; in add_legacy_ring()
197 char old[sizeof(engine->name)]; in engine_rename()
199 memcpy(old, engine->name, sizeof(engine->name)); in engine_rename()
200 scnprintf(engine->name, sizeof(engine->name), "%s%u", name, instance); in engine_rename()
201 drm_dbg(&engine->i915->drm, "renamed %s to %s\n", old, engine->name); in engine_rename()
215 p = &i915->uabi_engines.rb_node; in intel_engines_driver_register()
220 if (intel_gt_has_unrecoverable_error(engine->gt)) in intel_engines_driver_register()
223 GEM_BUG_ON(engine->class >= ARRAY_SIZE(uabi_classes)); in intel_engines_driver_register()
224 engine->uabi_class = uabi_classes[engine->class]; in intel_engines_driver_register()
225 if (engine->uabi_class == I915_NO_UABI_CLASS) { in intel_engines_driver_register()
228 GEM_BUG_ON(engine->uabi_class >= in intel_engines_driver_register()
229 ARRAY_SIZE(i915->engine_uabi_class_count)); in intel_engines_driver_register()
231 i915->engine_uabi_class_count[engine->uabi_class]++; in intel_engines_driver_register()
233 engine->uabi_instance = name_instance; in intel_engines_driver_register()
240 intel_engine_class_repr(engine->class), in intel_engines_driver_register()
243 if (engine->uabi_class == I915_NO_UABI_CLASS) in intel_engines_driver_register()
246 rb_link_node(&engine->uabi_node, prev, p); in intel_engines_driver_register()
247 rb_insert_color(&engine->uabi_node, &i915->uabi_engines); in intel_engines_driver_register()
250 engine->uabi_class, in intel_engines_driver_register()
251 engine->uabi_instance) != engine); in intel_engines_driver_register()
256 prev = &engine->uabi_node; in intel_engines_driver_register()
257 p = &prev->rb_right; in intel_engines_driver_register()
264 int class, inst; in intel_engines_driver_register() local
267 for (class = 0; class < ARRAY_SIZE(i915->engine_uabi_class_count); class++) { in intel_engines_driver_register()
268 for (inst = 0; inst < i915->engine_uabi_class_count[class]; inst++) { in intel_engines_driver_register()
270 class, inst); in intel_engines_driver_register()
272 pr_err("UABI engine not found for { class:%d, instance:%d }\n", in intel_engines_driver_register()
273 class, inst); in intel_engines_driver_register()
278 if (engine->uabi_class != class || in intel_engines_driver_register()
279 engine->uabi_instance != inst) { in intel_engines_driver_register()
280 pr_err("Wrong UABI engine:%s { class:%d, instance:%d } found for { class:%d, instance:%d }\n", in intel_engines_driver_register()
281 engine->name, in intel_engines_driver_register()
282 engine->uabi_class, in intel_engines_driver_register()
283 engine->uabi_instance, in intel_engines_driver_register()
284 class, inst); in intel_engines_driver_register()
297 unsigned int bit = BIT(engine->uabi_class); in intel_engines_driver_register()
298 unsigned int expected = engine->default_state ? bit : 0; in intel_engines_driver_register()
301 pr_err("mismatching default context state for class %d on engine %s\n", in intel_engines_driver_register()
302 engine->uabi_class, engine->name); in intel_engines_driver_register()
307 if (drm_WARN(&i915->drm, errors, in intel_engines_driver_register()
309 i915->uabi_engines = RB_ROOT; in intel_engines_driver_register()
322 if (engine->default_state) in intel_engines_has_context_isolation()
323 which |= BIT(engine->uabi_class); in intel_engines_has_context_isolation()