Lines Matching +full:software +full:- +full:locked

2  * Header file for reservations for dma-buf and ttm
5 * Copyright (C) 2012-2013 Canonical Ltd
11 * Thomas Hellstrom <thellstrom-at-vmware-dot-com>
16 * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
20 * copy of this software and associated documentation files (the
21 * "Software"), to deal in the Software without restriction, including
23 * distribute, sub license, and/or sell copies of the Software, and to
24 * permit persons to whom the Software is furnished to do so, subject to
29 * of the Software.
31 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
36 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
37 * USE OR OTHER DEALINGS IN THE SOFTWARE.
43 #include <linux/dma-fence.h>
53 * enum dma_resv_usage - how the fences from a dma_resv obj are used
81 * that is when the resource is known to be locked down in place by
120 * dma_resv_usage_rw - helper for implicit sync
139 * struct dma_resv - a reservation object manages fences for a buffer
144 * One use is to synchronize cross-driver access to a struct dma_buf, either for
147 * in-depth discussion.
182 * struct dma_resv_iter - current position into the dma_resv fences
225 * dma_resv_iter_begin - initialize a dma_resv_iter object
234 cursor->obj = obj; in dma_resv_iter_begin()
235 cursor->usage = usage; in dma_resv_iter_begin()
236 cursor->fence = NULL; in dma_resv_iter_begin()
240 * dma_resv_iter_end - cleanup a dma_resv_iter object
248 dma_fence_put(cursor->fence); in dma_resv_iter_end()
252 * dma_resv_iter_usage - Return the usage of the current fence
260 return cursor->fence_usage; in dma_resv_iter_usage()
264 * dma_resv_iter_is_restarted - test if this is the first fence after a restart
271 return cursor->is_restarted; in dma_resv_iter_is_restarted()
275 * dma_resv_for_each_fence_unlocked - unlocked fence iterator
294 * dma_resv_for_each_fence - fence iterator
311 #define dma_resv_held(obj) lockdep_is_held(&(obj)->lock.base)
312 #define dma_resv_assert_held(obj) lockdep_assert_held(&(obj)->lock.base)
321 * dma_resv_lock - lock the reservation object
330 * As the reservation object may be locked by multiple parties in an
333 * object may be locked by itself by passing NULL as @ctx.
335 * When a die situation is indicated by returning -EDEADLK all locks held by
345 return ww_mutex_lock(&obj->lock, ctx); in dma_resv_lock()
349 * dma_resv_lock_interruptible - lock the reservation object
358 * As the reservation object may be locked by multiple parties in an
361 * object may be locked by itself by passing NULL as @ctx.
363 * When a die situation is indicated by returning -EDEADLK all locks held by
372 return ww_mutex_lock_interruptible(&obj->lock, ctx); in dma_resv_lock_interruptible()
376 * dma_resv_lock_slow - slowpath lock the reservation object
389 ww_mutex_lock_slow(&obj->lock, ctx); in dma_resv_lock_slow()
393 * dma_resv_lock_slow_interruptible - slowpath lock the reservation
405 return ww_mutex_lock_slow_interruptible(&obj->lock, ctx); in dma_resv_lock_slow_interruptible()
409 * dma_resv_trylock - trylock the reservation object
424 return ww_mutex_trylock(&obj->lock, NULL); in dma_resv_trylock()
428 * dma_resv_is_locked - is the reservation object locked
431 * Returns true if the mutex is locked, false if unlocked.
435 return ww_mutex_is_locked(&obj->lock); in dma_resv_is_locked()
439 * dma_resv_locking_ctx - returns the context used to lock the object
443 * was used or the object is not locked at all.
452 return READ_ONCE(obj->lock.ctx); in dma_resv_locking_ctx()
456 * dma_resv_unlock - unlock the reservation object
464 ww_mutex_unlock(&obj->lock); in dma_resv_unlock()