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


[ROCm/ROCR-Runtime commit: 5131ab4e64]
This commit is contained in:
Felix Kuehling
2015-10-17 02:50:50 -04:00
parent 17a31f1cce
commit 29561cc13e
2 changed files with 196 additions and 24 deletions
+2 -2
View File
@@ -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)