Browse Source

gallium: extend pipe_context::flush for it to accept an END_OF_FRAME flag

Usage with pipe_context:
  pipe->flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME);

Usage with st_context_iface:
  st->flush(st, ST_FLUSH_END_OF_FRAME, NULL);

The flag is only a hint for drivers. Radeon will use it for buffer eviction
heuristics in the kernel (e.g. for queries like how many frames have passed
since a buffer was used).

The flag is currently only generated by st/dri on SwapBuffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
tags/gles3-fmt-v1
Marek Olšák 12 years ago
parent
commit
598cc1f74d
63 changed files with 120 additions and 81 deletions
  1. 3
    3
      src/gallium/drivers/galahad/glhd_context.c
  2. 2
    1
      src/gallium/drivers/i915/i915_flush.c
  3. 2
    2
      src/gallium/drivers/i915/i915_resource_texture.c
  4. 3
    3
      src/gallium/drivers/identity/id_context.c
  5. 2
    1
      src/gallium/drivers/llvmpipe/lp_context.c
  6. 2
    1
      src/gallium/drivers/noop/noop_pipe.c
  7. 2
    1
      src/gallium/drivers/nv30/nv30_context.c
  8. 2
    1
      src/gallium/drivers/nv50/nv50_context.c
  9. 2
    1
      src/gallium/drivers/nvc0/nvc0_context.c
  10. 2
    1
      src/gallium/drivers/r300/r300_flush.c
  11. 2
    1
      src/gallium/drivers/r600/r600_pipe.c
  12. 2
    1
      src/gallium/drivers/radeonsi/radeonsi_pipe.c
  13. 3
    3
      src/gallium/drivers/rbug/rbug_context.c
  14. 1
    1
      src/gallium/drivers/rbug/rbug_core.c
  15. 3
    2
      src/gallium/drivers/softpipe/sp_flush.c
  16. 3
    2
      src/gallium/drivers/softpipe/sp_flush.h
  17. 2
    1
      src/gallium/drivers/svga/svga_pipe_flush.c
  18. 4
    2
      src/gallium/drivers/trace/tr_context.c
  19. 4
    2
      src/gallium/include/pipe/p_context.h
  20. 6
    0
      src/gallium/include/pipe/p_defines.h
  21. 1
    0
      src/gallium/include/state_tracker/st_api.h
  22. 1
    1
      src/gallium/state_trackers/clover/core/queue.cpp
  23. 1
    1
      src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
  24. 2
    0
      src/gallium/state_trackers/dri/common/dri_drawable.c
  25. 1
    1
      src/gallium/state_trackers/dri/drm/dri2.c
  26. 1
    1
      src/gallium/state_trackers/egl/android/native_android.cpp
  27. 2
    2
      src/gallium/state_trackers/egl/common/native_helper.c
  28. 1
    1
      src/gallium/state_trackers/vdpau/presentation.c
  29. 1
    1
      src/gallium/state_trackers/vdpau/surface.c
  30. 2
    2
      src/gallium/state_trackers/vega/api_context.c
  31. 7
    1
      src/gallium/state_trackers/vega/vg_manager.c
  32. 1
    1
      src/gallium/state_trackers/xa/xa_composite.c
  33. 4
    4
      src/gallium/state_trackers/xa/xa_context.c
  34. 1
    1
      src/gallium/state_trackers/xa/xa_tracker.c
  35. 1
    1
      src/gallium/state_trackers/xa/xa_yuv.c
  36. 1
    1
      src/gallium/state_trackers/xorg/xorg_crtc.c
  37. 2
    2
      src/gallium/state_trackers/xorg/xorg_dri2.c
  38. 1
    1
      src/gallium/state_trackers/xorg/xorg_driver.c
  39. 1
    1
      src/gallium/state_trackers/xorg/xorg_exa.c
  40. 1
    1
      src/gallium/state_trackers/xvmc/surface.c
  41. 1
    1
      src/gallium/tests/graw/clear.c
  42. 1
    1
      src/gallium/tests/graw/fs-fragcoord.c
  43. 1
    1
      src/gallium/tests/graw/fs-frontface.c
  44. 1
    1
      src/gallium/tests/graw/fs-test.c
  45. 1
    1
      src/gallium/tests/graw/fs-write-z.c
  46. 1
    1
      src/gallium/tests/graw/gs-test.c
  47. 1
    1
      src/gallium/tests/graw/occlusion-query.c
  48. 1
    1
      src/gallium/tests/graw/quad-sample.c
  49. 1
    1
      src/gallium/tests/graw/quad-tex.c
  50. 1
    1
      src/gallium/tests/graw/shader-leak.c
  51. 1
    1
      src/gallium/tests/graw/tex-srgb.c
  52. 1
    1
      src/gallium/tests/graw/tex-swizzle.c
  53. 1
    1
      src/gallium/tests/graw/tri-gs.c
  54. 1
    1
      src/gallium/tests/graw/tri-instanced.c
  55. 1
    1
      src/gallium/tests/graw/tri.c
  56. 1
    1
      src/gallium/tests/graw/vs-test.c
  57. 1
    1
      src/gallium/tests/trivial/quad-tex.c
  58. 1
    1
      src/gallium/tests/trivial/tri.c
  59. 1
    1
      src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
  60. 6
    5
      src/mesa/state_tracker/st_cb_flush.c
  61. 2
    1
      src/mesa/state_tracker/st_cb_flush.h
  62. 1
    1
      src/mesa/state_tracker/st_cb_syncobj.c
  63. 7
    1
      src/mesa/state_tracker/st_manager.c

+ 3
- 3
src/gallium/drivers/galahad/glhd_context.c View File

@@ -843,13 +843,13 @@ galahad_context_clear_depth_stencil(struct pipe_context *_pipe,

static void
galahad_context_flush(struct pipe_context *_pipe,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
struct galahad_context *glhd_pipe = galahad_context(_pipe);
struct pipe_context *pipe = glhd_pipe->pipe;

pipe->flush(pipe,
fence);
pipe->flush(pipe, fence, flags);
}

static struct pipe_sampler_view *

+ 2
- 1
src/gallium/drivers/i915/i915_flush.c View File

@@ -39,7 +39,8 @@


static void i915_flush_pipe( struct pipe_context *pipe,
struct pipe_fence_handle **fence )
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags )
{
struct i915_context *i915 = i915_context(pipe);


+ 2
- 2
src/gallium/drivers/i915/i915_resource_texture.c View File

@@ -762,7 +762,7 @@ i915_texture_transfer_map(struct pipe_context *pipe,
} else {
/* TODO this is a sledgehammer */
tex = i915_texture(resource);
pipe->flush(pipe, NULL);
pipe->flush(pipe, NULL, 0);
}

offset = i915_texture_offset(tex, transfer->b.level, box->z);
@@ -805,7 +805,7 @@ i915_texture_transfer_unmap(struct pipe_context *pipe,
itransfer->b.box.x, itransfer->b.box.y, itransfer->b.box.z,
itransfer->staging_texture,
0, &sbox);
pipe->flush(pipe, NULL);
pipe->flush(pipe, NULL, 0);
pipe_resource_reference(&itransfer->staging_texture, NULL);
}


+ 3
- 3
src/gallium/drivers/identity/id_context.c View File

@@ -711,13 +711,13 @@ identity_clear_depth_stencil(struct pipe_context *_pipe,

static void
identity_flush(struct pipe_context *_pipe,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
struct identity_context *id_pipe = identity_context(_pipe);
struct pipe_context *pipe = id_pipe->pipe;

pipe->flush(pipe,
fence);
pipe->flush(pipe, fence, flags);
}

static struct pipe_sampler_view *

+ 2
- 1
src/gallium/drivers/llvmpipe/lp_context.c View File

@@ -98,7 +98,8 @@ static void llvmpipe_destroy( struct pipe_context *pipe )

static void
do_flush( struct pipe_context *pipe,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
llvmpipe_flush(pipe, fence, __FUNCTION__);
}

+ 2
- 1
src/gallium/drivers/noop/noop_pipe.c View File

@@ -242,7 +242,8 @@ static void noop_blit(struct pipe_context *ctx,
* context
*/
static void noop_flush(struct pipe_context *ctx,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
}


+ 2
- 1
src/gallium/drivers/nv30/nv30_context.c View File

@@ -67,7 +67,8 @@ nv30_context_kick_notify(struct nouveau_pushbuf *push)
}

static void
nv30_context_flush(struct pipe_context *pipe, struct pipe_fence_handle **fence)
nv30_context_flush(struct pipe_context *pipe, struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
struct nv30_context *nv30 = nv30_context(pipe);
struct nouveau_pushbuf *push = nv30->base.pushbuf;

+ 2
- 1
src/gallium/drivers/nv50/nv50_context.c View File

@@ -33,7 +33,8 @@

static void
nv50_flush(struct pipe_context *pipe,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
struct nouveau_screen *screen = nouveau_screen(pipe->screen);


+ 2
- 1
src/gallium/drivers/nvc0/nvc0_context.c View File

@@ -33,7 +33,8 @@

static void
nvc0_flush(struct pipe_context *pipe,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct nouveau_screen *screen = &nvc0->screen->base;

+ 2
- 1
src/gallium/drivers/r300/r300_flush.c View File

@@ -133,7 +133,8 @@ void r300_flush(struct pipe_context *pipe,
}

static void r300_flush_wrapped(struct pipe_context *pipe,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
r300_flush(pipe, 0, fence);
}

+ 2
- 1
src/gallium/drivers/r600/r600_pipe.c View File

@@ -143,7 +143,8 @@ void r600_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
}

static void r600_flush_from_st(struct pipe_context *ctx,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
r600_flush(ctx, fence, 0);
}

+ 2
- 1
src/gallium/drivers/radeonsi/radeonsi_pipe.c View File

@@ -158,7 +158,8 @@ void radeonsi_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
}

static void r600_flush_from_st(struct pipe_context *ctx,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
radeonsi_flush(ctx, fence, 0);
}

+ 3
- 3
src/gallium/drivers/rbug/rbug_context.c View File

@@ -941,14 +941,14 @@ rbug_clear_depth_stencil(struct pipe_context *_pipe,

static void
rbug_flush(struct pipe_context *_pipe,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;

pipe_mutex_lock(rb_pipe->call_mutex);
pipe->flush(pipe,
fence);
pipe->flush(pipe, fence, flags);
pipe_mutex_unlock(rb_pipe->call_mutex);
}


+ 1
- 1
src/gallium/drivers/rbug/rbug_core.c View File

@@ -497,7 +497,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, NULL);
rb_context->pipe->flush(rb_context->pipe, NULL, 0);

pipe_mutex_unlock(rb_context->call_mutex);
pipe_mutex_unlock(rb_screen->list_mutex);

+ 3
- 2
src/gallium/drivers/softpipe/sp_flush.c View File

@@ -93,8 +93,9 @@ softpipe_flush( struct pipe_context *pipe,
}

void
softpipe_flush_wrapped( struct pipe_context *pipe,
struct pipe_fence_handle **fence )
softpipe_flush_wrapped(struct pipe_context *pipe,
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
softpipe_flush(pipe, SP_FLUSH_TEXTURE_CACHE, fence);
}

+ 3
- 2
src/gallium/drivers/softpipe/sp_flush.h View File

@@ -41,8 +41,9 @@ softpipe_flush(struct pipe_context *pipe,
struct pipe_fence_handle **fence);

void
softpipe_flush_wrapped( struct pipe_context *pipe,
struct pipe_fence_handle **fence );
softpipe_flush_wrapped(struct pipe_context *pipe,
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags);

boolean
softpipe_flush_resource(struct pipe_context *pipe,

+ 2
- 1
src/gallium/drivers/svga/svga_pipe_flush.c View File

@@ -32,7 +32,8 @@


static void svga_flush( struct pipe_context *pipe,
struct pipe_fence_handle **fence )
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
struct svga_context *svga = svga_context(pipe);


+ 4
- 2
src/gallium/drivers/trace/tr_context.c View File

@@ -1284,7 +1284,8 @@ trace_context_clear_depth_stencil(struct pipe_context *_pipe,

static INLINE void
trace_context_flush(struct pipe_context *_pipe,
struct pipe_fence_handle **fence)
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
@@ -1292,8 +1293,9 @@ 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, fence);
pipe->flush(pipe, fence, flags);

if(fence)
trace_dump_ret(ptr, *fence);

+ 4
- 2
src/gallium/include/pipe/p_context.h View File

@@ -31,6 +31,7 @@
#include "p_compiler.h"
#include "p_format.h"
#include "p_video_enums.h"
#include "p_defines.h"

#ifdef __cplusplus
extern "C" {
@@ -349,8 +350,9 @@ struct pipe_context {

/** Flush draw commands
*/
void (*flush)( struct pipe_context *pipe,
struct pipe_fence_handle **fence );
void (*flush)(struct pipe_context *pipe,
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags);

/**
* Create a view on a texture to be used by a shader stage.

+ 6
- 0
src/gallium/include/pipe/p_defines.h View File

@@ -288,6 +288,12 @@ enum pipe_transfer_usage {

};

/**
* Flags for the flush function.
*/
enum pipe_flush_flags {
PIPE_FLUSH_END_OF_FRAME = (1 << 0)
};

/*
* Resource binding flags -- state tracker must specify in advance all

+ 1
- 0
src/gallium/include/state_tracker/st_api.h View File

@@ -158,6 +158,7 @@ enum st_context_resource_type {
* Flush flags.
*/
#define ST_FLUSH_FRONT (1 << 0)
#define ST_FLUSH_END_OF_FRAME (1 << 1)

/**
* Value to st_manager->get_param function.

+ 1
- 1
src/gallium/state_trackers/clover/core/queue.cpp View File

@@ -53,7 +53,7 @@ _cl_command_queue::flush() {
[](event_ptr &ev) { return !ev->signalled(); });

// Flush and fence them.
pipe->flush(pipe, &fence);
pipe->flush(pipe, &fence, 0);
std::for_each(first, last, [&](event_ptr &ev) { ev->fence(fence); });
screen->fence_reference(screen, &fence, NULL);
queued_events.erase(first, last);

+ 1
- 1
src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp View File

@@ -1234,7 +1234,7 @@ struct GalliumDXGISwapChain : public GalliumDXGIObject<IDXGISwapChain, GalliumDX
if(dst_surface)
pipe->surface_destroy(pipe, dst_surface);

pipe->flush(pipe, 0);
pipe->flush(pipe, NULL, 0);

memset(&ctrl, 0, sizeof(ctrl));
ctrl.natt = (db) ? NATIVE_ATTACHMENT_BACK_LEFT : NATIVE_ATTACHMENT_FRONT_LEFT;

+ 2
- 0
src/gallium/state_trackers/dri/common/dri_drawable.c View File

@@ -441,6 +441,8 @@ dri_flush(__DRIcontext *cPriv,
flush_flags = 0;
if (flags & __DRI2_FLUSH_CONTEXT)
flush_flags |= ST_FLUSH_FRONT;
if (reason == __DRI2_THROTTLE_SWAPBUFFER)
flush_flags |= ST_FLUSH_END_OF_FRAME;

/* Flush the context and throttle if needed. */
if (dri_screen(ctx->sPriv)->throttling_enabled &&

+ 1
- 1
src/gallium/state_trackers/dri/drm/dri2.c View File

@@ -420,7 +420,7 @@ dri2_flush_frontbuffer(struct dri_context *ctx,
struct pipe_context *pipe = ctx->st->pipe;

dri_msaa_resolve(ctx, drawable, ST_ATTACHMENT_FRONT_LEFT);
pipe->flush(pipe, NULL);
pipe->flush(pipe, NULL, 0);
}

if (loader->flushFrontBuffer) {

+ 1
- 1
src/gallium/state_trackers/egl/android/native_android.cpp View File

@@ -387,7 +387,7 @@ copy_resources(struct native_display *ndpy,

u_box_origin_2d(src->width0, src->height0, &box);
pipe->resource_copy_region(pipe, dst, 0, 0, 0, 0, src, 0, &box);
pipe->flush(pipe, NULL);
pipe->flush(pipe, NULL, 0);
}

static boolean

+ 2
- 2
src/gallium/state_trackers/egl/common/native_helper.c View File

@@ -352,7 +352,7 @@ resource_surface_flush(struct resource_surface *rsurf,
if (!pipe)
return FALSE;

pipe->flush(pipe, &fence);
pipe->flush(pipe, &fence, 0);
if (fence == NULL)
return FALSE;

@@ -398,7 +398,7 @@ native_display_copy_to_pixmap(struct native_display *ndpy,

u_box_origin_2d(src->width0, src->height0, &src_box);
pipe->resource_copy_region(pipe, dst, 0, 0, 0, 0, src, 0, &src_box);
pipe->flush(pipe, NULL);
pipe->flush(pipe, NULL, 0);

memset(&ctrl, 0, sizeof(ctrl));
ctrl.natt = natt;

+ 1
- 1
src/gallium/state_trackers/vdpau/presentation.c View File

@@ -275,7 +275,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
);

pipe->screen->fence_reference(pipe->screen, &surf->fence, NULL);
pipe->flush(pipe, &surf->fence);
pipe->flush(pipe, &surf->fence, 0);

if (dump_window == -1) {
dump_window = debug_get_num_option("VDPAU_DUMP", 0);

+ 1
- 1
src/gallium/state_trackers/vdpau/surface.c View File

@@ -359,5 +359,5 @@ vlVdpVideoSurfaceClear(vlVdpSurface *vlsurf)
pipe->clear_render_target(pipe, surfaces[i], &c, 0, 0,
surfaces[i]->width, surfaces[i]->height);
}
pipe->flush(pipe, NULL);
pipe->flush(pipe, NULL, 0);
}

+ 2
- 2
src/gallium/state_trackers/vega/api_context.c View File

@@ -56,7 +56,7 @@ void vegaFlush(void)
return;

pipe = ctx->pipe;
pipe->flush(pipe, NULL);
pipe->flush(pipe, NULL, 0);

vg_manager_flush_frontbuffer(ctx);
}
@@ -72,7 +72,7 @@ void vegaFinish(void)

pipe = ctx->pipe;

pipe->flush(pipe, &fence);
pipe->flush(pipe, &fence, 0);
if (fence) {
pipe->screen->fence_finish(pipe->screen, fence,
PIPE_TIMEOUT_INFINITE);

+ 7
- 1
src/gallium/state_trackers/vega/vg_manager.c View File

@@ -143,7 +143,13 @@ 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, fence);
enum pipe_flush_flags pipe_flags = 0;

if (flags & ST_FLUSH_END_OF_FRAME) {
pipe_flags |= PIPE_FLUSH_END_OF_FRAME;
}

ctx->pipe->flush(ctx->pipe, fence, pipe_flags);
if (flags & ST_FLUSH_FRONT)
vg_manager_flush_frontbuffer(ctx);
}

+ 1
- 1
src/gallium/state_trackers/xa/xa_composite.c View File

@@ -527,7 +527,7 @@ XA_EXPORT void
xa_composite_done(struct xa_context *ctx)
{
renderer_draw_flush(ctx);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence, 0);

ctx->comp = NULL;
ctx->has_solid_color = FALSE;

+ 4
- 4
src/gallium/state_trackers/xa/xa_context.c View File

@@ -119,7 +119,7 @@ xa_surface_dma(struct xa_context *ctx,
}
pipe->transfer_unmap(pipe, transfer);
if (to_surface)
pipe->flush(pipe, &ctx->last_fence);
pipe->flush(pipe, &ctx->last_fence, 0);
}
return XA_ERR_NONE;
}
@@ -244,9 +244,9 @@ xa_copy_done(struct xa_context *ctx)
{
if (!ctx->simple_copy) {
renderer_draw_flush(ctx);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence, 0);
} else
ctx->pipe->flush(ctx->pipe, &ctx->last_fence);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence, 0);
}

static void
@@ -325,7 +325,7 @@ XA_EXPORT void
xa_solid_done(struct xa_context *ctx)
{
renderer_draw_flush(ctx);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence, 0);

ctx->comp = NULL;
ctx->has_solid_color = FALSE;

+ 1
- 1
src/gallium/state_trackers/xa/xa_tracker.c View File

@@ -407,7 +407,7 @@ xa_surface_redefine(struct xa_surface *srf,
xa_min(save_height, template->height0), &src_box);
pipe->resource_copy_region(pipe, texture,
0, 0, 0, 0, srf->tex, 0, &src_box);
pipe->flush(pipe, &xa->default_ctx->last_fence);
pipe->flush(pipe, &xa->default_ctx->last_fence, 0);
}

pipe_resource_reference(&srf->tex, texture);

+ 1
- 1
src/gallium/state_trackers/xa/xa_yuv.c View File

@@ -153,7 +153,7 @@ xa_yuv_planar_blit(struct xa_context *r,
box++;
}

r->pipe->flush(r->pipe, &r->last_fence);
r->pipe->flush(r->pipe, &r->last_fence, 0);

xa_ctx_sampler_views_destroy(r);
xa_ctx_srf_destroy(r);

+ 1
- 1
src/gallium/state_trackers/xorg/xorg_crtc.c View File

@@ -248,7 +248,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
transfer->stride, 0, 0,
64, 64, (void*)image, 64 * 4, 0, 0);
ctx->transfer_unmap(ctx, transfer);
ctx->flush(ctx, &fence);
ctx->flush(ctx, &fence, 0);

if (fence) {
screen->fence_finish(screen, fence, PIPE_TIMEOUT_INFINITE);

+ 2
- 2
src/gallium/state_trackers/xorg/xorg_dri2.c View 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, NULL);
ms->ctx->flush(ms->ctx, NULL, 0);
return;
}
/* pixmap glXWaitGL */
@@ -394,7 +394,7 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
ms->ctx->flush(ms->ctx,
(pDestBuffer->attachment == DRI2BufferFrontLeft
&& ms->swapThrottling) ?
&dst_priv->fence : NULL);
&dst_priv->fence : NULL, 0);

if (cust && cust->winsys_context_throttle)
cust->winsys_context_throttle(cust, ms->ctx, THROTTLE_RENDER);

+ 1
- 1
src/gallium/state_trackers/xorg/xorg_driver.c View File

@@ -551,7 +551,7 @@ void xorg_flush(ScreenPtr pScreen)
ms->ctx->flush(ms->ctx,
ms->dirtyThrottling ?
&ms->fence[XORG_NR_FENCES-1] :
NULL);
NULL, 0);
if (ms->dirtyThrottling) {
if (ms->fence[0])

+ 1
- 1
src/gallium/state_trackers/xorg/xorg_exa.c View File

@@ -1071,7 +1071,7 @@ xorg_gpu_surface(struct pipe_context *pipe, struct exa_pixmap_priv *priv)
void xorg_exa_flush(struct exa_context *exa,
struct pipe_fence_handle **fence)
{
exa->pipe->flush(exa->pipe, fence);
exa->pipe->flush(exa->pipe, fence, 0);
}

void xorg_exa_finish(struct exa_context *exa)

+ 1
- 1
src/gallium/state_trackers/xvmc/surface.c View File

@@ -434,7 +434,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
vl_compositor_set_layer_dst_area(cstate, 1, &dst_rect);
vl_compositor_render(cstate, compositor, surf, dirty_area);

pipe->flush(pipe, &surface_priv->fence);
pipe->flush(pipe, &surface_priv->fence, 0);

XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for display. Pushing to front buffer.\n", surface);


+ 1
- 1
src/gallium/tests/graw/clear.c View File

@@ -29,7 +29,7 @@ static void draw( void )
union pipe_color_union clear_color = { {1, 0, 1, 1} };

ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0);
ctx->flush(ctx, NULL);
ctx->flush(ctx, NULL, 0);

graw_save_surface_to_file(ctx, surf, NULL);


+ 1
- 1
src/gallium/tests/graw/fs-fragcoord.c View File

@@ -185,7 +185,7 @@ draw(void)
PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL,
&clear_color, 1.0, 0);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, NUM_VERTS);
info.ctx->flush(info.ctx, NULL);
info.ctx->flush(info.ctx, NULL, 0);

#if 0
/* At the moment, libgraw leaks out/makes available some of the

+ 1
- 1
src/gallium/tests/graw/fs-frontface.c View File

@@ -159,7 +159,7 @@ draw(void)
PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL,
&clear_color, 1.0, 0);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, NUM_VERTS);
info.ctx->flush(info.ctx, NULL);
info.ctx->flush(info.ctx, NULL, 0);

graw_util_flush_front(&info);
}

+ 1
- 1
src/gallium/tests/graw/fs-test.c View File

@@ -236,7 +236,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, NULL);
ctx->flush(ctx, NULL, 0);

graw_save_surface_to_file(ctx, surf, NULL);


+ 1
- 1
src/gallium/tests/graw/fs-write-z.c View File

@@ -164,7 +164,7 @@ draw(void)
PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL,
&clear_color, 1.0, 0);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, NUM_VERTS);
info.ctx->flush(info.ctx, NULL);
info.ctx->flush(info.ctx, NULL, 0);

#if 0
/* At the moment, libgraw leaks out/makes available some of the

+ 1
- 1
src/gallium/tests/graw/gs-test.c View File

@@ -343,7 +343,7 @@ static void draw( void )
else
util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3);

ctx->flush(ctx, NULL);
ctx->flush(ctx, NULL, 0);

graw_save_surface_to_file(ctx, surf, NULL);


+ 1
- 1
src/gallium/tests/graw/occlusion-query.c View File

@@ -193,7 +193,7 @@ draw(void)
if (res2.u64 < expected2_min || res2.u64 > expected2_max)
printf(" Failure: result2 should be near %d\n", expected2);

info.ctx->flush(info.ctx, NULL);
info.ctx->flush(info.ctx, NULL, 0);

graw_util_flush_front(&info);


+ 1
- 1
src/gallium/tests/graw/quad-sample.c View File

@@ -152,7 +152,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, NULL);
ctx->flush(ctx, NULL, 0);

graw_save_surface_to_file(ctx, surf, NULL);


+ 1
- 1
src/gallium/tests/graw/quad-tex.c View File

@@ -107,7 +107,7 @@ static void draw( void )

info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4);
info.ctx->flush(info.ctx, NULL);
info.ctx->flush(info.ctx, NULL, 0);

graw_save_surface_to_file(info.ctx, info.color_surf[0], NULL);


+ 1
- 1
src/gallium/tests/graw/shader-leak.c View File

@@ -152,7 +152,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, NULL);
ctx->flush(ctx, NULL, 0);

ctx->bind_fs_state(ctx, NULL);
ctx->delete_fs_state(ctx, fs);

+ 1
- 1
src/gallium/tests/graw/tex-srgb.c View File

@@ -136,7 +136,7 @@ static void draw( void )
set_vertices(vertices2, 4);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4);

info.ctx->flush(info.ctx, NULL);
info.ctx->flush(info.ctx, NULL, 0);

graw_util_flush_front(&info);
}

+ 1
- 1
src/gallium/tests/graw/tex-swizzle.c View File

@@ -108,7 +108,7 @@ static void draw(void)

info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4);
info.ctx->flush(info.ctx, NULL);
info.ctx->flush(info.ctx, NULL, 0);

graw_util_flush_front(&info);
}

+ 1
- 1
src/gallium/tests/graw/tri-gs.c View File

@@ -166,7 +166,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, NULL);
ctx->flush(ctx, NULL, 0);

screen->flush_frontbuffer(screen, tex, 0, 0, window);
}

+ 1
- 1
src/gallium/tests/graw/tri-instanced.c View File

@@ -215,7 +215,7 @@ static void draw( void )

ctx->draw_vbo(ctx, &info);

ctx->flush(ctx, NULL);
ctx->flush(ctx, NULL, 0);

graw_save_surface_to_file(ctx, surf, NULL);


+ 1
- 1
src/gallium/tests/graw/tri.c View File

@@ -105,7 +105,7 @@ static void draw( void )

info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0);
util_draw_arrays(info.ctx, PIPE_PRIM_TRIANGLES, 0, 3);
info.ctx->flush(info.ctx, NULL);
info.ctx->flush(info.ctx, NULL, 0);

graw_save_surface_to_file(info.ctx, info.color_surf[0], NULL);


+ 1
- 1
src/gallium/tests/graw/vs-test.c View File

@@ -230,7 +230,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, NULL);
ctx->flush(ctx, NULL, 0);

graw_save_surface_to_file(ctx, surf, NULL);


+ 1
- 1
src/gallium/tests/trivial/quad-tex.c View File

@@ -333,7 +333,7 @@ static void draw(struct program *p)
4, /* verts */
2); /* attribs/vert */

p->pipe->flush(p->pipe, NULL);
p->pipe->flush(p->pipe, NULL, 0);

debug_dump_surface_bmp(p->pipe, "result.bmp", p->framebuffer.cbufs[0]);
}

+ 1
- 1
src/gallium/tests/trivial/tri.c View File

@@ -266,7 +266,7 @@ static void draw(struct program *p)
3, /* verts */
2); /* attribs/vert */

p->pipe->flush(p->pipe, NULL);
p->pipe->flush(p->pipe, NULL, 0);

debug_dump_surface_bmp(p->pipe, "result.bmp", p->framebuffer.cbufs[0]);
}

+ 1
- 1
src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c View File

@@ -242,7 +242,7 @@ wsw_dt_unmap(struct sw_winsys *ws,
return;

pipe->transfer_unmap(pipe, wdt->transfer);
pipe->flush(pipe, NULL);
pipe->flush(pipe, NULL, 0);
wdt->transfer = NULL;
}


+ 6
- 5
src/mesa/state_tracker/st_cb_flush.c View File

@@ -76,15 +76,16 @@ display_front_buffer(struct st_context *st)
}


void st_flush( struct st_context *st,
struct pipe_fence_handle **fence )
void st_flush(struct st_context *st,
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags)
{
FLUSH_VERTICES(st->ctx, 0);
FLUSH_CURRENT(st->ctx, 0);

st_flush_bitmap_cache(st);

st->pipe->flush( st->pipe, fence );
st->pipe->flush(st->pipe, fence, flags);
}


@@ -95,7 +96,7 @@ void st_finish( struct st_context *st )
{
struct pipe_fence_handle *fence = NULL;

st_flush(st, &fence);
st_flush(st, &fence, 0);

if(fence) {
st->pipe->screen->fence_finish(st->pipe->screen, fence,
@@ -118,7 +119,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, NULL);
st_flush(st, NULL, 0);

if (is_front_buffer_dirty(st)) {
display_front_buffer(st);

+ 2
- 1
src/mesa/state_tracker/st_cb_flush.h View File

@@ -41,7 +41,8 @@ st_init_flush_functions(struct dd_function_table *functions);

extern void
st_flush(struct st_context *st,
struct pipe_fence_handle **fence);
struct pipe_fence_handle **fence,
enum pipe_flush_flags flags);

extern void
st_finish(struct st_context *st);

+ 1
- 1
src/mesa/state_tracker/st_cb_syncobj.c View 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, &so->fence);
pipe->flush(pipe, &so->fence, 0);
}

static void st_check_sync(struct gl_context *ctx, struct gl_sync_object *obj)

+ 7
- 1
src/mesa/state_tracker/st_manager.c View File

@@ -455,7 +455,13 @@ 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, fence);
enum pipe_flush_flags pipe_flags = 0;

if (flags & ST_FLUSH_END_OF_FRAME) {
pipe_flags |= PIPE_FLUSH_END_OF_FRAME;
}

st_flush(st, fence, pipe_flags);
if (flags & ST_FLUSH_FRONT)
st_manager_flush_frontbuffer(st);
}

Loading…
Cancel
Save