broadcom: replace redefined ALIGN() macro with common util functions
authorYonggang Luo <luoyonggang@gmail.com>
Thu, 29 Jun 2023 03:32:05 +0000 (11:32 +0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 29 Jun 2023 21:12:07 +0000 (21:12 +0000)
commit38935d97898e31bfc31118b94f932f3f9ed5ce0c
tree06eaa7999d594bd7de307a4868a7e9e29d3bf848
parent9a8a7aaf1d17c4586ca7006a40b8ca53700dba05
broadcom: replace redefined ALIGN() macro with common util functions

`cl_aligned_packet_length()` expand literals, so use ALIGN_POT to compute it
at compile time.

`v3dv_AllocateMemory()` uses a 64-bit `allocationSize`, so use `align64()`.

`v3d_lower_nir()` uses a 32-bit `shared_size`, so use `align()`.

Extracted out of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23932
for easier review.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23938>
src/broadcom/compiler/vir.c
src/broadcom/vulkan/v3dv_cl.h
src/broadcom/vulkan/v3dv_device.c