summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-14 21:31:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-14 21:31:32 +0100
commite59ea828f521e2f1963152a9211c36b8091bf655 (patch)
treed880da6a17b3b21021da819d069cf7676ac76dae /src
parent9b8f7db5c93b4b687670ad9340fec6a857cd065e (diff)
sna: DBG log all bo allocation failure paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/kgem.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 2b146ca9..efce0266 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4478,8 +4478,10 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
size = kgem_surface_size(kgem, kgem->has_relaxed_fencing, flags,
width, height, bpp, tiling, &pitch);
- if (size == 0)
+ if (size == 0) {
+ DBG(("%s: invalid surface size (too large?)\n", __FUNCTION__));
return NULL;
+ }
size /= PAGE_SIZE;
bucket = cache_bucket(size);
@@ -5058,17 +5060,22 @@ no_retire:
}
create:
- if (flags & CREATE_CACHED)
+ if (flags & CREATE_CACHED) {
+ DBG(("%s: no cached bo found, requested not to create a new bo\n", __FUNCTION__));
return NULL;
+ }
if (bucket >= NUM_CACHE_BUCKETS)
size = ALIGN(size, 1024);
handle = gem_create(kgem->fd, size);
- if (handle == 0)
+ if (handle == 0) {
+ DBG(("%s: kernel allocation (gem_create) failure\n", __FUNCTION__));
return NULL;
+ }
bo = __kgem_bo_alloc(handle, size);
if (!bo) {
+ DBG(("%s: malloc failed\n", __FUNCTION__));
gem_close(kgem->fd, handle);
return NULL;
}
@@ -5082,6 +5089,7 @@ create:
__kgem_bo_make_scanout(kgem, bo, width, height);
} else {
if (flags & CREATE_EXACT) {
+ DBG(("%s: failed to set exact tiling (gem_set_tiling)\n", __FUNCTION__));
gem_close(kgem->fd, handle);
free(bo);
return NULL;