Split Standard 64KB heap for multiple root devices

Resolves: NEO-4196

Change-Id: Ibd76eb2447791e34ba3e1c27bbc7f5cd09325e98
Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
Igor Venevtsev
2020-01-29 17:48:36 +01:00
committed by sys_ocldev
parent dbd12dbaff
commit a34268fc54
13 changed files with 79 additions and 21 deletions

View File

@@ -3271,7 +3271,7 @@ TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedBu
TEST_F(DrmMemoryManagerTest, DISABLED_givenDrmMemoryManagerAndReleaseGpuRangeIsCalledThenGpuAddressIsDecanonized) {
auto mockGfxPartition = std::make_unique<MockGfxPartition>();
mockGfxPartition->init(maxNBitValue(48), 0, 0);
mockGfxPartition->init(maxNBitValue(48), 0, 0, 1);
auto size = 2 * MemoryConstants::megaByte;
auto gpuAddress = mockGfxPartition->heapAllocate(HeapIndex::HEAP_STANDARD, size);
auto gpuAddressCanonized = GmmHelper::canonize(gpuAddress);

View File

@@ -1057,7 +1057,7 @@ TEST_F(WddmGfxPartitionTest, initGfxPartition) {
ASSERT_FALSE(gfxPartition.heapInitialized(heap));
}
wddm->initGfxPartition(gfxPartition);
wddm->initGfxPartition(gfxPartition, 0, 1);
for (auto heap : MockGfxPartition::allHeapNames) {
if (!gfxPartition.heapInitialized(heap)) {
@@ -1068,6 +1068,26 @@ TEST_F(WddmGfxPartitionTest, initGfxPartition) {
}
}
TEST_F(WddmGfxPartitionTest, initGfxPartitionHeapStandard64KBSplit) {
struct MockWddm : public Wddm {
using Wddm::gfxPartition;
MockWddm(RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(rootDeviceEnvironment) {}
};
MockWddm wddm(*executionEnvironment->rootDeviceEnvironments[0].get());
uint32_t rootDeviceIndex = 3;
size_t numRootDevices = 5;
MockGfxPartition gfxPartition;
wddm.initGfxPartition(gfxPartition, rootDeviceIndex, numRootDevices);
auto heapStandard64KBSize = alignDown(wddm.gfxPartition.Standard64KB.Limit - wddm.gfxPartition.Standard64KB.Base + 1, GfxPartition::heapGranularity);
EXPECT_EQ(heapStandard64KBSize, gfxPartition.getHeapSize(HeapIndex::HEAP_STANDARD64KB));
EXPECT_EQ(wddm.gfxPartition.Standard64KB.Base + rootDeviceIndex * heapStandard64KBSize, gfxPartition.getHeapBase(HeapIndex::HEAP_STANDARD64KB));
}
TEST_F(Wddm20Tests, givenWddmWhenOpenAdapterAndForceDeviceIdIsTheSameAsTheExistingDeviceThenReturnTrue) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.ForceDeviceId.set("1234"); // Existing device Id