sna: Update bo->tiling during search_linear_cache

search_linear_cache() was updated to track the first good match whilst it
continued to search for a better match. This resulted in the first good
bo being modified and a record of those modifications lost, in
particular the change in tiling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-18 18:32:51 +00:00
parent 4b893ab081
commit ab387a89cf
1 changed files with 4 additions and 11 deletions

View File

@ -1874,6 +1874,8 @@ search_linear_cache(struct kgem *kgem, unsigned int size, unsigned flags)
if (gem_set_tiling(kgem->fd, bo->handle,
I915_TILING_NONE, 0) != I915_TILING_NONE)
continue;
bo->tiling = I915_TILING_NONE;
}
if (bo->map) {
@ -1908,7 +1910,7 @@ search_linear_cache(struct kgem *kgem, unsigned int size, unsigned flags)
else
kgem_bo_remove_from_inactive(kgem, bo);
bo->tiling = I915_TILING_NONE;
assert(bo->tiling == I915_TILING_NONE);
bo->pitch = 0;
bo->delta = 0;
DBG((" %s: found handle=%d (size=%d) in linear %s cache\n",
@ -1921,22 +1923,13 @@ search_linear_cache(struct kgem *kgem, unsigned int size, unsigned flags)
}
if (first) {
if (I915_TILING_NONE != first->tiling) {
assert(!use_active);
if (gem_set_tiling(kgem->fd, first->handle,
I915_TILING_NONE, 0) != I915_TILING_NONE)
return NULL;
if (first->map)
kgem_bo_release_map(kgem, first);
}
assert(first->tiling == I915_TILING_NONE);
if (use_active)
kgem_bo_remove_from_active(kgem, first);
else
kgem_bo_remove_from_inactive(kgem, first);
first->tiling = I915_TILING_NONE;
first->pitch = 0;
first->delta = 0;
DBG((" %s: found handle=%d (size=%d) in linear %s cache\n",