[PATCH] drm/i915: Special case kernel_context switch request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>

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@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux