Implement flat scratch support for dGPU

hsaKmtAllocMemory only allocates aligned address space and sets up
the scratch_physical aperture to match the allocated address space.

Actual allocation of backing memory happens in hsaKmtMapMemoryToGPU.

Change-Id: Ie709815ab9bedb3d682e096b4005fdfb5e94d3a7
此提交包含在:
Felix Kuehling
2015-10-17 02:50:50 -04:00
父節點 149261ba09
當前提交 5131ab4e64
共有 2 個檔案被更改,包括 196 行新增24 行删除
+2 -2
查看文件
@@ -155,7 +155,7 @@ hsaKmtAllocMemory(
return HSAKMT_STATUS_SUCCESS;
}
if (!MemFlags.ui32.HostAccess && MemFlags.ui32.NonPaged) {
if (!MemFlags.ui32.HostAccess && MemFlags.ui32.NonPaged && !MemFlags.ui32.Scratch) {
*MemoryAddress = fmm_allocate_device(gpu_id, SizeInBytes);
if (*MemoryAddress == NULL)
@@ -163,7 +163,7 @@ hsaKmtAllocMemory(
return HSAKMT_STATUS_SUCCESS;
}
if (MemFlags.ui32.HostAccess && MemFlags.ui32.Scratch ) {
if (MemFlags.ui32.Scratch ) {
*MemoryAddress = fmm_allocate_scratch(gpu_id, SizeInBytes);
if (*MemoryAddress == NULL)