[Mesa-dev] [RFC 3/7] xa: export a common context flush function
Brian Paul
brianp at vmware.com
Tue May 28 08:54:27 PDT 2013
On 05/28/2013 08:13 AM, Rob Clark wrote:
> From: Jerome Glisse <jglisse at redhat.com>
>
> First step before moving flushing inside the ddx.
>
> Signed-off-by: Jerome Glisse <jglisse at redhat.com>
> ---
> src/gallium/state_trackers/xa/xa_composite.c | 2 +-
> src/gallium/state_trackers/xa/xa_context.c | 17 +++++++++++------
> src/gallium/state_trackers/xa/xa_context.h | 2 ++
> src/gallium/state_trackers/xa/xa_priv.h | 3 +++
> 4 files changed, 17 insertions(+), 7 deletions(-)
>
> diff --git a/src/gallium/state_trackers/xa/xa_composite.c b/src/gallium/state_trackers/xa/xa_composite.c
> index eb949b9..a6bfa11 100644
> --- a/src/gallium/state_trackers/xa/xa_composite.c
> +++ b/src/gallium/state_trackers/xa/xa_composite.c
> @@ -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;
> diff --git a/src/gallium/state_trackers/xa/xa_context.c b/src/gallium/state_trackers/xa/xa_context.c
> index b31d555..badd47c 100644
> --- a/src/gallium/state_trackers/xa/xa_context.c
> +++ b/src/gallium/state_trackers/xa/xa_context.c
> @@ -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);
I believe 4-space indentation is the convention here.
> +}
>
> 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;
> diff --git a/src/gallium/state_trackers/xa/xa_context.h b/src/gallium/state_trackers/xa/xa_context.h
> index b547abf..202b8e5 100644
> --- a/src/gallium/state_trackers/xa/xa_context.h
> +++ b/src/gallium/state_trackers/xa/xa_context.h
> @@ -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.
> *
> diff --git a/src/gallium/state_trackers/xa/xa_priv.h b/src/gallium/state_trackers/xa/xa_priv.h
> index de4639a..2ab11b8 100644
> --- a/src/gallium/state_trackers/xa/xa_priv.h
> +++ b/src/gallium/state_trackers/xa/xa_priv.h
> @@ -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);
>
>
More information about the mesa-dev
mailing list