@@ -8476,3 +8476,46 @@ TEST_F(DrmMemoryManagerTest, givenVmAdviseAtomicAttributeNotPresentWhenCreateSha
84768476
84778477 memoryManager->freeGraphicsMemory (sharedUSM);
84788478}
8479+
8480+ TEST_F (DrmMemoryManagerTest, givenGfxPartitionWhenReleasedAndReinitializedThenNewGfxPartitionIsCorrect) {
8481+
8482+ auto gfxPartition = memoryManager->getGfxPartition (0 );
8483+
8484+ auto heapExternal = gfxPartition->getHeapBase (HeapIndex::heapExternal);
8485+ auto heapStandard = gfxPartition->getHeapBase (HeapIndex::heapStandard);
8486+ auto heapStandard64KB = gfxPartition->getHeapBase (HeapIndex::heapStandard64KB);
8487+ auto heapSvm = gfxPartition->getHeapBase (HeapIndex::heapSvm);
8488+ auto heapExtended = gfxPartition->getHeapBase (HeapIndex::heapExtended);
8489+ auto heapExternalFrontWindow = gfxPartition->getHeapBase (HeapIndex::heapExternalFrontWindow);
8490+ auto heapExternalDeviceFrontWindow = gfxPartition->getHeapBase (HeapIndex::heapExternalDeviceFrontWindow);
8491+ auto heapInternalFrontWindow = gfxPartition->getHeapBase (HeapIndex::heapInternalFrontWindow);
8492+ auto heapInternalDeviceFrontWindow = gfxPartition->getHeapBase (HeapIndex::heapInternalDeviceFrontWindow);
8493+
8494+ memoryManager->releaseDeviceSpecificGfxPartition (0 );
8495+ EXPECT_EQ (nullptr , memoryManager->getGfxPartition (0 ));
8496+ memoryManager->reInitDeviceSpecificGfxPartition (0 );
8497+
8498+ EXPECT_NE (nullptr , memoryManager->getGfxPartition (0 ));
8499+
8500+ gfxPartition = memoryManager->getGfxPartition (0 );
8501+
8502+ auto heapExternal2 = gfxPartition->getHeapBase (HeapIndex::heapExternal);
8503+ auto heapStandard2 = gfxPartition->getHeapBase (HeapIndex::heapStandard);
8504+ auto heapStandard64KB2 = gfxPartition->getHeapBase (HeapIndex::heapStandard64KB);
8505+ auto heapSvm2 = gfxPartition->getHeapBase (HeapIndex::heapSvm);
8506+ auto heapExtended2 = gfxPartition->getHeapBase (HeapIndex::heapExtended);
8507+ auto heapExternalFrontWindow2 = gfxPartition->getHeapBase (HeapIndex::heapExternalFrontWindow);
8508+ auto heapExternalDeviceFrontWindow2 = gfxPartition->getHeapBase (HeapIndex::heapExternalDeviceFrontWindow);
8509+ auto heapInternalFrontWindow2 = gfxPartition->getHeapBase (HeapIndex::heapInternalFrontWindow);
8510+ auto heapInternalDeviceFrontWindow2 = gfxPartition->getHeapBase (HeapIndex::heapInternalDeviceFrontWindow);
8511+
8512+ EXPECT_EQ (heapExternal, heapExternal2);
8513+ EXPECT_EQ (heapStandard, heapStandard2);
8514+ EXPECT_EQ (heapStandard64KB, heapStandard64KB2);
8515+ EXPECT_EQ (heapSvm, heapSvm2);
8516+ EXPECT_EQ (heapExtended, heapExtended2);
8517+ EXPECT_EQ (heapExternalFrontWindow, heapExternalFrontWindow2);
8518+ EXPECT_EQ (heapExternalDeviceFrontWindow, heapExternalDeviceFrontWindow2);
8519+ EXPECT_EQ (heapInternalFrontWindow, heapInternalFrontWindow2);
8520+ EXPECT_EQ (heapInternalDeviceFrontWindow, heapInternalDeviceFrontWindow2);
8521+ }
0 commit comments