[Mesa-dev] [PATCH 04/13] radeonsi: add a combined flag for flushing a framebuffer
Marek Olšák
maraeo at gmail.com
Mon Jan 5 12:20:54 PST 2015
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeonsi/si_descriptors.c | 20 ++++----------------
src/gallium/drivers/radeonsi/si_hw_context.c | 5 +----
src/gallium/drivers/radeonsi/si_pipe.h | 5 +++++
3 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 8f27624..d46f4e5 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -1085,10 +1085,7 @@ static void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
sctx->b.flags |= SI_CONTEXT_INV_TC_L1 |
SI_CONTEXT_INV_TC_L2 |
SI_CONTEXT_INV_KCACHE |
- SI_CONTEXT_FLUSH_AND_INV_CB |
- SI_CONTEXT_FLUSH_AND_INV_DB |
- SI_CONTEXT_FLUSH_AND_INV_CB_META |
- SI_CONTEXT_FLUSH_AND_INV_DB_META;
+ SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER;
sctx->b.flags |= SI_CONTEXT_PS_PARTIAL_FLUSH;
while (size) {
@@ -1127,10 +1124,7 @@ static void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
sctx->b.flags |= SI_CONTEXT_INV_TC_L1 |
SI_CONTEXT_INV_TC_L2 |
SI_CONTEXT_INV_KCACHE |
- SI_CONTEXT_FLUSH_AND_INV_CB |
- SI_CONTEXT_FLUSH_AND_INV_DB |
- SI_CONTEXT_FLUSH_AND_INV_CB_META |
- SI_CONTEXT_FLUSH_AND_INV_DB_META;
+ SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER;
}
void si_copy_buffer(struct si_context *sctx,
@@ -1153,10 +1147,7 @@ void si_copy_buffer(struct si_context *sctx,
sctx->b.flags |= SI_CONTEXT_INV_TC_L1 |
SI_CONTEXT_INV_TC_L2 |
SI_CONTEXT_INV_KCACHE |
- SI_CONTEXT_FLUSH_AND_INV_CB |
- SI_CONTEXT_FLUSH_AND_INV_DB |
- SI_CONTEXT_FLUSH_AND_INV_CB_META |
- SI_CONTEXT_FLUSH_AND_INV_DB_META |
+ SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER |
SI_CONTEXT_PS_PARTIAL_FLUSH;
while (size) {
@@ -1192,10 +1183,7 @@ void si_copy_buffer(struct si_context *sctx,
sctx->b.flags |= SI_CONTEXT_INV_TC_L1 |
SI_CONTEXT_INV_TC_L2 |
SI_CONTEXT_INV_KCACHE |
- SI_CONTEXT_FLUSH_AND_INV_CB |
- SI_CONTEXT_FLUSH_AND_INV_DB |
- SI_CONTEXT_FLUSH_AND_INV_CB_META |
- SI_CONTEXT_FLUSH_AND_INV_DB_META;
+ SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER;
}
/* INIT/DEINIT */
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
index 682988f..21c3ebf 100644
--- a/src/gallium/drivers/radeonsi/si_hw_context.c
+++ b/src/gallium/drivers/radeonsi/si_hw_context.c
@@ -90,10 +90,7 @@ void si_context_gfx_flush(void *context, unsigned flags,
r600_preflush_suspend_features(&ctx->b);
- ctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_CB |
- SI_CONTEXT_FLUSH_AND_INV_CB_META |
- SI_CONTEXT_FLUSH_AND_INV_DB |
- SI_CONTEXT_FLUSH_AND_INV_DB_META |
+ ctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER |
SI_CONTEXT_INV_TC_L1 |
SI_CONTEXT_INV_TC_L2 |
/* this is probably not needed anymore */
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 5a9b90d..4acc9f9 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -71,6 +71,11 @@
#define SI_CONTEXT_FLUSH_WITH_INV_L2 (R600_CONTEXT_PRIVATE_FLAG << 12) /* TODO: merge with TC? */
#define SI_CONTEXT_FLAG_COMPUTE (R600_CONTEXT_PRIVATE_FLAG << 13)
+#define SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER (SI_CONTEXT_FLUSH_AND_INV_CB | \
+ SI_CONTEXT_FLUSH_AND_INV_CB_META | \
+ SI_CONTEXT_FLUSH_AND_INV_DB | \
+ SI_CONTEXT_FLUSH_AND_INV_DB_META)
+
struct si_compute;
struct si_screen {
--
2.1.0
More information about the mesa-dev
mailing list