radeonsi: add safety assertions for meta cache flushes
authorMarek Olšák <marek.olsak@amd.com>
Sun, 17 Apr 2016 14:14:32 +0000 (16:14 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 18 Apr 2016 17:51:25 +0000 (19:51 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index 86fb443102271945e9e94efab6f37ec9d589dd8d..c9f56c6146e12708b58b40cb7c52a344a0db30f5 100644 (file)
@@ -662,10 +662,14 @@ void si_emit_cache_flush(struct si_context *si_ctx, struct r600_atom *atom)
        if (sctx->flags & SI_CONTEXT_FLUSH_AND_INV_CB_META) {
                radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0) | compute);
                radeon_emit(cs, EVENT_TYPE(V_028A90_FLUSH_AND_INV_CB_META) | EVENT_INDEX(0));
+               /* needed for wait for idle in SURFACE_SYNC */
+               assert(sctx->flags & SI_CONTEXT_FLUSH_AND_INV_CB);
        }
        if (sctx->flags & SI_CONTEXT_FLUSH_AND_INV_DB_META) {
                radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0) | compute);
                radeon_emit(cs, EVENT_TYPE(V_028A90_FLUSH_AND_INV_DB_META) | EVENT_INDEX(0));
+               /* needed for wait for idle in SURFACE_SYNC */
+               assert(sctx->flags & SI_CONTEXT_FLUSH_AND_INV_DB);
        }
        if (sctx->flags & SI_CONTEXT_FLUSH_WITH_INV_L2) {
                radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0) | compute);