All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Subject: [Intel-gfx] [PATCH 3/3] drm/i915/gem: Peek at the inflight context
Date: Fri, 25 Dec 2020 20:49:38 +0000	[thread overview]
Message-ID: <20201225204938.20248-3-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20201225204938.20248-1-chris@chris-wilson.co.uk>

If supported by the backend, we can quickly look at the context's
inflight engine rather than search along the active list to confirm.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index c7363036765a..e53a9d40f28b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -426,6 +426,10 @@ static struct intel_engine_cs *active_engine(struct intel_context *ce)
 	if (!ce->timeline)
 		return NULL;
 
+	engine = intel_context_inflight(ce);
+	if (engine)
+		return engine;
+
 	/*
 	 * rq->link is only SLAB_TYPESAFE_BY_RCU, we need to hold a reference
 	 * to the request to prevent it being transferred to a new timeline
-- 
2.20.1

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

  parent reply	other threads:[~2020-12-25 20:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-25 20:49 [Intel-gfx] [PATCH 1/3] drm/i915/gt: Cancel submitted requests upon context reset Chris Wilson
2020-12-25 20:49 ` [Intel-gfx] [PATCH 2/3] drm/i915/gt: Pull context closure check from request submit to schedule-in Chris Wilson
2020-12-25 20:49 ` Chris Wilson [this message]
2020-12-25 22:24 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/3] drm/i915/gt: Cancel submitted requests upon context reset Patchwork
2020-12-26  0:06 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/3] drm/i915/gt: Cancel submitted requests upon context reset (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-12-24 23:01 [Intel-gfx] [PATCH 1/3] drm/i915/gt: Cancel submitted requests upon context reset Chris Wilson
2020-12-24 23:01 ` [Intel-gfx] [PATCH 3/3] drm/i915/gem: Peek at the inflight context Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201225204938.20248-3-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.