summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c5f0ed1)
raw | patch | inline | side by side (parent: c5f0ed1)
author | Chris Wilson <chris@chris-wilson.co.uk> | |
Sun, 11 Dec 2011 17:35:06 +0000 (17:35 +0000) | ||
committer | Chris Wilson <chris@chris-wilson.co.uk> | |
Tue, 13 Dec 2011 10:59:13 +0000 (10:59 +0000) |
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>
handle the failures "gracefully" again.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
intel/intel_bufmgr_gem.c | patch | blob | history |
index bb096de5e99a395894e7ff1de7734cf9a2fc14f6..19441f3b7c875a00617e69ca9dd33626509f4201 100644 (file)
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
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;
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;
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