[Mesa-dev] [PATCH 24/70] i965: Refactor batch flush into intel_front_flush()

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 7 13:13:28 PDT 2015


Since we always flush the intel_batchbuffer before calling
intel_front_flush(), simply more that call into intel_front_flush()
itself.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 src/mesa/drivers/dri/i965/brw_context.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index d0c0d23..707bdf2 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -203,8 +203,7 @@ intel_flush_front(struct gl_context *ctx)
    __DRIscreen *const screen = brw->intelScreen->driScrnPriv;
 
    if (brw->front_buffer_dirty && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
-      if (flushFront(screen) && driDrawable &&
-          driDrawable->loaderPrivate) {
+      if (flushFront(screen) && driDrawable && driDrawable->loaderPrivate) {
 
          /* Resolve before flushing FAKE_FRONT_LEFT to FRONT_LEFT.
           *
@@ -224,6 +223,8 @@ intel_flush_front(struct gl_context *ctx)
          brw->front_buffer_dirty = false;
       }
    }
+
+   intel_batchbuffer_flush(brw);
 }
 
 static void
@@ -231,7 +232,6 @@ intel_glFlush(struct gl_context *ctx)
 {
    struct brw_context *brw = brw_context(ctx);
 
-   intel_batchbuffer_flush(brw);
    intel_flush_front(ctx);
 
    brw->need_flush_throttle = true;
@@ -1290,7 +1290,6 @@ intel_query_dri2_buffers(struct brw_context *brw,
        * query, we need to make sure all the pending drawing has landed in the
        * real front buffer.
        */
-      intel_batchbuffer_flush(brw);
       intel_flush_front(&brw->ctx);
 
       attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
@@ -1302,7 +1301,6 @@ intel_query_dri2_buffers(struct brw_context *brw,
        * So before doing the query, make sure all the pending drawing has
        * landed in the real front buffer.
        */
-      intel_batchbuffer_flush(brw);
       intel_flush_front(&brw->ctx);
    }
 
-- 
2.5.0



More information about the mesa-dev mailing list