aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/ttm/ttm_bo_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm/ttm/ttm_bo_driver.h')
-rw-r--r--include/drm/ttm/ttm_bo_driver.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index b87504235f1..d01b4ddbdc5 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -203,7 +203,22 @@ struct ttm_tt {
203 * It's set up by the ttm_bo_driver::init_mem_type method. 203 * It's set up by the ttm_bo_driver::init_mem_type method.
204 */ 204 */
205 205
206struct ttm_mem_type_manager;
207
208struct ttm_mem_type_manager_func {
209 int (*init)(struct ttm_mem_type_manager *man, unsigned long p_size);
210 int (*takedown)(struct ttm_mem_type_manager *man);
211 int (*get_node)(struct ttm_mem_type_manager *man,
212 struct ttm_buffer_object *bo,
213 struct ttm_placement *placement,
214 struct ttm_mem_reg *mem);
215 void (*put_node)(struct ttm_mem_type_manager *man,
216 struct ttm_mem_reg *mem);
217 void (*debug)(struct ttm_mem_type_manager *man, const char *prefix);
218};
219
206struct ttm_mem_type_manager { 220struct ttm_mem_type_manager {
221 struct ttm_bo_device *bdev;
207 222
208 /* 223 /*
209 * No protection. Constant from start. 224 * No protection. Constant from start.
@@ -222,8 +237,8 @@ struct ttm_mem_type_manager {
222 * TODO: Consider one lru_lock per ttm_mem_type_manager. 237 * TODO: Consider one lru_lock per ttm_mem_type_manager.
223 * Plays ill with list removal, though. 238 * Plays ill with list removal, though.
224 */ 239 */
225 240 const struct ttm_mem_type_manager_func *func;
226 struct drm_mm manager; 241 void *priv;
227 struct list_head lru; 242 struct list_head lru;
228}; 243};
229 244
@@ -649,6 +664,12 @@ extern int ttm_bo_mem_space(struct ttm_buffer_object *bo,
649 struct ttm_mem_reg *mem, 664 struct ttm_mem_reg *mem,
650 bool interruptible, 665 bool interruptible,
651 bool no_wait_reserve, bool no_wait_gpu); 666 bool no_wait_reserve, bool no_wait_gpu);
667
668extern void ttm_bo_mem_put(struct ttm_buffer_object *bo,
669 struct ttm_mem_reg *mem);
670extern void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo,
671 struct ttm_mem_reg *mem);
672
652/** 673/**
653 * ttm_bo_wait_for_cpu 674 * ttm_bo_wait_for_cpu
654 * 675 *
@@ -891,6 +912,8 @@ extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
891 */ 912 */
892extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); 913extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp);
893 914
915extern const struct ttm_mem_type_manager_func ttm_bo_manager_func;
916
894#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) 917#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
895#define TTM_HAS_AGP 918#define TTM_HAS_AGP
896#include <linux/agp_backend.h> 919#include <linux/agp_backend.h>