diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-07 17:02:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-07 17:02:01 -0400 |
commit | e33b3e7567f8636c61e79ff1da5ff9a6cf6562c7 (patch) | |
tree | 72f361fec4a8c81d5003b93344bf3eab3eb21775 | |
parent | e2dbe06c271f3bb2a495627980aad3d1d8ccef2a (diff) | |
parent | 8cfe92d683a0041ac8e016a0b0a487c99a78f6c1 (diff) |
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm/ttm: Remove the ttm_bo_block_reservation() function.
drm/ttm: Remove some leftover debug messages.
drm/radeon: async event synchronization for drmWaitVblank
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_lock.c | 5 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 28 |
4 files changed, 4 insertions, 61 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 4b05563d99e1..b3749d47be7b 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -216,6 +216,7 @@ static struct drm_driver driver_old = { | |||
216 | .mmap = drm_mmap, | 216 | .mmap = drm_mmap, |
217 | .poll = drm_poll, | 217 | .poll = drm_poll, |
218 | .fasync = drm_fasync, | 218 | .fasync = drm_fasync, |
219 | .read = drm_read, | ||
219 | #ifdef CONFIG_COMPAT | 220 | #ifdef CONFIG_COMPAT |
220 | .compat_ioctl = radeon_compat_ioctl, | 221 | .compat_ioctl = radeon_compat_ioctl, |
221 | #endif | 222 | #endif |
@@ -304,6 +305,7 @@ static struct drm_driver kms_driver = { | |||
304 | .mmap = radeon_mmap, | 305 | .mmap = radeon_mmap, |
305 | .poll = drm_poll, | 306 | .poll = drm_poll, |
306 | .fasync = drm_fasync, | 307 | .fasync = drm_fasync, |
308 | .read = drm_read, | ||
307 | #ifdef CONFIG_COMPAT | 309 | #ifdef CONFIG_COMPAT |
308 | .compat_ioctl = radeon_kms_compat_ioctl, | 310 | .compat_ioctl = radeon_kms_compat_ioctl, |
309 | #endif | 311 | #endif |
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index dd47b2a9a791..0e3754a3a303 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1716,40 +1716,12 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, | |||
1716 | } | 1716 | } |
1717 | EXPORT_SYMBOL(ttm_bo_wait); | 1717 | EXPORT_SYMBOL(ttm_bo_wait); |
1718 | 1718 | ||
1719 | void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo) | ||
1720 | { | ||
1721 | atomic_set(&bo->reserved, 0); | ||
1722 | wake_up_all(&bo->event_queue); | ||
1723 | } | ||
1724 | |||
1725 | int ttm_bo_block_reservation(struct ttm_buffer_object *bo, bool interruptible, | ||
1726 | bool no_wait) | ||
1727 | { | ||
1728 | int ret; | ||
1729 | |||
1730 | while (unlikely(atomic_cmpxchg(&bo->reserved, 0, 1) != 0)) { | ||
1731 | if (no_wait) | ||
1732 | return -EBUSY; | ||
1733 | else if (interruptible) { | ||
1734 | ret = wait_event_interruptible | ||
1735 | (bo->event_queue, atomic_read(&bo->reserved) == 0); | ||
1736 | if (unlikely(ret != 0)) | ||
1737 | return ret; | ||
1738 | } else { | ||
1739 | wait_event(bo->event_queue, | ||
1740 | atomic_read(&bo->reserved) == 0); | ||
1741 | } | ||
1742 | } | ||
1743 | return 0; | ||
1744 | } | ||
1745 | |||
1746 | int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait) | 1719 | int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait) |
1747 | { | 1720 | { |
1748 | int ret = 0; | 1721 | int ret = 0; |
1749 | 1722 | ||
1750 | /* | 1723 | /* |
1751 | * Using ttm_bo_reserve instead of ttm_bo_block_reservation | 1724 | * Using ttm_bo_reserve makes sure the lru lists are updated. |
1752 | * makes sure the lru lists are updated. | ||
1753 | */ | 1725 | */ |
1754 | 1726 | ||
1755 | ret = ttm_bo_reserve(bo, true, no_wait, false, 0); | 1727 | ret = ttm_bo_reserve(bo, true, no_wait, false, 0); |
diff --git a/drivers/gpu/drm/ttm/ttm_lock.c b/drivers/gpu/drm/ttm/ttm_lock.c index 3d172ef04ee1..de41e55a944a 100644 --- a/drivers/gpu/drm/ttm/ttm_lock.c +++ b/drivers/gpu/drm/ttm/ttm_lock.c | |||
@@ -204,7 +204,6 @@ static int __ttm_vt_unlock(struct ttm_lock *lock) | |||
204 | lock->flags &= ~TTM_VT_LOCK; | 204 | lock->flags &= ~TTM_VT_LOCK; |
205 | wake_up_all(&lock->queue); | 205 | wake_up_all(&lock->queue); |
206 | spin_unlock(&lock->lock); | 206 | spin_unlock(&lock->lock); |
207 | printk(KERN_INFO TTM_PFX "vt unlock.\n"); | ||
208 | 207 | ||
209 | return ret; | 208 | return ret; |
210 | } | 209 | } |
@@ -265,10 +264,8 @@ int ttm_vt_lock(struct ttm_lock *lock, | |||
265 | ttm_lock_type, &ttm_vt_lock_remove, NULL); | 264 | ttm_lock_type, &ttm_vt_lock_remove, NULL); |
266 | if (ret) | 265 | if (ret) |
267 | (void)__ttm_vt_unlock(lock); | 266 | (void)__ttm_vt_unlock(lock); |
268 | else { | 267 | else |
269 | lock->vt_holder = tfile; | 268 | lock->vt_holder = tfile; |
270 | printk(KERN_INFO TTM_PFX "vt lock.\n"); | ||
271 | } | ||
272 | 269 | ||
273 | return ret; | 270 | return ret; |
274 | } | 271 | } |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e929c27ede22..6b9db917e717 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -789,34 +789,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo); | |||
789 | extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, | 789 | extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, |
790 | bool interruptible); | 790 | bool interruptible); |
791 | 791 | ||
792 | /** | ||
793 | * ttm_bo_block_reservation | ||
794 | * | ||
795 | * @bo: A pointer to a struct ttm_buffer_object. | ||
796 | * @interruptible: Use interruptible sleep when waiting. | ||
797 | * @no_wait: Don't sleep, but rather return -EBUSY. | ||
798 | * | ||
799 | * Block reservation for validation by simply reserving the buffer. | ||
800 | * This is intended for single buffer use only without eviction, | ||
801 | * and thus needs no deadlock protection. | ||
802 | * | ||
803 | * Returns: | ||
804 | * -EBUSY: If no_wait == 1 and the buffer is already reserved. | ||
805 | * -ERESTARTSYS: If interruptible == 1 and the process received a signal | ||
806 | * while sleeping. | ||
807 | */ | ||
808 | extern int ttm_bo_block_reservation(struct ttm_buffer_object *bo, | ||
809 | bool interruptible, bool no_wait); | ||
810 | |||
811 | /** | ||
812 | * ttm_bo_unblock_reservation | ||
813 | * | ||
814 | * @bo: A pointer to a struct ttm_buffer_object. | ||
815 | * | ||
816 | * Unblocks reservation leaving lru lists untouched. | ||
817 | */ | ||
818 | extern void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo); | ||
819 | |||
820 | /* | 792 | /* |
821 | * ttm_bo_util.c | 793 | * ttm_bo_util.c |
822 | */ | 794 | */ |