Dave Airlie 5cf9b33
From b538d2921b8aaaa1d7abf1bf0ba3ab9330b0b0c8 Mon Sep 17 00:00:00 2001
Dave Airlie 5cf9b33
From: Dave Airlie <airlied@gmail.com>
Dave Airlie 5cf9b33
Date: Tue, 22 Jan 2013 13:56:04 +1000
Dave Airlie 5cf9b33
Subject: [PATCH 1/2] ttm: export functions to allow qxl do its own iomapping
Dave Airlie 5cf9b33
Dave Airlie 5cf9b33
qxl wants to use io mapping like i915 gem does, for now
Dave Airlie 5cf9b33
just export the symbols so the driver can implement atomic
Dave Airlie 5cf9b33
page maps using io mapping.
Dave Airlie 5cf9b33
Dave Airlie 5cf9b33
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie 5cf9b33
---
Dave Airlie 5cf9b33
 drivers/gpu/drm/ttm/ttm_bo_util.c | 13 +++++++++----
Dave Airlie 5cf9b33
 include/drm/ttm/ttm_bo_driver.h   |  4 ++++
Dave Airlie 5cf9b33
 2 files changed, 13 insertions(+), 4 deletions(-)
Dave Airlie 5cf9b33
Dave Airlie 5cf9b33
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
Dave Airlie 5cf9b33
index 44420fc..aaf6f47 100644
Dave Airlie 5cf9b33
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
Dave Airlie 5cf9b33
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
Dave Airlie 5cf9b33
@@ -86,6 +86,7 @@ int ttm_mem_io_lock(struct ttm_mem_type_manager *man, bool interruptible)
Dave Airlie 5cf9b33
 	mutex_lock(&man->io_reserve_mutex);
Dave Airlie 5cf9b33
 	return 0;
Dave Airlie 5cf9b33
 }
Dave Airlie 5cf9b33
+EXPORT_SYMBOL(ttm_mem_io_lock);
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
 void ttm_mem_io_unlock(struct ttm_mem_type_manager *man)
Dave Airlie 5cf9b33
 {
Dave Airlie 5cf9b33
@@ -94,6 +95,7 @@ void ttm_mem_io_unlock(struct ttm_mem_type_manager *man)
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
 	mutex_unlock(&man->io_reserve_mutex);
Dave Airlie 5cf9b33
 }
Dave Airlie 5cf9b33
+EXPORT_SYMBOL(ttm_mem_io_unlock);
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
 static int ttm_mem_io_evict(struct ttm_mem_type_manager *man)
Dave Airlie 5cf9b33
 {
Dave Airlie 5cf9b33
@@ -111,8 +113,9 @@ static int ttm_mem_io_evict(struct ttm_mem_type_manager *man)
Dave Airlie 5cf9b33
 	return 0;
Dave Airlie 5cf9b33
 }
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
-static int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
Dave Airlie 5cf9b33
-			      struct ttm_mem_reg *mem)
Dave Airlie 5cf9b33
+
Dave Airlie 5cf9b33
+int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
Dave Airlie 5cf9b33
+		       struct ttm_mem_reg *mem)
Dave Airlie 5cf9b33
 {
Dave Airlie 5cf9b33
 	struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
Dave Airlie 5cf9b33
 	int ret = 0;
Dave Airlie 5cf9b33
@@ -134,9 +137,10 @@ retry:
Dave Airlie 5cf9b33
 	}
Dave Airlie 5cf9b33
 	return ret;
Dave Airlie 5cf9b33
 }
Dave Airlie 5cf9b33
+EXPORT_SYMBOL(ttm_mem_io_reserve);
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
-static void ttm_mem_io_free(struct ttm_bo_device *bdev,
Dave Airlie 5cf9b33
-			    struct ttm_mem_reg *mem)
Dave Airlie 5cf9b33
+void ttm_mem_io_free(struct ttm_bo_device *bdev,
Dave Airlie 5cf9b33
+		     struct ttm_mem_reg *mem)
Dave Airlie 5cf9b33
 {
Dave Airlie 5cf9b33
 	struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
@@ -149,6 +153,7 @@ static void ttm_mem_io_free(struct ttm_bo_device *bdev,
Dave Airlie 5cf9b33
 		bdev->driver->io_mem_free(bdev, mem);
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
 }
Dave Airlie 5cf9b33
+EXPORT_SYMBOL(ttm_mem_io_free);
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
 int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo)
Dave Airlie 5cf9b33
 {
Dave Airlie 5cf9b33
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
Dave Airlie 5cf9b33
index 0fbd046..9c8dca7 100644
Dave Airlie 5cf9b33
--- a/include/drm/ttm/ttm_bo_driver.h
Dave Airlie 5cf9b33
+++ b/include/drm/ttm/ttm_bo_driver.h
Dave Airlie 5cf9b33
@@ -902,6 +902,10 @@ extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo);
Dave Airlie 5cf9b33
  * ttm_bo_util.c
Dave Airlie 5cf9b33
  */
Dave Airlie 5cf9b33
 
Dave Airlie 5cf9b33
+int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
Dave Airlie 5cf9b33
+		       struct ttm_mem_reg *mem);
Dave Airlie 5cf9b33
+void ttm_mem_io_free(struct ttm_bo_device *bdev,
Dave Airlie 5cf9b33
+		     struct ttm_mem_reg *mem);
Dave Airlie 5cf9b33
 /**
Dave Airlie 5cf9b33
  * ttm_bo_move_ttm
Dave Airlie 5cf9b33
  *
Dave Airlie 5cf9b33
-- 
Dave Airlie 5cf9b33
1.8.1.4
Dave Airlie 5cf9b33