OSDN Git Service

drm/i915: Eliminate the trylock for awaiting an earlier request
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 16 Dec 2019 16:53:17 +0000 (16:53 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 16 Dec 2019 23:25:49 +0000 (23:25 +0000)
commit9ddc8ec027a39759c946c3f4944d3e0c5a007ccd
tree4b8ab99b174f0e6aaa98b7f7c7d2f56dbb911899
parentf8b7487734ceae5f593e7b50368f98bc3eb3d068
drm/i915: Eliminate the trylock for awaiting an earlier request

We currently use an error-prone mutex_trylock to grab another timeline
to find an earlier request along it. However, with a bit of a
sleight-of-hand, we can reduce the mutex_trylock to a spin_lock on the
immediate request and careful pointer chasing to acquire a reference on
the previous request.

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