X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_screen_cache.h;h=96e1e9c52e28496beb218c5ac797b9cf7e3fe991;hb=be5276ae7d24563301ae627b994f612069c32461;hp=f5aa740d408c59839fb4cd1c76b2301eedbfc8ce;hpb=9c6a9363ef96c00dd0ad63e340b32479e43fea45;p=mesa.git diff --git a/src/gallium/drivers/svga/svga_screen_cache.h b/src/gallium/drivers/svga/svga_screen_cache.h index f5aa740d408..96e1e9c52e2 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.h +++ b/src/gallium/drivers/svga/svga_screen_cache.h @@ -1,3 +1,4 @@ + /********************************************************** * Copyright 2008-2009 VMware, Inc. All rights reserved. * @@ -31,7 +32,7 @@ #include "svga_reg.h" #include "svga3d_reg.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_double_list.h" @@ -39,7 +40,7 @@ /* 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: */ @@ -89,13 +90,13 @@ struct svga_host_surface_cache_entry * 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 @@ -117,6 +118,9 @@ 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; }; @@ -140,5 +144,8 @@ svga_screen_surface_destroy(struct svga_screen *svgascreen, 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_ */