drm/i915: Use the global runtime-pm wakelock for a busy GPU for execlists
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Apr 2015 15:20:49 +0000 (16:20 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 10 Apr 2015 06:56:14 +0000 (08:56 +0200)
When we submit a request to the GPU, we first take the rpm wakelock, and
only release it once the GPU has been idle for a small period of time
after all requests have been complete. This means that we are sure no
new interrupt can arrive whilst we do not hold the rpm wakelock and so
can drop the individual get/put around every single request inside
execlists.

Note: to close one potential issue we should mark the GPU as busy
earlier in __i915_add_request.

To elaborate: The issue is that we emit the irq signalling sequence
before we grab the rpm reference, which means we could miss the
resulting interrupt (since that's not set up when suspended). The only
bad side effect is a missed interrupt, gt mmio writes automatically
wake up the hw itself. But otoh we have an umbrella rpm reference for
the entirety of execbuf, as long as that's there we're covered.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Explain a bit more about the add_request issue, which after
some irc chatting with Chris turns out to not be an issue really.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_lrc.c

index 8feafe9be1f08cc0b4f5c5c3c8b57abb98322581..9fbc3558de67f8dcbf9d68230ba9b946ec53c88e 100644 (file)
@@ -2605,7 +2605,6 @@ static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv,
                                struct drm_i915_gem_request,
                                execlist_link);
                list_del(&submit_req->execlist_link);
-               intel_runtime_pm_put(dev_priv);
 
                if (submit_req->ctx != ring->default_context)
                        intel_lr_context_unpin(ring, submit_req->ctx);
index 2779070f59d2435e402a9840c742f5fd332ffe2c..3758298a353171ec6397a69b5f9837c2993a7361 100644 (file)
@@ -546,8 +546,6 @@ static int execlists_context_queue(struct intel_engine_cs *ring,
        }
        request->tail = tail;
 
-       intel_runtime_pm_get(dev_priv);
-
        spin_lock_irq(&ring->execlist_lock);
 
        list_for_each_entry(cursor, &ring->execlist_queue, execlist_link)
@@ -977,7 +975,6 @@ void intel_execlists_retire_requests(struct intel_engine_cs *ring)
 
                if (ctx_obj && (ctx != ring->default_context))
                        intel_lr_context_unpin(ring, ctx);
-               intel_runtime_pm_put(dev_priv);
                list_del(&req->execlist_link);
                i915_gem_request_unreference(req);
        }