Commit 5fb4ef0e authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Dave Airlie

drm/ttm: remove sync_obj_arg member

vmwgfx was its only user and always sets it to the same..
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-By: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent be013367
...@@ -501,7 +501,6 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) ...@@ -501,7 +501,6 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo)
struct ttm_bo_global *glob = bo->glob; struct ttm_bo_global *glob = bo->glob;
struct ttm_bo_driver *driver; struct ttm_bo_driver *driver;
void *sync_obj = NULL; void *sync_obj = NULL;
void *sync_obj_arg;
int put_count; int put_count;
int ret; int ret;
...@@ -537,7 +536,6 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) ...@@ -537,7 +536,6 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo)
driver = bdev->driver; driver = bdev->driver;
if (bo->sync_obj) if (bo->sync_obj)
sync_obj = driver->sync_obj_ref(bo->sync_obj); sync_obj = driver->sync_obj_ref(bo->sync_obj);
sync_obj_arg = bo->sync_obj_arg;
kref_get(&bo->list_kref); kref_get(&bo->list_kref);
list_add_tail(&bo->ddestroy, &bdev->ddestroy); list_add_tail(&bo->ddestroy, &bdev->ddestroy);
...@@ -545,7 +543,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) ...@@ -545,7 +543,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo)
spin_unlock(&bdev->fence_lock); spin_unlock(&bdev->fence_lock);
if (sync_obj) { if (sync_obj) {
driver->sync_obj_flush(sync_obj, sync_obj_arg); driver->sync_obj_flush(sync_obj, NULL);
driver->sync_obj_unref(&sync_obj); driver->sync_obj_unref(&sync_obj);
} }
schedule_delayed_work(&bdev->wq, schedule_delayed_work(&bdev->wq,
...@@ -1716,7 +1714,6 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, ...@@ -1716,7 +1714,6 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
struct ttm_bo_driver *driver = bo->bdev->driver; struct ttm_bo_driver *driver = bo->bdev->driver;
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
void *sync_obj; void *sync_obj;
void *sync_obj_arg;
int ret = 0; int ret = 0;
if (likely(bo->sync_obj == NULL)) if (likely(bo->sync_obj == NULL))
...@@ -1724,7 +1721,7 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, ...@@ -1724,7 +1721,7 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
while (bo->sync_obj) { while (bo->sync_obj) {
if (driver->sync_obj_signaled(bo->sync_obj, bo->sync_obj_arg)) { if (driver->sync_obj_signaled(bo->sync_obj, NULL)) {
void *tmp_obj = bo->sync_obj; void *tmp_obj = bo->sync_obj;
bo->sync_obj = NULL; bo->sync_obj = NULL;
clear_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); clear_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
...@@ -1738,9 +1735,8 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, ...@@ -1738,9 +1735,8 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
return -EBUSY; return -EBUSY;
sync_obj = driver->sync_obj_ref(bo->sync_obj); sync_obj = driver->sync_obj_ref(bo->sync_obj);
sync_obj_arg = bo->sync_obj_arg;
spin_unlock(&bdev->fence_lock); spin_unlock(&bdev->fence_lock);
ret = driver->sync_obj_wait(sync_obj, sync_obj_arg, ret = driver->sync_obj_wait(sync_obj, NULL,
lazy, interruptible); lazy, interruptible);
if (unlikely(ret != 0)) { if (unlikely(ret != 0)) {
driver->sync_obj_unref(&sync_obj); driver->sync_obj_unref(&sync_obj);
...@@ -1748,8 +1744,7 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, ...@@ -1748,8 +1744,7 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
return ret; return ret;
} }
spin_lock(&bdev->fence_lock); spin_lock(&bdev->fence_lock);
if (likely(bo->sync_obj == sync_obj && if (likely(bo->sync_obj == sync_obj)) {
bo->sync_obj_arg == sync_obj_arg)) {
void *tmp_obj = bo->sync_obj; void *tmp_obj = bo->sync_obj;
bo->sync_obj = NULL; bo->sync_obj = NULL;
clear_bit(TTM_BO_PRIV_FLAG_MOVING, clear_bit(TTM_BO_PRIV_FLAG_MOVING,
......
...@@ -630,7 +630,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, ...@@ -630,7 +630,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
bo->sync_obj = NULL; bo->sync_obj = NULL;
} }
bo->sync_obj = driver->sync_obj_ref(sync_obj); bo->sync_obj = driver->sync_obj_ref(sync_obj);
bo->sync_obj_arg = sync_obj_arg;
if (evict) { if (evict) {
ret = ttm_bo_wait(bo, false, false, false); ret = ttm_bo_wait(bo, false, false, false);
spin_unlock(&bdev->fence_lock); spin_unlock(&bdev->fence_lock);
......
...@@ -223,7 +223,6 @@ void ttm_eu_fence_buffer_objects(struct list_head *list, void *sync_obj) ...@@ -223,7 +223,6 @@ void ttm_eu_fence_buffer_objects(struct list_head *list, void *sync_obj)
bo = entry->bo; bo = entry->bo;
entry->old_sync_obj = bo->sync_obj; entry->old_sync_obj = bo->sync_obj;
bo->sync_obj = driver->sync_obj_ref(sync_obj); bo->sync_obj = driver->sync_obj_ref(sync_obj);
bo->sync_obj_arg = entry->new_sync_obj_arg;
ttm_bo_unreserve_locked(bo); ttm_bo_unreserve_locked(bo);
entry->reserved = false; entry->reserved = false;
} }
......
...@@ -170,7 +170,6 @@ struct ttm_tt; ...@@ -170,7 +170,6 @@ struct ttm_tt;
* @seq_valid: The value of @val_seq is valid. This value is protected by * @seq_valid: The value of @val_seq is valid. This value is protected by
* the bo_device::lru_lock. * the bo_device::lru_lock.
* @reserved: Deadlock-free lock used for synchronization state transitions. * @reserved: Deadlock-free lock used for synchronization state transitions.
* @sync_obj_arg: Opaque argument to synchronization object function.
* @sync_obj: Pointer to a synchronization object. * @sync_obj: Pointer to a synchronization object.
* @priv_flags: Flags describing buffer object internal state. * @priv_flags: Flags describing buffer object internal state.
* @vm_rb: Rb node for the vm rb tree. * @vm_rb: Rb node for the vm rb tree.
...@@ -252,7 +251,6 @@ struct ttm_buffer_object { ...@@ -252,7 +251,6 @@ struct ttm_buffer_object {
* checking NULL while reserved but not holding the mentioned lock. * checking NULL while reserved but not holding the mentioned lock.
*/ */
void *sync_obj_arg;
void *sync_obj; void *sync_obj;
unsigned long priv_flags; unsigned long priv_flags;
......
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
* *
* @head: list head for thread-private list. * @head: list head for thread-private list.
* @bo: refcounted buffer object pointer. * @bo: refcounted buffer object pointer.
* @new_sync_obj_arg: New sync_obj_arg for @bo, to be used once
* adding a new sync object.
* @reserved: Indicates whether @bo has been reserved for validation. * @reserved: Indicates whether @bo has been reserved for validation.
* @removed: Indicates whether @bo has been removed from lru lists. * @removed: Indicates whether @bo has been removed from lru lists.
* @put_count: Number of outstanding references on bo::list_kref. * @put_count: Number of outstanding references on bo::list_kref.
...@@ -50,7 +48,6 @@ ...@@ -50,7 +48,6 @@
struct ttm_validate_buffer { struct ttm_validate_buffer {
struct list_head head; struct list_head head;
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
void *new_sync_obj_arg;
bool reserved; bool reserved;
bool removed; bool removed;
int put_count; int put_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment