diff --git a/level_zero/sysman/source/api/diagnostics/linux/sysman_os_diagnostics_imp.cpp b/level_zero/sysman/source/api/diagnostics/linux/sysman_os_diagnostics_imp.cpp index 40585380bc..56ebdb97c7 100644 --- a/level_zero/sysman/source/api/diagnostics/linux/sysman_os_diagnostics_imp.cpp +++ b/level_zero/sysman/source/api/diagnostics/linux/sysman_os_diagnostics_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/helpers/string.h" #include "level_zero/sysman/source/shared/firmware_util/sysman_firmware_util.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" #include "level_zero/sysman/source/shared/linux/sysman_fs_access_interface.h" namespace L0 { @@ -24,7 +25,8 @@ const std::string LinuxDiagnosticsImp::invalidateLmemFile("invalidate_lmem_mmaps const std::string LinuxDiagnosticsImp::quiescentGpuFile("quiesce_gpu"); void OsDiagnostics::getSupportedDiagTestsFromFW(void *pOsSysman, std::vector &supportedDiagTests) { LinuxSysmanImp *pLinuxSysmanImp = static_cast(pOsSysman); - if (IGFX_PVC == pLinuxSysmanImp->getProductFamily()) { + auto pSysmanProductHelper = pLinuxSysmanImp->getSysmanProductHelper(); + if (pSysmanProductHelper->isDiagnosticsSupported()) { FirmwareUtil *pFwInterface = pLinuxSysmanImp->getFwUtilInterface(); if (pFwInterface != nullptr) { static_cast(pFwInterface)->fwSupportedDiagTests(supportedDiagTests); diff --git a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h index 112b676485..fe0b3ebc6d 100644 --- a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h +++ b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h @@ -75,6 +75,9 @@ class SysmanProductHelper { virtual uint64_t setPowerLimitValue(int32_t value) = 0; virtual zes_limit_unit_t getPowerLimitUnit() = 0; + // Diagnostics + virtual bool isDiagnosticsSupported() = 0; + virtual ~SysmanProductHelper() = default; protected: diff --git a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h index 982355d58b..0843f0d6b7 100644 --- a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h +++ b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h @@ -54,6 +54,9 @@ class SysmanProductHelperHw : public SysmanProductHelper { uint64_t setPowerLimitValue(int32_t value) override; zes_limit_unit_t getPowerLimitUnit() override; + // Diagnostics + bool isDiagnosticsSupported() override; + ~SysmanProductHelperHw() override = default; protected: diff --git a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl index 6b03baf5a6..38c55bfd5a 100644 --- a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl +++ b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl @@ -213,5 +213,10 @@ zes_limit_unit_t SysmanProductHelperHw::getPowerLimitUnit() { return ZES_LIMIT_UNIT_POWER; } +template +bool SysmanProductHelperHw::isDiagnosticsSupported() { + return false; +} + } // namespace Sysman } // namespace L0 diff --git a/level_zero/sysman/source/shared/linux/product_helper/xe_hpc_core/pvc/sysman_product_helper_pvc.cpp b/level_zero/sysman/source/shared/linux/product_helper/xe_hpc_core/pvc/sysman_product_helper_pvc.cpp index 58c7919b9e..5f2c148147 100644 --- a/level_zero/sysman/source/shared/linux/product_helper/xe_hpc_core/pvc/sysman_product_helper_pvc.cpp +++ b/level_zero/sysman/source/shared/linux/product_helper/xe_hpc_core/pvc/sysman_product_helper_pvc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -281,6 +281,11 @@ zes_limit_unit_t SysmanProductHelperHw::getPowerLimitUnit() { return ZES_LIMIT_UNIT_CURRENT; } +template <> +bool SysmanProductHelperHw::isDiagnosticsSupported() { + return true; +} + template class SysmanProductHelperHw; } // namespace Sysman