summaryrefslogtreecommitdiff
path: root/libdrm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-08-18 14:25:50 +1000
committerBen Skeggs <bskeggs@redhat.com>2009-08-18 15:55:02 +1000
commit250ab3a38eb6ef18d747717cabd0195ad04a82e0 (patch)
tree8b8174b9011bc21b6dcf9f40ff1769828e585b79 /libdrm/nouveau
parent1978f6d8d1215a9501882eb074901bcd0dfc0775 (diff)
nouveau: for the moment, assert if we exceed some reloc limits
Nasty, but nicer than silently not writing into the pushbuf
Diffstat (limited to 'libdrm/nouveau')
-rw-r--r--libdrm/nouveau/nouveau_pushbuf.c10
1 files changed, 8 insertions, 2 deletions
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;