diff options
Diffstat (limited to 'bsd-core/drm_lock.c')
-rw-r--r-- | bsd-core/drm_lock.c | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index a859b178..20ad4bff 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -33,18 +33,6 @@ #include "drmP.h" -int DRM(block)( DRM_IOCTL_ARGS ) -{ - DRM_DEBUG("\n"); - return 0; -} - -int DRM(unblock)( DRM_IOCTL_ARGS ) -{ - DRM_DEBUG("\n"); - return 0; -} - int DRM(lock_take)(__volatile__ unsigned int *lock, unsigned int context) { unsigned int old, new; @@ -107,98 +95,3 @@ int DRM(lock_free)(drm_device_t *dev, return 0; } -static int DRM(flush_queue)(drm_device_t *dev, int context) -{ - int error; - int ret = 0; - drm_queue_t *q = dev->queuelist[context]; - - DRM_DEBUG("\n"); - - atomic_inc(&q->use_count); - if (atomic_read(&q->use_count) > 1) { - atomic_inc(&q->block_write); - atomic_inc(&q->block_count); - error = tsleep((void *)&q->flush_queue, PZERO|PCATCH, "drmfq", 0); - if (error) - return error; - atomic_dec(&q->block_count); - } - atomic_dec(&q->use_count); - - /* NOTE: block_write is still incremented! - Use drm_flush_unlock_queue to decrement. */ - return ret; -} - -static int DRM(flush_unblock_queue)(drm_device_t *dev, int context) -{ - drm_queue_t *q = dev->queuelist[context]; - - DRM_DEBUG("\n"); - - atomic_inc(&q->use_count); - if (atomic_read(&q->use_count) > 1) { - if (atomic_read(&q->block_write)) { - atomic_dec(&q->block_write); - DRM_WAKEUP_INT((void *)&q->write_queue); - } - } - atomic_dec(&q->use_count); - return 0; -} - -int DRM(flush_block_and_flush)(drm_device_t *dev, int context, - drm_lock_flags_t flags) -{ - int ret = 0; - int i; - - DRM_DEBUG("\n"); - - if (flags & _DRM_LOCK_FLUSH) { - ret = DRM(flush_queue)(dev, DRM_KERNEL_CONTEXT); - if (!ret) ret = DRM(flush_queue)(dev, context); - } - if (flags & _DRM_LOCK_FLUSH_ALL) { - for (i = 0; !ret && i < dev->queue_count; i++) { - ret = DRM(flush_queue)(dev, i); - } - } - return ret; -} - -int DRM(flush_unblock)(drm_device_t *dev, int context, drm_lock_flags_t flags) -{ - int ret = 0; - int i; - - DRM_DEBUG("\n"); - - if (flags & _DRM_LOCK_FLUSH) { - ret = DRM(flush_unblock_queue)(dev, DRM_KERNEL_CONTEXT); - if (!ret) ret = DRM(flush_unblock_queue)(dev, context); - } - if (flags & _DRM_LOCK_FLUSH_ALL) { - for (i = 0; !ret && i < dev->queue_count; i++) { - ret = DRM(flush_unblock_queue)(dev, i); - } - } - - return ret; -} - -int DRM(finish)( DRM_IOCTL_ARGS ) -{ - DRM_DEVICE; - int ret = 0; - drm_lock_t lock; - - DRM_DEBUG("\n"); - - DRM_COPY_FROM_USER_IOCTL( lock, (drm_lock_t *)data, sizeof(lock) ); - - ret = DRM(flush_block_and_flush)(dev, lock.context, lock.flags); - DRM(flush_unblock)(dev, lock.context, lock.flags); - return ret; -} |