From ee4c3e790f4659acecc83d851527ecad64efbdb2 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Tue, 11 Nov 2025 15:15:35 +0800 Subject: [PATCH] anv: use align/align64 instead ALIGN, as the input is size_t/uint64_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the input is size_t, cast the input to uint32_t, as the output is expect uint32_t not size_t Signed-off-by: Yonggang Luo Reviewed-by: Timur Kristóf Acked-by: Alyssa Rosenzweig Part-of: --- src/intel/vulkan/genX_acceleration_structure.c | 2 +- src/intel/vulkan/genX_cmd_video_enc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/genX_acceleration_structure.c b/src/intel/vulkan/genX_acceleration_structure.c index 656e9ab209a..e6f97e22571 100644 --- a/src/intel/vulkan/genX_acceleration_structure.c +++ b/src/intel/vulkan/genX_acceleration_structure.c @@ -248,7 +248,7 @@ get_bvh_layout(VkGeometryTypeKHR geometry_type, uint32_t leaf_count, offset += leaf_count * sizeof(uint64_t); } /* The BVH and hence bvh_offset needs 64 byte alignment for RT nodes. */ - offset = ALIGN(offset, 64); + offset = align64(offset, 64); /* This is where internal_nodes/leaves start to be encoded */ layout->bvh_offset = offset; diff --git a/src/intel/vulkan/genX_cmd_video_enc.c b/src/intel/vulkan/genX_cmd_video_enc.c index 8e0b18be2fd..97291fcbf45 100644 --- a/src/intel/vulkan/genX_cmd_video_enc.c +++ b/src/intel/vulkan/genX_cmd_video_enc.c @@ -1246,7 +1246,7 @@ anv_h264_encode_video(struct anv_cmd_buffer *cmd, const VkVideoEncodeInfoKHR *en slice_header_data_len_in_bits -= 8; - length_in_dw = ALIGN(slice_header_data_len_in_bits, 32) >> 5; + length_in_dw = align((uint32_t)slice_header_data_len_in_bits, 32) >> 5; data_bits_in_last_dw = slice_header_data_len_in_bits & 0x1f; dw = anv_batch_emitn(&cmd->batch, length_in_dw + 2, GENX(MFX_PAK_INSERT_OBJECT), @@ -2355,7 +2355,7 @@ anv_h265_encode_video(struct anv_cmd_buffer *cmd, const VkVideoEncodeInfoKHR *en uint32_t length_in_dw; uint32_t data_bits_in_last_dw; - length_in_dw = ALIGN(slice_header_data_len_in_bits, 32) >> 5; + length_in_dw = align((uint32_t)slice_header_data_len_in_bits, 32) >> 5; data_bits_in_last_dw = slice_header_data_len_in_bits & 0x1f; dw = anv_batch_emitn(&cmd->batch, length_in_dw + 2, GENX(HCP_PAK_INSERT_OBJECT),