]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/execlists: Clear semaphore immediately upon ELSP promotion
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 15 Oct 2019 09:32:04 +0000 (10:32 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 15 Oct 2019 10:51:13 +0000 (11:51 +0100)
There is no significance to our delay before clearing the semaphore the
engine is waiting on, so release it as soon as we acknowledge the CS
update following our preemption request. This should allow the GPU to
resume work earlier, if it was stuck on the semaphore at the end of a
request.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191015093204.25693-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_lrc.c

index 26b6b699193b4009bc55f18da07ca32d1254e47b..1e9e2cc168f7078e252ceeec50395dee4d7a7f0e 100644 (file)
@@ -1910,6 +1910,9 @@ static void process_csb(struct intel_engine_cs *engine)
                else
                        promote = gen8_csb_parse(execlists, buf + 2 * head);
                if (promote) {
+                       if (!inject_preempt_hang(execlists))
+                               ring_set_paused(engine, 0);
+
                        /* cancel old inflight, prepare for switch */
                        trace_ports(execlists, "preempted", execlists->active);
                        while (*execlists->active)
@@ -1926,9 +1929,6 @@ static void process_csb(struct intel_engine_cs *engine)
                        if (enable_timeslice(execlists))
                                mod_timer(&execlists->timer, jiffies + 1);
 
-                       if (!inject_preempt_hang(execlists))
-                               ring_set_paused(engine, 0);
-
                        WRITE_ONCE(execlists->pending[0], NULL);
                } else {
                        GEM_BUG_ON(!*execlists->active);