OSDN Git Service

i915g: Check relocs as well
authorJakob Bornecrantz <wallbraker@gmail.com>
Sat, 8 Aug 2009 15:19:43 +0000 (17:19 +0200)
committerJakob Bornecrantz <wallbraker@gmail.com>
Wed, 12 Aug 2009 01:58:37 +0000 (03:58 +0200)
src/gallium/drivers/i915simple/i915_batch.h

index a433cf0..c6e68ea 100644 (file)
@@ -50,8 +50,8 @@ i915_batchbuffer_check( struct i915_batchbuffer *batch,
                        size_t dwords,
                        size_t relocs )
 {
-   /** TODO JB: Check relocs */
-   return dwords * 4 <= batch->size - (batch->ptr - batch->map);
+   return dwords * 4 <= batch->size - (batch->ptr - batch->map) &&
+          relocs <= (batch->max_relocs - batch->relocs);
 }
 
 static INLINE size_t