mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
panvk: Force a cacheline alignment when allocating objects from WB shared pools
When allocating individual objects from a shared pool, we don't want objects to share cachelines, otherwise cache maintenance operations on individual objects might corrupt other objects. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36385>
This commit is contained in:
parent
1c7793ea0b
commit
f60d2aa545
1 changed files with 10 additions and 0 deletions
|
|
@ -141,6 +141,16 @@ panvk_pool_alloc_backing(struct panvk_pool *pool, size_t sz)
|
|||
struct panvk_priv_mem
|
||||
panvk_pool_alloc_mem(struct panvk_pool *pool, struct panvk_pool_alloc_info info)
|
||||
{
|
||||
struct panvk_physical_device *pdev =
|
||||
to_panvk_physical_device(pool->dev->vk.physical);
|
||||
|
||||
/* Make sure objects allocated from shared BOs are aligned on a cacheline. */
|
||||
if (!pool->props.owns_bos &&
|
||||
(pool->props.create_flags & PAN_KMOD_BO_FLAG_WB_MMAP)) {
|
||||
info.alignment =
|
||||
MAX2(pdev->vk.properties.nonCoherentAtomSize, info.alignment);
|
||||
}
|
||||
|
||||
assert(info.alignment == util_next_power_of_two(info.alignment));
|
||||
|
||||
if (pool->props.needs_locking)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue