summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r600/r700_ioctl.c
diff options
context:
space:
mode:
authorRichard Li <RichardZ.Li@amd.com>2009-05-08 19:23:45 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-05-08 19:23:45 -0400
commite2dcebd2e6b2af6269a5ece6d6ced73ec8bb4a47 (patch)
treed8aa42c0ccdf36c283f548dec293d26ee4af601a /src/mesa/drivers/dri/r600/r700_ioctl.c
parent604dd37f66d9c0e83cb3a9012ff1fc35f38b3e37 (diff)
R6xx/R7xx: WIP r6xx-rewrite code
Diffstat (limited to 'src/mesa/drivers/dri/r600/r700_ioctl.c')
-rw-r--r--src/mesa/drivers/dri/r600/r700_ioctl.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r600/r700_ioctl.c b/src/mesa/drivers/dri/r600/r700_ioctl.c
index 0541dc76e4..7493efab0f 100644
--- a/src/mesa/drivers/dri/r600/r700_ioctl.c
+++ b/src/mesa/drivers/dri/r600/r700_ioctl.c
@@ -37,12 +37,38 @@
#include "radeon_lock.h"
#include "r600_context.h"
+#include "r700_chip.h"
#include "r700_ioctl.h"
#include "r700_clear.h"
+static void r700Flush(GLcontext *ctx)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ context_t * context = R700_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, radeon->cmdbuf.cs->cdw);
+
+ /* okay if we have no cmds in the buffer &&
+ we have no DMA flush &&
+ we have no DMA buffer allocated.
+ then no point flushing anything at all.
+ */
+ if (!radeon->dma.flush && !radeon->cmdbuf.cs->cdw && !radeon->dma.current)
+ return;
+
+ if (radeon->dma.flush)
+ radeon->dma.flush( ctx );
+
+ r700SendContextStates(context, NULL, NULL);
+
+ if (radeon->cmdbuf.cs->cdw)
+ rcommonFlushCmdBuf(radeon, __FUNCTION__);
+}
+
void r700InitIoctlFuncs(struct dd_function_table *functions)
{
functions->Clear = r700Clear;
functions->Finish = radeonFinish;
- functions->Flush = radeonFlush;
+ functions->Flush = r700Flush;
}