Mesa (openchrome-branch): openchrome: Flush before mapping if buffers are already on validate list.

Thomas Hellstrom thomash at kemper.freedesktop.org
Sun Feb 22 23:34:05 PST 2009


Module: Mesa
Branch: openchrome-branch
Commit: 3238bd47fb32484320405a6e02d7592e11332834
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3238bd47fb32484320405a6e02d7592e11332834

Author: Thomas Hellstrom <thomas-at-shipmail-dot-org>
Date:   Sun Feb 22 21:36:17 2009 +0100

openchrome: Flush before mapping if buffers are already on validate list.

---

 src/mesa/drivers/dri/openchrome/via_depthstencil.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/openchrome/via_depthstencil.c b/src/mesa/drivers/dri/openchrome/via_depthstencil.c
index 13c5501..ef49169 100644
--- a/src/mesa/drivers/dri/openchrome/via_depthstencil.c
+++ b/src/mesa/drivers/dri/openchrome/via_depthstencil.c
@@ -92,9 +92,16 @@ map_buffers(GLcontext * ctx,
 	    struct via_renderbuffer *depthRb,
 	    struct via_renderbuffer *stencilRb)
 {
+    struct via_context *vmesa = VIA_CONTEXT(ctx);
     int ret;
+    int flushed = 0;
 
     if (depthRb && depthRb->buf) {
+	if (wsbmBOOnList(depthRb->buf)) {
+	    VIA_FLUSH_DMA(vmesa);
+	    flushed = 1;
+	}
+	    
 	ret = wsbmBOSyncForCpu(depthRb->buf,
 			       WSBM_SYNCCPU_READ | WSBM_SYNCCPU_WRITE);
 	if (ret)
@@ -109,6 +116,10 @@ map_buffers(GLcontext * ctx,
     }
 
     if (stencilRb && stencilRb->buf) {
+	if (!flushed && wsbmBOOnList(stencilRb->buf)) {
+	    VIA_FLUSH_DMA(vmesa);
+	}
+
 	ret = wsbmBOSyncForCpu(stencilRb->buf,
 			       WSBM_SYNCCPU_READ | WSBM_SYNCCPU_WRITE);
 	if (ret)



More information about the mesa-commit mailing list