radeonsi: add a combined flag for flushing a framebuffer
authorMarek Olšák <marek.olsak@amd.com>
Tue, 30 Dec 2014 12:08:32 +0000 (13:08 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jan 2015 11:06:43 +0000 (12:06 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_hw_context.c
src/gallium/drivers/radeonsi/si_pipe.h

index 8f27624a8ea8d50fe36633f43c872dfd81073d0b..d46f4e522e60c956ca32432ec946d27dcc6e71d5 100644 (file)
@@ -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 */
index 682988facfc2bfac6ef6fe64e421ab15c7d34073..21c3ebfc4a5d29a297c91ddce3d0141d5ccc327f 100644 (file)
@@ -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 */
index e420d1fdf67769ea6ba3bf8dc2ed8c245740907c..287537fe8bd3aeae6a7760a966cbf888e12e98e0 100644 (file)
 #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 {