drm/i915: Assign every HW context a unique ID
[deliverable/linux.git] / drivers / gpu / drm / i915 / i915_drv.h
index 831da9f4332463564a3fe6289abda02d62e80a88..0f7575252c6efe187e4ecc96cd17d08f2bda4aad 100644 (file)
@@ -851,6 +851,9 @@ struct intel_context {
        struct i915_ctx_hang_stats hang_stats;
        struct i915_hw_ppgtt *ppgtt;
 
+       /* Unique identifier for this context, used by the hw for tracking */
+       unsigned hw_id;
+
        /* Legacy ring buffer submission */
        struct {
                struct drm_i915_gem_object *rcs_state;
@@ -1838,6 +1841,13 @@ struct drm_i915_private {
        DECLARE_HASHTABLE(mm_structs, 7);
        struct mutex mm_lock;
 
+       /* The hw wants to have a stable context identifier for the lifetime
+        * of the context (for OA, PASID, faults, etc). This is limited
+        * in execlists to 21 bits.
+        */
+       struct ida context_hw_ida;
+#define MAX_CONTEXT_HW_ID (1<<21) /* exclusive */
+
        /* Kernel Modesetting */
 
        struct drm_crtc *plane_to_crtc_mapping[I915_MAX_PIPES];
This page took 0.036317 seconds and 5 git commands to generate.