diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-10-06 15:10:25 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-10-06 15:10:25 +0100 |
commit | a33a96a3533bef4dd6276d980632cfa5a2069813 (patch) | |
tree | f46d1df78c08e1034b4e7a186bec3550bba5ef90 | |
parent | 291fdcdc09420d8e422617070731eb3da3d55b44 (diff) |
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>
-rw-r--r-- | src/sna/kgem.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index b8338237..122dda71 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -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); |