asahi: Use 64bit size fields

This allows for BOs >4G.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32081>
This commit is contained in:
Asahi Lina 2024-10-04 01:41:25 +09:00 committed by Marge Bot
parent 63dd4c13d0
commit 81546c769e
4 changed files with 8 additions and 8 deletions

View file

@ -11,7 +11,7 @@
/* Helper to calculate the bucket index of a BO */
static unsigned
agx_bucket_index(unsigned size)
agx_bucket_index(size_t size)
{
/* Round down to POT to compute a bucket index */
unsigned bucket_index = util_logbase2(size);
@ -24,7 +24,7 @@ agx_bucket_index(unsigned size)
}
static struct list_head *
agx_bucket(struct agx_device *dev, unsigned size)
agx_bucket(struct agx_device *dev, size_t size)
{
return &dev->bo_cache.buckets[agx_bucket_index(size)];
}
@ -197,14 +197,14 @@ agx_bo_unreference(struct agx_device *dev, struct agx_bo *bo)
}
struct agx_bo *
agx_bo_create(struct agx_device *dev, unsigned size, unsigned align,
agx_bo_create(struct agx_device *dev, size_t size, unsigned align,
enum agx_bo_flags flags, const char *label)
{
struct agx_bo *bo;
assert(size > 0);
/* BOs are allocated in pages */
size = ALIGN_POT(size, dev->params.vm_page_size);
size = ALIGN_POT(size, (size_t)dev->params.vm_page_size);
align = MAX2(align, dev->params.vm_page_size);
/* See if we have a BO already in the cache */

View file

@ -118,7 +118,7 @@ agx_bo_writer(uint32_t queue, uint32_t syncobj)
return (((uint64_t)queue) << 32) | syncobj;
}
struct agx_bo *agx_bo_create(struct agx_device *dev, unsigned size,
struct agx_bo *agx_bo_create(struct agx_device *dev, size_t size,
unsigned align, enum agx_bo_flags flags,
const char *label);

View file

@ -198,7 +198,7 @@ unsigned agx_get_num_cores(const struct agx_device *dev);
struct agx_device_key agx_gather_device_key(struct agx_device *dev);
struct agx_va *agx_va_alloc(struct agx_device *dev, uint32_t size_B,
uint32_t align_B, enum agx_va_flags flags,
struct agx_va *agx_va_alloc(struct agx_device *dev, uint64_t size_B,
uint64_t align_B, enum agx_va_flags flags,
uint64_t fixed_va);
void agx_va_free(struct agx_device *dev, struct agx_va *va);

View file

@ -13,7 +13,7 @@ agx_vma_heap(struct agx_device *dev, enum agx_va_flags flags)
}
struct agx_va *
agx_va_alloc(struct agx_device *dev, uint32_t size_B, uint32_t align_B,
agx_va_alloc(struct agx_device *dev, uint64_t size_B, uint64_t align_B,
enum agx_va_flags flags, uint64_t fixed_va)
{
assert((fixed_va != 0) == !!(flags & AGX_VA_FIXED));