summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/kgem.c12
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;
}