[Mesa-dev] [PATCH v2 01/18] anv: Add the pci_id into the shader cache UUID

Tapani Pälli tapani.palli at intel.com
Thu Apr 20 07:11:21 UTC 2017



On 03/14/2017 04:26 AM, Jason Ekstrand wrote:
> This prevents a user from using a cache created on one hardware
> generation on a different one.  Of course, with Intel hardware, this
> requires moving their drive from one machine to another but it's still
> possible and we should prevent it.
> 
> Reviewed-by: Chad Versace <chadversary at chromium.org>
> ---
>   src/intel/vulkan/anv_device.c | 22 +++++++++++++++++-----
>   1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index be2b2f3..5db0a6c 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -32,6 +32,7 @@
>   #include "util/strtod.h"
>   #include "util/debug.h"
>   #include "util/build_id.h"
> +#include "util/mesa-sha1.h"
>   #include "util/vk_util.h"
>   
>   #include "genxml/gen7_pack.h"
> @@ -53,17 +54,28 @@ compiler_perf_log(void *data, const char *fmt, ...)
>   }
>   
>   static bool
> -anv_device_get_cache_uuid(void *uuid)
> +anv_device_get_cache_uuid(void *uuid, uint16_t pci_id)
>   {
>      const struct build_id_note *note = build_id_find_nhdr("libvulkan_intel.so");
>      if (!note)
>         return false;
>   
> -   unsigned len = build_id_length(note);
> -   if (len < VK_UUID_SIZE)
> +   unsigned build_id_len = build_id_length(note);
> +   if (build_id_len < 20) /* It should be a SHA-1 */

This line here causes issues for Android, for us the build_id_len seems 
to be 16 (and worked before nicely as check was against VK_UUID_SIZE 
which is 16). I just bisected this and haven't yet figured out why but 
will check.

// Tapani


More information about the mesa-dev mailing list