Mesa (master): cso: remove unused code
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Dec 3 22:01:37 UTC 2020
Module: Mesa
Branch: master
Commit: 0b22def5f84c0c2c83daaf00710ae7c50ceee9d1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b22def5f84c0c2c83daaf00710ae7c50ceee9d1
Author: Marek Olšák <marek.olsak at amd.com>
Date: Sun Nov 29 01:39:01 2020 -0500
cso: remove unused code
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7901>
---
src/gallium/auxiliary/cso_cache/cso_cache.c | 12 --------
src/gallium/auxiliary/cso_cache/cso_cache.h | 4 ---
src/gallium/auxiliary/cso_cache/cso_hash.c | 45 -----------------------------
src/gallium/auxiliary/cso_cache/cso_hash.h | 3 --
4 files changed, 64 deletions(-)
diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.c b/src/gallium/auxiliary/cso_cache/cso_cache.c
index 6cae21ca871..b2dea19ddea 100644
--- a/src/gallium/auxiliary/cso_cache/cso_cache.c
+++ b/src/gallium/auxiliary/cso_cache/cso_cache.c
@@ -234,13 +234,6 @@ struct cso_hash_iter cso_find_state_template(struct cso_cache *sc,
return iter;
}
-void * cso_take_state(struct cso_cache *sc,
- unsigned hash_key, enum cso_cache_type type)
-{
- struct cso_hash *hash = _cso_hash_for_type(sc, type);
- return cso_hash_take(hash, hash_key);
-}
-
struct cso_cache *cso_cache_create(void)
{
struct cso_cache *sc = MALLOC_STRUCT(cso_cache);
@@ -305,11 +298,6 @@ void cso_set_maximum_cache_size(struct cso_cache *sc, int number)
sanitize_hash(sc, &sc->hashes[i], i, sc->max_size);
}
-int cso_maximum_cache_size(const struct cso_cache *sc)
-{
- return sc->max_size;
-}
-
void cso_cache_set_sanitize_callback(struct cso_cache *sc,
cso_sanitize_callback cb,
void *user_data)
diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.h b/src/gallium/auxiliary/cso_cache/cso_cache.h
index ab1e4af0adf..3a413324eb9 100644
--- a/src/gallium/auxiliary/cso_cache/cso_cache.h
+++ b/src/gallium/auxiliary/cso_cache/cso_cache.h
@@ -163,11 +163,7 @@ struct cso_hash_iter cso_find_state_template(struct cso_cache *sc,
void *templ, unsigned size);
void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
cso_state_callback func, void *user_data);
-void * cso_take_state(struct cso_cache *sc, unsigned hash_key,
- enum cso_cache_type type);
-
void cso_set_maximum_cache_size(struct cso_cache *sc, int number);
-int cso_maximum_cache_size(const struct cso_cache *sc);
#ifdef __cplusplus
}
diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.c b/src/gallium/auxiliary/cso_cache/cso_hash.c
index 9fdb650d319..dae3a2dbcaf 100644
--- a/src/gallium/auxiliary/cso_cache/cso_hash.c
+++ b/src/gallium/auxiliary/cso_cache/cso_hash.c
@@ -251,44 +251,6 @@ struct cso_node *cso_hash_data_next(struct cso_node *node)
return a.e;
}
-
-static struct cso_node *cso_hash_data_prev(struct cso_node *node)
-{
- union {
- struct cso_node *e;
- struct cso_hash *d;
- } a;
- int start;
- struct cso_node *sentinel;
- struct cso_node **bucket;
-
- a.e = node;
- while (a.e->next)
- a.e = a.e->next;
-
- if (node == a.e)
- start = a.d->numBuckets - 1;
- else
- start = node->key % a.d->numBuckets;
-
- sentinel = node;
- bucket = a.d->buckets + start;
- while (start >= 0) {
- if (*bucket != sentinel) {
- struct cso_node *prev = *bucket;
- while (prev->next != sentinel)
- prev = prev->next;
- return prev;
- }
-
- sentinel = a.e;
- --bucket;
- --start;
- }
- debug_printf("iterating backward beyond first element\n");
- return a.e;
-}
-
void *cso_hash_take(struct cso_hash *hash, unsigned akey)
{
struct cso_node **node = cso_hash_find_node(hash, akey);
@@ -305,13 +267,6 @@ void *cso_hash_take(struct cso_hash *hash, unsigned akey)
return NULL;
}
-struct cso_hash_iter cso_hash_iter_prev(struct cso_hash_iter iter)
-{
- struct cso_hash_iter prev = {iter.hash,
- cso_hash_data_prev(iter.node)};
- return prev;
-}
-
struct cso_hash_iter cso_hash_first_node(struct cso_hash *hash)
{
struct cso_hash_iter iter = {hash, cso_data_first_node(hash)};
diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.h b/src/gallium/auxiliary/cso_cache/cso_hash.h
index e984f117c95..26ab7fc5a06 100644
--- a/src/gallium/auxiliary/cso_cache/cso_hash.h
+++ b/src/gallium/auxiliary/cso_cache/cso_hash.h
@@ -111,9 +111,6 @@ bool cso_hash_contains(struct cso_hash *hash, unsigned key);
unsigned cso_hash_iter_key(struct cso_hash_iter iter);
-struct cso_hash_iter cso_hash_iter_prev(struct cso_hash_iter iter);
-
-
/**
* Convenience routine to iterate over the collision list while doing a memory
* comparison to see which entry in the list is a direct copy of our template
More information about the mesa-commit
mailing list