diff options
author | Felix Kuehling <[email protected]> | 2005-01-21 01:39:09 +0000 |
---|---|---|
committer | Felix Kuehling <[email protected]> | 2005-01-21 01:39:09 +0000 |
commit | fa15f6c840bcab5a37e42bca4b80668024352c98 (patch) | |
tree | f126b062ea8e9cfb4ef10daec083c7df895dab82 /src/mesa/drivers/dri/savage/savageioctl.c | |
parent | 677d1d07c41050e7474f44c592641b14ffd73e8c (diff) |
Small cleanup:
* Remove some unused (mostly empty) functions
* Added context parameter to WAIT_IDLE_EMPTY[_LOCKED] for consistency
* Added debug messages to WAIT_IDLE_EMPTY[_LOCKED]
* Don't flush empty command buffers
Diffstat (limited to 'src/mesa/drivers/dri/savage/savageioctl.c')
-rw-r--r-- | src/mesa/drivers/dri/savage/savageioctl.c | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c index 27747c3cd89..d914aad38e0 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.c +++ b/src/mesa/drivers/dri/savage/savageioctl.c @@ -455,30 +455,6 @@ void savageSwapBuffers( __DRIdrawablePrivate *dPriv ) #endif } -/* This waits for *everybody* to finish rendering -- overkill. - */ -void savageDmaFinish( savageContextPtr imesa ) -{ - savageWaitEvent( imesa, savageEmitEventLocked( imesa, SAVAGE_WAIT_3D ) ); -} - - -void savageRegetLockQuiescent( savageContextPtr imesa ) -{ - - -} - -void savageWaitAgeLocked( savageContextPtr imesa, int age ) -{ -} - - -void savageWaitAge( savageContextPtr imesa, int age ) -{ -} - - unsigned int savageEmitEventLocked( savageContextPtr imesa, unsigned int flags ) { drm_savage_event_emit_t event; @@ -559,9 +535,15 @@ void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard ) drm_savage_cmd_header_t *start; int ret; + if (!imesa->dmaVtxBuf.total) + discard = GL_FALSE; + /* complete indexed drawing commands */ savageFlushElts(imesa); + if (imesa->cmdBuf.write == imesa->cmdBuf.start && !discard) + return; + /* If we lost the context we must restore the initial state (at * the start of the command buffer). */ if (imesa->lostContext) { @@ -570,9 +552,6 @@ void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard ) } else start = imesa->cmdBuf.start; - if (!imesa->dmaVtxBuf.total) - discard = GL_FALSE; - if ((SAVAGE_DEBUG & DEBUG_DMA) && discard) fprintf (stderr, "Discarding DMA buffer, used=%u\n", imesa->dmaVtxBuf.used); @@ -647,9 +626,7 @@ static void savageDDFlush( GLcontext *ctx ) fprintf (stderr, "%s\n", __FUNCTION__); savageContextPtr imesa = SAVAGE_CONTEXT(ctx); savageFlushVertices (imesa); - LOCK_HARDWARE(imesa); - savageFlushCmdBufLocked(imesa, GL_FALSE); - UNLOCK_HARDWARE(imesa); + savageFlushCmdBuf(imesa, GL_FALSE); } static void savageDDFinish( GLcontext *ctx ) @@ -658,10 +635,8 @@ static void savageDDFinish( GLcontext *ctx ) fprintf (stderr, "%s\n", __FUNCTION__); savageContextPtr imesa = SAVAGE_CONTEXT(ctx); savageFlushVertices (imesa); - LOCK_HARDWARE(imesa); - savageFlushCmdBufLocked(imesa, GL_FALSE); - savageDmaFinish (imesa); - UNLOCK_HARDWARE(imesa); + savageFlushCmdBuf(imesa, GL_FALSE); + WAIT_IDLE_EMPTY(imesa); } void savageDDInitIoctlFuncs( GLcontext *ctx ) |