aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2013-03-04 12:26:18 -0500
committerRob Clark <[email protected]>2013-07-25 13:59:55 -0400
commit6e8c9589dbd714ac5fdff0c14f2b0abdf1fdcdf7 (patch)
treee68f325ec679f89a582116ca22083018f482c4cc /src
parentd1444225d3a600be77602af35d1e9879e469c70e (diff)
xa: export a common context flush function
First step before moving flushing inside the ddx. Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/xa/xa_composite.c2
-rw-r--r--src/gallium/state_trackers/xa/xa_context.c17
-rw-r--r--src/gallium/state_trackers/xa/xa_context.h2
-rw-r--r--src/gallium/state_trackers/xa/xa_priv.h3
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 eb949b93cd1..a6bfa11a2f1 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 b31d555c50a..badd47cd3fc 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);
+}
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 b547abf96a3..202b8e56e23 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 de4639a41a8..2ab11b82b26 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);