sna: Skip the exact match if we can't change tiling

If we can't change tiling on the cached bo and we expect an exact match
(for e.g. scanout) then skip over the unwanted bo.

Reported-by: Adric Blake <promarbler14@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2017-10-06 15:10:25 +01:00
parent 291fdcdc09
commit a33a96a353
1 changed files with 18 additions and 4 deletions

View File

@ -5536,9 +5536,16 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
if (num_pages(bo) < size)
continue;
if (!kgem_set_tiling(kgem, bo, tiling, pitch) &&
!exact)
if (!kgem_set_tiling(kgem, bo, tiling, pitch)) {
if (exact) {
DBG(("tiled and pitch not exact: tiling=%d, (want %d), pitch=%d, need %d\n",
bo->tiling, tiling,
bo->pitch, pitch));
continue;
}
set_gpu_tiling(kgem, bo, tiling, pitch);
}
}
kgem_bo_remove_from_active(kgem, bo);
@ -5712,9 +5719,16 @@ search_active:
if (num_pages(bo) < size)
continue;
if (!kgem_set_tiling(kgem, bo, tiling, pitch) &&
!exact)
if (!kgem_set_tiling(kgem, bo, tiling, pitch)) {
if (exact) {
DBG(("tiled and pitch not exact: tiling=%d, (want %d), pitch=%d, need %d\n",
bo->tiling, tiling,
bo->pitch, pitch));
continue;
}
set_gpu_tiling(kgem, bo, tiling, pitch);
}
}
assert(bo->tiling == tiling);
assert(bo->pitch >= pitch);