aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/ttm
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-06-15 07:44:03 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 14:54:41 -0400
commit3ddf4ad9179779693a7656e67872fc37cc49e92b (patch)
tree806b34a24459764c6625a704ea3a73b70f72e6a3 /include/drm/ttm
parentf849c6d6527a4108b1d7813e1a0eac9f1568cc4b (diff)
drm/ttm: add the infrastructure for pipelined evictions
Free up the memory immediately, remember the last eviction for each domain and make new allocations depend on the last eviction to be completed. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/drm/ttm')
-rw-r--r--include/drm/ttm/ttm_bo_driver.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 44dea22d594e..e2ebe6666e2b 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -258,8 +258,10 @@ struct ttm_mem_type_manager_func {
258 * reserved by the TTM vm system. 258 * reserved by the TTM vm system.
259 * @io_reserve_lru: Optional lru list for unreserving io mem regions. 259 * @io_reserve_lru: Optional lru list for unreserving io mem regions.
260 * @io_reserve_fastpath: Only use bdev::driver::io_mem_reserve to obtain 260 * @io_reserve_fastpath: Only use bdev::driver::io_mem_reserve to obtain
261 * @move_lock: lock for move fence
261 * static information. bdev::driver::io_mem_free is never used. 262 * static information. bdev::driver::io_mem_free is never used.
262 * @lru: The lru list for this memory type. 263 * @lru: The lru list for this memory type.
264 * @move: The fence of the last pipelined move operation.
263 * 265 *
264 * This structure is used to identify and manage memory types for a device. 266 * This structure is used to identify and manage memory types for a device.
265 * It's set up by the ttm_bo_driver::init_mem_type method. 267 * It's set up by the ttm_bo_driver::init_mem_type method.
@@ -286,6 +288,7 @@ struct ttm_mem_type_manager {
286 struct mutex io_reserve_mutex; 288 struct mutex io_reserve_mutex;
287 bool use_io_reserve_lru; 289 bool use_io_reserve_lru;
288 bool io_reserve_fastpath; 290 bool io_reserve_fastpath;
291 spinlock_t move_lock;
289 292
290 /* 293 /*
291 * Protected by @io_reserve_mutex: 294 * Protected by @io_reserve_mutex:
@@ -298,6 +301,11 @@ struct ttm_mem_type_manager {
298 */ 301 */
299 302
300 struct list_head lru; 303 struct list_head lru;
304
305 /*
306 * Protected by @move_lock.
307 */
308 struct fence *move;
301}; 309};
302 310
303/** 311/**
@@ -1014,6 +1022,22 @@ extern void ttm_bo_free_old_node(struct ttm_buffer_object *bo);
1014extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, 1022extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
1015 struct fence *fence, bool evict, 1023 struct fence *fence, bool evict,
1016 struct ttm_mem_reg *new_mem); 1024 struct ttm_mem_reg *new_mem);
1025
1026/**
1027 * ttm_bo_pipeline_move.
1028 *
1029 * @bo: A pointer to a struct ttm_buffer_object.
1030 * @fence: A fence object that signals when moving is complete.
1031 * @evict: This is an evict move. Don't return until the buffer is idle.
1032 * @new_mem: struct ttm_mem_reg indicating where to move.
1033 *
1034 * Function for pipelining accelerated moves. Either free the memory
1035 * immediately or hang it on a temporary buffer object.
1036 */
1037int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
1038 struct fence *fence, bool evict,
1039 struct ttm_mem_reg *new_mem);
1040
1017/** 1041/**
1018 * ttm_io_prot 1042 * ttm_io_prot
1019 * 1043 *