@@ -267,21 +267,20 @@ TEST_F(Wddm20Tests, createAllocation32bit) {
267267 delete gmm;
268268}
269269
270- TEST_F (Wddm20Tests, givenGraphicsAllocationWhenItIsMappedInHeap0ThenItHasGpuAddressWithingHeap0Limits ) {
270+ TEST_F (Wddm20Tests, givenGraphicsAllocationWhenItIsMappedInHeap0ThenItHasGpuAddressWithingHeapInternalLimits ) {
271271 void *alignedPtr = (void *)0x12000 ;
272272 size_t alignedSize = 0x2000 ;
273273 WddmAllocation allocation (alignedPtr, alignedSize, nullptr , MemoryPool::MemoryNull, 1u , false );
274274
275275 allocation.handle = ALLOCATION_HANDLE;
276276 allocation.gmm = GmmHelperFunctions::getGmm (allocation.getUnderlyingBuffer (), allocation.getUnderlyingBufferSize ());
277277 allocation.origin = AllocationOrigin::INTERNAL_ALLOCATION;
278- EXPECT_EQ (HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY , wddm->selectHeap (&allocation, allocation.getAlignedCpuPtr ()));
278+ EXPECT_EQ (internalHeapIndex , wddm->selectHeap (&allocation, allocation.getAlignedCpuPtr ()));
279279 bool ret = wddm->mapGpuVirtualAddress (&allocation, allocation.getAlignedCpuPtr ());
280280 EXPECT_TRUE (ret);
281281
282- uint32_t heapIndex = static_cast <uint32_t >(HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY);
283- auto cannonizedHeapBase = GmmHelper::canonize (this ->wddm ->getGfxPartition ().Heap32 [heapIndex].Base );
284- auto cannonizedHeapEnd = GmmHelper::canonize (this ->wddm ->getGfxPartition ().Heap32 [heapIndex].Limit );
282+ auto cannonizedHeapBase = GmmHelper::canonize (this ->wddm ->getGfxPartition ().Heap32 [static_cast <uint32_t >(internalHeapIndex)].Base );
283+ auto cannonizedHeapEnd = GmmHelper::canonize (this ->wddm ->getGfxPartition ().Heap32 [static_cast <uint32_t >(internalHeapIndex)].Limit );
285284
286285 EXPECT_GE (allocation.gpuPtr , cannonizedHeapBase);
287286 EXPECT_LE (allocation.gpuPtr , cannonizedHeapEnd);
@@ -1001,17 +1000,17 @@ TEST_F(Wddm20Tests, whenEvictingTemporaryResourceThenOtherResourcesRemainOnTheLi
10011000
10021001using WddmHeapSelectorTest = Wddm20Tests;
10031002
1004- TEST_F (WddmHeapSelectorTest, given32bitInternalAllocationWhenSelectingHeapThenInternalDeviceMemoryHeapIsUsed ) {
1003+ TEST_F (WddmHeapSelectorTest, given32bitInternalAllocationWhenSelectingHeapThenInternalHeapIsUsed ) {
10051004 WddmAllocation allocation{nullptr , 0 , nullptr , MemoryPool::MemoryNull, 1u , false };
10061005 allocation.is32BitAllocation = true ;
10071006 allocation.origin = AllocationOrigin::INTERNAL_ALLOCATION;
1008- EXPECT_EQ (HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY , wddm->selectHeap (&allocation, nullptr ));
1007+ EXPECT_EQ (internalHeapIndex , wddm->selectHeap (&allocation, nullptr ));
10091008}
1010- TEST_F (WddmHeapSelectorTest, givenNon32bitInternalAllocationWhenSelectingHeapThenInternalDeviceMemoryHeapIsUsed ) {
1009+ TEST_F (WddmHeapSelectorTest, givenNon32bitInternalAllocationWhenSelectingHeapThenInternalHeapIsUsed ) {
10111010 WddmAllocation allocation{nullptr , 0 , nullptr , MemoryPool::MemoryNull, 1u , false };
10121011 allocation.is32BitAllocation = false ;
10131012 allocation.origin = AllocationOrigin::INTERNAL_ALLOCATION;
1014- EXPECT_EQ (HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY , wddm->selectHeap (&allocation, nullptr ));
1013+ EXPECT_EQ (internalHeapIndex , wddm->selectHeap (&allocation, nullptr ));
10151014}
10161015TEST_F (WddmHeapSelectorTest, given32bitExternalAllocationWhenSelectingHeapThenExternalHeapIsUsed) {
10171016 WddmAllocation allocation{nullptr , 0 , nullptr , MemoryPool::MemoryNull, 1u , false };
0 commit comments