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: Mika Kuoppala <mika.kuoppala@intel.com>
Subject: [PATCH 2/4] drm/i915: Special case kernel_context switch request
Date: Tue, 22 May 2018 16:33:59 +0100	[thread overview]
Message-ID: <20180522153401.17661-2-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20180522153401.17661-1-chris@chris-wilson.co.uk>

From: Mika Kuoppala <mika.kuoppala@intel.com>

When checking if engine is idling on a kernel context,
the last request emitted to it could have been the exact
request to switch into kernel context.

Do not bail out early even if engine has requests,
if the last request was for kernel context.

Fixes: a89d1f921c15 ("drm/i915: Split i915_gem_timeline into individual timelines")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index b69b18ef8120..3fe1212b0f7e 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -595,7 +595,10 @@ static bool engine_has_idle_kernel_context(struct intel_engine_cs *engine)
 	lockdep_assert_held(&engine->i915->drm.struct_mutex);
 
 	list_for_each_entry(ring, active_rings, active_link) {
-		if (last_request_on_engine(ring->timeline, engine))
+		struct i915_request *rq =
+			last_request_on_engine(ring->timeline, engine);
+
+		if (rq && rq->gem_context != engine->i915->kernel_context)
 			return false;
 	}
 
-- 
2.17.0

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

  reply	other threads:[~2018-05-22 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 15:33 [PATCH 1/4] drm/i915: Prepare GEM for suspend earlier Chris Wilson
2018-05-22 15:33 ` Chris Wilson [this message]
2018-05-22 15:34 ` [PATCH 3/4] RFC drm/i915: Switch to kernel context before idling at runtime Chris Wilson
2018-05-22 15:34 ` [PATCH 4/4] drm/i915: "Race-to-idle" after switching to the kernel context Chris Wilson
2018-05-22 16:11 ` ✗ Fi.CI.BAT: failure for series starting with [1/4] drm/i915: Prepare GEM for suspend earlier Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2018-05-22 15:08 [PATCH 1/4] " Chris Wilson
2018-05-22 15:08 ` [PATCH 2/4] drm/i915: Special case kernel_context switch request 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=20180522153401.17661-2-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@intel.com \
    /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.