Pull the repeated check for the last active request being completed to a
single spot, when deciding whether or not execlist preemption is
required.

Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c 
b/drivers/gpu/drm/i915/gt/intel_lrc.c
index f9aa44f222db..a870fd243e44 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -2148,12 +2148,9 @@ static void execlists_dequeue(struct intel_engine_cs 
*engine)
         */
 
        if ((last = *active)) {
-               if (need_preempt(engine, last, rb)) {
-                       if (i915_request_completed(last)) {
-                               tasklet_hi_schedule(&execlists->tasklet);
-                               return;
-                       }
-
+               if (i915_request_completed(last)) {
+                       goto check_secondary;
+               } else if (need_preempt(engine, last, rb)) {
                        ENGINE_TRACE(engine,
                                     "preempting last=%llx:%lld, prio=%d, 
hint=%d\n",
                                     last->fence.context,
@@ -2181,11 +2178,6 @@ static void execlists_dequeue(struct intel_engine_cs 
*engine)
                        last = NULL;
                } else if (need_timeslice(engine, last, rb) &&
                           timeslice_expired(execlists, last)) {
-                       if (i915_request_completed(last)) {
-                               tasklet_hi_schedule(&execlists->tasklet);
-                               return;
-                       }
-
                        ENGINE_TRACE(engine,
                                     "expired last=%llx:%lld, prio=%d, hint=%d, 
yield?=%s\n",
                                     last->fence.context,
@@ -2221,6 +2213,7 @@ static void execlists_dequeue(struct intel_engine_cs 
*engine)
                         * we hopefully coalesce several updates into a single
                         * submission.
                         */
+check_secondary:
                        if (!list_is_last(&last->sched.link,
                                          &engine->active.requests)) {
                                /*
-- 
2.20.1

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

Reply via email to