From c99d44d7f09fc92daf64eee1f6f3300e11e1cf01 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 10 Oct 2013 08:32:51 +0100 Subject: [PATCH] sna: Prevent changes in tiling/pitch of existing framebuffers Reported-by: Daniel Vetter Signed-off-by: Chris Wilson --- src/sna/kgem.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 7da05dde..3dcc6142 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -3935,22 +3935,16 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem, if (size > num_pages(bo) || num_pages(bo) > 2*size) continue; + if (bo->tiling != tiling || bo->pitch != pitch) + /* No tiling/pitch without recreating fb */ + continue; + if (!check_scanout_size(kgem, bo, width, height)) { if (first == NULL) first = bo; continue; } - if (bo->tiling != tiling || - (tiling != I915_TILING_NONE && bo->pitch != pitch)) { - if (!gem_set_tiling(kgem->fd, bo->handle, - tiling, pitch)) - continue; - - bo->tiling = tiling; - bo->pitch = pitch; - } - if (flags & CREATE_INACTIVE && bo->rq) { last = bo; continue;