Mesa (master): svga: Tell the host to discard when doing writes without FLUSH_EXPLICIT.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Mar 15 15:47:41 UTC 2011


Module: Mesa
Branch: master
Commit: b0fff8d17eb65368db018f6ccc226482ccf46763
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0fff8d17eb65368db018f6ccc226482ccf46763

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Mar 14 16:55:46 2011 +0000

svga: Tell the host to discard when doing writes without FLUSH_EXPLICIT.

---

 src/gallium/drivers/svga/svga_resource_buffer.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c
index ae854a8..2d7c524 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer.c
+++ b/src/gallium/drivers/svga/svga_resource_buffer.c
@@ -228,11 +228,18 @@ svga_buffer_unmap( struct pipe_context *pipe,
    if(sbuf->hwbuf)
       sws->buffer_unmap(sws, sbuf->hwbuf);
 
-   if(sbuf->map.writing) {
-      if(!sbuf->map.flush_explicit) {
-         /* No mapped range was flushed -- flush the whole buffer */
+   if (sbuf->map.writing) {
+      if (!sbuf->map.flush_explicit) {
+         /*
+          * Mapped range not flushed explicitly, so flush the whole buffer,
+          * and tell the host to discard the contents when processing the DMA
+          * command.
+          */
+
          SVGA_DBG(DEBUG_DMA, "flushing the whole buffer\n");
    
+         sbuf->dma.flags.discard = TRUE;
+
          svga_buffer_add_range(sbuf, 0, sbuf->b.b.width0);
       }
       




More information about the mesa-commit mailing list