All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Assert that the kernel_context is hw-id 0
@ 2017-01-21 17:29 Chris Wilson
  2017-01-21 17:29 ` [PATCH 2/2] drm/i915: Assert that the context-switch completion matches our context Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Chris Wilson @ 2017-01-21 17:29 UTC (permalink / raw)
  To: intel-gfx

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>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 17f90c618208..77458da9627d 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -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;
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-01-23 11:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21 17:29 [PATCH 1/2] drm/i915: Assert that the kernel_context is hw-id 0 Chris Wilson
2017-01-21 17:29 ` [PATCH 2/2] drm/i915: Assert that the context-switch completion matches our context Chris Wilson
2017-01-23  8:26   ` Joonas Lahtinen
2017-01-23  8:32     ` Chris Wilson
2017-01-23  8:50   ` [PATCH v2] " Chris Wilson
2017-01-23 10:26     ` Tvrtko Ursulin
2017-01-23 10:30       ` Chris Wilson
2017-01-23 10:44         ` Tvrtko Ursulin
2017-01-23 10:52           ` Chris Wilson
2017-01-23 11:18             ` Mika Kuoppala
2017-01-21 17:54 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Assert that the kernel_context is hw-id 0 Patchwork
2017-01-23  8:07 ` [PATCH 1/2] " Joonas Lahtinen
2017-01-23 10:23 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Assert that the kernel_context is hw-id 0 (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.