Linux Kernel
3.7.1
|
Go to the source code of this file.
Functions | |
int | drm_lock (struct drm_device *dev, void *data, struct drm_file *file_priv) |
int | drm_unlock (struct drm_device *dev, void *data, struct drm_file *file_priv) |
int | drm_lock_free (struct drm_lock_data *lock_data, unsigned int context) |
void | drm_idlelock_take (struct drm_lock_data *lock_data) |
EXPORT_SYMBOL (drm_idlelock_take) | |
void | drm_idlelock_release (struct drm_lock_data *lock_data) |
EXPORT_SYMBOL (drm_idlelock_release) | |
int | drm_i_have_hw_lock (struct drm_device *dev, struct drm_file *file_priv) |
IOCTLs for locking
Definition in file drm_lock.c.
int drm_i_have_hw_lock | ( | struct drm_device * | dev, |
struct drm_file * | file_priv | ||
) |
Definition at line 367 of file drm_lock.c.
Definition at line 347 of file drm_lock.c.
This function returns immediately and takes the hw lock with the kernel context if it is free, otherwise it gets the highest priority when and if it is eventually released.
This guarantees that the kernel will eventually have the lock unless it is held by a blocked process. (In the latter case an explicit wait for the hardware lock would cause a deadlock, which is why the "idlelock" was invented).
This should be sufficient to wait for GPU idle without having to worry about starvation.
Definition at line 328 of file drm_lock.c.
Lock ioctl.
inode | device inode. |
file_priv | DRM file private. |
cmd | command. |
arg | user argument, pointing to a drm_lock structure. |
Add the current task to the lock wait queue, and attempt to take to lock.
Definition at line 54 of file drm_lock.c.
int drm_unlock | ( | struct drm_device * | dev, |
void * | data, | ||
struct drm_file * | file_priv | ||
) |
Unlock ioctl.
inode | device inode. |
file_priv | DRM file private. |
cmd | command. |
arg | user argument, pointing to a drm_lock structure. |
Transfer and free the lock.
Definition at line 149 of file drm_lock.c.
EXPORT_SYMBOL | ( | drm_idlelock_take | ) |
EXPORT_SYMBOL | ( | drm_idlelock_release | ) |