drm/i915: Clarify type evolution of uabi_node/uabi_engines
[linux-2.6-block.git] / drivers / gpu / drm / i915 / i915_drv.h
index b08026cd4f405138e1a27dba4a2c83a1795c76b4..11bc7e5f40122648253933e801aca1683a12e3fe 100644 (file)
@@ -222,7 +222,22 @@ struct drm_i915_private {
                bool mchbar_need_disable;
        } gmch;
 
-       struct rb_root uabi_engines;
+       /*
+        * Chaining user engines happens in multiple stages, starting with a
+        * simple lock-less linked list created by intel_engine_add_user(),
+        * which later gets sorted and converted to an intermediate regular
+        * list, just to be converted once again to its final rb tree structure
+        * in intel_engines_driver_register().
+        *
+        * Make sure to use the right iterator helper, depending on if the code
+        * in question runs before or after intel_engines_driver_register() --
+        * for_each_uabi_engine() can only be used afterwards!
+        */
+       union {
+               struct llist_head uabi_engines_llist;
+               struct list_head uabi_engines_list;
+               struct rb_root uabi_engines;
+       };
        unsigned int engine_uabi_class_count[I915_LAST_UABI_ENGINE_CLASS + 1];
 
        /* protects the irq masks */