diff options
author | David McFarland <[email protected]> | 2018-10-23 21:51:09 -0300 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-10-26 14:49:22 +1100 |
commit | 07a00a8729d709a4c43c828c64242c226607f09a (patch) | |
tree | ec5fd349e3367c66aa3c5550eccffda1b853df0d /src/amd | |
parent | 3d198926a487cefc0316c2c4d1ebb20ff8ebf535 (diff) |
util: Change remaining uint32 cache ids to sha1
After discussion with Timothy Arceri. disk_cache_get_function_identifier
was using only the first byte of the sha1 build-id. Replace
disk_cache_get_function_identifier with implementation from
radv_get_build_id. Instead of writing a uint32_t it now writes to a
mesa_sha1. All drivers using disk_cache_get_function_identifier are
updated accordingly.
Reviewed-by: Timothy Arceri <[email protected]>
Fixes: 83ea8dd99bb1 ("util: add disk_cache_get_function_identifier()")
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 8e43a3aab58..b2798c402f6 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -50,24 +50,6 @@ #include "util/debug.h" #include "util/mesa-sha1.h" -static bool -radv_get_build_id(void *ptr, struct mesa_sha1 *ctx) -{ - uint32_t timestamp; - -#ifdef HAVE_DL_ITERATE_PHDR - const struct build_id_note *note = NULL; - if ((note = build_id_find_nhdr_for_addr(ptr))) { - _mesa_sha1_update(ctx, build_id_data(note), build_id_length(note)); - } else -#endif - if (disk_cache_get_function_timestamp(ptr, ×tamp)) { - _mesa_sha1_update(ctx, ×tamp, sizeof(timestamp)); - } else - return false; - return true; -} - static int radv_device_get_cache_uuid(enum radeon_family family, void *uuid) { @@ -78,8 +60,8 @@ radv_device_get_cache_uuid(enum radeon_family family, void *uuid) memset(uuid, 0, VK_UUID_SIZE); _mesa_sha1_init(&ctx); - if (!radv_get_build_id(radv_device_get_cache_uuid, &ctx) || - !radv_get_build_id(LLVMInitializeAMDGPUTargetInfo, &ctx)) + if (!disk_cache_get_function_identifier(radv_device_get_cache_uuid, &ctx) || + !disk_cache_get_function_identifier(LLVMInitializeAMDGPUTargetInfo, &ctx)) return -1; _mesa_sha1_update(&ctx, &family, sizeof(family)); |