mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
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:
parent
134f965b88
commit
dc1b988273
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue