aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/drm/ttm/ttm_bo_api.h3
-rw-r--r--include/drm/ttm/ttm_bo_driver.h25
2 files changed, 25 insertions, 3 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 267a86c74e2e..49b43c23636a 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -102,7 +102,8 @@ struct ttm_bus_placement {
102 */ 102 */
103 103
104struct ttm_mem_reg { 104struct ttm_mem_reg {
105 struct drm_mm_node *mm_node; 105 void *mm_node;
106 unsigned long start;
106 unsigned long size; 107 unsigned long size;
107 unsigned long num_pages; 108 unsigned long num_pages;
108 uint32_t page_alignment; 109 uint32_t page_alignment;
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index b87504235f18..e3371dbe6a10 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,10 @@ 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);
670
652/** 671/**
653 * ttm_bo_wait_for_cpu 672 * ttm_bo_wait_for_cpu
654 * 673 *
@@ -891,6 +910,8 @@ extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
891 */ 910 */
892extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); 911extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp);
893 912
913extern const struct ttm_mem_type_manager_func ttm_bo_manager_func;
914
894#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) 915#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
895#define TTM_HAS_AGP 916#define TTM_HAS_AGP
896#include <linux/agp_backend.h> 917#include <linux/agp_backend.h>