summaryrefslogtreecommitdiff
path: root/intel
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-10-28 13:13:08 -0700
committerEric Anholt <eric@anholt.net>2011-10-29 12:04:09 -0700
commitd0ae6837d117881d9f1f9cc12d3f1012b6a46103 (patch)
tree77c1dd3a829948c906bf807437fe30a1202b117e /intel
parent4cb01eeccfa6a5169edea07c339117cac1f7b261 (diff)
intel: Share the implementation of BO unmap between CPU and GTT mappings.
Before this, consumers of the libdrm API that might map a buffer either way had to track which way was chosen at map time to call the appropriate unmap. This relaxes that requirement by making drm_intel_bo_unmap() always appropriate. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'intel')
-rw-r--r--intel/intel_bufmgr_gem.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index cebf732e..dd58c0c4 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1134,21 +1134,6 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
return 0;
}
-int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo)
-{
- drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
- int ret = 0;
-
- if (bo == NULL)
- return 0;
-
- pthread_mutex_lock(&bufmgr_gem->lock);
- bo->virtual = NULL;
- pthread_mutex_unlock(&bufmgr_gem->lock);
-
- return ret;
-}
-
static int drm_intel_gem_bo_unmap(drm_intel_bo *bo)
{
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
@@ -1182,6 +1167,11 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo)
return ret;
}
+int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo)
+{
+ return drm_intel_gem_bo_unmap(bo);
+}
+
static int
drm_intel_gem_bo_subdata(drm_intel_bo *bo, unsigned long offset,
unsigned long size, const void *data)