Commit 6e8c9589 authored by Jerome Glisse's avatar Jerome Glisse Committed by Rob Clark

xa: export a common context flush function

First step before moving flushing inside the ddx.
Signed-off-by: default avatarJerome Glisse <jglisse@redhat.com>
parent d1444225
......@@ -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, 0);
xa_context_flush(ctx);
ctx->comp = NULL;
ctx->has_solid_color = FALSE;
......
......@@ -34,6 +34,11 @@
#include "util/u_surface.h"
#include "pipe/p_context.h"
XA_EXPORT void
xa_context_flush(struct xa_context *ctx)
{
ctx->pipe->flush(ctx->pipe, &ctx->last_fence, 0);
}
XA_EXPORT struct xa_context *
xa_context_default(struct xa_tracker *xa)
......@@ -119,7 +124,7 @@ xa_surface_dma(struct xa_context *ctx,
}
pipe->transfer_unmap(pipe, transfer);
if (to_surface)
pipe->flush(pipe, &ctx->last_fence, 0);
xa_context_flush(ctx);
}
return XA_ERR_NONE;
}
......@@ -139,9 +144,9 @@ xa_surface_map(struct xa_context *ctx,
return NULL;
if (usage & XA_MAP_READ)
transfer_direction = PIPE_TRANSFER_READ;
transfer_direction |= PIPE_TRANSFER_READ;
if (usage & XA_MAP_WRITE)
transfer_direction = PIPE_TRANSFER_WRITE;
transfer_direction |= PIPE_TRANSFER_WRITE;
if (!transfer_direction)
return NULL;
......@@ -244,9 +249,9 @@ xa_copy_done(struct xa_context *ctx)
{
if (!ctx->simple_copy) {
renderer_draw_flush(ctx);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence, 0);
xa_context_flush(ctx);
} else
ctx->pipe->flush(ctx->pipe, &ctx->last_fence, 0);
xa_context_flush(ctx);
}
static void
......@@ -325,7 +330,7 @@ XA_EXPORT void
xa_solid_done(struct xa_context *ctx)
{
renderer_draw_flush(ctx);
ctx->pipe->flush(ctx->pipe, &ctx->last_fence, 0);
xa_context_flush(ctx);
ctx->comp = NULL;
ctx->has_solid_color = FALSE;
......
......@@ -40,6 +40,8 @@ extern struct xa_context *xa_context_create(struct xa_tracker *xa);
extern void xa_context_destroy(struct xa_context *r);
extern void xa_context_flush(struct xa_context *ctx);
/**
* xa_yuv_planar_blit - 2D blit with color conversion and scaling.
*
......
......@@ -205,6 +205,9 @@ struct xa_shader xa_shaders_get(struct xa_shaders *shaders,
/*
* xa_context.c
*/
extern void
xa_context_flush(struct xa_context *ctx);
extern int
xa_ctx_srf_create(struct xa_context *ctx, struct xa_surface *dst);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment