Module: Mesa
Branch: 9.1
Commit: 11d9f75f01c96658a6413dc07a0f0f102397aead
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=11d9f75f01c96658a6413dc07a0f0f102397aead

Author: Alex Deucher <alexander.deuc...@amd.com>
Date:   Fri Feb 22 17:02:54 2013 -0500

r600g: add PS_PARTIAL_FLUSH flag

PS_PARTIAL flushes seems to be required in certain
cases to prevent hangs, especially on r6xx.

Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
(cherry picked from commit 7ebf83f109db9dde89830d5844107c936cf42e4d)

---

 src/gallium/drivers/r600/r600.h            |    1 +
 src/gallium/drivers/r600/r600_hw_context.c |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h
index 08b77e4..11dbb3b 100644
--- a/src/gallium/drivers/r600/r600.h
+++ b/src/gallium/drivers/r600/r600.h
@@ -151,6 +151,7 @@ struct r600_so_target {
 #define R600_CONTEXT_WAIT_CP_DMA_IDLE          (1 << 3)
 #define R600_CONTEXT_FLUSH_AND_INV             (1 << 4)
 #define R600_CONTEXT_FLUSH_AND_INV_CB_META     (1 << 5)
+#define R600_CONTEXT_PS_PARTIAL_FLUSH          (1 << 6)
 
 struct r600_context;
 struct r600_screen;
diff --git a/src/gallium/drivers/r600/r600_hw_context.c 
b/src/gallium/drivers/r600/r600_hw_context.c
index 44a9c82..9f0a1f3 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -622,6 +622,11 @@ void r600_flush_emit(struct r600_context *rctx)
                return;
        }
 
+       if (rctx->flags & R600_CONTEXT_PS_PARTIAL_FLUSH) {
+               cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 0, 0);
+               cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_PS_PARTIAL_FLUSH) | 
EVENT_INDEX(4);
+       }
+
        if (rctx->flags & R600_CONTEXT_WAIT_3D_IDLE) {
                wait_until |= S_008040_WAIT_3D_IDLE(1);
        }

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to