From dbe6d105a60ff28419b549d439bbb29f50b28f08 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Wed, 24 Sep 2014 08:18:32 +0200 Subject: [PATCH] sna: Validate framebuffer tiling before creation In sna_pixmap_alloc_gpu() a different than the default tiling may be picked by a usage hint. Before passing the tiling to kgem_create_2d() fix it up by calling kgem_choose_tiling(). This avoids kgem_surface_size() not being able to find a surface size for the tiling value. Fixes regression from commit a10781b70f222f3997928fa979f6292617f79316 [2.99.913] Author: Chris Wilson Date: Tue Jul 1 15:11:07 2014 +0100 sna: Enforce LinearFramebuffer option Signed-off-by: Egbert Eich --- src/sna/sna_accel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index ab438314..37e1e7cf 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1617,7 +1617,11 @@ static bool sna_pixmap_alloc_gpu(struct sna *sna, /* Use tiling by default, but disable per user request */ if (pixmap->usage_hint == SNA_CREATE_FB && (sna->flags & SNA_LINEAR_FB) == 0) { flags |= CREATE_SCANOUT; - tiling = -I915_TILING_X; + tiling = kgem_choose_tiling(&sna->kgem, + -I915_TILING_X, + pixmap->drawable.width, + pixmap->drawable.height, + pixmap->drawable.bitsPerPixel); } else tiling = sna_pixmap_default_tiling(sna, pixmap);