From d0ae6837d117881d9f1f9cc12d3f1012b6a46103 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 28 Oct 2011 13:13:08 -0700 Subject: 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 Reviewed-by: Chris Wilson --- intel/intel_bufmgr_gem.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'intel') 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) -- cgit v1.2.3