Lines Matching refs:lock_data
164 int drm_lock_take(struct drm_lock_data *lock_data,
168 volatile unsigned int *lock = &lock_data->hw_lock->lock;
176 ((lock_data->user_waiters + lock_data->kernel_waiters > 1) ?
210 static int drm_lock_transfer(struct drm_lock_data *lock_data,
214 volatile unsigned int *lock = &lock_data->hw_lock->lock;
216 lock_data->file_priv = NULL;
235 int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context)
238 volatile unsigned int *lock = &lock_data->hw_lock->lock;
240 mutex_enter(&lock_data->lock_mutex);
241 if (lock_data->kernel_waiters != 0) {
242 (void) drm_lock_transfer(lock_data, 0);
243 lock_data->idle_has_lock = 1;
244 mutex_exit(&lock_data->lock_mutex);
256 mutex_exit(&lock_data->lock_mutex);
259 cv_broadcast(&lock_data->lock_cv);
260 mutex_exit(&lock_data->lock_mutex);
277 void drm_idlelock_take(struct drm_lock_data *lock_data)
281 mutex_enter(&lock_data->lock_mutex);
282 lock_data->kernel_waiters++;
283 if (!lock_data->idle_has_lock) {
285 ret = drm_lock_take(lock_data, DRM_KERNEL_CONTEXT);
288 lock_data->idle_has_lock = 1;
290 mutex_exit(&(lock_data->lock_mutex));
293 void drm_idlelock_release(struct drm_lock_data *lock_data)
296 volatile unsigned int *lock = &lock_data->hw_lock->lock;
298 mutex_enter(&lock_data->lock_mutex);
299 if (--lock_data->kernel_waiters == 0) {
300 if (lock_data->idle_has_lock) {
304 cv_broadcast(&lock_data->lock_cv);
305 lock_data->idle_has_lock = 0;
308 mutex_exit(&lock_data->lock_mutex);