diff --git a/level_zero/sysman/source/shared/windows/CMakeLists.txt b/level_zero/sysman/source/shared/windows/CMakeLists.txt index f53e83f3be..88ac92e349 100644 --- a/level_zero/sysman/source/shared/windows/CMakeLists.txt +++ b/level_zero/sysman/source/shared/windows/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2023 Intel Corporation +# Copyright (C) 2023-2024 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -17,4 +17,5 @@ if(WIN32) ${CMAKE_CURRENT_SOURCE_DIR}/zes_os_sysman_driver_imp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/zes_os_sysman_driver_imp.h ) + add_subdirectories() endif() diff --git a/level_zero/sysman/source/shared/windows/product_helper/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/CMakeLists.txt new file mode 100644 index 0000000000..dbaf8e5d91 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_hw.h + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_hw.inl + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper.cpp +) + +add_subdirectories() diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen11/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen11/CMakeLists.txt new file mode 100644 index 0000000000..ed573e731e --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen11/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +add_subdirectories() diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/CMakeLists.txt new file mode 100644 index 0000000000..a8dc32b491 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_ICLLP) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_icllp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_icllp.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/enable_sysman_product_helper_icllp.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/enable_sysman_product_helper_icllp.cpp new file mode 100644 index 0000000000..58b918cbec --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/enable_sysman_product_helper_icllp.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableIcllp; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/sysman_product_helper_icllp.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/sysman_product_helper_icllp.cpp new file mode 100644 index 0000000000..a000b8264b --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen11/icllp/sysman_product_helper_icllp.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_ICELAKE_LP; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/CMakeLists.txt new file mode 100644 index 0000000000..ed573e731e --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +add_subdirectories() diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/CMakeLists.txt new file mode 100644 index 0000000000..bb364aaefd --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_ADLN) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_adln.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_adln.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/enable_sysman_product_helper_adln.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/enable_sysman_product_helper_adln.cpp new file mode 100644 index 0000000000..52e4d42bd7 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/enable_sysman_product_helper_adln.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableAdln; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/sysman_product_helper_adln.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/sysman_product_helper_adln.cpp new file mode 100644 index 0000000000..d66b36e424 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adln/sysman_product_helper_adln.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_ALDERLAKE_N; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/CMakeLists.txt new file mode 100644 index 0000000000..7bfa1a8a19 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_ADLP) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_adlp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_adlp.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/enable_sysman_product_helper_adlp.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/enable_sysman_product_helper_adlp.cpp new file mode 100644 index 0000000000..ee7fbf996e --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/enable_sysman_product_helper_adlp.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableAdlp; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/sysman_product_helper_adlp.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/sysman_product_helper_adlp.cpp new file mode 100644 index 0000000000..e1a1c19746 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adlp/sysman_product_helper_adlp.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_ALDERLAKE_P; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/CMakeLists.txt new file mode 100644 index 0000000000..7fbd922417 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_ADLS) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_adls.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_adls.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/enable_sysman_product_helper_adls.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/enable_sysman_product_helper_adls.cpp new file mode 100644 index 0000000000..582e2ec595 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/enable_sysman_product_helper_adls.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableAdls; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/sysman_product_helper_adls.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/sysman_product_helper_adls.cpp new file mode 100644 index 0000000000..7bef250fa2 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/adls/sysman_product_helper_adls.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_ALDERLAKE_S; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/CMakeLists.txt new file mode 100644 index 0000000000..3fc8067c85 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_DG1) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_dg1.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_dg1.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/enable_sysman_product_helper_dg1.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/enable_sysman_product_helper_dg1.cpp new file mode 100644 index 0000000000..7dec613e80 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/enable_sysman_product_helper_dg1.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableDg1; + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/sysman_product_helper_dg1.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/sysman_product_helper_dg1.cpp new file mode 100644 index 0000000000..64340aabd0 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/dg1/sysman_product_helper_dg1.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_DG1; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/CMakeLists.txt new file mode 100644 index 0000000000..dd3ac6fb42 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_RKL) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_rkl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_rkl.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/enable_sysman_product_helper_rkl.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/enable_sysman_product_helper_rkl.cpp new file mode 100644 index 0000000000..9eb5f38fe7 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/enable_sysman_product_helper_rkl.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableRkl; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/sysman_product_helper_rkl.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/sysman_product_helper_rkl.cpp new file mode 100644 index 0000000000..ece0da33d2 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/rkl/sysman_product_helper_rkl.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { + +constexpr static auto gfxProduct = IGFX_ROCKETLAKE; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/CMakeLists.txt new file mode 100644 index 0000000000..a16c76f93e --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_TGLLP) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_tgllp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_tgllp.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/enable_sysman_product_helper_tgllp.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/enable_sysman_product_helper_tgllp.cpp new file mode 100644 index 0000000000..6db211f2dc --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/enable_sysman_product_helper_tgllp.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableTgllp; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/sysman_product_helper_tgllp.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/sysman_product_helper_tgllp.cpp new file mode 100644 index 0000000000..81984fc186 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen12lp/tgllp/sysman_product_helper_tgllp.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { + +constexpr static auto gfxProduct = IGFX_TIGERLAKE_LP; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen9/CMakeLists.txt new file mode 100644 index 0000000000..ed573e731e --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +add_subdirectories() diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/CMakeLists.txt new file mode 100644 index 0000000000..4709e1abfe --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_CFL) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_cfl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_cfl.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/enable_sysman_product_helper_cfl.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/enable_sysman_product_helper_cfl.cpp new file mode 100644 index 0000000000..1a6010d309 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/enable_sysman_product_helper_cfl.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableCfl; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/sysman_product_helper_cfl.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/sysman_product_helper_cfl.cpp new file mode 100644 index 0000000000..3a4bab647d --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/cfl/sysman_product_helper_cfl.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_COFFEELAKE; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/CMakeLists.txt new file mode 100644 index 0000000000..824fb8c5a1 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_KBL) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_kbl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_kbl.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/enable_sysman_product_helper_kbl.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/enable_sysman_product_helper_kbl.cpp new file mode 100644 index 0000000000..90be4fe85b --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/enable_sysman_product_helper_kbl.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableKbl; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/sysman_product_helper_kbl.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/sysman_product_helper_kbl.cpp new file mode 100644 index 0000000000..084e48f7c3 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/kbl/sysman_product_helper_kbl.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_KABYLAKE; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/CMakeLists.txt new file mode 100644 index 0000000000..cd29f4d60c --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_SKL) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_skl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_skl.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/enable_sysman_product_helper_skl.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/enable_sysman_product_helper_skl.cpp new file mode 100644 index 0000000000..4a0c135d64 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/enable_sysman_product_helper_skl.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableSkl; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/sysman_product_helper_skl.cpp b/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/sysman_product_helper_skl.cpp new file mode 100644 index 0000000000..ef767ada33 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/gen9/skl/sysman_product_helper_skl.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_SKYLAKE; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.cpp b/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.cpp new file mode 100644 index 0000000000..92b6ac3ce1 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h" + +namespace L0 { +namespace Sysman { + +SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[IGFX_MAX_PRODUCT] = {}; + +} +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h b/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h new file mode 100644 index 0000000000..f7adb97937 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include +#include + +#include "igfxfmid.h" + +#include +#include + +namespace NEO { +class Drm; +} + +namespace L0 { +namespace Sysman { + +class SysmanProductHelper; + +using SysmanProductHelperCreateFunctionType = std::unique_ptr (*)(); +extern SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[IGFX_MAX_PRODUCT]; + +class SysmanProductHelper { + public: + static std::unique_ptr create(PRODUCT_FAMILY product) { + auto productHelperCreateFunction = sysmanProductHelperFactory[product]; + if (productHelperCreateFunction == nullptr) { + return nullptr; + } + auto productHelper = productHelperCreateFunction(); + return productHelper; + } + + virtual ~SysmanProductHelper() = default; + + protected: + SysmanProductHelper() = default; +}; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h b/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h new file mode 100644 index 0000000000..70b1bed1f4 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include "shared/source/debug_settings/debug_settings_manager.h" + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h" + +namespace L0 { +namespace Sysman { + +template +class SysmanProductHelperHw : public SysmanProductHelper { + public: + static std::unique_ptr create() { + auto pSysmanProductHelper = std::unique_ptr(new SysmanProductHelperHw()); + return pSysmanProductHelper; + } + + ~SysmanProductHelperHw() override = default; + + protected: + SysmanProductHelperHw() = default; +}; + +template +struct EnableSysmanProductHelper { + EnableSysmanProductHelper() { + auto sysmanProductHelperCreateFunction = SysmanProductHelperHw::create; + sysmanProductHelperFactory[gfxProduct] = sysmanProductHelperCreateFunction; + } +}; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl b/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl new file mode 100644 index 0000000000..95810c6a51 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/CMakeLists.txt new file mode 100644 index 0000000000..ed573e731e --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +add_subdirectories() diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/CMakeLists.txt new file mode 100644 index 0000000000..66b20ea254 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_PVC) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_pvc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_pvc.cpp + ) +endif() diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/enable_sysman_product_helper_pvc.cpp b/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/enable_sysman_product_helper_pvc.cpp new file mode 100644 index 0000000000..5d66aa2441 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/enable_sysman_product_helper_pvc.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enablePvc; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/sysman_product_helper_pvc.cpp b/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/sysman_product_helper_pvc.cpp new file mode 100644 index 0000000000..4c429cd69f --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpc_core/pvc/sysman_product_helper_pvc.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { +constexpr static auto gfxProduct = IGFX_PVC; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/CMakeLists.txt new file mode 100644 index 0000000000..ed573e731e --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +add_subdirectories() diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/CMakeLists.txt new file mode 100644 index 0000000000..f2d8316f0a --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_ARL) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_arl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_arl.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/enable_sysman_product_helper_arl.cpp b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/enable_sysman_product_helper_arl.cpp new file mode 100644 index 0000000000..fa0413a3d1 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/enable_sysman_product_helper_arl.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableArl; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/sysman_product_helper_arl.cpp b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/sysman_product_helper_arl.cpp new file mode 100644 index 0000000000..822134d51a --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/arl/sysman_product_helper_arl.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { + +constexpr static auto gfxProduct = IGFX_ARROWLAKE; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/CMakeLists.txt new file mode 100644 index 0000000000..484e0a9608 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_DG2) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_dg2.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_dg2.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/enable_sysman_product_helper_dg2.cpp b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/enable_sysman_product_helper_dg2.cpp new file mode 100644 index 0000000000..57fd45f3c1 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/enable_sysman_product_helper_dg2.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableDg2; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/sysman_product_helper_dg2.cpp b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/sysman_product_helper_dg2.cpp new file mode 100644 index 0000000000..bb78d2848a --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/dg2/sysman_product_helper_dg2.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { + +constexpr static auto gfxProduct = IGFX_DG2; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/CMakeLists.txt b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/CMakeLists.txt new file mode 100644 index 0000000000..aae7ca1dc9 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_MTL) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_mtl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_mtl.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/enable_sysman_product_helper_mtl.cpp b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/enable_sysman_product_helper_mtl.cpp new file mode 100644 index 0000000000..a125ed6d38 --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/enable_sysman_product_helper_mtl.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableMtl; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/sysman_product_helper_mtl.cpp b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/sysman_product_helper_mtl.cpp new file mode 100644 index 0000000000..a01e85c77a --- /dev/null +++ b/level_zero/sysman/source/shared/windows/product_helper/xe_hpg_core/mtl/sysman_product_helper_mtl.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { + +constexpr static auto gfxProduct = IGFX_METEORLAKE; + +template class SysmanProductHelperHw; + +} // namespace Sysman +} // namespace L0 diff --git a/level_zero/sysman/source/shared/windows/zes_os_sysman_imp.cpp b/level_zero/sysman/source/shared/windows/zes_os_sysman_imp.cpp index fd690d963b..7cc20fd9a1 100644 --- a/level_zero/sysman/source/shared/windows/zes_os_sysman_imp.cpp +++ b/level_zero/sysman/source/shared/windows/zes_os_sysman_imp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,6 +12,7 @@ #include "shared/source/os_interface/windows/wddm/wddm.h" #include "level_zero/sysman/source/shared/firmware_util/sysman_firmware_util.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h" #include "level_zero/sysman/source/shared/windows/sysman_kmd_sys_manager.h" namespace L0 { @@ -35,6 +36,9 @@ ze_result_t WddmSysmanImp::init() { subDeviceCount = 0; } + pSysmanProductHelper = SysmanProductHelper::create(getProductFamily()); + DEBUG_BREAK_IF(nullptr == pSysmanProductHelper); + return ZE_RESULT_SUCCESS; } @@ -46,6 +50,11 @@ SysmanDeviceImp *WddmSysmanImp::getSysmanDeviceImp() { return pParentSysmanDeviceImp; } +SysmanProductHelper *WddmSysmanImp::getSysmanProductHelper() { + UNRECOVERABLE_IF(nullptr == pSysmanProductHelper); + return pSysmanProductHelper.get(); +} + void WddmSysmanImp::createFwUtilInterface() { const auto pciBusInfo = pParentSysmanDeviceImp->getRootDeviceEnvironment().osInterface->getDriverModel()->getPciBusInfo(); const uint16_t domain = static_cast(pciBusInfo.pciDomain); diff --git a/level_zero/sysman/source/shared/windows/zes_os_sysman_imp.h b/level_zero/sysman/source/shared/windows/zes_os_sysman_imp.h index e2a549d932..785407a690 100644 --- a/level_zero/sysman/source/shared/windows/zes_os_sysman_imp.h +++ b/level_zero/sysman/source/shared/windows/zes_os_sysman_imp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,6 +20,7 @@ class Wddm; } namespace L0 { namespace Sysman { +class SysmanProductHelper; class WddmSysmanImp : public OsSysman, NEO::NonCopyableOrMovableClass { public: @@ -36,11 +37,14 @@ class WddmSysmanImp : public OsSysman, NEO::NonCopyableOrMovableClass { uint32_t getSubDeviceCount() override; SysmanDeviceImp *getSysmanDeviceImp(); const NEO::HardwareInfo &getHardwareInfo() const override { return pParentSysmanDeviceImp->getHardwareInfo(); } + PRODUCT_FAMILY getProductFamily() const { return pParentSysmanDeviceImp->getProductFamily(); } + SysmanProductHelper *getSysmanProductHelper(); protected: FirmwareUtil *pFwUtilInterface = nullptr; KmdSysManager *pKmdSysManager = nullptr; SysmanDevice *pDevice = nullptr; + std::unique_ptr pSysmanProductHelper; private: SysmanDeviceImp *pParentSysmanDeviceImp = nullptr; diff --git a/level_zero/sysman/test/unit_tests/sources/windows/CMakeLists.txt b/level_zero/sysman/test/unit_tests/sources/windows/CMakeLists.txt index 4868ccea74..aa627fae16 100644 --- a/level_zero/sysman/test/unit_tests/sources/windows/CMakeLists.txt +++ b/level_zero/sysman/test/unit_tests/sources/windows/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2023 Intel Corporation +# Copyright (C) 2020-2024 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -15,4 +15,5 @@ if(WIN32) ${CMAKE_CURRENT_SOURCE_DIR}/test_sysman_driver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_sysman_manager.cpp ) + add_subdirectories() endif() diff --git a/level_zero/sysman/test/unit_tests/sources/windows/mocks/CMakeLists.txt b/level_zero/sysman/test/unit_tests/sources/windows/mocks/CMakeLists.txt new file mode 100644 index 0000000000..5c37f77904 --- /dev/null +++ b/level_zero/sysman/test/unit_tests/sources/windows/mocks/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(WIN32) + target_sources(${TARGET_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/mock_sysman_product_helper.cpp + ) +endif() \ No newline at end of file diff --git a/level_zero/sysman/test/unit_tests/sources/windows/mocks/mock_sysman_product_helper.cpp b/level_zero/sysman/test/unit_tests/sources/windows/mocks/mock_sysman_product_helper.cpp new file mode 100644 index 0000000000..36435e439d --- /dev/null +++ b/level_zero/sysman/test/unit_tests/sources/windows/mocks/mock_sysman_product_helper.cpp @@ -0,0 +1,11 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper_hw.inl" + +template class L0::Sysman::SysmanProductHelperHw; diff --git a/level_zero/sysman/test/unit_tests/sources/windows/product_helper/CMakeLists.txt b/level_zero/sysman/test/unit_tests/sources/windows/product_helper/CMakeLists.txt new file mode 100644 index 0000000000..0338bd6e41 --- /dev/null +++ b/level_zero/sysman/test/unit_tests/sources/windows/product_helper/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (C) 2024 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(WIN32) + target_sources(${TARGET_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_tests.cpp + ) +endif() \ No newline at end of file diff --git a/level_zero/sysman/test/unit_tests/sources/windows/product_helper/sysman_product_helper_tests.cpp b/level_zero/sysman/test/unit_tests/sources/windows/product_helper/sysman_product_helper_tests.cpp new file mode 100644 index 0000000000..2b1101a28f --- /dev/null +++ b/level_zero/sysman/test/unit_tests/sources/windows/product_helper/sysman_product_helper_tests.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/windows/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/test/unit_tests/sources/windows/mock_sysman_fixture.h" + +#include "gtest/gtest.h" + +namespace L0 { +namespace Sysman { +namespace ult { + +using SysmanProductHelperTest = SysmanDeviceFixture; + +TEST_F(SysmanProductHelperTest, GivenValidWddmSysmanImpObjectWhenCallingGetSysmanProductHelperThenNotNullObjectIsReturned) { + auto pSysmanProductHelper = pWddmSysmanImp->getSysmanProductHelper(); + EXPECT_NE(nullptr, pSysmanProductHelper); +} + +TEST_F(SysmanProductHelperTest, GivenInvalidProductFamilyWhenCallingProductHelperCreateThenNullPtrIsReturned) { + auto pSysmanProductHelper = L0::Sysman::SysmanProductHelper::create(IGFX_UNKNOWN); + EXPECT_EQ(nullptr, pSysmanProductHelper); +} + +} // namespace ult +} // namespace Sysman +} // namespace L0 \ No newline at end of file