Skip to content

Commit

Permalink
drm/i915/guc: Reorder __i915_guc_submit to reduce spinlock holdtime
Browse files Browse the repository at this point in the history
A couple of operations, the flushes and the tracepoint, do not require
serialisation by client->wq_lock, so move them before we take it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170228112803.11646-3-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
  • Loading branch information
Chris Wilson committed Feb 28, 2017
1 parent 349ab91 commit 0c33518
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/gpu/drm/i915/i915_guc_submission.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,18 +517,18 @@ static void __i915_guc_submit(struct drm_i915_gem_request *rq)
struct i915_guc_client *client = guc->execbuf_client;
int b_ret;

/* We are always called with irqs disabled */
GEM_BUG_ON(!irqs_disabled());

spin_lock(&client->wq_lock);
guc_wq_item_append(client, rq);

/* WA to flush out the pending GMADR writes to ring buffer. */
if (i915_vma_is_map_and_fenceable(rq->ring->vma))
POSTING_READ_FW(GUC_STATUS);

trace_i915_gem_request_in(rq, 0);

/* We are always called with irqs disabled */
GEM_BUG_ON(!irqs_disabled());

spin_lock(&client->wq_lock);

guc_wq_item_append(client, rq);
b_ret = guc_ring_doorbell(client);

client->submissions[engine_id] += 1;
Expand All @@ -538,6 +538,7 @@ static void __i915_guc_submit(struct drm_i915_gem_request *rq)

guc->submissions[engine_id] += 1;
guc->last_seqno[engine_id] = rq->global_seqno;

spin_unlock(&client->wq_lock);
}

Expand Down

0 comments on commit 0c33518

Please sign in to comment.