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>
This commit is contained in:
@@ -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 *
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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 *
|
||||
|
@@ -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__);
|
||||
}
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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,
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
|
@@ -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.
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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 &&
|
||||
|
@@ -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) {
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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])
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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]);
|
||||
}
|
||||
|
@@ -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]);
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user