xf86-video-intel: src/sna/kgem.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Mar 11 00:35:21 PDT 2014


 src/sna/kgem.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 78970676e79d462cf99509012db54479ba93c01a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Mar 11 07:33:09 2014 +0000

    sna: Be defensive when applying size restrictions to bo
    
    The assumption that all paths prevalidate the restrictions upon creation
    the bo are false. Some important paths try to force the bo creation in
    order to meet client expectations (e.g. DRI). So we are faced with
    impossible requests which must fail, so make sure we do report those
    failures.
    
    Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289049
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 698e251..8aef623 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4196,7 +4196,9 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
 
 	size = kgem_surface_size(kgem, kgem->has_relaxed_fencing, flags,
 				 width, height, bpp, tiling, &pitch);
-	assert(size && size <= kgem->max_object_size);
+	if (size == 0)
+		return NULL;
+
 	size /= PAGE_SIZE;
 	bucket = cache_bucket(size);
 


More information about the xorg-commit mailing list