utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*

Rename env_var_as_unsigned() -> debug_get_num_option(), because duplicate
Rename env_var_as_bool() -> debug_get_bool_option(), because duplicate

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7177

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19336>
This commit is contained in:
Illia Abernikhin
2022-09-13 12:49:56 +03:00
committed by Marge Bot
parent 0e47171abe
commit aa4ac5ff8b
91 changed files with 150 additions and 250 deletions
+6 -6
View File
@@ -38,7 +38,7 @@
#include <inttypes.h>
#include "util/crc32.h"
#include "util/debug.h"
#include "util/u_debug.h"
#include "util/rand_xor.h"
#include "util/u_atomic.h"
#include "util/mesa-sha1.h"
@@ -118,10 +118,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
if (strcmp(driver_id, "make_check_uncompressed") == 0)
cache->compression_disabled = true;
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) {
if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) {
if (!disk_cache_load_cache_index_foz(local, cache))
goto path_fail;
} else if (env_var_as_boolean("MESA_DISK_CACHE_DATABASE", false)) {
} else if (debug_get_bool_option("MESA_DISK_CACHE_DATABASE", false)) {
if (!disk_cache_db_load_cache_index(local, cache))
goto path_fail;
@@ -257,7 +257,7 @@ disk_cache_destroy(struct disk_cache *cache)
util_queue_finish(&cache->cache_queue);
util_queue_destroy(&cache->cache_queue);
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false))
if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false))
foz_destroy(&cache->foz_db);
if (cache->use_cache_db)
@@ -363,7 +363,7 @@ cache_put(void *job, void *gdata, int thread_index)
char *filename = NULL;
struct disk_cache_put_job *dc_job = (struct disk_cache_put_job *) job;
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) {
if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) {
disk_cache_write_item_to_disk_foz(dc_job);
} else if (dc_job->cache->use_cache_db) {
disk_cache_db_write_item_to_disk(dc_job);
@@ -463,7 +463,7 @@ disk_cache_get(struct disk_cache *cache, const cache_key key, size_t *size)
return blob;
}
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) {
if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) {
return disk_cache_load_item_foz(cache, key, size);
} else if (cache->use_cache_db) {
return disk_cache_db_load_item(cache, key, size);