Skip to content

Commit

Permalink
drm/i915: Assert that the kernel_context is hw-id 0
Browse files Browse the repository at this point in the history
For easy recognisability, we want the kernel context to have id 0 and
all user contexts to have non-zero ids.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170123113132.18665-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Jan 23, 2017
1 parent 2f1ac9c commit 5d12fce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/i915/i915_gem_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ int i915_gem_context_init(struct drm_i915_private *dev_priv)
return PTR_ERR(ctx);
}

/* For easy recognisablity, we want the kernel context to be 0 and then
* all user contexts will have non-zero hw_id.
*/
GEM_BUG_ON(ctx->hw_id);

i915_gem_context_clear_bannable(ctx);
ctx->priority = I915_PRIORITY_MIN; /* lowest priority; idle task */
dev_priv->kernel_context = ctx;
Expand Down

0 comments on commit 5d12fce

Please sign in to comment.