summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-11 17:35:06 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-13 10:59:13 +0000
commit015286f03e871ccf49af9f2ceef7f5e04c8d61ca (patch)
treee0251b45e65af19b6f7d0b9b640840cc04e7dff5
parentc5f0ed1d296f11367febd0e1b7dce8789308bf35 (diff)
intel: Remove the fresh assertions used to debug the vma cacheing
Hopefully all the bugs in the callers have been found, so time to handle the failures "gracefully" again. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--intel/intel_bufmgr_gem.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index bb096de5..19441f3b 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1098,8 +1098,8 @@ static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable)
if (!bo_gem->mem_virtual) {
struct drm_i915_gem_mmap mmap_arg;
- DBG("bo_map: %d (%s)\n", bo_gem->gem_handle, bo_gem->name);
- assert(bo_gem->map_count == 1);
+ DBG("bo_map: %d (%s), map_count=%d\n",
+ bo_gem->gem_handle, bo_gem->name, bo_gem->map_count);
memset(&mmap_arg, 0, sizeof(mmap_arg));
mmap_arg.handle = bo_gem->gem_handle;
@@ -1163,9 +1163,8 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
if (bo_gem->gtt_virtual == NULL) {
struct drm_i915_gem_mmap_gtt mmap_arg;
- DBG("bo_map_gtt: mmap %d (%s)\n", bo_gem->gem_handle,
- bo_gem->name);
- assert(bo_gem->map_count == 1);
+ DBG("bo_map_gtt: mmap %d (%s), map_count=%d\n",
+ bo_gem->gem_handle, bo_gem->name, bo_gem->map_count);
memset(&mmap_arg, 0, sizeof(mmap_arg));
mmap_arg.handle = bo_gem->gem_handle;
@@ -1239,7 +1238,14 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo)
pthread_mutex_lock(&bufmgr_gem->lock);
- assert(bo_gem->map_count > 0);
+ if (bo_gem->map_count <= 0) {
+ DBG("attempted to unmap an unmapped bo\n");
+ pthread_mutex_unlock(&bufmgr_gem->lock);
+ /* Preserve the old behaviour of just treating this as a
+ * no-op rather than reporting the error.
+ */
+ return 0;
+ }
if (bo_gem->mapped_cpu_write) {
/* Cause a flush to happen if the buffer's pinned for