diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-15 19:04:01 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-15 19:56:35 +0000 |
commit | 8652bf7a196f53842db70f5c70aded31b470b0ab (patch) | |
tree | 14487c946c63a7af75ec088ed75786fef0f89621 /src | |
parent | cc4b616990fa71e96d38512d8cdb4c3e2abb21c0 (diff) |
sna: Don't track an unmatching tiled bo when searching the linear cache
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/kgem.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 31039dee..0075bedb 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1848,6 +1848,15 @@ search_linear_cache(struct kgem *kgem, unsigned int size, unsigned flags) continue; } + if (I915_TILING_NONE != bo->tiling) { + if (use_active) + continue; + + if (gem_set_tiling(kgem->fd, bo->handle, + I915_TILING_NONE, 0) != I915_TILING_NONE) + continue; + } + if (bo->map) { if (flags & (CREATE_CPU_MAP | CREATE_GTT_MAP)) { int for_cpu = !!(flags & CREATE_CPU_MAP); @@ -1875,15 +1884,6 @@ search_linear_cache(struct kgem *kgem, unsigned int size, unsigned flags) } } - if (I915_TILING_NONE != bo->tiling) { - if (use_active) - continue; - - if (gem_set_tiling(kgem->fd, bo->handle, - I915_TILING_NONE, 0) != I915_TILING_NONE) - continue; - } - if (use_active) kgem_bo_remove_from_active(kgem, bo); else @@ -1903,9 +1903,7 @@ search_linear_cache(struct kgem *kgem, unsigned int size, unsigned flags) if (first) { if (I915_TILING_NONE != first->tiling) { - if (use_active) - return NULL; - + assert(!use_active); if (gem_set_tiling(kgem->fd, first->handle, I915_TILING_NONE, 0) != I915_TILING_NONE) return NULL; |