From 0aecf9e2d18804d83473a5cc142297c1bbae04f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 30 Dec 2014 13:08:32 +0100 Subject: [PATCH] radeonsi: add a combined flag for flushing a framebuffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Michel Dänzer --- 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 8f27624a8ea..d46f4e522e6 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 682988facfc..21c3ebfc4a5 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 e420d1fdf67..287537fe8bd 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -73,6 +73,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.30.2