Skip to content

venus: do page align on the requested allocationSize

Yiwei Zhang requested to merge zzyiwei/mesa:vn-page-align into main

We need to do page align on native device memory allocations and export allocation that could trigger a blob mem creation to match the virtio-gpu kernel page align.

We need to do page align on external memory fd import because if the originally exported fd is from Venus, then the memory requirement used by the app would be the same for import, and we have to align to match the size aligned up in the prior export allocation.

We don't have to page align for AHB import since the size is zero.

We should not page align for AHB export since the AHB to be allocated must reflect the requested params from the platform level. e.g. For an AHB buffer, the AHB width from ahb_describe must match the VkBuffer size.

For AHB export and import, vn_device_memory_import_dma_buf is used. So we do page align before that to make things aligned. minigbm virgl and cross_domain backends already page align the bo total size.

Test: AHB cts and memory cts

/cc @rakko

Edited by Yiwei Zhang

Merge request reports