Move common implementation to os agnostic .inl files

Signed-off-by: Rafal Maziejuk <rafal.maziejuk@intel.com>
Related-To: NEO-4541
This commit is contained in:
Rafal Maziejuk
2021-08-25 15:39:07 +00:00
committed by Compute-Runtime-Automation
parent 2aebe7af12
commit c7ff2bacd3
16 changed files with 106 additions and 174 deletions

View File

@ -6,6 +6,7 @@
*/
#include "shared/source/gen12lp/helpers_gen12lp.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/hw_info_config.inl"
#include "shared/source/os_interface/hw_info_config_bdw_and_later.inl"
@ -13,17 +14,11 @@
namespace NEO {
constexpr static auto gfxProduct = IGFX_ALDERLAKE_P;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_adlp.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
template <>
void HwInfoConfigHw<IGFX_ALDERLAKE_P>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
PLATFORM *platform = &hwInfo->platform;
platform->eRenderCoreFamily = IGFX_GEN12LP_CORE;
platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE;
}
template <>
int HwInfoConfigHw<IGFX_ALDERLAKE_P>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
GT_SYSTEM_INFO *gtSystemInfo = &hwInfo->gtSystemInfo;
gtSystemInfo->SliceCount = 1;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo->platform.eProductFamily);
@ -34,16 +29,5 @@ int HwInfoConfigHw<IGFX_ALDERLAKE_P>::configureHardwareCustom(HardwareInfo *hwIn
return 0;
}
template <>
uint32_t HwInfoConfigHw<IGFX_ALDERLAKE_P>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x4;
}
return CommonConstants::invalidStepping;
}
template class HwInfoConfigHw<IGFX_ALDERLAKE_P>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -14,23 +14,8 @@
namespace NEO {
constexpr static auto gfxProduct = IGFX_ALDERLAKE_S;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_adls.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
template <>
void HwInfoConfigHw<IGFX_ALDERLAKE_S>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
uint32_t HwInfoConfigHw<IGFX_ALDERLAKE_S>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x4;
}
return CommonConstants::invalidStepping;
}
template class HwInfoConfigHw<IGFX_ALDERLAKE_S>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -18,12 +18,7 @@ constexpr static auto gfxProduct = IGFX_DG1;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
template <>
void HwInfoConfigHw<IGFX_DG1>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
int HwInfoConfigHw<IGFX_DG1>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
GT_SYSTEM_INFO *gtSystemInfo = &hwInfo->gtSystemInfo;
gtSystemInfo->SliceCount = 1;
@ -36,5 +31,5 @@ int HwInfoConfigHw<IGFX_DG1>::configureHardwareCustom(HardwareInfo *hwInfo, OSIn
return 0;
}
template class HwInfoConfigHw<IGFX_DG1>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -15,14 +15,10 @@ namespace NEO {
constexpr static auto gfxProduct = IGFX_ROCKETLAKE;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_rkl.inl"
template <>
void HwInfoConfigHw<IGFX_ROCKETLAKE>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
int HwInfoConfigHw<IGFX_ROCKETLAKE>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
GT_SYSTEM_INFO *gtSystemInfo = &hwInfo->gtSystemInfo;
gtSystemInfo->SliceCount = 1;
hwInfo->featureTable.ftrGpGpuMidThreadLevelPreempt = false;
@ -32,18 +28,5 @@ int HwInfoConfigHw<IGFX_ROCKETLAKE>::configureHardwareCustom(HardwareInfo *hwInf
return 0;
}
template <>
uint32_t HwInfoConfigHw<IGFX_ROCKETLAKE>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x1;
case REVISION_C:
return 0x4;
}
return CommonConstants::invalidStepping;
}
template class HwInfoConfigHw<IGFX_ROCKETLAKE>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -15,14 +15,10 @@ namespace NEO {
constexpr static auto gfxProduct = IGFX_TIGERLAKE_LP;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_tgllp.inl"
template <>
void HwInfoConfigHw<IGFX_TIGERLAKE_LP>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
int HwInfoConfigHw<IGFX_TIGERLAKE_LP>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
GT_SYSTEM_INFO *gtSystemInfo = &hwInfo->gtSystemInfo;
gtSystemInfo->SliceCount = 1;
hwInfo->featureTable.ftrGpGpuMidThreadLevelPreempt = false;
@ -31,18 +27,5 @@ int HwInfoConfigHw<IGFX_TIGERLAKE_LP>::configureHardwareCustom(HardwareInfo *hwI
return 0;
}
template <>
uint32_t HwInfoConfigHw<IGFX_TIGERLAKE_LP>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x1;
case REVISION_C:
return 0x3;
}
return CommonConstants::invalidStepping;
}
template class HwInfoConfigHw<IGFX_TIGERLAKE_LP>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -0,0 +1,17 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x4;
}
return CommonConstants::invalidStepping;
}

View File

@ -0,0 +1,17 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x4;
}
return CommonConstants::invalidStepping;
}

View File

@ -7,13 +7,11 @@
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
if (hwInfo.platform.eProductFamily == gfxProduct) {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x1;
}
}
return CommonConstants::invalidStepping;
}

View File

@ -5,6 +5,11 @@
*
*/
template <>
void HwInfoConfigHw<gfxProduct>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
bool HwInfoConfigHw<gfxProduct>::isPageTableManagerSupported(const HardwareInfo &hwInfo) const {
return hwInfo.capabilityTable.ftrRenderCompressedBuffers || hwInfo.capabilityTable.ftrRenderCompressedImages;

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x1;
case REVISION_C:
return 0x4;
}
return CommonConstants::invalidStepping;
}

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x1;
case REVISION_C:
return 0x3;
}
return CommonConstants::invalidStepping;
}

View File

@ -5,6 +5,7 @@
*
*/
#include "shared/source/gen12lp/helpers_gen12lp.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/hw_info_config.inl"
@ -13,26 +14,8 @@
namespace NEO {
constexpr static auto gfxProduct = IGFX_ALDERLAKE_P;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_adlp.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
template <>
void HwInfoConfigHw<IGFX_ALDERLAKE_P>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
PLATFORM *platform = &hwInfo->platform;
platform->eRenderCoreFamily = IGFX_GEN12LP_CORE;
platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE;
}
template <>
uint32_t HwInfoConfigHw<IGFX_ALDERLAKE_P>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x4;
}
return CommonConstants::invalidStepping;
}
template class HwInfoConfigHw<IGFX_ALDERLAKE_P>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -14,24 +14,8 @@
namespace NEO {
constexpr static auto gfxProduct = IGFX_ALDERLAKE_S;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_adls.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
template <>
void HwInfoConfigHw<IGFX_ALDERLAKE_S>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
uint32_t HwInfoConfigHw<IGFX_ALDERLAKE_S>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x4;
}
return CommonConstants::invalidStepping;
}
template class HwInfoConfigHw<IGFX_ALDERLAKE_S>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -17,11 +17,5 @@ constexpr static auto gfxProduct = IGFX_DG1;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_dg1.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
template <>
void HwInfoConfigHw<IGFX_DG1>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template class HwInfoConfigHw<IGFX_DG1>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -15,25 +15,8 @@ namespace NEO {
constexpr static auto gfxProduct = IGFX_ROCKETLAKE;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_rkl.inl"
template <>
void HwInfoConfigHw<IGFX_ROCKETLAKE>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
uint32_t HwInfoConfigHw<IGFX_ROCKETLAKE>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x1;
case REVISION_C:
return 0x4;
}
return CommonConstants::invalidStepping;
}
template class HwInfoConfigHw<IGFX_ROCKETLAKE>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -15,25 +15,8 @@ namespace NEO {
constexpr static auto gfxProduct = IGFX_TIGERLAKE_LP;
#include "shared/source/gen12lp/os_agnostic_hw_info_config_gen12lp.inl"
#include "shared/source/gen12lp/os_agnostic_hw_info_config_tgllp.inl"
template <>
void HwInfoConfigHw<IGFX_TIGERLAKE_LP>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
Gen12LPHelpers::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
uint32_t HwInfoConfigHw<IGFX_TIGERLAKE_LP>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x1;
case REVISION_C:
return 0x3;
}
return CommonConstants::invalidStepping;
}
template class HwInfoConfigHw<IGFX_TIGERLAKE_LP>;
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO