OSDN Git Service

drm/i915: Use lockdep_pin_lock() over the construction of the request
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 Apr 2019 08:21:32 +0000 (09:21 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 5 Apr 2019 09:39:17 +0000 (10:39 +0100)
commitb66ea2c2cf59b80c38a14127fafb49fdf0df9180
treebbb483368908e89aab28cf84b74870650e3ca0b8
parentc2400ec3b6d15beea34d652ee18962ed13433528
drm/i915: Use lockdep_pin_lock() over the construction of the request

During request construction, we take the timeline->mutex to ensure
exclusive access to the ringbuffer (for command emission) and the
timeline itself (for command ordering). The timeline->mutex should not
be dropped by callers until we release it in i915_request_add().

lockdep provides a pin/unpin lock facility to detect accidental unlocks
inside critical sections, so put it to use for request construction.

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/20190403082132.327-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_request.c
drivers/gpu/drm/i915/i915_request.h