From 1fd82451eb8a76f2df85720e8d9d607d9e37ab24 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 7 Feb 2008 15:12:59 -0800 Subject: [PATCH] [965] Remove stale brw_state_cache.c comment and function export. --- src/mesa/drivers/dri/i965/brw_state.h | 1 - src/mesa/drivers/dri/i965/brw_state_cache.c | 44 ++++++--------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 1510e5b0425..d1fca051ecc 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -114,7 +114,6 @@ dri_bo *brw_search_cache( struct brw_cache *cache, dri_bo **reloc_bufs, GLuint nr_reloc_bufs, void *aux_return); -void brw_clear_cache( struct brw_context *brw ); void brw_state_cache_check_size( struct brw_context *brw ); void brw_init_cache( struct brw_context *brw ); diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index 9e5e6235612..7b5eff4f2d1 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -44,8 +44,8 @@ * consumers use structured keys). * * Replacement is not implemented. Instead, when the cache gets too big, at - * a safe point (unlock) we throw out all of the cache data let it regenerate - * it for the next rendering operation. + * a safe point (unlock) we throw out all of the cache data and let it + * regenerate for the next rendering operation. * * The reloc_buf pointers need to be included as key data, otherwise the * non-unique values stuffed in the offset in key data through @@ -447,29 +447,17 @@ void brw_init_cache( struct brw_context *brw ) 0); } - -/* When we lose hardware context, need to invalidate the surface cache - * as these structs must be explicitly re-uploaded. They are subject - * to fixup by the memory manager as they contain absolute agp - * offsets, so we need to ensure there is a fresh version of the - * struct available to receive the fixup. - * - * XXX: Need to ensure that there aren't two versions of a surface or - * bufferobj with different backing data active in the same buffer at - * once? Otherwise the cache could confuse them. Maybe better not to - * cache at all? - * - * --> Isn't this the same as saying need to ensure batch is flushed - * before new data is uploaded to an existing buffer? We - * already try to make sure of that. - */ -static void clear_cache( struct brw_cache *cache ) +static void +brw_clear_cache( struct brw_context *brw ) { struct brw_cache_item *c, *next; GLuint i; - for (i = 0; i < cache->size; i++) { - for (c = cache->items[i]; c; c = next) { + if (INTEL_DEBUG & DEBUG_STATE) + _mesa_printf("%s\n", __FUNCTION__); + + for (i = 0; i < brw->cache.size; i++) { + for (c = brw->cache.items[i]; c; c = next) { int j; next = c->next; @@ -479,18 +467,10 @@ static void clear_cache( struct brw_cache *cache ) free((void *)c->key); free(c); } - cache->items[i] = NULL; + brw->cache.items[i] = NULL; } - cache->n_items = 0; -} - -void brw_clear_cache( struct brw_context *brw ) -{ - if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s\n", __FUNCTION__); - - clear_cache(&brw->cache); + brw->cache.n_items = 0; if (brw->curbe.last_buf) { _mesa_free(brw->curbe.last_buf); @@ -515,7 +495,7 @@ void brw_destroy_cache( struct brw_context *brw ) { GLuint i; - clear_cache(&brw->cache); + brw_clear_cache(brw); for (i = 0; i < BRW_MAX_CACHE; i++) free(brw->cache.name[i]); -- 2.30.2