mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Bring back adjustPlatformForProductFamily() method
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
7330f989ef
commit
ba51cf5380
@ -23,6 +23,13 @@ int HwInfoConfigHw<IGFX_TIGERLAKE_LP>::configureHardwareCustom(HardwareInfo *hwI
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwInfoConfigHw<IGFX_TIGERLAKE_LP>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
|
||||
PLATFORM *platform = &hwInfo->platform;
|
||||
platform->eRenderCoreFamily = IGFX_GEN12LP_CORE;
|
||||
platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE;
|
||||
}
|
||||
|
||||
template class HwInfoConfigHw<IGFX_TIGERLAKE_LP>;
|
||||
#endif
|
||||
#ifdef SUPPORT_DG1
|
||||
@ -34,6 +41,13 @@ int HwInfoConfigHw<IGFX_DG1>::configureHardwareCustom(HardwareInfo *hwInfo, OSIn
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwInfoConfigHw<IGFX_DG1>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
|
||||
PLATFORM *platform = &hwInfo->platform;
|
||||
platform->eRenderCoreFamily = IGFX_GEN12LP_CORE;
|
||||
platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<IGFX_DG1>::isEvenContextCountRequired() {
|
||||
return true;
|
||||
@ -54,6 +68,13 @@ int HwInfoConfigHw<IGFX_ROCKETLAKE>::configureHardwareCustom(HardwareInfo *hwInf
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwInfoConfigHw<IGFX_ROCKETLAKE>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
|
||||
PLATFORM *platform = &hwInfo->platform;
|
||||
platform->eRenderCoreFamily = IGFX_GEN12LP_CORE;
|
||||
platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE;
|
||||
}
|
||||
|
||||
template class HwInfoConfigHw<IGFX_ROCKETLAKE>;
|
||||
#endif
|
||||
#ifdef SUPPORT_ADLS
|
||||
@ -65,6 +86,13 @@ int HwInfoConfigHw<IGFX_ALDERLAKE_S>::configureHardwareCustom(HardwareInfo *hwIn
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwInfoConfigHw<IGFX_ALDERLAKE_S>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
|
||||
PLATFORM *platform = &hwInfo->platform;
|
||||
platform->eRenderCoreFamily = IGFX_GEN12LP_CORE;
|
||||
platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE;
|
||||
}
|
||||
|
||||
template class HwInfoConfigHw<IGFX_ALDERLAKE_S>;
|
||||
#endif
|
||||
} // namespace NEO
|
||||
|
@ -30,3 +30,15 @@ GEN12LPTEST_F(HwInfoConfigTestWindowsGen12lp, givenE2ECSetByKmdWhenConfiguringHw
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(HwInfoConfigTestWindows, givenGen12LpProductWhenAdjustPlatformForProductFamilyCalledThenOverrideWithCorrectFamily) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
|
||||
PLATFORM *testPlatform = &outHwInfo.platform;
|
||||
testPlatform->eDisplayCoreFamily = IGFX_GEN11_CORE;
|
||||
testPlatform->eRenderCoreFamily = IGFX_GEN11_CORE;
|
||||
hwInfoConfig->adjustPlatformForProductFamily(&outHwInfo);
|
||||
|
||||
EXPECT_EQ(IGFX_GEN12LP_CORE, testPlatform->eRenderCoreFamily);
|
||||
EXPECT_EQ(IGFX_GEN12LP_CORE, testPlatform->eDisplayCoreFamily);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/windows/gdi_interface.h"
|
||||
|
||||
#include "opencl/test/unit_test/mocks/mock_execution_environment.h"
|
||||
@ -61,3 +62,34 @@ GEN12LPTEST_F(Gen12LpWddmTest, whenConfigureDeviceAddressSpaceThenObtainMinAddre
|
||||
|
||||
EXPECT_EQ(minAddress, wddm->getWddmMinAddress());
|
||||
}
|
||||
|
||||
using Gen12LpWddmHwInfoTest = ::testing::Test;
|
||||
|
||||
GEN12LPTEST_F(Gen12LpWddmHwInfoTest, givenIncorrectProductFamiliyWhenInitCalledThenOverride) {
|
||||
HardwareInfo localHwInfo = *defaultHwInfo;
|
||||
|
||||
localHwInfo.platform.eRenderCoreFamily = GFXCORE_FAMILY::IGFX_UNKNOWN_CORE;
|
||||
localHwInfo.platform.eDisplayCoreFamily = GFXCORE_FAMILY::IGFX_UNKNOWN_CORE;
|
||||
|
||||
std::unique_ptr<OsLibrary> mockGdiDll(setAdapterInfo(&localHwInfo.platform,
|
||||
&localHwInfo.gtSystemInfo,
|
||||
localHwInfo.capabilityTable.gpuAddressSpace));
|
||||
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
|
||||
rootDeviceEnvironment->osInterface = std::make_unique<OSInterface>();
|
||||
|
||||
auto localWddm = std::unique_ptr<Wddm>(Wddm::createWddm(nullptr, *rootDeviceEnvironment));
|
||||
localWddm->init();
|
||||
|
||||
auto newHwInfo = rootDeviceEnvironment->getHardwareInfo();
|
||||
|
||||
EXPECT_EQ(GFXCORE_FAMILY::IGFX_GEN12LP_CORE, newHwInfo->platform.eRenderCoreFamily);
|
||||
EXPECT_EQ(GFXCORE_FAMILY::IGFX_GEN12LP_CORE, newHwInfo->platform.eDisplayCoreFamily);
|
||||
|
||||
// reset mock gdi globals
|
||||
localHwInfo = *defaultHwInfo;
|
||||
mockGdiDll.reset(setAdapterInfo(&localHwInfo.platform,
|
||||
&localHwInfo.gtSystemInfo,
|
||||
localHwInfo.capabilityTable.gpuAddressSpace));
|
||||
}
|
||||
|
@ -50,6 +50,10 @@ cl_unified_shared_memory_capabilities_intel HwInfoConfigHw<IGFX_UNKNOWN>::getHos
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwInfoConfigHw<IGFX_UNKNOWN>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
|
||||
}
|
||||
|
||||
template <>
|
||||
cl_unified_shared_memory_capabilities_intel HwInfoConfigHw<IGFX_UNKNOWN>::getDeviceMemCapabilities() {
|
||||
return 0;
|
||||
@ -512,3 +516,17 @@ TEST_F(HwInfoConfigTestLinuxDummy, givenFailingGttSizeIoctlWhenInitializingHwInf
|
||||
EXPECT_NE(0u, outHwInfo.capabilityTable.gpuAddressSpace);
|
||||
EXPECT_EQ(pInHwInfo.capabilityTable.gpuAddressSpace, outHwInfo.capabilityTable.gpuAddressSpace);
|
||||
}
|
||||
|
||||
TEST(HwInfoConfigLinuxTest, whenAdjustPlatformForProductFamilyCalledThenDoNothing) {
|
||||
HardwareInfo localHwInfo = *defaultHwInfo;
|
||||
|
||||
auto hwInfoConfig = HwInfoConfig::get(localHwInfo.platform.eProductFamily);
|
||||
|
||||
localHwInfo.platform.eDisplayCoreFamily = GFXCORE_FAMILY::IGFX_UNKNOWN_CORE;
|
||||
localHwInfo.platform.eRenderCoreFamily = GFXCORE_FAMILY::IGFX_UNKNOWN_CORE;
|
||||
|
||||
hwInfoConfig->adjustPlatformForProductFamily(&localHwInfo);
|
||||
|
||||
EXPECT_EQ(GFXCORE_FAMILY::IGFX_UNKNOWN_CORE, localHwInfo.platform.eRenderCoreFamily);
|
||||
EXPECT_EQ(GFXCORE_FAMILY::IGFX_UNKNOWN_CORE, localHwInfo.platform.eDisplayCoreFamily);
|
||||
}
|
||||
|
@ -48,6 +48,10 @@ int HwInfoConfigHw<IGFX_UNKNOWN>::configureHardwareCustom(HardwareInfo *hwInfo,
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwInfoConfigHw<IGFX_UNKNOWN>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<IGFX_UNKNOWN>::isEvenContextCountRequired() {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user