gallium: remove flags from the flush function
authorMarek Olšák <maraeo@gmail.com>
Mon, 7 Mar 2011 23:57:48 +0000 (00:57 +0100)
committerMarek Olšák <maraeo@gmail.com>
Fri, 11 Mar 2011 20:39:31 +0000 (21:39 +0100)
The drivers have been changed so that they behave as if all of the flags
were set. This is already implicit in most hardware drivers and required
for multiple contexts.

Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag
to decide whether flush_frontbuffer should be called.
New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement.

69 files changed:
src/gallium/docs/d3d11ddi.txt
src/gallium/drivers/cell/ppu/cell_flush.c
src/gallium/drivers/failover/fo_context.c
src/gallium/drivers/galahad/glhd_context.c
src/gallium/drivers/i915/i915_flush.c
src/gallium/drivers/i965/brw_pipe_flush.c
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_flush.c
src/gallium/drivers/llvmpipe/lp_flush.h
src/gallium/drivers/llvmpipe/lp_query.c
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_setup.h
src/gallium/drivers/llvmpipe/lp_surface.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/noop/noop_pipe.c
src/gallium/drivers/nv50/nv50_context.c
src/gallium/drivers/nvc0/nvc0_context.c
src/gallium/drivers/nvfx/nvfx_context.c
src/gallium/drivers/nvfx/nvfx_state_emit.c
src/gallium/drivers/r300/r300_flush.c
src/gallium/drivers/r300/r300_transfer.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_query.c
src/gallium/drivers/r600/r600_texture.c
src/gallium/drivers/rbug/rbug_context.c
src/gallium/drivers/rbug/rbug_core.c
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_flush.c
src/gallium/drivers/softpipe/sp_flush.h
src/gallium/drivers/svga/svga_pipe_draw.c
src/gallium/drivers/svga/svga_pipe_flush.c
src/gallium/drivers/trace/tr_context.c
src/gallium/include/pipe/p_context.h
src/gallium/include/pipe/p_defines.h
src/gallium/include/state_tracker/st_api.h
src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
src/gallium/state_trackers/dri/common/dri_context.c
src/gallium/state_trackers/dri/sw/drisw.c
src/gallium/state_trackers/egl/common/egl_g3d_api.c
src/gallium/state_trackers/egl/common/egl_g3d_sync.c
src/gallium/state_trackers/egl/common/native_helper.c
src/gallium/state_trackers/glx/xlib/xm_api.c
src/gallium/state_trackers/vega/api_context.c
src/gallium/state_trackers/vega/vg_manager.c
src/gallium/state_trackers/wgl/stw_context.c
src/gallium/state_trackers/xorg/xorg_dri2.c
src/gallium/state_trackers/xorg/xorg_driver.c
src/gallium/state_trackers/xorg/xorg_exa.c
src/gallium/state_trackers/xorg/xorg_exa.h
src/gallium/tests/graw/clear.c
src/gallium/tests/graw/fs-test.c
src/gallium/tests/graw/gs-test.c
src/gallium/tests/graw/quad-sample.c
src/gallium/tests/graw/quad-tex.c
src/gallium/tests/graw/shader-leak.c
src/gallium/tests/graw/tri-gs.c
src/gallium/tests/graw/tri-instanced.c
src/gallium/tests/graw/tri.c
src/gallium/tests/graw/vs-test.c
src/gallium/tests/trivial/quad-tex.c
src/gallium/tests/trivial/tri.c
src/gallium/winsys/r600/drm/r600_bo.c
src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
src/mesa/state_tracker/st_cb_flush.c
src/mesa/state_tracker/st_cb_flush.h
src/mesa/state_tracker/st_cb_syncobj.c
src/mesa/state_tracker/st_manager.c

index 0a9e7e50f1d7af08cd4587e4736b2d5c41c6ac32..b5a06b4b9434e122e162b444a1445ddb5a4d0f1c 100644 (file)
@@ -453,8 +453,8 @@ SetVertexPipelineOutput (D3D10.1+ only)
 SetViewports
        - Gallium lacks support for multiple geometry-shader-selectable viewports D3D11 has
 
-ShaderResourceViewReadAfterWriteHazard -> flush(PIPE_FLUSH_RENDER_CACHE)
-       - Gallium does not support specifying this per-render-target/view
+ShaderResourceViewReadAfterWriteHazard
+       - Gallium lacks support for this
 
 SoSetTargets -> set_stream_output_buffers
 
index 8275c9dc9c7b4686a860a27066a139cc8bebf1fa..463f4d03eb9b02c73a506b1b71a2b1ac1743626a 100644 (file)
  * Called via pipe->flush()
  */
 void
-cell_flush(struct pipe_context *pipe, unsigned flags,
+cell_flush(struct pipe_context *pipe,
            struct pipe_fence_handle **fence)
 {
    struct cell_context *cell = cell_context(pipe);
 
    if (fence) {
       *fence = NULL;
-      /* XXX: Implement real fencing */
-      flags |= CELL_FLUSH_WAIT;
    }
 
-   if (flags & (PIPE_FLUSH_SWAPBUFFERS | PIPE_FLUSH_RENDER_CACHE))
-      flags |= CELL_FLUSH_WAIT;
+   flags |= CELL_FLUSH_WAIT;
 
    draw_flush( cell->draw );
    cell_flush_int(cell, flags);
index b536dc4afabb30cfc47ab3add4053997d1b49adb..0fefec9aaea231d474a710132a4e35d96879a80c 100644 (file)
@@ -79,7 +79,7 @@ static void failover_draw_vbo( struct pipe_context *pipe,
    if (failover->mode == FO_SW) {
 
       if (failover->dirty) {
-         failover->hw->flush( failover->hw, ~0, NULL );
+         failover->hw->flush( failover->hw, NULL );
         failover_state_emit( failover );
       }
 
@@ -89,7 +89,7 @@ static void failover_draw_vbo( struct pipe_context *pipe,
        * intervening flush.  Unlikely to be much performance impact to
        * this:
        */
-      failover->sw->flush( failover->sw, ~0, NULL );
+      failover->sw->flush( failover->sw, NULL );
    }
 }
 
index 1dc652c6bd9de1fa9ad6fba26a24e8dcb8014f29..813a21e2ee30cd29e78404f5600b82c6ac9edcaf 100644 (file)
@@ -761,14 +761,12 @@ galahad_clear_depth_stencil(struct pipe_context *_pipe,
 
 static void
 galahad_flush(struct pipe_context *_pipe,
-               unsigned flags,
                struct pipe_fence_handle **fence)
 {
    struct galahad_context *glhd_pipe = galahad_context(_pipe);
    struct pipe_context *pipe = glhd_pipe->pipe;
 
    pipe->flush(pipe,
-               flags,
                fence);
 }
 
index f2044d661e3b32ba6cc7f747c400f5d16db0441f..87966d98079a3f1becb7932fdd1b126e4aadbb64 100644 (file)
@@ -39,7 +39,6 @@
 
 
 static void i915_flush_pipe( struct pipe_context *pipe,
-                             unsigned flags,
                              struct pipe_fence_handle **fence )
 {
    struct i915_context *i915 = i915_context(pipe);
@@ -50,6 +49,7 @@ static void i915_flush_pipe( struct pipe_context *pipe,
    /* Do we need to emit an MI_FLUSH command to flush the hardware
     * caches?
     */
+   /* XXX These flags are now implicit. All of them. */
    if (flags & (PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_TEXTURE_CACHE)) {
       unsigned flush = MI_FLUSH;
       
index 0ae1a6be9e5e778d91dc3f5202ba6f028ca93c8f..3b4a99beed2d173fb10ccd4bf84319f3d168160a 100644 (file)
@@ -38,7 +38,6 @@ void brw_context_flush( struct brw_context *brw )
 
 static void
 brw_flush( struct pipe_context *pipe,
-           unsigned flags, 
            struct pipe_fence_handle **fence )
 {
    brw_context_flush( brw_context( pipe ) );
index 5c865f8a22c2064a83ae2c035604d164d674465b..2a9d73601555f1520615aa4cb6956bad4921e71c 100644 (file)
@@ -668,14 +668,12 @@ identity_clear_depth_stencil(struct pipe_context *_pipe,
 
 static void
 identity_flush(struct pipe_context *_pipe,
-               unsigned flags,
                struct pipe_fence_handle **fence)
 {
    struct identity_context *id_pipe = identity_context(_pipe);
    struct pipe_context *pipe = id_pipe->pipe;
 
    pipe->flush(pipe,
-               flags,
                fence);
 }
 
index 644201ddf7c1580e9aac6d3f22ec466474de95d1..8a5655d49965ba4c3b5a5702dba99bc105288c34 100644 (file)
@@ -136,10 +136,9 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
 
 static void
 do_flush( struct pipe_context *pipe,
-          unsigned flags,
           struct pipe_fence_handle **fence)
 {
-   llvmpipe_flush(pipe, flags, fence, __FUNCTION__);
+   llvmpipe_flush(pipe, fence, __FUNCTION__);
 }
 
 
index 2a3ba904fe4621d457a28a24d0bb196cf3f2f3a3..42430550ea680703a560db9320c1600cb38cee67 100644 (file)
 
 
 /**
- * \param flags  bitmask of PIPE_FLUSH_x flags
  * \param fence  if non-null, returns pointer to a fence which can be waited on
  */
 void
 llvmpipe_flush( struct pipe_context *pipe,
-                unsigned flags,
                 struct pipe_fence_handle **fence,
                 const char *reason)
 {
@@ -54,7 +52,7 @@ llvmpipe_flush( struct pipe_context *pipe,
    draw_flush(llvmpipe->draw);
 
    /* ask the setup module to flush */
-   lp_setup_flush(llvmpipe->setup, flags, fence, reason);
+   lp_setup_flush(llvmpipe->setup, fence, reason);
 
 
    if (llvmpipe_variant_count > 1000) {
@@ -65,23 +63,21 @@ llvmpipe_flush( struct pipe_context *pipe,
 
    /* Enable to dump BMPs of the color/depth buffers each frame */
    if (0) {
-      if (flags & PIPE_FLUSH_FRAME) {
-         static unsigned frame_no = 1;
-         char filename[256];
-         unsigned i;
-
-         for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) {
-            util_snprintf(filename, sizeof(filename), "cbuf%u_%u", i, frame_no);
-            debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.cbufs[i]);
-         }
-
-         if (0) {
-            util_snprintf(filename, sizeof(filename), "zsbuf_%u", frame_no);
-            debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.zsbuf);
-         }
-
-         ++frame_no;
+      static unsigned frame_no = 1;
+      char filename[256];
+      unsigned i;
+
+      for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) {
+         util_snprintf(filename, sizeof(filename), "cbuf%u_%u", i, frame_no);
+         debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.cbufs[i]);
+      }
+
+      if (0) {
+         util_snprintf(filename, sizeof(filename), "zsbuf_%u", frame_no);
+         debug_dump_surface_bmp(&llvmpipe->pipe, filename, llvmpipe->framebuffer.zsbuf);
       }
+
+      ++frame_no;
    }
 }
 
@@ -90,7 +86,7 @@ llvmpipe_finish( struct pipe_context *pipe,
                  const char *reason )
 {
    struct pipe_fence_handle *fence = NULL;
-   llvmpipe_flush(pipe, 0, &fence, reason);
+   llvmpipe_flush(pipe, &fence, reason);
    if (fence) {
       pipe->screen->fence_finish(pipe->screen, fence, PIPE_TIMEOUT_INFINITE);
       pipe->screen->fence_reference(pipe->screen, &fence, NULL);
@@ -110,7 +106,6 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
                         struct pipe_resource *resource,
                         unsigned level,
                         int layer,
-                        unsigned flush_flags,
                         boolean read_only,
                         boolean cpu_access,
                         boolean do_not_block,
@@ -136,7 +131,7 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
           * Just flush.
           */
 
-         llvmpipe_flush(pipe, flush_flags, NULL, reason);
+         llvmpipe_flush(pipe, NULL, reason);
       }
    }
 
index 579d24c68ad185b2398070c4d0689c213f088bd6..efff94c8c0cfe08c4cf1249e7f65a372aabfc44c 100644 (file)
@@ -36,7 +36,6 @@ struct pipe_resource;
 
 void
 llvmpipe_flush(struct pipe_context *pipe,
-               unsigned flags,
                struct pipe_fence_handle **fence,
                const char *reason);
 
@@ -49,7 +48,6 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
                         struct pipe_resource *resource,
                         unsigned level,
                         int layer,
-                        unsigned flush_flags,
                         boolean read_only,
                         boolean cpu_access,
                         boolean do_not_block,
index 84c66dd36e8ea3551b6cace0dbe3b5bfb1001c95..1e2401fa84d62ddf950858b136bcff325c64621d 100644 (file)
@@ -69,7 +69,7 @@ llvmpipe_destroy_query(struct pipe_context *pipe, struct pipe_query *q)
     */
    if (pq->fence) {
       if (!lp_fence_issued(pq->fence))
-         llvmpipe_flush(pipe, 0, NULL, __FUNCTION__);
+         llvmpipe_flush(pipe, NULL, __FUNCTION__);
 
       if (!lp_fence_signalled(pq->fence))
          lp_fence_wait(pq->fence);
@@ -99,7 +99,7 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
 
    if (!lp_fence_signalled(pq->fence)) {
       if (!lp_fence_issued(pq->fence))
-         llvmpipe_flush(pipe, 0, NULL, __FUNCTION__);
+         llvmpipe_flush(pipe, NULL, __FUNCTION__);
          
       if (!wait)
          return FALSE;
index 41d8fa6d124e41fc8fbbdff08f19e835cb6187ab..3813e0ed972fcf530ff15510d5789b6ebb289bfe 100644 (file)
@@ -333,12 +333,8 @@ fail:
 }
 
 
-/**
- * \param flags  bitmask of PIPE_FLUSH_x flags
- */
 void
 lp_setup_flush( struct lp_setup_context *setup,
-                unsigned flags,
                 struct pipe_fence_handle **fence,
                 const char *reason)
 {
@@ -469,7 +465,7 @@ lp_setup_clear( struct lp_setup_context *setup,
                 unsigned flags )
 {
    if (!lp_setup_try_clear( setup, color, depth, stencil, flags )) {
-      lp_setup_flush(setup, 0, NULL, __FUNCTION__);
+      lp_setup_flush(setup, NULL, __FUNCTION__);
 
       if (!lp_setup_try_clear( setup, color, depth, stencil, flags ))
          assert(0);
@@ -1114,7 +1110,7 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq)
       if (!lp_scene_bin_everywhere(setup->scene,
                                    LP_RAST_OP_END_QUERY,
                                    dummy)) {
-         lp_setup_flush(setup, 0, NULL, __FUNCTION__);
+         lp_setup_flush(setup, NULL, __FUNCTION__);
       }
    }
    else {
index 0d6e161a2188df54d8a4169ec39bbbf16b269315..8655259d27c72b3249c3f9f9d61fab6bd0e74a12 100644 (file)
@@ -64,7 +64,6 @@ lp_setup_clear(struct lp_setup_context *setup,
 
 void
 lp_setup_flush( struct lp_setup_context *setup,
-                unsigned flags,
                 struct pipe_fence_handle **fence,
                 const char *reason);
 
index e7e46a628a15f0eac8b8b856ac783c707702a3e4..f49638acf08af1df224ca76dd272d067e135043c 100644 (file)
@@ -69,7 +69,6 @@ lp_resource_copy(struct pipe_context *pipe,
 
    llvmpipe_flush_resource(pipe,
                            dst, dst_level, dstz,
-                           0, /* flush_flags */
                            FALSE, /* read_only */
                            TRUE, /* cpu_access */
                            FALSE, /* do_not_block */
@@ -77,7 +76,6 @@ lp_resource_copy(struct pipe_context *pipe,
 
    llvmpipe_flush_resource(pipe,
                            src, src_level, src_box->z,
-                           0, /* flush_flags */
                            TRUE, /* read_only */
                            TRUE, /* cpu_access */
                            FALSE, /* do_not_block */
index 2e6a4bd7dc888422e5650f2dce7b184d40511465..fa4ce5bf2ac20816a187eb8b210219512e5194c6 100644 (file)
@@ -575,7 +575,6 @@ llvmpipe_get_transfer(struct pipe_context *pipe,
       if (!llvmpipe_flush_resource(pipe, resource,
                                    level,
                                    box->depth > 1 ? -1 : box->z,
-                                   0, /* flush_flags */
                                    read_only,
                                    TRUE, /* cpu_access */
                                    do_not_block,
index 9bcc1e6b45ac5904508168d709517c215ae4e4a9..496b7f5ec6dd827b43cab5c2af33783b4b5ff8be 100644 (file)
@@ -260,7 +260,7 @@ static void noop_resource_copy_region(struct pipe_context *ctx,
 /*
  * context
  */
-static void noop_flush(struct pipe_context *ctx, unsigned flags,
+static void noop_flush(struct pipe_context *ctx,
                        struct pipe_fence_handle **fence)
 {
 }
index 912367b83917502a2bcabf757ecde63f714edaf0..c6bd0b15cbc4cab263be45013983846db08e3b38 100644 (file)
 #include "nouveau/nouveau_reloc.h"
 
 static void
-nv50_flush(struct pipe_context *pipe, unsigned flags,
+nv50_flush(struct pipe_context *pipe,
            struct pipe_fence_handle **fence)
 {
    struct nv50_context *nv50 = nv50_context(pipe);
    struct nouveau_channel *chan = nv50->screen->base.channel;
 
-   if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
+   /* XXX This flag wasn't set by the state tracker anyway. */
+   /*if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
       BEGIN_RING(chan, RING_3D_(NV50_GRAPH_WAIT_FOR_IDLE), 1);
       OUT_RING  (chan, 0);
       BEGIN_RING(chan, RING_3D(TEX_CACHE_CTL), 1);
       OUT_RING  (chan, 0x20);
-   }
+   }*/
 
    if (fence)
       nouveau_fence_ref(nv50->screen->base.fence.current,
                         (struct nouveau_fence **)fence);
 
-   if (flags & (PIPE_FLUSH_SWAPBUFFERS | PIPE_FLUSH_FRAME))
-      FIRE_RING(chan);
+   FIRE_RING(chan);
 }
 
 void
index d6de979b132d0f46ee2a45621ef2a9c14f9cce18..881d102dab0eaab0ae17b21adfa232e69d4cc7d4 100644 (file)
 #include "nouveau/nouveau_reloc.h"
 
 static void
-nvc0_flush(struct pipe_context *pipe, unsigned flags,
+nvc0_flush(struct pipe_context *pipe,
            struct pipe_fence_handle **fence)
 {
    struct nvc0_context *nvc0 = nvc0_context(pipe);
    struct nouveau_channel *chan = nvc0->screen->base.channel;
 
-   if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
+   /* XXX This flag wasn't set by the state tracker anyway. */
+   /*if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
       BEGIN_RING(chan, RING_3D(SERIALIZE), 1);
       OUT_RING  (chan, 0);
       BEGIN_RING(chan, RING_3D(TEX_CACHE_CTL), 1);
       OUT_RING  (chan, 0x00);
-   } else
-   if ((flags & PIPE_FLUSH_RENDER_CACHE) && !(flags & PIPE_FLUSH_FRAME)) {
+   } else*/
+   /* XXX FLUSH_FRAME is now implicit. */
+   /*if ((flags & PIPE_FLUSH_RENDER_CACHE) && !(flags & PIPE_FLUSH_FRAME)) {
       BEGIN_RING(chan, RING_3D(SERIALIZE), 1);
       OUT_RING  (chan, 0);
-   }
+   }*/
 
    if (fence)
       nouveau_fence_ref(nvc0->screen->base.fence.current,
                         (struct nouveau_fence **)fence);
 
-   if (flags & (PIPE_FLUSH_SWAPBUFFERS | PIPE_FLUSH_FRAME))
-      FIRE_RING(chan);
+   FIRE_RING(chan);
 }
 
 static void
index 6c8934d3a4a2a6d61d23892b0ee6f7fe2f0d94d1..2bcb93d93e3bd64580394c6d3e603cb870ee5a96 100644 (file)
@@ -7,7 +7,7 @@
 #include "nvfx_resource.h"
 
 static void
-nvfx_flush(struct pipe_context *pipe, unsigned flags,
+nvfx_flush(struct pipe_context *pipe,
           struct pipe_fence_handle **fence)
 {
        struct nvfx_context *nvfx = nvfx_context(pipe);
@@ -16,12 +16,13 @@ nvfx_flush(struct pipe_context *pipe, unsigned flags,
        struct nouveau_grobj *eng3d = screen->eng3d;
 
        /* XXX: we need to actually be intelligent here */
-       if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
+        /* XXX This flag wasn't set by the state tracker anyway. */
+        /*if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
                BEGIN_RING(chan, eng3d, 0x1fd8, 1);
                OUT_RING(chan, 2);
                BEGIN_RING(chan, eng3d, 0x1fd8, 1);
                OUT_RING(chan, 1);
-       }
+        }*/
 
        FIRE_RING(chan);
        if (fence)
index 40ae4f5bd2108c971c015f3506059af32d5c6682..ae9c31418c3c097a3e9650bb3b6be7b8f3d45487 100644 (file)
@@ -426,7 +426,7 @@ nvfx_state_validate_swtnl(struct nvfx_context *nvfx)
                        NOUVEAU_ERR("hw->swtnl 0x%08x\n", nvfx->fallback_swtnl);
                        warned = TRUE;
                }
-               nvfx->pipe.flush(&nvfx->pipe, 0, NULL);
+                nvfx->pipe.flush(&nvfx->pipe, NULL);
                nvfx->dirty |= (NVFX_NEW_VIEWPORT |
                                NVFX_NEW_VERTPROG |
                                NVFX_NEW_ARRAYS);
index fa0926868be550770315d32466ef4826016d98b3..b3d0d344ec4ccf17ce64f913babb7272f6eedef5 100644 (file)
@@ -94,10 +94,8 @@ void r300_flush(struct pipe_context *pipe,
 }
 
 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);
 }
 
index 928c86be0c59cef545dd60db2e44602dd75da061..65c5095be6aab36711c0eab36eb7d25781d23d35 100644 (file)
@@ -73,7 +73,7 @@ static void r300_copy_into_tiled_texture(struct pipe_context *ctx,
                               &r300transfer->linear_texture->b.b.b, 0, &src_box);
 
     /* XXX remove this. */
-    ctx->flush(ctx, 0, NULL);
+    r300_flush(ctx, 0, NULL);
 }
 
 struct pipe_transfer*
index d8e057fe5d205d538778165add1bc1cd1e5412ae..8303b7224ac68503a0719e570f70b99e74fc7846 100644 (file)
@@ -48,7 +48,7 @@
 /*
  * pipe_context
  */
-static void r600_flush(struct pipe_context *ctx, unsigned flags,
+static void r600_flush(struct pipe_context *ctx,
                        struct pipe_fence_handle **fence)
 {
        struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
index 343403f92f3adb2f105ed8ae551a8755e70189d7..181ea3f9e49b1cad0a8bda620c7d5305d0c308d7 100644 (file)
@@ -62,7 +62,7 @@ static boolean r600_get_query_result(struct pipe_context *ctx,
        struct r600_query *rquery = (struct r600_query *)query;
 
        if (rquery->num_results) {
-               ctx->flush(ctx, 0, NULL);
+                ctx->flush(ctx, NULL);
        }
        return r600_context_query_result(&rctx->ctx, (struct r600_query *)query, wait, vresult);
 }
index f527c07adcdb548339e51af6f6afd92398644ea8..86a9defa9af2bd5b53d6337ba6ec764585c36132 100644 (file)
@@ -68,7 +68,7 @@ static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600
                                  rtransfer->staging_texture,
                                  0, &sbox);
 
-       ctx->flush(ctx, 0, NULL);
+        ctx->flush(ctx, NULL);
 }
 
 unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
@@ -635,7 +635,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
                if (usage & PIPE_TRANSFER_READ) {
                        r600_copy_to_staging_texture(ctx, trans);
                        /* Always referenced in the blit. */
-                       ctx->flush(ctx, 0, NULL);
+                        ctx->flush(ctx, NULL);
                }
                return &trans->transfer;
        }
index f5e2d5f4d6240374ffe03a5a38b7c725e555e7f2..bd0eae9ac46cf8455ffbea0bb89b878b147c8902 100644 (file)
@@ -801,14 +801,12 @@ rbug_clear_depth_stencil(struct pipe_context *_pipe,
 
 static void
 rbug_flush(struct pipe_context *_pipe,
-           unsigned flags,
            struct pipe_fence_handle **fence)
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct pipe_context *pipe = rb_pipe->pipe;
 
    pipe->flush(pipe,
-               flags,
                fence);
 }
 
index eb772d19d05ea5184572fbb5f7e76caded29b356..b80bcd4228fee5357546220f6b8df26a4070f3b4 100644 (file)
@@ -498,7 +498,7 @@ rbug_context_flush(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32
    /* protect the pipe context */
    pipe_mutex_lock(rb_context->call_mutex);
 
-   rb_context->pipe->flush(rb_context->pipe, flush->flags, NULL);
+   rb_context->pipe->flush(rb_context->pipe, NULL);
 
    pipe_mutex_unlock(rb_context->call_mutex);
    pipe_mutex_unlock(rb_screen->list_mutex);
index 5ea2ee58219f436ba0dd371c97ab0c0bdb7c16d8..ce22f6462289bf8011ddf9fd98d0cfb368812031 100644 (file)
@@ -255,7 +255,7 @@ softpipe_create_context( struct pipe_screen *screen,
    softpipe->pipe.draw_stream_output = softpipe_draw_stream_output;
 
    softpipe->pipe.clear = softpipe_clear;
-   softpipe->pipe.flush = softpipe_flush;
+   softpipe->pipe.flush = softpipe_flush_wrapped;
 
    softpipe->pipe.render_condition = softpipe_render_condition;
 
index edbce6a297adfb643548d3b1c49383df0bbbd7b6..720fea83cb219967fd961b99a96138cf026eee3b 100644 (file)
@@ -42,7 +42,7 @@
 
 void
 softpipe_flush( struct pipe_context *pipe,
-               unsigned flags,
+                unsigned flags,
                 struct pipe_fence_handle **fence )
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -50,7 +50,7 @@ softpipe_flush( struct pipe_context *pipe,
 
    draw_flush(softpipe->draw);
 
-   if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
+   if (flags & SP_FLUSH_TEXTURE_CACHE) {
       for (i = 0; i < softpipe->num_fragment_sampler_views; i++) {
          sp_flush_tex_tile_cache(softpipe->fragment_tex_cache[i]);
       }
@@ -62,34 +62,27 @@ softpipe_flush( struct pipe_context *pipe,
       }
    }
 
-   if (flags & PIPE_FLUSH_SWAPBUFFERS) {
-      /* If this is a swapbuffers, just flush color buffers.
-       *
-       * The zbuffer changes are not discarded, but held in the cache
-       * in the hope that a later clear will wipe them out.
-       */
-      for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++)
-         if (softpipe->cbuf_cache[i])
-            sp_flush_tile_cache(softpipe->cbuf_cache[i]);
-
-      /* Need this call for hardware buffers before swapbuffers.
-       *
-       * there should probably be another/different flush-type function
-       * that's called before swapbuffers because we don't always want
-       * to unmap surfaces when flushing.
-       */
-      softpipe_unmap_transfers(softpipe);
-   }
-   else if (flags & PIPE_FLUSH_RENDER_CACHE) {
-      for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++)
-         if (softpipe->cbuf_cache[i])
-            sp_flush_tile_cache(softpipe->cbuf_cache[i]);
-
-      if (softpipe->zsbuf_cache)
-         sp_flush_tile_cache(softpipe->zsbuf_cache);
-     
-      softpipe->dirty_render_cache = FALSE;
-   }
+   /* If this is a swapbuffers, just flush color buffers.
+    *
+    * The zbuffer changes are not discarded, but held in the cache
+    * in the hope that a later clear will wipe them out.
+    */
+   for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++)
+      if (softpipe->cbuf_cache[i])
+         sp_flush_tile_cache(softpipe->cbuf_cache[i]);
+
+   if (softpipe->zsbuf_cache)
+      sp_flush_tile_cache(softpipe->zsbuf_cache);
+
+   softpipe->dirty_render_cache = FALSE;
+
+   /* Need this call for hardware buffers before swapbuffers.
+    *
+    * there should probably be another/different flush-type function
+    * that's called before swapbuffers because we don't always want
+    * to unmap surfaces when flushing.
+    */
+   softpipe_unmap_transfers(softpipe);
 
    /* Enable to dump BMPs of the color/depth buffers each frame */
 #if 0
@@ -108,6 +101,13 @@ softpipe_flush( struct pipe_context *pipe,
       *fence = NULL;
 }
 
+void
+softpipe_flush_wrapped( struct pipe_context *pipe,
+                        struct pipe_fence_handle **fence )
+{
+   softpipe_flush(pipe, SP_FLUSH_TEXTURE_CACHE, fence);
+}
+
 
 /**
  * Flush context if necessary.
@@ -139,11 +139,8 @@ softpipe_flush_resource(struct pipe_context *pipe,
        * disappear and the pipe driver should just ensure that all visible
        * side-effects happen when they need to happen.
        */
-      if (referenced & SP_REFERENCED_FOR_WRITE)
-         flush_flags |= PIPE_FLUSH_RENDER_CACHE;
-
       if (referenced & SP_REFERENCED_FOR_READ)
-         flush_flags |= PIPE_FLUSH_TEXTURE_CACHE;
+         flush_flags |= SP_FLUSH_TEXTURE_CACHE;
 
       if (cpu_access) {
          /*
@@ -155,7 +152,7 @@ softpipe_flush_resource(struct pipe_context *pipe,
          if (do_not_block)
             return FALSE;
 
-         pipe->flush(pipe, flush_flags, &fence);
+         softpipe_flush(pipe, flush_flags, &fence);
 
          if (fence) {
             /*
@@ -171,7 +168,7 @@ softpipe_flush_resource(struct pipe_context *pipe,
           * Just flush.
           */
 
-         pipe->flush(pipe, flush_flags, NULL);
+         softpipe_flush(pipe, flush_flags, NULL);
       }
    }
 
index 22a5ceeb9ecc4fd7bc6232434bf3348c0e28a77c..ab01c249abe1c639ebfa3a79b656f623d30d1ce5 100644 (file)
 struct pipe_context;
 struct pipe_fence_handle;
 
+#define SP_FLUSH_TEXTURE_CACHE  0x2
+
 void
-softpipe_flush(struct pipe_context *pipe, unsigned flags,
+softpipe_flush(struct pipe_context *pipe,
+               unsigned flags,
                struct pipe_fence_handle **fence);
 
+void
+softpipe_flush_wrapped( struct pipe_context *pipe,
+                        struct pipe_fence_handle **fence );
+
 boolean
 softpipe_flush_resource(struct pipe_context *pipe,
                         struct pipe_resource *texture,
index d98b9b0e0005bd8b0b53c419dd557a2de4823dc9..fda5c28433c2a93ec5879a2f43c3ffb9e1617ca6 100644 (file)
@@ -161,7 +161,7 @@ svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
       /* We're switching between SW and HW drawing.  Do a flush to avoid
        * mixing HW and SW rendering with the same vertex buffer.
        */
-      pipe->flush(pipe, ~0, NULL);
+      pipe->flush(pipe, NULL);
       svga->prev_draw_swtnl = svga->state.sw.need_swtnl;
    }
 
index 9357d827f289805054398421ec1ad09e8e10044a..4578c136cb8787bfbb216238fdad434a0ea9e41a 100644 (file)
@@ -32,7 +32,6 @@
 
 
 static void svga_flush( struct pipe_context *pipe,
-                        unsigned flags,
                         struct pipe_fence_handle **fence )
 {
    struct svga_context *svga = svga_context(pipe);
@@ -45,29 +44,27 @@ static void svga_flush( struct pipe_context *pipe,
     */
    svga_context_flush(svga, fence);
 
-   SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "%s flags %x fence_ptr %p\n",
-            __FUNCTION__, flags, fence ? *fence : 0x0);
+   SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "%s fence_ptr %p\n",
+            __FUNCTION__, fence ? *fence : 0x0);
 
    /* Enable to dump BMPs of the color/depth buffers each frame */
    if (0) {
-      if (flags & PIPE_FLUSH_FRAME) {
-         struct pipe_framebuffer_state *fb = &svga->curr.framebuffer;
-         static unsigned frame_no = 1;
-         char filename[256];
-         unsigned i;
+      struct pipe_framebuffer_state *fb = &svga->curr.framebuffer;
+      static unsigned frame_no = 1;
+      char filename[256];
+      unsigned i;
 
-         for (i = 0; i < fb->nr_cbufs; i++) {
-            util_snprintf(filename, sizeof(filename), "cbuf%u_%04u", i, frame_no);
-            debug_dump_surface_bmp(&svga->pipe, filename, fb->cbufs[i]);
-         }
-
-         if (0 && fb->zsbuf) {
-            util_snprintf(filename, sizeof(filename), "zsbuf_%04u", frame_no);
-            debug_dump_surface_bmp(&svga->pipe, filename, fb->zsbuf);
-         }
+      for (i = 0; i < fb->nr_cbufs; i++) {
+         util_snprintf(filename, sizeof(filename), "cbuf%u_%04u", i, frame_no);
+         debug_dump_surface_bmp(&svga->pipe, filename, fb->cbufs[i]);
+      }
 
-         ++frame_no;
+      if (0 && fb->zsbuf) {
+         util_snprintf(filename, sizeof(filename), "zsbuf_%04u", frame_no);
+         debug_dump_surface_bmp(&svga->pipe, filename, fb->zsbuf);
       }
+
+      ++frame_no;
    }
 }
 
index 6123873cac629c9eb5363ca8b8da4e7b629b7a0e..4db7619c4248b0eeb7bb9f2789ebaca1171ea181 100644 (file)
@@ -1184,7 +1184,6 @@ trace_context_clear_depth_stencil(struct pipe_context *_pipe,
 
 static INLINE void
 trace_context_flush(struct pipe_context *_pipe,
-                    unsigned flags,
                     struct pipe_fence_handle **fence)
 {
    struct trace_context *tr_ctx = trace_context(_pipe);
@@ -1193,9 +1192,8 @@ trace_context_flush(struct pipe_context *_pipe,
    trace_dump_call_begin("pipe_context", "flush");
 
    trace_dump_arg(ptr, pipe);
-   trace_dump_arg(uint, flags);
 
-   pipe->flush(pipe, flags, fence);
+   pipe->flush(pipe, fence);
 
    if(fence)
       trace_dump_ret(ptr, *fence);
index 4a0fbfdd4d6005c8c8f26788b9409173fc931e9e..211f99f7cef66410cf8726c6c7063c8e871f7e61 100644 (file)
@@ -312,11 +312,9 @@ struct pipe_context {
                                unsigned dstx, unsigned dsty,
                                unsigned width, unsigned height);
 
-   /** Flush rendering
-    * \param flags  bitmask of PIPE_FLUSH_x tokens)
+   /** Flush draw commands
     */
    void (*flush)( struct pipe_context *pipe,
-                  unsigned flags,
                   struct pipe_fence_handle **fence );
 
    /**
index a4185f23839074bfcecab746881c001d09adda01..bac3300df3c785090cc5192810e301b6e9cf6918 100644 (file)
@@ -337,15 +337,6 @@ enum pipe_transfer_usage {
 #define PIPE_USAGE_STAGING        5 /* supports data transfers from the GPU to the CPU */
 
 
-/** 
- * Flush types:
- */
-#define PIPE_FLUSH_RENDER_CACHE   0x1
-#define PIPE_FLUSH_TEXTURE_CACHE  0x2
-#define PIPE_FLUSH_SWAPBUFFERS    0x4
-#define PIPE_FLUSH_FRAME          0x8 /**< Mark the end of a frame */
-
-
 /**
  * Shaders
  */
index 1c2148b78f23d459960a63e829c5114f70bb6f35..d4973a10cc7bc7eebc4a5cd6b8af70e0ecb7b71e 100644 (file)
@@ -120,6 +120,11 @@ enum st_context_resource_type {
    ST_CONTEXT_RESOURCE_OPENVG_PARENT_IMAGE
 };
 
+/**
+ * Flush flags.
+ */
+#define ST_FLUSH_FRONT                    (1 << 0)
+
 /**
  * Value to st_manager->get_param function.
  */
index 2e45f3f43e97be64ae08a34cc4309bbd416209d4..741a97f897db542dae986fb63cda50d284ecced8 100644 (file)
@@ -1234,7 +1234,7 @@ struct GalliumDXGISwapChain : public GalliumDXGIObject<IDXGISwapChain, GalliumDX
                if(dst_surface)
                        pipe->surface_destroy(pipe, dst_surface);
 
-               pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, 0);
+                pipe->flush(pipe, 0);
 
                att = (db) ? NATIVE_ATTACHMENT_BACK_LEFT : NATIVE_ATTACHMENT_FRONT_LEFT;
                if(!surface->present(surface, att, FALSE, 0))
index 542d65912936c1e8f44346a1540dce0d9a04e36c..12f2aaddc916e624fa8baa09df3515d51a9019c8 100644 (file)
@@ -1823,7 +1823,7 @@ changed:
        virtual void STDMETHODCALLTYPE Flush(void)
        {
                SYNCHRONIZED;
-               pipe->flush(pipe, PIPE_FLUSH_FRAME, 0);
+                pipe->flush(pipe, 0);
        }
 
        /* In Direct3D 10, if the reference count of an object drops to 0, it is automatically
index fc68ee13eaa3e20586b1f7ff1a0147f9fe9fa945..e23c1bcafafdfb267951106ca7fabdae5b2fd519 100644 (file)
@@ -149,7 +149,7 @@ dri_unbind_context(__DRIcontext * cPriv)
 
    if (--ctx->bind_count == 0) {
       if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
-         ctx->st->flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+         ctx->st->flush(ctx->st, ST_FLUSH_FRONT, NULL);
          stapi->make_current(stapi, NULL, NULL, NULL);
          draw->context = NULL;
          read->context = NULL;
@@ -171,7 +171,7 @@ dri_make_current(__DRIcontext * cPriv,
    struct st_context_iface *old_st = ctx->stapi->get_current(ctx->stapi);
 
    if (old_st && old_st != ctx->st)
-      old_st->flush(old_st, PIPE_FLUSH_RENDER_CACHE, NULL);
+      old_st->flush(old_st, ST_FLUSH_FRONT, NULL);
 
    ++ctx->bind_count;
 
index 0efa5ffdc694095b68d4480dae8b15cdf06106ad..ac11f7c47f6a2b9b23f24244681b7a689dcb7b08 100644 (file)
@@ -139,7 +139,7 @@ drisw_swap_buffers(__DRIdrawable *dPriv)
    ptex = drawable->textures[ST_ATTACHMENT_BACK_LEFT];
 
    if (ptex) {
-      ctx->st->flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+      ctx->st->flush(ctx->st, ST_FLUSH_FRONT, NULL);
 
       drisw_copy_to_front(dPriv, ptex);
    }
index 6b409573fa30fa25d3da05e8cdb28bf5c58e70f8..f1568329ecf6e28f11e0f21fcda10b034fef0cbd 100644 (file)
@@ -528,8 +528,7 @@ egl_g3d_make_current(_EGLDriver *drv, _EGLDisplay *dpy,
    old_gctx = egl_g3d_context(old_ctx);
    if (old_gctx) {
       /* flush old context */
-      old_gctx->stctxi->flush(old_gctx->stctxi,
-            PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
+      old_gctx->stctxi->flush(old_gctx->stctxi, ST_FLUSH_FRONT, NULL);
    }
 
    if (gctx) {
@@ -606,8 +605,7 @@ egl_g3d_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
 
    /* flush if the surface is current */
    if (gctx) {
-      gctx->stctxi->flush(gctx->stctxi,
-            PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
+      gctx->stctxi->flush(gctx->stctxi, ST_FLUSH_FRONT, NULL);
    }
 
    return gsurf->native->present(gsurf->native,
@@ -652,8 +650,7 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
    /* flush if the surface is current */
    if (ctx && ctx->DrawSurface == &gsurf->base) {
       struct egl_g3d_context *gctx = egl_g3d_context(ctx);
-      gctx->stctxi->flush(gctx->stctxi,
-            PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
+      gctx->stctxi->flush(gctx->stctxi, ST_FLUSH_FRONT, NULL);
    }
 
    pipe = ndpy_get_copy_context(gdpy->native);
@@ -667,7 +664,7 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
       u_box_origin_2d(ptex->width0, ptex->height0, &src_box);
       pipe->resource_copy_region(pipe, ptex, 0, 0, 0, 0,
             gsurf->render_texture, 0, &src_box);
-      pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+      pipe->flush(pipe, NULL);
       nsurf->present(nsurf, NATIVE_ATTACHMENT_FRONT_LEFT, FALSE, 0);
 
       pipe_resource_reference(&ptex, NULL);
@@ -686,8 +683,7 @@ egl_g3d_wait_client(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
    struct pipe_screen *screen = gdpy->native->screen;
    struct pipe_fence_handle *fence = NULL;
 
-   gctx->stctxi->flush(gctx->stctxi,
-         PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
+   gctx->stctxi->flush(gctx->stctxi, ST_FLUSH_FRONT, &fence);
    if (fence) {
       screen->fence_finish(screen, fence, PIPE_TIMEOUT_INFINITE);
       screen->fence_reference(screen, &fence, NULL);
@@ -758,8 +754,7 @@ egl_g3d_bind_tex_image(_EGLDriver *drv, _EGLDisplay *dpy,
    /* flush properly if the surface is bound */
    if (gsurf->base.CurrentContext) {
       gctx = egl_g3d_context(gsurf->base.CurrentContext);
-      gctx->stctxi->flush(gctx->stctxi,
-            PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
+      gctx->stctxi->flush(gctx->stctxi, ST_FLUSH_FRONT, NULL);
    }
 
    gctx = egl_g3d_context(es1);
index 7610e04fa3e22ea29528ade11222d1fcdc13fbf8..dd07af140a7af28efcd2deac8455b74c30f5c719 100644 (file)
@@ -234,7 +234,7 @@ egl_g3d_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
          struct egl_g3d_context *gctx = egl_g3d_context(ctx);
 
          if (gctx)
-            gctx->stctxi->flush(gctx->stctxi, PIPE_FLUSH_RENDER_CACHE , NULL);
+            gctx->stctxi->flush(gctx->stctxi, ST_FLUSH_FRONT, NULL);
       }
 
       if (timeout) {
index 290c6d7076d93984b1f1e6881bd97170ece237f2..ee18cb2025b7a5e5fdce3a0853ef1eb2dcae35dc 100644 (file)
@@ -352,7 +352,7 @@ resource_surface_flush(struct resource_surface *rsurf,
    if (!pipe)
       return FALSE;
 
-   pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, &fence);
+   pipe->flush(pipe, &fence);
    if (fence == NULL)
       return FALSE;
 
index 7bfd2c3779d42886416c4ab9fb463da86181627f..3b35cbc890c9bef515d3541bd81b7805038fdc43 100644 (file)
@@ -1193,11 +1193,7 @@ void XMesaSwapBuffers( XMesaBuffer b )
    XMesaContext xmctx = XMesaGetCurrentContext();
 
    if (xmctx && xmctx->xm_buffer == b) {
-      xmctx->st->flush( xmctx->st,
-            PIPE_FLUSH_RENDER_CACHE | 
-            PIPE_FLUSH_SWAPBUFFERS |
-            PIPE_FLUSH_FRAME,
-            NULL);
+      xmctx->st->flush( xmctx->st, ST_FLUSH_FRONT, NULL);
    }
 
    xmesa_swap_st_framebuffer(b->stfb);
@@ -1223,7 +1219,7 @@ void XMesaFlush( XMesaContext c )
       XMesaDisplay xmdpy = xmesa_init_display(c->xm_visual->display);
       struct pipe_fence_handle *fence = NULL;
 
-      c->st->flush(c->st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
+      c->st->flush(c->st, ST_FLUSH_FRONT, &fence);
       if (fence) {
          xmdpy->screen->fence_finish(xmdpy->screen, fence,
                                      PIPE_TIMEOUT_INFINITE);
index 47e57f9285896cefbe0ea7e540c69e275d93de81..19e42dd1562bb6a81f2f8625428ed6e656972616 100644 (file)
@@ -56,7 +56,7 @@ void vegaFlush(void)
       return;
 
    pipe = ctx->pipe;
-   pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+   pipe->flush(pipe, NULL);
 
    vg_manager_flush_frontbuffer(ctx);
 }
@@ -72,7 +72,7 @@ void vegaFinish(void)
 
    pipe = ctx->pipe;
 
-   pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
+   pipe->flush(pipe, &fence);
    if (fence) {
       pipe->screen->fence_finish(pipe->screen, fence,
                                  PIPE_TIMEOUT_INFINITE);
index 44d2996bb4580f52dc1b762a8f8c1f26da4dd566..eeea68677de6d63678b0ef29b2f91b7b0f27bb2c 100644 (file)
@@ -142,8 +142,8 @@ vg_context_flush(struct st_context_iface *stctxi, unsigned flags,
                  struct pipe_fence_handle **fence)
 {
    struct vg_context *ctx = (struct vg_context *) stctxi;
-   ctx->pipe->flush(ctx->pipe, flags, fence);
-   if (flags & PIPE_FLUSH_RENDER_CACHE)
+   ctx->pipe->flush(ctx->pipe, fence);
+   if (flags & ST_FLUSH_FRONT)
       vg_manager_flush_frontbuffer(ctx);
 }
 
index cd4f3c8b3e28a8ba4a701b65c770aadd32a7e6e1..5608d4f4ce7a73a054583898b0b7719042a5c356 100644 (file)
@@ -277,7 +277,7 @@ stw_make_current(
             return TRUE;
          }
       } else {
-         curctx->st->flush(curctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+         curctx->st->flush(curctx->st, ST_FLUSH_FRONT, NULL);
       }
    }
 
@@ -351,11 +351,7 @@ stw_flush_current_locked( struct stw_framebuffer *fb )
    struct stw_context *ctx = stw_current_context();
 
    if (ctx && ctx->current_framebuffer == fb) {
-      ctx->st->flush(ctx->st,
-            PIPE_FLUSH_RENDER_CACHE | 
-            PIPE_FLUSH_SWAPBUFFERS |
-            PIPE_FLUSH_FRAME,
-            NULL);
+      ctx->st->flush(ctx->st, ST_FLUSH_FRONT, NULL);
    }
 }
 
index edd988f4e0926f2605bdbdda1281d074199f509f..6f2c52eabb66cb01f711bf2c1ad0b2a7ac68f3ec 100644 (file)
@@ -336,7 +336,7 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
        /* pixmap glXWaitX */
        if (pSrcBuffer->attachment == DRI2BufferFrontLeft &&
            pDestBuffer->attachment == DRI2BufferFakeFrontLeft) {
-           ms->ctx->flush(ms->ctx, PIPE_FLUSH_SWAPBUFFERS, NULL);
+           ms->ctx->flush(ms->ctx, NULL);
            return;
        }
        /* pixmap glXWaitGL */
@@ -389,7 +389,7 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
 
     FreeScratchGC(gc);
 
-    ms->ctx->flush(ms->ctx, PIPE_FLUSH_SWAPBUFFERS,
+    ms->ctx->flush(ms->ctx,
                   (pDestBuffer->attachment == DRI2BufferFrontLeft
                    && ms->swapThrottling) ?
                   &dst_priv->fence : NULL);
index 5148a0c9baae8a9e7096c0e1ef301e72bbdb3b69..19e9bf84656d67db8c6c8a13e02b90f3d23d1e23 100644 (file)
@@ -548,7 +548,7 @@ void xorg_flush(ScreenPtr pScreen)
     if (ms->ctx) {
        int j;
 
-       ms->ctx->flush(ms->ctx, PIPE_FLUSH_RENDER_CACHE,
+       ms->ctx->flush(ms->ctx,
                       ms->dirtyThrottling ?
                       &ms->fence[XORG_NR_FENCES-1] :
                       NULL);
index 2accda1525e3fb1de2803d7eb91be6b1ce55dce0..e7d6a93e5caf5dedeb8310093b68a3150d26cb8d 100644 (file)
@@ -1072,17 +1072,17 @@ xorg_gpu_surface(struct pipe_context *pipe, struct exa_pixmap_priv *priv)
 
 }
 
-void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
+void xorg_exa_flush(struct exa_context *exa,
                     struct pipe_fence_handle **fence)
 {
-   exa->pipe->flush(exa->pipe, pipeFlushFlags, fence);
+   exa->pipe->flush(exa->pipe, fence);
 }
 
 void xorg_exa_finish(struct exa_context *exa)
 {
    struct pipe_fence_handle *fence = NULL;
 
-   xorg_exa_flush(exa, PIPE_FLUSH_RENDER_CACHE, &fence);
+   xorg_exa_flush(exa, &fence);
 
    exa->pipe->screen->fence_finish(exa->pipe->screen, fence,
                                    PIPE_TIMEOUT_INFINITE);
index 1f78f60be743f8f6237359d4e3d98715acd36603..30b6f0ce460a593b0a52db5735058bf0fbe3bcdd 100644 (file)
@@ -74,7 +74,7 @@ do {                                                          \
 struct pipe_surface *
 xorg_gpu_surface(struct pipe_context *pipe, struct exa_pixmap_priv *priv);
 
-void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
+void xorg_exa_flush(struct exa_context *exa,
                     struct pipe_fence_handle **fence);
 void xorg_exa_finish(struct exa_context *exa);
 
index 55cc0087a09eee838e96c894f6fae23a62496a75..392d1503f19b20047e076a556094c95c243be544 100644 (file)
@@ -29,7 +29,7 @@ static void draw( void )
    float clear_color[4] = {1,0,1,1};
 
    ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    graw_save_surface_to_file(ctx, surf, NULL);
 
index ff82b6071100c76350f8fcbbaf610e344ffdd3b6..fda23bd7c9ffc622bd3aa37250237ae5b15c3872 100644 (file)
@@ -276,7 +276,7 @@ static void draw( void )
 
    ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
    util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3);
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    graw_save_surface_to_file(ctx, surf, NULL);
 
index cc05889dd05c66ca3aceef8a301bdeb7c81ef4c4..ebb26d2f3f4a767266784988753c7a6472b08ba3 100644 (file)
@@ -339,7 +339,7 @@ static void draw( void )
    else
       util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3);
 
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    graw_save_surface_to_file(ctx, surf, NULL);
 
index 3c6458b434e8f06b8798badcd79457e277c34fc4..6903046cf0e774514215540523db9e0c73ef461a 100644 (file)
@@ -150,7 +150,7 @@ static void draw( void )
 
    ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
    util_draw_arrays(ctx, PIPE_PRIM_QUADS, 0, 4);
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    graw_save_surface_to_file(ctx, surf, NULL);
 
index 4e66813b301274304e5d1c7d3d62fd89f977eeb1..fd01cb3f84fc387f2e2b18d5a6d9dd9084076033 100644 (file)
@@ -147,7 +147,7 @@ static void draw( void )
 
    ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
    util_draw_arrays(ctx, PIPE_PRIM_QUADS, 0, 4);
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    graw_save_surface_to_file(ctx, surf, NULL);
 
index a23ca73ac1df4eee14ef8841045335e25a70f561..004b1691b6bb8aabf05d3c66664627555f6cb2f9 100644 (file)
@@ -149,7 +149,7 @@ static void draw( void )
 
       ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
       util_draw_arrays(ctx, PIPE_PRIM_POINTS, 0, 1);
-      ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+      ctx->flush(ctx, NULL);
 
       ctx->bind_fs_state(ctx, NULL);
       ctx->delete_fs_state(ctx, fs);
index 47b76530c6b2d62d302f9f0c41d62d52f880fa56..ab0116bed731a8794ca4b4e56f9c19177cb72d68 100644 (file)
@@ -163,7 +163,7 @@ static void draw( void )
 
    ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
    util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3);
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    screen->flush_frontbuffer(screen, tex, 0, 0, window);
 }
index 259b3d9527c92cf1a983dac92f8c2200b440c064..bed3437466644bb8030c3b8f9600d4080a998c29 100644 (file)
@@ -211,7 +211,7 @@ static void draw( void )
 
    ctx->draw_vbo(ctx, &info);
 
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    graw_save_surface_to_file(ctx, surf, NULL);
 
index 4266c0394d813b80350a01e747b66b865e99c750..30ead999a479f42a10c67ef396b30e76adc28185 100644 (file)
@@ -140,7 +140,7 @@ static void draw( void )
 
    ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
    util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3);
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    graw_save_surface_to_file(ctx, surf, NULL);
 
index dd64d8b9301d7c5502ce2b4b19bca32cebac6d0f..18e056dcb358b8641591b2c537150d4e6e1029bf 100644 (file)
@@ -227,7 +227,7 @@ static void draw( void )
 
    ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
    util_draw_arrays(ctx, PIPE_PRIM_POINTS, 0, Elements(vertices));
-   ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+   ctx->flush(ctx, NULL);
 
    graw_save_surface_to_file(ctx, surf, NULL);
 
index af93e09d8d4ecd8a45b0130de3e3ecec6f821db5..3a64b1c8d963796b196171e8ceaed9daf397fcde 100644 (file)
@@ -335,7 +335,7 @@ static void draw(struct program *p)
                                4,  /* verts */
                                2); /* attribs/vert */
 
-       p->pipe->flush(p->pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+        p->pipe->flush(p->pipe, NULL);
 
        debug_dump_surface_bmp(p->pipe, "result.bmp", p->framebuffer.cbufs[0]);
 }
index b89cfe0d98920ef2a79d5fd19b6b5542abc7e7a2..bfd2f3ca9a35a956f59c593500d2e079ebf63469 100644 (file)
@@ -264,7 +264,7 @@ static void draw(struct program *p)
                                3,  /* verts */
                                2); /* attribs/vert */
 
-       p->pipe->flush(p->pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+        p->pipe->flush(p->pipe, NULL);
 
        debug_dump_surface_bmp(p->pipe, "result.bmp", p->framebuffer.cbufs[0]);
 }
index edd774e0e0052758a2a623a13230ddb6074b570c..122a68884b4eeeeb12183c97a92126e2f9054844 100644 (file)
@@ -120,7 +120,7 @@ void *r600_bo_map(struct radeon *radeon, struct r600_bo *bo, unsigned usage, voi
                        return NULL;
                }
                if (ctx) {
-                       pctx->flush(pctx, 0, NULL);
+                        pctx->flush(pctx, NULL);
                }
        }
 
index 4ecfdbf391583e024ac7e77d452d8c0f1c6c5d41..51245766d1cd2aae9e08ad3a1f71d04c5f746d38 100644 (file)
@@ -246,7 +246,7 @@ wsw_dt_unmap(struct sw_winsys *ws,
 
    pipe->transfer_unmap(pipe, wdt->transfer);
    pipe->transfer_destroy(pipe, wdt->transfer);
-   pipe->flush(pipe, 0, NULL);
+   pipe->flush(pipe, NULL);
    wdt->transfer = NULL;
 }
 
index ce902231eff4a835489f030e9e5b3c2b7432fddc..0e27cb9a3fd7245ea98badbe8b43603104aff707 100644 (file)
@@ -76,7 +76,7 @@ display_front_buffer(struct st_context *st)
 }
 
 
-void st_flush( struct st_context *st, uint pipeFlushFlags,
+void st_flush( struct st_context *st,
                struct pipe_fence_handle **fence )
 {
    FLUSH_CURRENT(st->ctx, 0);
@@ -89,7 +89,7 @@ void st_flush( struct st_context *st, uint pipeFlushFlags,
    util_blit_flush(st->blit);
    util_gen_mipmap_flush(st->gen_mipmap);
 
-   st->pipe->flush( st->pipe, pipeFlushFlags, fence );
+   st->pipe->flush( st->pipe, fence );
 }
 
 
@@ -100,7 +100,7 @@ void st_finish( struct st_context *st )
 {
    struct pipe_fence_handle *fence = NULL;
 
-   st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
+   st_flush(st, &fence);
 
    if(fence) {
       st->pipe->screen->fence_finish(st->pipe->screen, fence,
@@ -123,7 +123,7 @@ static void st_glFlush(struct gl_context *ctx)
     * synchronization issues.  Calling finish() here will just hide
     * problems that need to be fixed elsewhere.
     */
-   st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
+   st_flush(st, NULL);
 
    if (is_front_buffer_dirty(st)) {
       display_front_buffer(st);
index 7672b4cf1da4cb9a9c6f885ba2a9c9471be0cb63..598536ba045a657f713c18c57c068bf56ce1b649 100644 (file)
@@ -40,7 +40,7 @@ extern void
 st_init_flush_functions(struct dd_function_table *functions);
 
 extern void
-st_flush(struct st_context *st, uint pipeFlushFlags,
+st_flush(struct st_context *st,
          struct pipe_fence_handle **fence);
 
 extern void
index 450909cf1820cbef1e769a77e7ad9afc5a10ee67..d575a84974b87c3525645f6419ce848549adee52 100644 (file)
@@ -72,7 +72,7 @@ static void st_fence_sync(struct gl_context *ctx, struct gl_sync_object *obj,
    assert(condition == GL_SYNC_GPU_COMMANDS_COMPLETE && flags == 0);
    assert(so->fence == NULL);
 
-   pipe->flush(pipe, 0, &so->fence);
+   pipe->flush(pipe, &so->fence);
 }
 
 static void st_check_sync(struct gl_context *ctx, struct gl_sync_object *obj)
index d85bcd4f7c3129df07c5ecfa0e8962fc54226d2c..a68544ddac759f270c2d2d5ed31a6b9f723b299d 100644 (file)
@@ -502,8 +502,8 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags,
                  struct pipe_fence_handle **fence)
 {
    struct st_context *st = (struct st_context *) stctxi;
-   st_flush(st, flags, fence);
-   if (flags & PIPE_FLUSH_RENDER_CACHE)
+   st_flush(st, fence);
+   if (flags & ST_FLUSH_FRONT)
       st_manager_flush_frontbuffer(st);
 }