iris/bufmgr: Align vma addresses to 64K for local memory

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
This commit is contained in:
Jordan Justen 2019-07-31 15:18:59 -07:00 committed by Marge Bot
parent cb6feae0b5
commit 84069acfd4
1 changed files with 7 additions and 2 deletions

View File

@ -186,6 +186,8 @@ struct iris_bufmgr {
struct util_vma_heap vma_allocator[IRIS_MEMZONE_COUNT];
uint64_t vma_min_align;
bool has_llc:1;
bool has_mmap_offset:1;
bool has_tiling_uapi:1;
@ -305,8 +307,9 @@ vma_alloc(struct iris_bufmgr *bufmgr,
uint64_t size,
uint64_t alignment)
{
/* Force alignment to be some number of pages */
alignment = ALIGN(alignment, PAGE_SIZE);
/* Force minimum alignment based on device requirements */
assert((alignment & (alignment - 1)) == 0);
alignment = MAX2(alignment, bufmgr->vma_min_align);
if (memzone == IRIS_MEMZONE_BORDER_COLOR_POOL)
return IRIS_BORDER_COLOR_POOL_ADDRESS;
@ -1655,6 +1658,8 @@ iris_bufmgr_create(struct intel_device_info *devinfo, int fd, bool bo_reuse)
bufmgr->handle_table =
_mesa_hash_table_create(NULL, _mesa_hash_uint, _mesa_key_uint_equal);
bufmgr->vma_min_align = devinfo->has_local_mem ? 64 * 1024 : PAGE_SIZE;
if (devinfo->has_aux_map) {
bufmgr->aux_map_ctx = intel_aux_map_init(bufmgr, &aux_map_allocator,
devinfo);