sna: Prevent changes in tiling/pitch of existing framebuffers

Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-10-10 08:32:51 +01:00
parent 97d809c26b
commit c99d44d7f0
1 changed files with 4 additions and 10 deletions

View File

@ -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;