intel: add swizzle flag into driver uuid
authorJianxun Zhang <jianxun.zhang@linux.intel.com>
Mon, 10 Jan 2022 22:11:40 +0000 (14:11 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 13 Jan 2022 03:09:36 +0000 (03:09 +0000)
Suggested by Lionel Landwerlin, we add has_bit6_swizzle as
another input when computing driver uuid.

Also fix miscalculation of the length of driver tag.

Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13936>

src/intel/common/intel_uuid.c

index df24715..14f6275 100644 (file)
@@ -78,7 +78,9 @@ intel_uuid_compute_driver_id(uint8_t *uuid,
     * UUID.
     */
    _mesa_sha1_init(&sha1_ctx);
-   _mesa_sha1_update(&sha1_ctx, intelDriver, strlen(intelDriver) * sizeof(char));
+   _mesa_sha1_update(&sha1_ctx, intelDriver, strlen(intelDriver));
+   _mesa_sha1_update(&sha1_ctx, &devinfo->has_bit6_swizzle,
+                     sizeof(devinfo->has_bit6_swizzle));
    _mesa_sha1_final(&sha1_ctx, sha1);
    memcpy(uuid, sha1, size);
 }