panvk: Fix panvk_priv_mem_bo() on 32-bit platforms

Masking with an ~7ull promotes the value to 64-bit, leading
to a size mismatch when we cast it to a pointer.

Make sure we're using an uintptr_t type for the mask.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32938>
This commit is contained in:
Boris Brezillon 2025-01-08 12:41:29 +01:00 committed by Marge Bot
parent 134f965b88
commit dc1b988273

View file

@ -128,16 +128,18 @@ struct panvk_priv_mem {
unsigned offset;
};
#define PANVK_PRIV_MEM_FLAGS_MASK ((uintptr_t)7)
static struct panvk_priv_bo *
panvk_priv_mem_bo(struct panvk_priv_mem mem)
{
return (struct panvk_priv_bo *)(mem.bo & ~7ull);
return (struct panvk_priv_bo *)(mem.bo & ~PANVK_PRIV_MEM_FLAGS_MASK);
}
static uint32_t
panvk_priv_mem_flags(struct panvk_priv_mem mem)
{
return mem.bo & 7ull;
return mem.bo & PANVK_PRIV_MEM_FLAGS_MASK;
}
static inline uint64_t