diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-11 07:33:09 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-11 07:33:09 +0000 |
commit | 78970676e79d462cf99509012db54479ba93c01a (patch) | |
tree | ed18515d08f4002718ac8459fef708eee568954c /src/sna/kgem.c | |
parent | d10a5abcbd7c751adc08e24d9f4bdc33596b6f12 (diff) |
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@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r-- | src/sna/kgem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 698e251d..8aef6233 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); |