Use preferredGpuVirtualAddress for nonSVM 32 bit applications

Change-Id: Ic8ee097138b860f64d752eb1bc54754f36a97b1d
Signed-off-by: Koska <andrzej.koska@intel.com>
Related-To: NEO-4218
This commit is contained in:
Koska 2020-04-07 17:54:39 +02:00 committed by sys_ocldev
parent 7b9767636b
commit ea56bde3fb
3 changed files with 4 additions and 3 deletions

View File

@ -494,7 +494,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF
auto wddmAllocation = (WddmAllocation *)graphicsAllocation;
ASSERT_NE(nullptr, wddmAllocation);
if (is32bit && executionEnvironment->rootDeviceEnvironments[graphicsAllocation->getRootDeviceIndex()]->isFullRangeSvm()) {
if (is32bit) {
EXPECT_NE(wddm->mapGpuVirtualAddressResult.cpuPtrPassed, nullptr);
} else {
EXPECT_EQ(wddm->mapGpuVirtualAddressResult.cpuPtrPassed, nullptr);

View File

@ -1420,7 +1420,8 @@ TEST_F(MockWddmMemoryManagerTest, givenWddmWhenallocateGraphicsMemory64kbThenLoc
GraphicsAllocation *galloc = memoryManager64k.allocateGraphicsMemory64kb(allocationData);
EXPECT_EQ(lockCount + 1, wddm->lockResult.called);
EXPECT_EQ(mapGpuVirtualAddressResult + 1, wddm->mapGpuVirtualAddressResult.called);
if (executionEnvironment->rootDeviceEnvironments[0]->isFullRangeSvm()) {
if (is32bit || executionEnvironment->rootDeviceEnvironments[0]->isFullRangeSvm()) {
EXPECT_NE(nullptr, wddm->mapGpuVirtualAddressResult.cpuPtrPassed);
} else {
EXPECT_EQ(nullptr, wddm->mapGpuVirtualAddressResult.cpuPtrPassed);

View File

@ -508,7 +508,7 @@ bool WddmMemoryManager::createWddmAllocation(WddmAllocation *allocation, void *r
bool WddmMemoryManager::mapGpuVaForOneHandleAllocation(WddmAllocation *allocation, const void *preferredGpuVirtualAddress) {
D3DGPU_VIRTUAL_ADDRESS addressToMap = castToUint64(preferredGpuVirtualAddress);
auto heapIndex = selectHeap(allocation, preferredGpuVirtualAddress != nullptr, is32bit || executionEnvironment.rootDeviceEnvironments[allocation->getRootDeviceIndex()]->isFullRangeSvm());
if (!executionEnvironment.rootDeviceEnvironments[allocation->getRootDeviceIndex()]->isFullRangeSvm()) {
if (!executionEnvironment.rootDeviceEnvironments[allocation->getRootDeviceIndex()]->isFullRangeSvm() && !is32bit) {
addressToMap = 0u;
}
if (allocation->reservedGpuVirtualAddress) {