diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-09-09 16:11:42 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-09-09 16:23:00 +0300 |
commit | ba49b2f8237b0241fb86660812c0b235580ac182 (patch) | |
tree | e18f6d40b8d0bb2c01f2cd81f31baa378f78d23b /drivers/gpu/drm/i915 | |
parent | e68a139f6bf38eb9fb8f61de8789870465c2ffaa (diff) | |
download | linux-ba49b2f8237b0241fb86660812c0b235580ac182.tar.xz |
drm/i915: Only queue requests during execlists submission
Leave the more complicated request dequeueing to the tasklet and instead
just kick start the tasklet if we detect we are adding the first
request.
v2: Play around with list operators until we agree upon something
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160909131201.16673-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 92bfe47ad33c..9bfe304c5256 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -609,35 +609,15 @@ static void intel_lrc_irq_handler(unsigned long data) static void execlists_submit_request(struct drm_i915_gem_request *request) { struct intel_engine_cs *engine = request->engine; - struct drm_i915_gem_request *cursor; - int num_elements = 0; spin_lock_bh(&engine->execlist_lock); - list_for_each_entry(cursor, &engine->execlist_queue, execlist_link) - if (++num_elements > 2) - break; - - if (num_elements > 2) { - struct drm_i915_gem_request *tail_req; - - tail_req = list_last_entry(&engine->execlist_queue, - struct drm_i915_gem_request, - execlist_link); - - if (request->ctx == tail_req->ctx) { - WARN(tail_req->elsp_submitted != 0, - "More than 2 already-submitted reqs queued\n"); - list_del(&tail_req->execlist_link); - i915_gem_request_put(tail_req); - } - } - i915_gem_request_get(request); - list_add_tail(&request->execlist_link, &engine->execlist_queue); request->ctx_hw_id = request->ctx->hw_id; - if (num_elements == 0) - execlists_unqueue(engine); + + if (list_empty(&engine->execlist_queue)) + tasklet_hi_schedule(&engine->irq_tasklet); + list_add_tail(&request->execlist_link, &engine->execlist_queue); spin_unlock_bh(&engine->execlist_lock); } |