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.
*/
"%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;
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;
}
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;
__FILE__, __LINE__,
bo_gem->gem_handle, bo_gem->name,
strerror(errno));
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}
__FILE__, __LINE__,
bo_gem->gem_handle, bo_gem->name,
strerror(errno));
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}
}
strerror(errno));
}
- pthread_mutex_unlock(&bufmgr_gem->lock);
-
return ret;
}
assert(bo_gem->gtt_virtual != NULL);
- pthread_mutex_lock(&bufmgr_gem->lock);
bo->virtual = NULL;
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}
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.
*/
ret = ret == -1 ? -errno : 0;
bo->virtual = NULL;
- pthread_mutex_unlock(&bufmgr_gem->lock);
return ret;
}