sna: Skip a tiled bo when searching the cache for a linear mmap

If we change tiling on a bo, we are effectively discarding the cached
mmap so it is preferable to look for another.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-02-25 00:43:30 +00:00
parent 85e48d2e5e
commit b1b4db8942
1 changed files with 7 additions and 2 deletions

View File

@ -1982,7 +1982,9 @@ search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
if (num_pages > num_pages(bo))
continue;
if (use_active && bo->tiling != I915_TILING_NONE)
if (use_active &&
kgem->gen <= 40 &&
bo->tiling != I915_TILING_NONE)
continue;
if (bo->purged && !kgem_bo_clear_purgeable(kgem, bo)) {
@ -1991,7 +1993,10 @@ search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
}
if (I915_TILING_NONE != bo->tiling) {
if (use_active)
if (flags & (CREATE_CPU_MAP | CREATE_GTT_MAP))
continue;
if (first)
continue;
if (gem_set_tiling(kgem->fd, bo->handle,