From cc5d68a62f13f0399ab64f2dcae9b26ecf1a891a Mon Sep 17 00:00:00 2001 From: Alban Browaeys Date: Tue, 31 Jan 2012 00:53:36 +0100 Subject: [PATCH 2/2] kgem: set tiling none when size is above max 3d texture size. This setting the tiling to none when size is above max 3d texture size fixes a crash of Xorg when requesting 2049 on gen2. In this case kgem_surface_size returning zero triggers the assert thus the crash. --- src/sna/kgem.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index a45f04d..8049af7 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -2294,6 +2294,15 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem, kgem->has_relaxed_fencing, flags & CREATE_SCANOUT, width, height, bpp, tiling, &pitch); + if (size <= 0) { + tiling = I915_TILING_NONE; + + size = kgem_surface_size(kgem, + kgem->has_relaxed_fencing, + flags & CREATE_SCANOUT, + width, height, bpp, tiling, &pitch); + } + assert(size && size <= kgem->max_object_size); size /= PAGE_SIZE; bucket = cache_bucket(size); -- 1.7.8.3