summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-02-09 15:55:15 -0800
committerIan Romanick <ian.d.romanick@intel.com>2009-03-13 17:38:38 -0700
commitca2564f1e688e63884c614284b4ca9f14298448b (patch)
tree25d59c19144b133ae26606cfdb91fe6bd80d8127
parent711a57f7c70447f54caf035089be204f9ce083a8 (diff)
intel: Don't do the extra MI_FLUSH in flushing except when doing glFlush().
Everything other than "make sure the last rendering ends up visible on the screen" doesn't need that behavior. (cherry picked from commit 01bc4d441fd6821ad9fc20d5e9544e4e587e4ff0)
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 668d8ed2ab..5c5b1b1163 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -505,9 +505,8 @@ intelInvalidateState(GLcontext * ctx, GLuint new_state)
intel->vtbl.invalidate_state( intel, new_state );
}
-
-void
-intelFlush(GLcontext * ctx)
+static void
+intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
{
struct intel_context *intel = intel_context(ctx);
@@ -521,13 +520,26 @@ intelFlush(GLcontext * ctx)
* lands onscreen in a timely manner, even if the X Server doesn't trigger
* a flush for us.
*/
- intel_batchbuffer_emit_mi_flush(intel->batch);
+ if (needs_mi_flush)
+ intel_batchbuffer_emit_mi_flush(intel->batch);
if (intel->batch->map != intel->batch->ptr)
intel_batchbuffer_flush(intel->batch);
}
void
+intelFlush(GLcontext * ctx)
+{
+ intel_flush(ctx, GL_FALSE);
+}
+
+static void
+intel_glFlush(GLcontext *ctx)
+{
+ intel_flush(ctx, GL_TRUE);
+}
+
+void
intelFinish(GLcontext * ctx)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
@@ -553,7 +565,7 @@ intelInitDriverFunctions(struct dd_function_table *functions)
{
_mesa_init_driver_functions(functions);
- functions->Flush = intelFlush;
+ functions->Flush = intel_glFlush;
functions->Finish = intelFinish;
functions->GetString = intelGetString;
functions->UpdateState = intelInvalidateState;