intel: add swizzle flag into driver uuid

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>
This commit is contained in:
Jianxun Zhang 2022-01-10 14:11:40 -08:00 committed by Marge Bot
parent f43c7185e0
commit 14a4600b62
1 changed files with 3 additions and 1 deletions

View 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);
}