diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-25 00:43:30 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-25 00:43:30 +0000 |
commit | b1b4db8942e69d47aabfad3751165dc2252fa448 (patch) | |
tree | c113328b7e2d38673cced8751afe032870702f94 | |
parent | 85e48d2e5eb029d8c17714cb5e7db39ea06a2455 (diff) |
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>
-rw-r--r-- | src/sna/kgem.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 007dc045..d73fc304 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -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, |