panvk: Return os_page_size for minMemoryMapAlignment

The spec says "When mapping a memory allocation with vkMapMemory,
subtracting offset bytes from the returned pointer will always produce
an integer multiple of this limit", meaning the OS page size.

As the page size depends on the kernel configuration, this should be
queried at runtime.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28715>
This commit is contained in:
Mary Guillemard 2024-04-12 10:38:20 +02:00 committed by Marge Bot
parent c040283e7a
commit a0f80774ce
1 changed files with 4 additions and 1 deletions

View File

@ -372,6 +372,9 @@ panvk_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
{
VK_FROM_HANDLE(panvk_physical_device, pdevice, physicalDevice);
uint64_t os_page_size = 4096;
os_get_page_size(&os_page_size);
/* HW supports MSAA 4, 8 and 16, but we limit ourselves to MSAA 4 for now. */
VkSampleCountFlags sample_counts =
VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_4_BIT;
@ -559,7 +562,7 @@ panvk_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
.viewportSubPixelBits = 0,
/* Align on a page. */
.minMemoryMapAlignment = 4096,
.minMemoryMapAlignment = os_page_size,
/* Some compressed texture formats require 128-byte alignment. */
.minTexelBufferOffsetAlignment = 64,