From 250ab3a38eb6ef18d747717cabd0195ad04a82e0 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 18 Aug 2009 14:25:50 +1000 Subject: nouveau: for the moment, assert if we exceed some reloc limits Nasty, but nicer than silently not writing into the pushbuf --- libdrm/nouveau/nouveau_pushbuf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libdrm') diff --git a/libdrm/nouveau/nouveau_pushbuf.c b/libdrm/nouveau/nouveau_pushbuf.c index 2a242f70..480dbd26 100644 --- a/libdrm/nouveau/nouveau_pushbuf.c +++ b/libdrm/nouveau/nouveau_pushbuf.c @@ -65,8 +65,11 @@ nouveau_pushbuf_emit_reloc(struct nouveau_channel *chan, void *ptr, struct drm_nouveau_gem_pushbuf_bo *pbbo; uint32_t domains = 0; - if (nvpb->nr_relocs >= NOUVEAU_GEM_MAX_RELOCS) + if (nvpb->nr_relocs >= NOUVEAU_GEM_MAX_RELOCS) { + fprintf(stderr, "too many relocs!!\n"); + assert(0); return -ENOMEM; + } if (nouveau_bo(bo)->user && (flags & NOUVEAU_BO_WR)) { fprintf(stderr, "write to user buffer!!\n"); @@ -74,8 +77,11 @@ nouveau_pushbuf_emit_reloc(struct nouveau_channel *chan, void *ptr, } pbbo = nouveau_bo_emit_buffer(chan, bo); - if (!pbbo) + if (!pbbo) { + fprintf(stderr, "buffer emit fail :(\n"); + assert(0); return -ENOMEM; + } if (flags & NOUVEAU_BO_VRAM) domains |= NOUVEAU_GEM_DOMAIN_VRAM; -- cgit v1.2.3