diff options
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 2 | ||||
-rw-r--r-- | include/drm/ttm/ttm_page_alloc.h | 36 |
2 files changed, 38 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index ae06e421cf90..beef9abaaefd 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -104,6 +104,7 @@ enum ttm_caching_state { | |||
104 | * @caching_state: The current caching state of the pages. | 104 | * @caching_state: The current caching state of the pages. |
105 | * @state: The current binding state of the pages. | 105 | * @state: The current binding state of the pages. |
106 | * @dma_address: The DMA (bus) addresses of the pages (if TTM_PAGE_FLAG_DMA32) | 106 | * @dma_address: The DMA (bus) addresses of the pages (if TTM_PAGE_FLAG_DMA32) |
107 | * @alloc_list: used by some page allocation backend | ||
107 | * | 108 | * |
108 | * This is a structure holding the pages, caching- and aperture binding | 109 | * This is a structure holding the pages, caching- and aperture binding |
109 | * status for a buffer object that isn't backed by fixed (VRAM / AGP) | 110 | * status for a buffer object that isn't backed by fixed (VRAM / AGP) |
@@ -127,6 +128,7 @@ struct ttm_tt { | |||
127 | tt_unpopulated, | 128 | tt_unpopulated, |
128 | } state; | 129 | } state; |
129 | dma_addr_t *dma_address; | 130 | dma_addr_t *dma_address; |
131 | struct list_head alloc_list; | ||
130 | }; | 132 | }; |
131 | 133 | ||
132 | #define TTM_MEMTYPE_FLAG_FIXED (1 << 0) /* Fixed (on-card) PCI memory */ | 134 | #define TTM_MEMTYPE_FLAG_FIXED (1 << 0) /* Fixed (on-card) PCI memory */ |
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h index 18deeee23494..1e1337e81f31 100644 --- a/include/drm/ttm/ttm_page_alloc.h +++ b/include/drm/ttm/ttm_page_alloc.h | |||
@@ -89,4 +89,40 @@ extern void ttm_pool_unpopulate(struct ttm_tt *ttm); | |||
89 | * Output the state of pools to debugfs file | 89 | * Output the state of pools to debugfs file |
90 | */ | 90 | */ |
91 | extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data); | 91 | extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data); |
92 | |||
93 | |||
94 | #ifdef CONFIG_SWIOTLB | ||
95 | /** | ||
96 | * Initialize pool allocator. | ||
97 | */ | ||
98 | int ttm_dma_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages); | ||
99 | |||
100 | /** | ||
101 | * Free pool allocator. | ||
102 | */ | ||
103 | void ttm_dma_page_alloc_fini(void); | ||
104 | |||
105 | /** | ||
106 | * Output the state of pools to debugfs file | ||
107 | */ | ||
108 | extern int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data); | ||
109 | |||
110 | int ttm_dma_populate(struct ttm_tt *ttm, struct device *dev); | ||
111 | extern void ttm_dma_unpopulate(struct ttm_tt *ttm, struct device *dev); | ||
112 | |||
113 | #else | ||
114 | static inline int ttm_dma_page_alloc_init(struct ttm_mem_global *glob, | ||
115 | unsigned max_pages) | ||
116 | { | ||
117 | return -ENODEV; | ||
118 | } | ||
119 | |||
120 | static inline void ttm_dma_page_alloc_fini(void) { return; } | ||
121 | |||
122 | static inline int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data) | ||
123 | { | ||
124 | return 0; | ||
125 | } | ||
126 | #endif | ||
127 | |||
92 | #endif | 128 | #endif |