summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/savage/savageioctl.h
diff options
context:
space:
mode:
authorFelix Kuehling <[email protected]>2004-03-24 16:15:28 +0000
committerFelix Kuehling <[email protected]>2004-03-24 16:15:28 +0000
commit67d03433772867abc23272c9cf323b15285dde47 (patch)
tree0b4c5df93786cb097da5eed60e39141e530bfd71 /src/mesa/drivers/dri/savage/savageioctl.h
parentfda7215db36ddee1900cab38b1435f1d73ac7858 (diff)
Buffer vertices and emit them in batches. Still using conventional drawing
commands, no vertex DMA.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savageioctl.h')
-rw-r--r--src/mesa/drivers/dri/savage/savageioctl.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/savage/savageioctl.h b/src/mesa/drivers/dri/savage/savageioctl.h
index 94b02e33197..92f42950e13 100644
--- a/src/mesa/drivers/dri/savage/savageioctl.h
+++ b/src/mesa/drivers/dri/savage/savageioctl.h
@@ -68,5 +68,32 @@ GLuint savageGetPhyAddress(savageContextPtr imesa,void * pointer);
int savageFreeDMABuffer(savageContextPtr, drm_savage_alloc_cont_mem_t*);
#endif
-#define FLUSH_BATCH(imesa) savageDMAFlush(imesa)
+#define FLUSH_BATCH(imesa) do { \
+ if (imesa->vertex_dma_buffer) savageFlushVertices(imesa); \
+} while (0)
+
+static __inline
+uint32_t *savageAllocDmaLow( savageContextPtr imesa, GLuint bytes )
+{
+ uint32_t *head;
+
+ if (!imesa->vertex_dma_buffer) {
+ LOCK_HARDWARE(imesa);
+ imesa->vertex_dma_buffer = savageFakeGetBuffer (imesa);
+ UNLOCK_HARDWARE(imesa);
+ } else if (imesa->vertex_dma_buffer->used + bytes >
+ imesa->vertex_dma_buffer->total) {
+ LOCK_HARDWARE(imesa);
+ savageFlushVerticesLocked( imesa );
+ imesa->vertex_dma_buffer = savageFakeGetBuffer (imesa);
+ UNLOCK_HARDWARE(imesa);
+ }
+
+ head = (uint32_t *)((uint8_t *)imesa->vertex_dma_buffer->address +
+ imesa->vertex_dma_buffer->used);
+
+ imesa->vertex_dma_buffer->used += bytes;
+ return head;
+}
+
#endif