All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/8] drm/i915/gt: Teach veng to defer the context allocation
@ 2019-12-18 14:31 Chris Wilson
  2019-12-18 14:31 ` [Intel-gfx] [PATCH 2/8] drm/i915: Drop GEM context as a direct link from i915_request Chris Wilson
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Chris Wilson @ 2019-12-18 14:31 UTC (permalink / raw)
  To: intel-gfx

Since we added the context_alloc callback to intel_context_ops, we can
safely install a custom hook for the deferred virtual context allocation.
This means that all new contexts behave the same upon creation,
simplifying later code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 4ebfecd95032..f0078b54b693 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -4240,6 +4240,13 @@ static void virtual_engine_initial_hint(struct virtual_engine *ve)
 						ve->siblings[0]);
 }
 
+static int virtual_context_alloc(struct intel_context *ce)
+{
+	struct virtual_engine *ve = container_of(ce, typeof(*ve), context);
+
+	return __execlists_context_alloc(ce, ve->siblings[0]);
+}
+
 static int virtual_context_pin(struct intel_context *ce)
 {
 	struct virtual_engine *ve = container_of(ce, typeof(*ve), context);
@@ -4277,6 +4284,8 @@ static void virtual_context_exit(struct intel_context *ce)
 }
 
 static const struct intel_context_ops virtual_context_ops = {
+	.alloc = virtual_context_alloc,
+
 	.pin = virtual_context_pin,
 	.unpin = execlists_context_unpin,
 
@@ -4594,12 +4603,6 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx,
 
 	ve->base.flags |= I915_ENGINE_IS_VIRTUAL;
 
-	err = __execlists_context_alloc(&ve->context, siblings[0]);
-	if (err)
-		goto err_put;
-
-	__set_bit(CONTEXT_ALLOC_BIT, &ve->context.flags);
-
 	return &ve->context;
 
 err_put:
-- 
2.24.1

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

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

end of thread, other threads:[~2019-12-20  2:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 14:31 [Intel-gfx] [PATCH 1/8] drm/i915/gt: Teach veng to defer the context allocation Chris Wilson
2019-12-18 14:31 ` [Intel-gfx] [PATCH 2/8] drm/i915: Drop GEM context as a direct link from i915_request Chris Wilson
2019-12-19 15:08   ` Andi Shyti
2019-12-18 14:31 ` [Intel-gfx] [PATCH 3/8] drm/i915: Push the use-semaphore marker onto the intel_context Chris Wilson
2019-12-19 15:09   ` Andi Shyti
2019-12-18 14:31 ` [Intel-gfx] [PATCH 4/8] drm/i915: Remove i915->kernel_context Chris Wilson
2019-12-18 14:31 ` [Intel-gfx] [PATCH 5/8] drm/i915: Move i915_gem_init_contexts() earlier Chris Wilson
2019-12-19 15:15   ` Andi Shyti
2019-12-18 14:31 ` [Intel-gfx] [PATCH 6/8] drm/i915/gt: Pull GT initialisation under intel_gt_init() Chris Wilson
2019-12-19 15:35   ` Andi Shyti
2019-12-18 14:31 ` [Intel-gfx] [PATCH 7/8] drm/i915/gt: Pull intel_gt_init_hw() into intel_gt_resume() Chris Wilson
2019-12-19 15:37   ` Andi Shyti
2019-12-18 14:31 ` [Intel-gfx] [PATCH 8/8] drm/i915/gt: Merge engine init/setup loops Chris Wilson
2019-12-19 15:43   ` Andi Shyti
2019-12-18 18:36 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/8] drm/i915/gt: Teach veng to defer the context allocation Patchwork
2019-12-19 15:08 ` [Intel-gfx] [PATCH 1/8] " Andi Shyti

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.