aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2013-01-21 22:56:04 -0500
committerDave Airlie <airlied@redhat.com>2013-04-11 23:50:46 -0400
commitafe6804c045fbd69a1b75c681107b5d6df9190de (patch)
treed102a41ad9bd8ace8edd9b6c2b380fca3d707499
parent97d103311aab2c652ef37bc3cd157e701057e535 (diff)
ttm: export functions to allow qxl do its own iomapping
qxl wants to use io mapping like i915 gem does, for now just export the symbols so the driver can implement atomic page maps using io mapping. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c13
-rw-r--r--include/drm/ttm/ttm_bo_driver.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 8be35c809c7b..af894584dd90 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -86,6 +86,7 @@ int ttm_mem_io_lock(struct ttm_mem_type_manager *man, bool interruptible)
86 mutex_lock(&man->io_reserve_mutex); 86 mutex_lock(&man->io_reserve_mutex);
87 return 0; 87 return 0;
88} 88}
89EXPORT_SYMBOL(ttm_mem_io_lock);
89 90
90void ttm_mem_io_unlock(struct ttm_mem_type_manager *man) 91void ttm_mem_io_unlock(struct ttm_mem_type_manager *man)
91{ 92{
@@ -94,6 +95,7 @@ void ttm_mem_io_unlock(struct ttm_mem_type_manager *man)
94 95
95 mutex_unlock(&man->io_reserve_mutex); 96 mutex_unlock(&man->io_reserve_mutex);
96} 97}
98EXPORT_SYMBOL(ttm_mem_io_unlock);
97 99
98static int ttm_mem_io_evict(struct ttm_mem_type_manager *man) 100static int ttm_mem_io_evict(struct ttm_mem_type_manager *man)
99{ 101{
@@ -111,8 +113,9 @@ static int ttm_mem_io_evict(struct ttm_mem_type_manager *man)
111 return 0; 113 return 0;
112} 114}
113 115
114static int ttm_mem_io_reserve(struct ttm_bo_device *bdev, 116
115 struct ttm_mem_reg *mem) 117int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
118 struct ttm_mem_reg *mem)
116{ 119{
117 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; 120 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
118 int ret = 0; 121 int ret = 0;
@@ -134,9 +137,10 @@ retry:
134 } 137 }
135 return ret; 138 return ret;
136} 139}
140EXPORT_SYMBOL(ttm_mem_io_reserve);
137 141
138static void ttm_mem_io_free(struct ttm_bo_device *bdev, 142void ttm_mem_io_free(struct ttm_bo_device *bdev,
139 struct ttm_mem_reg *mem) 143 struct ttm_mem_reg *mem)
140{ 144{
141 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; 145 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
142 146
@@ -149,6 +153,7 @@ static void ttm_mem_io_free(struct ttm_bo_device *bdev,
149 bdev->driver->io_mem_free(bdev, mem); 153 bdev->driver->io_mem_free(bdev, mem);
150 154
151} 155}
156EXPORT_SYMBOL(ttm_mem_io_free);
152 157
153int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo) 158int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo)
154{ 159{
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 0fbd046e7c93..9c8dca79808e 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -902,6 +902,10 @@ extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo);
902 * ttm_bo_util.c 902 * ttm_bo_util.c
903 */ 903 */
904 904
905int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
906 struct ttm_mem_reg *mem);
907void ttm_mem_io_free(struct ttm_bo_device *bdev,
908 struct ttm_mem_reg *mem);
905/** 909/**
906 * ttm_bo_move_ttm 910 * ttm_bo_move_ttm
907 * 911 *