diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-14 09:27:49 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-14 09:30:02 +0000 |
commit | 0c405595fb8739b22569f81f400100b5dfa472cf (patch) | |
tree | cf28edd43654feef76f9c2867fa54cb4036b1a68 | |
parent | 1baff9f8cf79fdb4a5649eabcc66cf73487c873e (diff) |
sna: Downgrade tiling in order to fit within fence constraints
Fixes a later assert that the fenced size is valid for kgem_create_2d()
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42888
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index ef712e2d..2d6760f3 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1332,6 +1332,8 @@ struct kgem_bo *kgem_create_linear(struct kgem *kgem, int size) int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int bpp) { + uint32_t pitch; + if (DBG_NO_TILING) return I915_TILING_NONE; @@ -1401,6 +1403,16 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int } } + /* And finally check that we can fence the whole object */ + if (tiling && + kgem_surface_size(kgem, false, + width, height, bpp, tiling, + &pitch) >= kgem->max_object_size) { + DBG(("%s: too large (%dx%d) to be fenced, discarding tiling\n", + __FUNCTION__, width, height)); + tiling = I915_TILING_NONE; + } + DBG(("%s: %dx%d -> %d\n", __FUNCTION__, width, height, tiling)); return tiling; } |