panfrost,tu: use util_is_aligned

I was hoping this would catch more... Oh well.

Via Coccinelle patch:

    @@
    expression x, pot;
    @@

    -align(x, pot) == x
    +util_is_aligned(x, pot)

    @@
    expression x, pot;
    @@

    -ALIGN(x, pot) == x
    +util_is_aligned(x, pot)

    @@
    expression x, pot;
    @@

    -ALIGN_POT(x, pot) == x
    +util_is_aligned(x, pot)

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38169>
This commit is contained in:
Alyssa Rosenzweig
2025-10-30 14:36:35 -04:00
committed by Marge Bot
parent 6ac9bfdd1c
commit 603bfa34d9
3 changed files with 3 additions and 3 deletions

View File

@@ -274,7 +274,7 @@ tu_tiling_config_update_tile_layout(struct tu_framebuffer *fb,
/* Check that we did the math right. */
min_layer_stride = tile_align_h * tile_align_w * pass->min_cpp;
assert(align(min_layer_stride, gmem_align) == min_layer_stride);
assert(util_is_aligned(min_layer_stride, gmem_align));
}
/* will force to sysmem, don't bother trying to have a valid tile config

View File

@@ -2447,7 +2447,7 @@ static inline void
cs_trace_preamble(struct cs_builder *b, const struct cs_tracing_ctx *ctx,
struct cs_index scratch_regs, unsigned trace_size)
{
assert(trace_size > 0 && ALIGN_POT(trace_size, 64) == trace_size &&
assert(trace_size > 0 && util_is_aligned(trace_size, 64) &&
trace_size < INT16_MAX);
assert(scratch_regs.size >= 4 && !(scratch_regs.reg & 1));

View File

@@ -929,7 +929,7 @@ cs_render_desc_ringbuf_reserve(struct cs_builder *b, uint32_t size)
assert(size <= RENDER_DESC_RINGBUF_SIZE);
/* Make sure the allocation is 64-byte aligned. */
assert(ALIGN_POT(size, 64) == size);
assert(util_is_aligned(size, 64));
struct cs_index ringbuf_sync = cs_scratch_reg64(b, 0);
struct cs_index sz_reg = cs_scratch_reg32(b, 2);