summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_flush.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-03-08 08:20:31 +0100
committerMarek Olšák <[email protected]>2011-03-08 08:23:29 +0100
commit5650a719f0c69c00954e47bd7a7b3e9433cb551d (patch)
tree3aff20999b60e66b84d9949c50dffeb963104989 /src/gallium/drivers/r300/r300_flush.c
parent6051f26b78917d430e7f4eb9b92b20de17aea4cc (diff)
r300g: decide whether a flush should be asynchronous when calling it
Thread offloading is not sometimes desirable, e.g. when mapping a buffer.
Diffstat (limited to 'src/gallium/drivers/r300/r300_flush.c')
-rw-r--r--src/gallium/drivers/r300/r300_flush.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
index 9c41a1383ce..fa0926868be 100644
--- a/src/gallium/drivers/r300/r300_flush.c
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -31,9 +31,10 @@
#include "r300_cs.h"
#include "r300_emit.h"
-static void r300_flush(struct pipe_context* pipe,
- unsigned flags,
- struct pipe_fence_handle** fence)
+
+void r300_flush(struct pipe_context *pipe,
+ unsigned flags,
+ struct pipe_fence_handle **fence)
{
struct r300_context *r300 = r300_context(pipe);
struct r300_atom *atom;
@@ -61,7 +62,7 @@ static void r300_flush(struct pipe_context* pipe,
r500_emit_index_bias(r300, 0);
r300->flush_counter++;
- r300->rws->cs_flush(r300->cs);
+ r300->rws->cs_flush(r300->cs, flags);
r300->dirty_hw = 0;
/* New kitchen sink, baby. */
@@ -83,20 +84,24 @@ static void r300_flush(struct pipe_context* pipe,
* and we cannot emit an empty CS. We must write some regs then. */
CS_LOCALS(r300);
OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0);
- r300->rws->cs_flush(r300->cs);
+ r300->rws->cs_flush(r300->cs, flags);
} else {
/* Even if hw is not dirty, we should at least reset the CS in case
* the space checking failed for the first draw operation. */
- r300->rws->cs_flush(r300->cs);
+ r300->rws->cs_flush(r300->cs, flags);
}
}
+}
- if (flags & PIPE_FLUSH_FRAME) {
- r300->rws->cs_sync_flush(r300->cs);
- }
+static void r300_flush_wrapped(struct pipe_context *pipe,
+ unsigned flags,
+ struct pipe_fence_handle **fence)
+{
+ /* don't use the flags param, it means something else */
+ r300_flush(pipe, 0, fence);
}
void r300_init_flush_functions(struct r300_context* r300)
{
- r300->context.flush = r300_flush;
+ r300->context.flush = r300_flush_wrapped;
}