diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-13 15:07:13 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-13 15:07:13 +0100 |
commit | b478420740d05fa87ddbd92042b1f7f2d002f73e (patch) | |
tree | b9c4731ef5ea849ab62ade2cd77767c2d006cae8 | |
parent | 90e2740e7e459c56205fa65bab1ae3dbfd5d3945 (diff) |
sna: Limit the buffer reuse for mappable uploads to only those with mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index f0c971ea..2d096667 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -2156,6 +2156,9 @@ search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags) //assert(!kgem_busy(kgem, bo->handle)); return bo; } + + if (flags & CREATE_EXACT) + return NULL; } cache = use_active ? active(kgem, num_pages, I915_TILING_NONE) : inactive(kgem, num_pages); @@ -3683,7 +3686,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem, * devices like gen2 or with relatively slow gpu like i3. */ old = search_linear_cache(kgem, alloc, - CREATE_INACTIVE | CREATE_GTT_MAP); + CREATE_EXACT | CREATE_INACTIVE | CREATE_GTT_MAP); #if HAVE_I915_GEM_BUFFER_INFO if (old) { struct drm_i915_gem_buffer_info info; @@ -3705,7 +3708,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem, #endif if (old == NULL) old = search_linear_cache(kgem, NUM_PAGES(size), - CREATE_INACTIVE | CREATE_GTT_MAP); + CREATE_EXACT | CREATE_INACTIVE | CREATE_GTT_MAP); if (old) { DBG(("%s: reusing handle=%d for buffer\n", __FUNCTION__, old->handle)); |