summaryrefslogtreecommitdiffstats
path: root/include/drm/ttm
diff options
context:
space:
mode:
authorRoger He <Hongbo.He@amd.com>2017-12-21 04:42:50 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-28 09:48:19 -0500
commitd0cef9fa4411eb17dd350cced3336ca58f465ff1 (patch)
tree43aff52b5cf09da35a507c253112e5c77ead0346 /include/drm/ttm
parent9de2fb99ebe059f7777b4c0463eca2946f2bda4d (diff)
drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver (v2)
forward the operation context to ttm_tt_populate as well, and the ultimate goal is swapout enablement for reserved BOs. v2: squash in fix for vboxvideo Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Roger He <Hongbo.He@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.h5
-rw-r--r--include/drm/ttm/ttm_page_alloc.h11
2 files changed, 10 insertions, 6 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 934fecfa7b07..84860ece77eb 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -352,7 +352,8 @@ struct ttm_bo_driver {
352 * Returns: 352 * Returns:
353 * -ENOMEM: Out of memory. 353 * -ENOMEM: Out of memory.
354 */ 354 */
355 int (*ttm_tt_populate)(struct ttm_tt *ttm); 355 int (*ttm_tt_populate)(struct ttm_tt *ttm,
356 struct ttm_operation_ctx *ctx);
356 357
357 /** 358 /**
358 * ttm_tt_unpopulate 359 * ttm_tt_unpopulate
@@ -1077,7 +1078,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev,
1077 struct agp_bridge_data *bridge, 1078 struct agp_bridge_data *bridge,
1078 unsigned long size, uint32_t page_flags, 1079 unsigned long size, uint32_t page_flags,
1079 struct page *dummy_read_page); 1080 struct page *dummy_read_page);
1080int ttm_agp_tt_populate(struct ttm_tt *ttm); 1081int ttm_agp_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx);
1081void ttm_agp_tt_unpopulate(struct ttm_tt *ttm); 1082void ttm_agp_tt_unpopulate(struct ttm_tt *ttm);
1082#endif 1083#endif
1083 1084
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h
index 593811362a91..4d9b019d253c 100644
--- a/include/drm/ttm/ttm_page_alloc.h
+++ b/include/drm/ttm/ttm_page_alloc.h
@@ -47,7 +47,7 @@ void ttm_page_alloc_fini(void);
47 * 47 *
48 * Add backing pages to all of @ttm 48 * Add backing pages to all of @ttm
49 */ 49 */
50int ttm_pool_populate(struct ttm_tt *ttm); 50int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx);
51 51
52/** 52/**
53 * ttm_pool_unpopulate: 53 * ttm_pool_unpopulate:
@@ -61,7 +61,8 @@ void ttm_pool_unpopulate(struct ttm_tt *ttm);
61/** 61/**
62 * Populates and DMA maps pages to fullfil a ttm_dma_populate() request 62 * Populates and DMA maps pages to fullfil a ttm_dma_populate() request
63 */ 63 */
64int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt); 64int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt,
65 struct ttm_operation_ctx *ctx);
65 66
66/** 67/**
67 * Unpopulates and DMA unmaps pages as part of a 68 * Unpopulates and DMA unmaps pages as part of a
@@ -89,7 +90,8 @@ void ttm_dma_page_alloc_fini(void);
89 */ 90 */
90int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data); 91int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data);
91 92
92int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev); 93int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev,
94 struct ttm_operation_ctx *ctx);
93void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev); 95void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev);
94 96
95#else 97#else
@@ -106,7 +108,8 @@ static inline int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
106 return 0; 108 return 0;
107} 109}
108static inline int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, 110static inline int ttm_dma_populate(struct ttm_dma_tt *ttm_dma,
109 struct device *dev) 111 struct device *dev,
112 struct ttm_operation_ctx *ctx)
110{ 113{
111 return -ENOMEM; 114 return -ENOMEM;
112} 115}