diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2005-01-05 13:51:38 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2005-01-05 13:51:38 +0000 |
commit | 30f64862766c573505fb7cd03a1c10bbf584c183 (patch) | |
tree | 93c6d28e26211fa951f9fce093cc51bfdf443123 /src/mesa/drivers/dri/unichrome/via_ioctl.h | |
parent | 830e046972842482283f8d0eade8544780ae455f (diff) |
make alloc-dma functions inline, rearrange some debug
Diffstat (limited to 'src/mesa/drivers/dri/unichrome/via_ioctl.h')
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_ioctl.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.h b/src/mesa/drivers/dri/unichrome/via_ioctl.h index b5dd9a8e5c..5facad50f7 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.h +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.h @@ -49,9 +49,36 @@ void viaCheckDma(viaContextPtr vmesa, GLuint bytes); } while (0) -GLuint *viaExtendPrimitive(viaContextPtr vmesa, int bytes); -GLuint *viaAllocDmaFunc(viaContextPtr vmesa, int bytes, const char *func, int line); -#define viaAllocDma( v, b ) viaAllocDmaFunc(v, b, __FUNCTION__, __LINE__) +void viaWrapPrimitive( viaContextPtr vmesa ); + +static __inline__ GLuint *viaAllocDma(viaContextPtr vmesa, int bytes) +{ + if (vmesa->dmaLow + bytes > VIA_DMA_HIGHWATER) { + viaFlushDma(vmesa); + } + + { + GLuint *start = (GLuint *)(vmesa->dma + vmesa->dmaLow); + vmesa->dmaLow += bytes; + return start; + } +} + + +static GLuint __inline__ *viaExtendPrimitive(viaContextPtr vmesa, int bytes) +{ + if (vmesa->dmaLow + bytes > VIA_DMA_HIGHWATER) { + viaWrapPrimitive(vmesa); + } + + { + GLuint *start = (GLuint *)(vmesa->dma + vmesa->dmaLow); + vmesa->dmaLow += bytes; + return start; + } +} + + #define RING_VARS GLuint *_vb = 0, _nr, _x; |