libhsakmt: add new flag for memory mapped as uncached

It is to provide an option to map specific memory as
uncached on A+A HW platform.

Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
Change-Id: Ib665cb306a0e78aba3ea5ee2f0e46cb62ae139f8
This commit is contained in:
Eric Huang
2020-05-12 15:12:52 -04:00
committed by Kent Russell
parent 8881075ab2
commit 2464bfc714
3 changed files with 11 additions and 3 deletions
+8 -2
View File
@@ -1334,8 +1334,11 @@ void *fmm_allocate_device(uint32_t gpu_id, void *address, uint64_t MemorySizeInB
aperture = &gpu_mem[gpu_mem_id].gpuvm_aperture;
}
if (!flags.ui32.CoarseGrain || svm.disable_cache)
if (!flags.ui32.CoarseGrain || svm.disable_cache) {
ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_COHERENT;
if (flags.ui32.Uncached)
ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED;
}
mem = __fmm_allocate_device(gpu_id, address, size, aperture, &mmap_offset,
ioc_flags, &vm_obj);
@@ -1540,8 +1543,11 @@ static void *fmm_allocate_host_gpu(uint32_t node_id, void *address,
else
aperture = svm.dgpu_alt_aperture; /* always coherent */
if (!flags.ui32.CoarseGrain || svm.disable_cache)
if (!flags.ui32.CoarseGrain || svm.disable_cache) {
ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_COHERENT;
if (flags.ui32.Uncached)
ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED;
}
ioc_flags |= fmm_translate_hsa_to_ioc_flags(flags);
if (flags.ui32.AQLQueueMemory)