summaryrefslogtreecommitdiff
path: root/intel
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-04-01 17:15:39 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-06 22:56:41 +0100
commit7ca558494dd3f68f29bb6ca981de9b8f49620b60 (patch)
tree4542df07786e738318080579d8c97c3b17856bb3 /intel
parent6293152eb065016a2e5e4fcd047c2db5c2fb0f36 (diff)
intel: We don't need to take the bufmgr lock whilst mapping.
Diffstat (limited to 'intel')
-rw-r--r--intel/intel_bufmgr_gem.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index a2cf6e6a..8fa5631d 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -927,8 +927,6 @@ static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable)
struct drm_i915_gem_set_domain set_domain;
int ret;
- pthread_mutex_lock(&bufmgr_gem->lock);
-
/* Allow recursive mapping. Mesa may recursively map buffers with
* nested display loops.
*/
@@ -952,7 +950,6 @@ static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable)
"%s:%d: Error mapping buffer %d (%s): %s .\n",
__FILE__, __LINE__, bo_gem->gem_handle,
bo_gem->name, strerror(errno));
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}
bo_gem->mem_virtual = (void *)(uintptr_t) mmap_arg.addr_ptr;
@@ -977,12 +974,9 @@ static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable)
fprintf(stderr, "%s:%d: Error setting to CPU domain %d: %s\n",
__FILE__, __LINE__, bo_gem->gem_handle,
strerror(errno));
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}
- pthread_mutex_unlock(&bufmgr_gem->lock);
-
return 0;
}
@@ -993,8 +987,6 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
struct drm_i915_gem_set_domain set_domain;
int ret;
- pthread_mutex_lock(&bufmgr_gem->lock);
-
/* Get a mapping of the buffer if we haven't before. */
if (bo_gem->gtt_virtual == NULL) {
struct drm_i915_gem_mmap_gtt mmap_arg;
@@ -1018,7 +1010,6 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
__FILE__, __LINE__,
bo_gem->gem_handle, bo_gem->name,
strerror(errno));
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}
@@ -1034,7 +1025,6 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
__FILE__, __LINE__,
bo_gem->gem_handle, bo_gem->name,
strerror(errno));
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}
}
@@ -1061,8 +1051,6 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
strerror(errno));
}
- pthread_mutex_unlock(&bufmgr_gem->lock);
-
return ret;
}
@@ -1077,9 +1065,7 @@ int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo)
assert(bo_gem->gtt_virtual != NULL);
- pthread_mutex_lock(&bufmgr_gem->lock);
bo->virtual = NULL;
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}
@@ -1096,8 +1082,6 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo)
assert(bo_gem->mem_virtual != NULL);
- pthread_mutex_lock(&bufmgr_gem->lock);
-
/* Cause a flush to happen if the buffer's pinned for scanout, so the
* results show up in a timely manner.
*/
@@ -1110,7 +1094,6 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo)
ret = ret == -1 ? -errno : 0;
bo->virtual = NULL;
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}