summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-18 18:32:51 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-18 18:49:42 +0000
commitab387a89cf64ace9f7d7fa52b7743e78b625f47d (patch)
treef7f1d9c41746acfbba6b7b4d6956f27aa6634ae7
parent4b893ab0812452238305b29b1beea224219f641d (diff)
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>
-rw-r--r--src/sna/kgem.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index f8242306..0fb244f2 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -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",