aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>2012-10-12 11:02:19 -0400
committerDave Airlie <airlied@redhat.com>2012-11-20 01:09:55 -0500
commit5fb4ef0e36b4c6ecc7fb025aaacb3b63b1114e87 (patch)
tree425e7b5c48bbe54769925ad5c48cf3d9de74e088
parentbe013367fd6fbab52ddf6f76c243f4109090c890 (diff)
drm/ttm: remove sync_obj_arg member
vmwgfx was its only user and always sets it to the same.. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-By: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c13
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c1
-rw-r--r--drivers/gpu/drm/ttm/ttm_execbuf_util.c1
-rw-r--r--include/drm/ttm/ttm_bo_api.h2
-rw-r--r--include/drm/ttm/ttm_execbuf_util.h3
5 files changed, 4 insertions, 16 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 4066e788cff8..4cb3f493da76 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -501,7 +501,6 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo)
501 struct ttm_bo_global *glob = bo->glob; 501 struct ttm_bo_global *glob = bo->glob;
502 struct ttm_bo_driver *driver; 502 struct ttm_bo_driver *driver;
503 void *sync_obj = NULL; 503 void *sync_obj = NULL;
504 void *sync_obj_arg;
505 int put_count; 504 int put_count;
506 int ret; 505 int ret;
507 506
@@ -537,7 +536,6 @@ queue:
537 driver = bdev->driver; 536 driver = bdev->driver;
538 if (bo->sync_obj) 537 if (bo->sync_obj)
539 sync_obj = driver->sync_obj_ref(bo->sync_obj); 538 sync_obj = driver->sync_obj_ref(bo->sync_obj);
540 sync_obj_arg = bo->sync_obj_arg;
541 539
542 kref_get(&bo->list_kref); 540 kref_get(&bo->list_kref);
543 list_add_tail(&bo->ddestroy, &bdev->ddestroy); 541 list_add_tail(&bo->ddestroy, &bdev->ddestroy);
@@ -545,7 +543,7 @@ queue:
545 spin_unlock(&bdev->fence_lock); 543 spin_unlock(&bdev->fence_lock);
546 544
547 if (sync_obj) { 545 if (sync_obj) {
548 driver->sync_obj_flush(sync_obj, sync_obj_arg); 546 driver->sync_obj_flush(sync_obj, NULL);
549 driver->sync_obj_unref(&sync_obj); 547 driver->sync_obj_unref(&sync_obj);
550 } 548 }
551 schedule_delayed_work(&bdev->wq, 549 schedule_delayed_work(&bdev->wq,
@@ -1716,7 +1714,6 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
1716 struct ttm_bo_driver *driver = bo->bdev->driver; 1714 struct ttm_bo_driver *driver = bo->bdev->driver;
1717 struct ttm_bo_device *bdev = bo->bdev; 1715 struct ttm_bo_device *bdev = bo->bdev;
1718 void *sync_obj; 1716 void *sync_obj;
1719 void *sync_obj_arg;
1720 int ret = 0; 1717 int ret = 0;
1721 1718
1722 if (likely(bo->sync_obj == NULL)) 1719 if (likely(bo->sync_obj == NULL))
@@ -1724,7 +1721,7 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
1724 1721
1725 while (bo->sync_obj) { 1722 while (bo->sync_obj) {
1726 1723
1727 if (driver->sync_obj_signaled(bo->sync_obj, bo->sync_obj_arg)) { 1724 if (driver->sync_obj_signaled(bo->sync_obj, NULL)) {
1728 void *tmp_obj = bo->sync_obj; 1725 void *tmp_obj = bo->sync_obj;
1729 bo->sync_obj = NULL; 1726 bo->sync_obj = NULL;
1730 clear_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); 1727 clear_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
@@ -1738,9 +1735,8 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
1738 return -EBUSY; 1735 return -EBUSY;
1739 1736
1740 sync_obj = driver->sync_obj_ref(bo->sync_obj); 1737 sync_obj = driver->sync_obj_ref(bo->sync_obj);
1741 sync_obj_arg = bo->sync_obj_arg;
1742 spin_unlock(&bdev->fence_lock); 1738 spin_unlock(&bdev->fence_lock);
1743 ret = driver->sync_obj_wait(sync_obj, sync_obj_arg, 1739 ret = driver->sync_obj_wait(sync_obj, NULL,
1744 lazy, interruptible); 1740 lazy, interruptible);
1745 if (unlikely(ret != 0)) { 1741 if (unlikely(ret != 0)) {
1746 driver->sync_obj_unref(&sync_obj); 1742 driver->sync_obj_unref(&sync_obj);
@@ -1748,8 +1744,7 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
1748 return ret; 1744 return ret;
1749 } 1745 }
1750 spin_lock(&bdev->fence_lock); 1746 spin_lock(&bdev->fence_lock);
1751 if (likely(bo->sync_obj == sync_obj && 1747 if (likely(bo->sync_obj == sync_obj)) {
1752 bo->sync_obj_arg == sync_obj_arg)) {
1753 void *tmp_obj = bo->sync_obj; 1748 void *tmp_obj = bo->sync_obj;
1754 bo->sync_obj = NULL; 1749 bo->sync_obj = NULL;
1755 clear_bit(TTM_BO_PRIV_FLAG_MOVING, 1750 clear_bit(TTM_BO_PRIV_FLAG_MOVING,
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 2026060f03e0..81c74f53ce4f 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -630,7 +630,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
630 bo->sync_obj = NULL; 630 bo->sync_obj = NULL;
631 } 631 }
632 bo->sync_obj = driver->sync_obj_ref(sync_obj); 632 bo->sync_obj = driver->sync_obj_ref(sync_obj);
633 bo->sync_obj_arg = sync_obj_arg;
634 if (evict) { 633 if (evict) {
635 ret = ttm_bo_wait(bo, false, false, false); 634 ret = ttm_bo_wait(bo, false, false, false);
636 spin_unlock(&bdev->fence_lock); 635 spin_unlock(&bdev->fence_lock);
diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
index 1937069432c5..b227a9961a07 100644
--- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c
+++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
@@ -223,7 +223,6 @@ void ttm_eu_fence_buffer_objects(struct list_head *list, void *sync_obj)
223 bo = entry->bo; 223 bo = entry->bo;
224 entry->old_sync_obj = bo->sync_obj; 224 entry->old_sync_obj = bo->sync_obj;
225 bo->sync_obj = driver->sync_obj_ref(sync_obj); 225 bo->sync_obj = driver->sync_obj_ref(sync_obj);
226 bo->sync_obj_arg = entry->new_sync_obj_arg;
227 ttm_bo_unreserve_locked(bo); 226 ttm_bo_unreserve_locked(bo);
228 entry->reserved = false; 227 entry->reserved = false;
229 } 228 }
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index a554c2e22d56..5ff938df5fce 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -170,7 +170,6 @@ struct ttm_tt;
170 * @seq_valid: The value of @val_seq is valid. This value is protected by 170 * @seq_valid: The value of @val_seq is valid. This value is protected by
171 * the bo_device::lru_lock. 171 * the bo_device::lru_lock.
172 * @reserved: Deadlock-free lock used for synchronization state transitions. 172 * @reserved: Deadlock-free lock used for synchronization state transitions.
173 * @sync_obj_arg: Opaque argument to synchronization object function.
174 * @sync_obj: Pointer to a synchronization object. 173 * @sync_obj: Pointer to a synchronization object.
175 * @priv_flags: Flags describing buffer object internal state. 174 * @priv_flags: Flags describing buffer object internal state.
176 * @vm_rb: Rb node for the vm rb tree. 175 * @vm_rb: Rb node for the vm rb tree.
@@ -252,7 +251,6 @@ struct ttm_buffer_object {
252 * checking NULL while reserved but not holding the mentioned lock. 251 * checking NULL while reserved but not holding the mentioned lock.
253 */ 252 */
254 253
255 void *sync_obj_arg;
256 void *sync_obj; 254 void *sync_obj;
257 unsigned long priv_flags; 255 unsigned long priv_flags;
258 256
diff --git a/include/drm/ttm/ttm_execbuf_util.h b/include/drm/ttm/ttm_execbuf_util.h
index 1926cae373ba..547e19f06e57 100644
--- a/include/drm/ttm/ttm_execbuf_util.h
+++ b/include/drm/ttm/ttm_execbuf_util.h
@@ -39,8 +39,6 @@
39 * 39 *
40 * @head: list head for thread-private list. 40 * @head: list head for thread-private list.
41 * @bo: refcounted buffer object pointer. 41 * @bo: refcounted buffer object pointer.
42 * @new_sync_obj_arg: New sync_obj_arg for @bo, to be used once
43 * adding a new sync object.
44 * @reserved: Indicates whether @bo has been reserved for validation. 42 * @reserved: Indicates whether @bo has been reserved for validation.
45 * @removed: Indicates whether @bo has been removed from lru lists. 43 * @removed: Indicates whether @bo has been removed from lru lists.
46 * @put_count: Number of outstanding references on bo::list_kref. 44 * @put_count: Number of outstanding references on bo::list_kref.
@@ -50,7 +48,6 @@
50struct ttm_validate_buffer { 48struct ttm_validate_buffer {
51 struct list_head head; 49 struct list_head head;
52 struct ttm_buffer_object *bo; 50 struct ttm_buffer_object *bo;
53 void *new_sync_obj_arg;
54 bool reserved; 51 bool reserved;
55 bool removed; 52 bool removed;
56 int put_count; 53 int put_count;