i915: Use the new draw vbuf interface
[mesa.git] / src / gallium / drivers / i915simple / i915_batch.h
index 6c62e84bc38608b58c3cdbf056af8e43f55afa24..a433cf054de7331102a69a1fe8b77f3f1406d528 100644 (file)
@@ -29,7 +29,6 @@
 #define I915_BATCH_H
 
 #include "i915_winsys.h"
-#include "i915_debug.h"
 
 struct i915_batchbuffer
 {
@@ -40,6 +39,7 @@ struct i915_batchbuffer
    unsigned char *ptr;
 
    size_t size;
+   size_t actual_size;
 
    size_t relocs;
    size_t max_relocs;
@@ -50,39 +50,25 @@ i915_batchbuffer_check( struct i915_batchbuffer *batch,
                        size_t dwords,
                        size_t relocs )
 {
-#if 0 /* To be used */
    /** TODO JB: Check relocs */
    return dwords * 4 <= batch->size - (batch->ptr - batch->map);
-#else
-   if (batch->winsys->batch_start( batch->winsys, dwords, relocs ))
-      return 1;
-   return 0;
-#endif
 }
 
 static INLINE size_t
 i915_batchbuffer_space( struct i915_batchbuffer *batch )
 {
-#if 0 /* To be used */
    return batch->size - (batch->ptr - batch->map);
-#else
-   return 0;
-#endif
 }
 
 static INLINE void
 i915_batchbuffer_dword( struct i915_batchbuffer *batch,
                        unsigned dword )
 {
-#if 0 /* To be used */
    if (i915_batchbuffer_space(batch) < 4)
       return;
 
    *(unsigned *)batch->ptr = dword;
    batch->ptr += 4;
-#else
-   batch->winsys->batch_dword( batch->winsys, dword );
-#endif
 }
 
 static INLINE void
@@ -90,14 +76,11 @@ i915_batchbuffer_write( struct i915_batchbuffer *batch,
                        void *data,
                        size_t size )
 {
-#if 0 /* To be used */
    if (i915_batchbuffer_space(batch) < size)
       return;
 
    memcpy(data, batch->ptr, size);
    batch->ptr += size;
-#else
-#endif
 }
 
 static INLINE void
@@ -116,8 +99,6 @@ i915_batchbuffer_flush( struct i915_batchbuffer *batch,
    batch->winsys->batch_flush( batch->winsys, fence );
 }
 
-#define BATCH_LOCALS
-
 #define BEGIN_BATCH( dwords, relocs ) \
    (i915_batchbuffer_check( i915->batch, dwords, relocs ))
 
@@ -127,12 +108,9 @@ i915_batchbuffer_flush( struct i915_batchbuffer *batch,
 #define OUT_RELOC( buf, flags, delta ) \
    i915_batchbuffer_reloc( i915->batch, buf, flags, delta )
 
-#define ADVANCE_BATCH()
-
-#define FLUSH_BATCH(fence) do {                        \
-   if (0) i915_dump_batchbuffer( i915 );               \
+#define FLUSH_BATCH(fence) do {                                \
    i915->winsys->batch_flush( i915->winsys, fence );   \
    i915->hardware_dirty = ~0;                          \
 } while (0)
 
-#endif 
+#endif