drm/ttm: flip the switch, and convert to dma_fence
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
This commit is contained in:
@@ -173,7 +173,6 @@ struct ttm_tt;
|
||||
* @lru: List head for the lru list.
|
||||
* @ddestroy: List head for the delayed destroy list.
|
||||
* @swap: List head for swap LRU list.
|
||||
* @sync_obj: Pointer to a synchronization object.
|
||||
* @priv_flags: Flags describing buffer object internal state.
|
||||
* @vma_node: Address space manager node.
|
||||
* @offset: The current GPU offset, which can have different meanings
|
||||
@@ -240,7 +239,6 @@ struct ttm_buffer_object {
|
||||
* Members protected by a bo reservation.
|
||||
*/
|
||||
|
||||
void *sync_obj;
|
||||
unsigned long priv_flags;
|
||||
|
||||
struct drm_vma_offset_node vma_node;
|
||||
|
@@ -312,11 +312,6 @@ struct ttm_mem_type_manager {
|
||||
* @move: Callback for a driver to hook in accelerated functions to
|
||||
* move a buffer.
|
||||
* If set to NULL, a potentially slow memcpy() move is used.
|
||||
* @sync_obj_signaled: See ttm_fence_api.h
|
||||
* @sync_obj_wait: See ttm_fence_api.h
|
||||
* @sync_obj_flush: See ttm_fence_api.h
|
||||
* @sync_obj_unref: See ttm_fence_api.h
|
||||
* @sync_obj_ref: See ttm_fence_api.h
|
||||
*/
|
||||
|
||||
struct ttm_bo_driver {
|
||||
@@ -418,23 +413,6 @@ struct ttm_bo_driver {
|
||||
int (*verify_access) (struct ttm_buffer_object *bo,
|
||||
struct file *filp);
|
||||
|
||||
/**
|
||||
* In case a driver writer dislikes the TTM fence objects,
|
||||
* the driver writer can replace those with sync objects of
|
||||
* his / her own. If it turns out that no driver writer is
|
||||
* using these. I suggest we remove these hooks and plug in
|
||||
* fences directly. The bo driver needs the following functionality:
|
||||
* See the corresponding functions in the fence object API
|
||||
* documentation.
|
||||
*/
|
||||
|
||||
bool (*sync_obj_signaled) (void *sync_obj);
|
||||
int (*sync_obj_wait) (void *sync_obj,
|
||||
bool lazy, bool interruptible);
|
||||
int (*sync_obj_flush) (void *sync_obj);
|
||||
void (*sync_obj_unref) (void **sync_obj);
|
||||
void *(*sync_obj_ref) (void *sync_obj);
|
||||
|
||||
/* hook to notify driver about a driver move so it
|
||||
* can do tiling things */
|
||||
void (*move_notify)(struct ttm_buffer_object *bo,
|
||||
@@ -1022,7 +1000,7 @@ extern void ttm_bo_free_old_node(struct ttm_buffer_object *bo);
|
||||
* ttm_bo_move_accel_cleanup.
|
||||
*
|
||||
* @bo: A pointer to a struct ttm_buffer_object.
|
||||
* @sync_obj: A sync object that signals when moving is complete.
|
||||
* @fence: A fence object that signals when moving is complete.
|
||||
* @evict: This is an evict move. Don't return until the buffer is idle.
|
||||
* @no_wait_gpu: Return immediately if the GPU is busy.
|
||||
* @new_mem: struct ttm_mem_reg indicating where to move.
|
||||
@@ -1036,7 +1014,7 @@ extern void ttm_bo_free_old_node(struct ttm_buffer_object *bo);
|
||||
*/
|
||||
|
||||
extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
|
||||
void *sync_obj,
|
||||
struct fence *fence,
|
||||
bool evict, bool no_wait_gpu,
|
||||
struct ttm_mem_reg *new_mem);
|
||||
/**
|
||||
|
@@ -39,16 +39,11 @@
|
||||
*
|
||||
* @head: list head for thread-private list.
|
||||
* @bo: refcounted buffer object pointer.
|
||||
* @reserved: Indicates whether @bo has been reserved for validation.
|
||||
* @removed: Indicates whether @bo has been removed from lru lists.
|
||||
* @put_count: Number of outstanding references on bo::list_kref.
|
||||
* @old_sync_obj: Pointer to a sync object about to be unreferenced
|
||||
*/
|
||||
|
||||
struct ttm_validate_buffer {
|
||||
struct list_head head;
|
||||
struct ttm_buffer_object *bo;
|
||||
void *old_sync_obj;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -100,7 +95,7 @@ extern int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
|
||||
*
|
||||
* @ticket: ww_acquire_ctx from reserve call
|
||||
* @list: thread private list of ttm_validate_buffer structs.
|
||||
* @sync_obj: The new sync object for the buffers.
|
||||
* @fence: The new exclusive fence for the buffers.
|
||||
*
|
||||
* This function should be called when command submission is complete, and
|
||||
* it will add a new sync object to bos pointed to by entries on @list.
|
||||
@@ -109,6 +104,7 @@ extern int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
|
||||
*/
|
||||
|
||||
extern void ttm_eu_fence_buffer_objects(struct ww_acquire_ctx *ticket,
|
||||
struct list_head *list, void *sync_obj);
|
||||
struct list_head *list,
|
||||
struct fence *fence);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user