summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Widawsky <benjamin.widawsky@intel.com>2013-11-06 19:09:11 -0800
committerBen Widawsky <benjamin.widawsky@intel.com>2013-12-06 10:55:35 -0800
commit0f48a19a4442cd5d59aba591c65949e8a1bd4817 (patch)
treed214229007c1b30922c651dc607b3afc87bfb8a6
parenta4fdc3ca637e2ac1eef510a0a289a016e2c571b5 (diff)
drm/i915: Do not allow buffers at offset 0
This is primarily a band aid for an unexplainable error in gem_reloc_vs_gpu/forked-faulting-reloc-thrashing. Essentially as soon as a relocated buffer (which had a non-zero presumed offset) moved to offset 0, something goes bad. Since I have been unable to solve this, and potentially this is a good thing to do anyway, since many things can accidentally write to offset 0, why not? Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e6d7b4c3ab5b..a9cabff5aa37 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3280,9 +3280,11 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
WARN_ON(!list_is_singular(&obj->vma_list));
search_free:
+ /* FIXME: Some tests are failing when they receive a reloc of 0. To
+ * prevent this, we simply don't allow the 0th offset. */
ret = drm_mm_insert_node_in_range_generic(&vm->mm, &vma->node,
size, alignment,
- obj->cache_level, 0, gtt_max,
+ obj->cache_level, 1, gtt_max,
DRM_MM_SEARCH_DEFAULT);
if (ret) {
ret = i915_gem_evict_something(dev, vm, size, alignment,