mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-21 09:50:36 +02:00
asahi: extract agx_get_num_cores
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32081>
This commit is contained in:
parent
e145425746
commit
beab5d2792
3 changed files with 14 additions and 4 deletions
|
|
@ -797,3 +797,15 @@ agx_get_driver_uuid(void *uuid)
|
|||
assert(SHA1_DIGEST_LENGTH >= UUID_SIZE);
|
||||
memcpy(uuid, sha1, UUID_SIZE);
|
||||
}
|
||||
|
||||
unsigned
|
||||
agx_get_num_cores(const struct agx_device *dev)
|
||||
{
|
||||
unsigned n = 0;
|
||||
|
||||
for (unsigned cl = 0; cl < dev->params.num_clusters_total; cl++) {
|
||||
n += util_bitcount(dev->params.core_masks[cl]);
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ agx_gpu_time_to_ns(struct agx_device *dev, uint64_t gpu_time)
|
|||
|
||||
void agx_get_device_uuid(const struct agx_device *dev, void *uuid);
|
||||
void agx_get_driver_uuid(void *uuid);
|
||||
unsigned agx_get_num_cores(const 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,
|
||||
|
|
|
|||
|
|
@ -289,10 +289,7 @@ agx_scratch_init(struct agx_device *dev, struct agx_scratch *scratch)
|
|||
#ifdef SCRATCH_DEBUG_CORES
|
||||
scratch->num_cores = SCRATCH_DEBUG_CORES;
|
||||
#else
|
||||
scratch->num_cores = 0;
|
||||
for (unsigned cl = 0; cl < dev->params.num_clusters_total; cl++) {
|
||||
scratch->num_cores += util_bitcount(dev->params.core_masks[cl]);
|
||||
}
|
||||
scratch->num_cores = agx_get_num_cores(dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue