@@ -41,12 +41,15 @@ void intel_engine_add_user(struct intel_engine_cs *engine)
41
41
llist_add (& engine -> uabi_llist , & engine -> i915 -> uabi_engines_llist );
42
42
}
43
43
44
- static const u8 uabi_classes [] = {
44
+ #define I915_NO_UABI_CLASS ((u16)(-1))
45
+
46
+ static const u16 uabi_classes [] = {
45
47
[RENDER_CLASS ] = I915_ENGINE_CLASS_RENDER ,
46
48
[COPY_ENGINE_CLASS ] = I915_ENGINE_CLASS_COPY ,
47
49
[VIDEO_DECODE_CLASS ] = I915_ENGINE_CLASS_VIDEO ,
48
50
[VIDEO_ENHANCEMENT_CLASS ] = I915_ENGINE_CLASS_VIDEO_ENHANCE ,
49
51
[COMPUTE_CLASS ] = I915_ENGINE_CLASS_COMPUTE ,
52
+ [OTHER_CLASS ] = I915_NO_UABI_CLASS , /* Not exposed to users, no uabi class. */
50
53
};
51
54
52
55
static int engine_cmp (void * priv , const struct list_head * A ,
@@ -200,6 +203,7 @@ static void engine_rename(struct intel_engine_cs *engine, const char *name, u16
200
203
201
204
void intel_engines_driver_register (struct drm_i915_private * i915 )
202
205
{
206
+ u16 name_instance , other_instance = 0 ;
203
207
struct legacy_ring ring = {};
204
208
struct list_head * it , * next ;
205
209
struct rb_node * * p , * prev ;
@@ -216,27 +220,28 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
216
220
if (intel_gt_has_unrecoverable_error (engine -> gt ))
217
221
continue ; /* ignore incomplete engines */
218
222
219
- /*
220
- * We don't want to expose the GSC engine to the users, but we
221
- * still rename it so it is easier to identify in the debug logs
222
- */
223
- if (engine -> id == GSC0 ) {
224
- engine_rename (engine , "gsc" , 0 );
225
- continue ;
226
- }
227
-
228
223
GEM_BUG_ON (engine -> class >= ARRAY_SIZE (uabi_classes ));
229
224
engine -> uabi_class = uabi_classes [engine -> class ];
225
+ if (engine -> uabi_class == I915_NO_UABI_CLASS ) {
226
+ name_instance = other_instance ++ ;
227
+ } else {
228
+ GEM_BUG_ON (engine -> uabi_class >=
229
+ ARRAY_SIZE (i915 -> engine_uabi_class_count ));
230
+ name_instance =
231
+ i915 -> engine_uabi_class_count [engine -> uabi_class ]++ ;
232
+ }
233
+ engine -> uabi_instance = name_instance ;
230
234
231
- GEM_BUG_ON (engine -> uabi_class >=
232
- ARRAY_SIZE (i915 -> engine_uabi_class_count ));
233
- engine -> uabi_instance =
234
- i915 -> engine_uabi_class_count [engine -> uabi_class ]++ ;
235
-
236
- /* Replace the internal name with the final user facing name */
235
+ /*
236
+ * Replace the internal name with the final user and log facing
237
+ * name.
238
+ */
237
239
engine_rename (engine ,
238
240
intel_engine_class_repr (engine -> class ),
239
- engine -> uabi_instance );
241
+ name_instance );
242
+
243
+ if (engine -> uabi_class == I915_NO_UABI_CLASS )
244
+ continue ;
240
245
241
246
rb_link_node (& engine -> uabi_node , prev , p );
242
247
rb_insert_color (& engine -> uabi_node , & i915 -> uabi_engines );
0 commit comments