Use family type from hwInfo in WDDM

Change-Id: I3120673781b4cc0eb170833ac42eab1aad718d79
This commit is contained in:
Maciej Dziuban
2020-07-06 14:42:48 +02:00
committed by sys_ocldev
parent 85152c5107
commit b1062812be
4 changed files with 22 additions and 2 deletions

View File

@ -27,8 +27,12 @@ class MockGmmMemoryBase : public GmmMemory {
return true;
}
void overrideInternalGpuVaRangeLimit(uintptr_t value) {
this->internalGpuVaRangeLimit = value;
}
uintptr_t getInternalGpuVaRangeLimit() override {
return NEO::windowsMinAddress;
return internalGpuVaRangeLimit;
}
bool setDeviceInfo(GMM_DEVICE_INFO *deviceInfo) override {
@ -39,6 +43,7 @@ class MockGmmMemoryBase : public GmmMemory {
GMM_GFX_PARTITIONING *partition = nullptr;
bool setDeviceInfoValue = true;
uintptr_t internalGpuVaRangeLimit = NEO::windowsMinAddress;
GMM_DEVICE_CALLBACKS_INT deviceCallbacks{};
};

View File

@ -41,6 +41,7 @@ class WddmMock : public Wddm {
using Wddm::pagingFenceAddress;
using Wddm::pagingQueue;
using Wddm::residencyLogger;
using Wddm::rootDeviceEnvironment;
using Wddm::temporaryResources;
using Wddm::wddmInterface;

View File

@ -1000,7 +1000,7 @@ bool Wddm::configureDeviceAddressSpace() {
? maximumApplicationAddress + 1u
: 0u;
bool obtainMinAddress = gfxPlatform->eRenderCoreFamily == IGFX_GEN12LP_CORE;
bool obtainMinAddress = rootDeviceEnvironment.getHardwareInfo()->platform.eRenderCoreFamily == IGFX_GEN12LP_CORE;
return gmmMemory->configureDevice(getAdapter(), device, getGdi()->escape, svmSize, featureTable->ftrL3IACoherency, minAddress, obtainMinAddress);
}

View File

@ -25,4 +25,18 @@ TEST_F(WddmTests, whenCreatingAllocation64kThenDoNotCreateResource) {
EXPECT_EQ(FALSE, gdiParam->Flags.CreateResource);
}
TEST_F(WddmTests, whenInitializingWddmThenSetMinAddressToCorrectValue) {
constexpr static uintptr_t mockedInternalGpuVaRange = 0x9876u;
auto gmmMemory = new MockGmmMemoryBase(wddm->rootDeviceEnvironment.getGmmClientContext());
gmmMemory->overrideInternalGpuVaRangeLimit(mockedInternalGpuVaRange);
wddm->gmmMemory.reset(gmmMemory);
ASSERT_EQ(0u, wddm->getWddmMinAddress());
wddm->init();
const bool obtainFromGmm = defaultHwInfo->platform.eRenderCoreFamily == IGFX_GEN12LP_CORE;
const auto expectedMinAddress = obtainFromGmm ? mockedInternalGpuVaRange : windowsMinAddress;
ASSERT_EQ(expectedMinAddress, wddm->getWddmMinAddress());
}
} // namespace NEO