Mesa (mesa_7_7_branch): svga: Always pass SVGA3D_SURFACE_HINT_DYNAMIC.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Fri Dec 11 06:14:18 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: 8469baf41bd4775eab2403ecf08ed013343943a5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8469baf41bd4775eab2403ecf08ed013343943a5

Author: José Fonseca <jfonseca at vmware.com>
Date:   Fri Dec 11 13:15:12 2009 +0000

svga: Always pass SVGA3D_SURFACE_HINT_DYNAMIC.

Since we're reusing buffers we're effectively transforming all
of them into dynamic buffers.

It would be nice to not cache long lived static buffers. But there
is no way to detect the long lived from short lived ones yet. A
good heuristic would be buffer size.

---

 src/gallium/drivers/svga/svga_screen_cache.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c
index 8a06383..eff36e0 100644
--- a/src/gallium/drivers/svga/svga_screen_cache.c
+++ b/src/gallium/drivers/svga/svga_screen_cache.c
@@ -277,6 +277,15 @@ svga_screen_surface_create(struct svga_screen *svgascreen,
          while(size < key->size.width)
             size <<= 1;
          key->size.width = size;
+	 /* Since we're reusing buffers we're effectively transforming all
+	  * of them into dynamic buffers.
+	  *
+	  * It would be nice to not cache long lived static buffers. But there
+	  * is no way to detect the long lived from short lived ones yet. A
+	  * good heuristic would be buffer size.
+	  */
+	 key->flags &= ~SVGA3D_SURFACE_HINT_STATIC;
+	 key->flags |= SVGA3D_SURFACE_HINT_DYNAMIC;
       }
 
       handle = svga_screen_cache_lookup(svgascreen, key);



More information about the mesa-commit mailing list