diff options
author | Jakob Bornecrantz <[email protected]> | 2008-06-02 17:22:45 +0200 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2008-06-02 17:24:30 +0200 |
commit | 7cc23a9eaebc788ae34f6e06c6227524d08a7693 (patch) | |
tree | 2237f882c05d6780a6af5b9c6476626841bdb4ef /src/gallium/drivers/i915simple/i915_batch.h | |
parent | 4ee14279f3a466093869f1f40819e6c6d5af378d (diff) |
i915: Implement and use the reworked batchbuffer code
Diffstat (limited to 'src/gallium/drivers/i915simple/i915_batch.h')
-rw-r--r-- | src/gallium/drivers/i915simple/i915_batch.h | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/gallium/drivers/i915simple/i915_batch.h b/src/gallium/drivers/i915simple/i915_batch.h index 6c62e84bc38..9379d1fb5de 100644 --- a/src/gallium/drivers/i915simple/i915_batch.h +++ b/src/gallium/drivers/i915simple/i915_batch.h @@ -40,6 +40,7 @@ struct i915_batchbuffer unsigned char *ptr; size_t size; + size_t actual_size; size_t relocs; size_t max_relocs; @@ -50,39 +51,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 +77,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 @@ -135,4 +119,4 @@ i915_batchbuffer_flush( struct i915_batchbuffer *batch, i915->hardware_dirty = ~0; \ } while (0) -#endif +#endif |