Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | ttm_lock |
Functions | |
void | ttm_lock_init (struct ttm_lock *lock) |
void | ttm_read_unlock (struct ttm_lock *lock) |
int | ttm_read_lock (struct ttm_lock *lock, bool interruptible) |
int | ttm_read_trylock (struct ttm_lock *lock, bool interruptible) |
void | ttm_write_unlock (struct ttm_lock *lock) |
int | ttm_write_lock (struct ttm_lock *lock, bool interruptible) |
void | ttm_lock_downgrade (struct ttm_lock *lock) |
void | ttm_suspend_lock (struct ttm_lock *lock) |
void | ttm_suspend_unlock (struct ttm_lock *lock) |
int | ttm_vt_lock (struct ttm_lock *lock, bool interruptible, struct ttm_object_file *tfile) |
int | ttm_vt_unlock (struct ttm_lock *lock) |
This file implements a simple replacement for the buffer manager use of the DRM heavyweight hardware lock. The lock is a read-write lock. Taking it in read mode and write mode is relatively fast, and intended for in-kernel use only.
The vt mode is used only when there is a need to block all user-space processes from validating buffers. It's allowed to leave kernel space with the vt lock held. If a user-space process dies while having the vt-lock, it will be released during the file descriptor release. The vt lock excludes write lock and read lock.
The suspend mode is used to lock out all TTM users when preparing for and executing suspend operations.
Definition in file ttm_lock.h.
ttm_lock_init
: Pointer to a struct ttm_lock Initializes the lock.
Definition at line 45 of file ttm_lock.c.
ttm_read_lock
: Pointer to a struct ttm_lock : Interruptible sleeping while waiting for a lock.
Takes the lock in read mode. Returns: -ERESTARTSYS If interrupted by a signal and interruptible is true.
Definition at line 83 of file ttm_lock.c.
ttm_read_trylock
: Pointer to a struct ttm_lock : Interruptible sleeping while waiting for a lock.
Tries to take the lock in read mode. If the lock is already held in write mode, the function will return -EBUSY. If the lock is held in vt or suspend mode, the function will sleep until these modes are unlocked.
Returns: -EBUSY The lock was already held in write mode. -ERESTARTSYS If interrupted by a signal and interruptible is true.
Definition at line 120 of file ttm_lock.c.
ttm_read_unlock
: Pointer to a struct ttm_lock
Releases a read lock.
Definition at line 56 of file ttm_lock.c.
ttm_suspend_lock
: Pointer to a struct ttm_lock
Takes the lock in suspend mode. Excludes read and write mode.
Definition at line 306 of file ttm_lock.c.
ttm_suspend_unlock
: Pointer to a struct ttm_lock
Releases a suspend lock
Definition at line 281 of file ttm_lock.c.
ttm_vt_lock
: Pointer to a struct ttm_lock : Interruptible sleeping while waiting for a lock. : Pointer to a struct ttm_object_file to register the lock with.
Takes the lock in vt mode. Returns: -ERESTARTSYS If interrupted by a signal and interruptible is true. -ENOMEM: Out of memory when locking.
Definition at line 238 of file ttm_lock.c.
ttm_vt_unlock
: Pointer to a struct ttm_lock
Releases a vt lock. Returns: -EINVAL If the lock was not held.
Definition at line 274 of file ttm_lock.c.
ttm_write_lock
: Pointer to a struct ttm_lock : Interruptible sleeping while waiting for a lock.
Takes the lock in write mode. Returns: -ERESTARTSYS If interrupted by a signal and interruptible is true.
Definition at line 169 of file ttm_lock.c.