+
/**********************************************************
* Copyright 2008-2009 VMware, Inc. All rights reserved.
*
/* Guess the storage size of cached surfaces and try and keep it under
* this amount:
*/
-#define SVGA_HOST_SURFACE_CACHE_BYTES 16*1024*1024
+#define SVGA_HOST_SURFACE_CACHE_BYTES (16 * 1024 * 1024)
/* Maximum number of discrete surfaces in the cache:
*/
* Cache of the host surfaces.
*
* A cache entry can be in the following stages:
- * 1. empty
+ * 1. empty (entry->handle = NULL)
* 2. holding a buffer in a validate list
* 3. holding a flushed buffer (not in any validate list) with an active fence
* 4. holding a flushed buffer with an expired fence
*
* An entry progresses from 1 -> 2 -> 3 -> 4. When we need an entry to put a
- * buffer into we preferencial take from 1, or from the least recentely used
+ * buffer into we preferentially take from 1, or from the least recently used
* buffer from 3/4.
*/
struct svga_host_surface_cache
/** The actual storage for the entries */
struct svga_host_surface_cache_entry entries[SVGA_HOST_SURFACE_CACHE_SIZE];
+
+ /** Sum of sizes of all surfaces (in bytes) */
+ unsigned total_size;
};
const struct svga_host_surface_cache_key *key,
struct svga_winsys_surface **handle);
+void
+svga_screen_cache_dump(const struct svga_screen *svgascreen);
+
#endif /* SVGA_SCREEN_CACHE_H_ */