This fixes rare graphical corruption.
NOTE: This is a candidate for the stable branches.
if (rctx->framebuffer.state.nr_cbufs) {
rctx->flags |= R600_CONTEXT_CB_FLUSH;
+
+ if (rctx->framebuffer.state.cbufs[0]->texture->nr_samples > 1) {
+ rctx->flags |= R600_CONTEXT_FLUSH_AND_INV_CB_META;
+ }
}
if (rctx->framebuffer.state.zsbuf) {
rctx->flags |= R600_CONTEXT_DB_FLUSH;
#define R600_CONTEXT_WAIT_IDLE (1 << 7)
#define R600_CONTEXT_FLUSH_AND_INV (1 << 8)
#define R600_CONTEXT_HTILE_ERRATA (1 << 9)
+#define R600_CONTEXT_FLUSH_AND_INV_CB_META (1 << 10)
struct r600_context;
struct r600_screen;
cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_PS_PARTIAL_FLUSH) | EVENT_INDEX(4);
}
+ if (rctx->chip_class >= R700 &&
+ (rctx->flags & R600_CONTEXT_FLUSH_AND_INV_CB_META)) {
+ cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 0, 0);
+ cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_FLUSH_AND_INV_CB_META) | EVENT_INDEX(0);
+ }
+
if (rctx->flags & R600_CONTEXT_FLUSH_AND_INV) {
cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 0, 0);
cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_EVENT) | EVENT_INDEX(0);
#include "r600_pipe.h"
/* the number of CS dwords for flushing and drawing */
-#define R600_MAX_FLUSH_CS_DWORDS 44
+#define R600_MAX_FLUSH_CS_DWORDS 46
#define R600_MAX_DRAW_CS_DWORDS 34
/* these flags are used in register flags and added into block flags */
if (rctx->framebuffer.state.nr_cbufs) {
rctx->flags |= R600_CONTEXT_CB_FLUSH;
+
+ if (rctx->chip_class >= R700 &&
+ rctx->framebuffer.state.cbufs[0]->texture->nr_samples > 1) {
+ rctx->flags |= R600_CONTEXT_FLUSH_AND_INV_CB_META;
+ }
}
if (rctx->framebuffer.state.zsbuf) {
rctx->flags |= R600_CONTEXT_DB_FLUSH;
#define EVENT_TYPE_CACHE_FLUSH_AND_INV_EVENT 0x16
#define EVENT_TYPE_SO_VGTSTREAMOUT_FLUSH 0x1f
#define EVENT_TYPE_SAMPLE_STREAMOUTSTATS 0x20
+#define EVENT_TYPE_FLUSH_AND_INV_CB_META 46 /* supported on r700+ */
#define EVENT_TYPE(x) ((x) << 0)
#define EVENT_INDEX(x) ((x) << 8)
/* 0 - any non-TS event