mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Use family type from hwInfo in WDDM
Change-Id: I3120673781b4cc0eb170833ac42eab1aad718d79
This commit is contained in:

committed by
sys_ocldev

parent
85152c5107
commit
b1062812be
@ -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{};
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user