panfrost: avoid accidental aliasing

We already have a variable call "alignment" here, and aliasing it
breaks things. Whoops, let's rename the variable to page_size to
avoid this.

Fixes: 22985caf3f ("panfrost: sanity-check alignment")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34156>
(cherry picked from commit 1471279203)
This commit is contained in:
Erik Faye-Lund 2025-01-14 16:54:39 +01:00 committed by Eric Engestrom
parent 82304cad79
commit 29cf4608db
2 changed files with 4 additions and 4 deletions

View file

@ -214,7 +214,7 @@
"description": "panfrost: avoid accidental aliasing",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "22985caf3ff3d5845d5c03c4516be12f6d004d5e",
"notes": null

View file

@ -142,9 +142,9 @@ panfrost_pool_alloc_aligned(struct panfrost_pool *pool, size_t sz,
#ifdef PAN_DBG_OVERFLOW
if (unlikely(pool->dev->debug & PAN_DBG_OVERFLOW) &&
!(pool->create_flags & PAN_BO_INVISIBLE)) {
long alignment = sysconf(_SC_PAGESIZE);
assert(alignment > 0 && util_is_power_of_two_nonzero(alignment));
unsigned aligned = ALIGN_POT(sz, alignment);
long page_size = sysconf(_SC_PAGESIZE);
assert(page_size > 0 && util_is_power_of_two_nonzero(page_size));
unsigned aligned = ALIGN_POT(sz, page_size);
unsigned bo_size = aligned + PAN_GUARD_SIZE;
bo = panfrost_pool_alloc_backing(pool, bo_size);