Mesa (master): svga: add some comments in svga_screen_cache.c
Brian Paul
brianp at kemper.freedesktop.org
Thu Aug 2 15:41:44 UTC 2012
Module: Mesa
Branch: master
Commit: 81f2f3f65c5cbff6db476e564da18198336e13d1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=81f2f3f65c5cbff6db476e564da18198336e13d1
Author: Brian Paul <brianp at vmware.com>
Date: Thu Aug 2 09:40:40 2012 -0600
svga: add some comments in svga_screen_cache.c
---
src/gallium/drivers/svga/svga_screen_cache.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c
index 9350fee..fa19073 100644
--- a/src/gallium/drivers/svga/svga_screen_cache.c
+++ b/src/gallium/drivers/svga/svga_screen_cache.c
@@ -194,7 +194,7 @@ svga_screen_cache_shrink(struct svga_screen *svgascreen,
}
-/*
+/**
* Transfers a handle reference.
*/
static INLINE void
@@ -331,6 +331,10 @@ svga_screen_cache_flush(struct svga_screen *svgascreen,
}
+/**
+ * Free all the surfaces in the cache.
+ * Called when destroying the svga screen object.
+ */
void
svga_screen_cache_cleanup(struct svga_screen *svgascreen)
{
@@ -381,6 +385,11 @@ svga_screen_cache_init(struct svga_screen *svgascreen)
}
+/**
+ * Allocate a new host-side surface. If the surface is marked as cachable,
+ * first try re-using a surface in the cache of freed surfaces. Otherwise,
+ * allocate a new surface.
+ */
struct svga_winsys_surface *
svga_screen_surface_create(struct svga_screen *svgascreen,
struct svga_host_surface_cache_key *key)
@@ -457,6 +466,10 @@ svga_screen_surface_create(struct svga_screen *svgascreen,
}
+/**
+ * Release a surface. We don't actually free the surface- we put
+ * it into the cache of freed surfaces (if it's cachable).
+ */
void
svga_screen_surface_destroy(struct svga_screen *svgascreen,
const struct svga_host_surface_cache_key *key,
More information about the mesa-commit
mailing list