summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/savage/savageioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/savage/savageioctl.c')
-rw-r--r--src/mesa/drivers/dri/savage/savageioctl.c43
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 )