mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
fix: Update appropriate values in PCI property & state for Windows
Related-To: NEO-12320 Signed-off-by: Vishnu Khanth <vishnu.khanth.b@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fb8921df97
commit
44658fb7d9
@@ -14,10 +14,8 @@ namespace L0 {
|
||||
namespace Sysman {
|
||||
|
||||
ze_result_t WddmPciImp::getProperties(zes_pci_properties_t *properties) {
|
||||
properties->haveBandwidthCounters = false;
|
||||
properties->havePacketCounters = false;
|
||||
properties->haveReplayCounters = false;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
auto pSysmanProductHelper = pWddmSysmanImp->getSysmanProductHelper();
|
||||
return pSysmanProductHelper->getPciProperties(properties);
|
||||
}
|
||||
|
||||
ze_result_t WddmPciImp::getPciBdf(zes_pci_properties_t &pciProperties) {
|
||||
@@ -111,9 +109,9 @@ ze_result_t WddmPciImp::getState(zes_pci_state_t *state) {
|
||||
std::vector<KmdSysman::ResponseProperty> vResponses = {};
|
||||
KmdSysman::RequestProperty request = {};
|
||||
|
||||
state->qualityIssues = ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32;
|
||||
state->stabilityIssues = ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32;
|
||||
state->status = ZES_PCI_LINK_STATUS_FORCE_UINT32;
|
||||
state->qualityIssues = 0;
|
||||
state->stabilityIssues = 0;
|
||||
state->status = ZES_PCI_LINK_STATUS_UNKNOWN;
|
||||
|
||||
state->speed.gen = -1;
|
||||
state->speed.width = -1;
|
||||
|
||||
@@ -46,6 +46,7 @@ class SysmanProductHelper {
|
||||
|
||||
// Pci
|
||||
virtual ze_result_t getPciStats(zes_pci_stats_t *pStats, WddmSysmanImp *pWddmSysmanImp) = 0;
|
||||
virtual ze_result_t getPciProperties(zes_pci_properties_t *properties) = 0;
|
||||
|
||||
// Memory
|
||||
virtual ze_result_t getMemoryBandWidth(zes_mem_bandwidth_t *pBandwidth, WddmSysmanImp *pWddmSysmanImp) = 0;
|
||||
|
||||
@@ -30,6 +30,7 @@ class SysmanProductHelperHw : public SysmanProductHelper {
|
||||
|
||||
// Pci
|
||||
ze_result_t getPciStats(zes_pci_stats_t *pStats, WddmSysmanImp *pWddmSysmanImp) override;
|
||||
ze_result_t getPciProperties(zes_pci_properties_t *properties) override;
|
||||
|
||||
// Memory
|
||||
ze_result_t getMemoryBandWidth(zes_mem_bandwidth_t *pBandwidth, WddmSysmanImp *pWddmSysmanImp) override;
|
||||
|
||||
@@ -91,6 +91,14 @@ ze_result_t SysmanProductHelperHw<gfxProduct>::getPciStats(zes_pci_stats_t *pSta
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
ze_result_t SysmanProductHelperHw<gfxProduct>::getPciProperties(zes_pci_properties_t *properties) {
|
||||
properties->haveBandwidthCounters = false;
|
||||
properties->havePacketCounters = false;
|
||||
properties->haveReplayCounters = false;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
ze_result_t SysmanProductHelperHw<gfxProduct>::getMemoryBandWidth(zes_mem_bandwidth_t *pBandwidth, WddmSysmanImp *pWddmSysmanImp) {
|
||||
KmdSysManager *pKmdSysManager = &pWddmSysmanImp->getKmdSysManager();
|
||||
|
||||
@@ -456,6 +456,14 @@ ze_result_t SysmanProductHelperHw<gfxProduct>::getPciStats(zes_pci_stats_t *pSta
|
||||
return status;
|
||||
}
|
||||
|
||||
template <>
|
||||
ze_result_t SysmanProductHelperHw<gfxProduct>::getPciProperties(zes_pci_properties_t *properties) {
|
||||
properties->haveBandwidthCounters = true;
|
||||
properties->havePacketCounters = true;
|
||||
properties->haveReplayCounters = true;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
template <>
|
||||
ze_result_t SysmanProductHelperHw<gfxProduct>::getMemoryBandWidth(zes_mem_bandwidth_t *pBandwidth, WddmSysmanImp *pWddmSysmanImp) {
|
||||
ze_result_t status = ZE_RESULT_SUCCESS;
|
||||
|
||||
@@ -308,6 +308,26 @@ TEST_F(SysmanDevicePciFixture, GivenValidSysmanHandleWhenGettingResizableBarEnab
|
||||
delete pPciImp;
|
||||
}
|
||||
|
||||
HWTEST2_F(SysmanDevicePciFixture, GivenValidSysmanHandleWhenCallingGetPropertiesThenPropertiesAreSetToTrue, IsBMG) {
|
||||
zes_pci_properties_t properties{};
|
||||
WddmPciImp *pPciImp = new WddmPciImp(pOsSysman);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, pPciImp->getProperties(&properties));
|
||||
EXPECT_TRUE(properties.haveBandwidthCounters);
|
||||
EXPECT_TRUE(properties.havePacketCounters);
|
||||
EXPECT_TRUE(properties.haveReplayCounters);
|
||||
delete pPciImp;
|
||||
}
|
||||
|
||||
HWTEST2_F(SysmanDevicePciFixture, GivenValidSysmanHandleWhenCallingGetPropertiesThenPropertiesAreSetToFalse, IsNotBMG) {
|
||||
zes_pci_properties_t properties{};
|
||||
WddmPciImp *pPciImp = new WddmPciImp(pOsSysman);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, pPciImp->getProperties(&properties));
|
||||
EXPECT_FALSE(properties.haveBandwidthCounters);
|
||||
EXPECT_FALSE(properties.havePacketCounters);
|
||||
EXPECT_FALSE(properties.haveReplayCounters);
|
||||
delete pPciImp;
|
||||
}
|
||||
|
||||
HWTEST2_F(SysmanDevicePciFixture, GivenValidDeviceHandleWhenGettingZesDevicePciGetStatsThenValidReadingIsRetrieved, IsBMG) {
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsCreateFile)> psysCallsCreateFile(&NEO::SysCalls::sysCallsCreateFile, [](LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) -> HANDLE {
|
||||
return reinterpret_cast<HANDLE>(static_cast<uintptr_t>(0x7));
|
||||
|
||||
@@ -119,9 +119,9 @@ ze_result_t WddmPciImp::getState(zes_pci_state_t *state) {
|
||||
std::vector<KmdSysman::ResponseProperty> vResponses = {};
|
||||
KmdSysman::RequestProperty request = {};
|
||||
|
||||
state->qualityIssues = ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32;
|
||||
state->stabilityIssues = ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32;
|
||||
state->status = ZES_PCI_LINK_STATUS_FORCE_UINT32;
|
||||
state->qualityIssues = 0;
|
||||
state->stabilityIssues = 0;
|
||||
state->status = ZES_PCI_LINK_STATUS_UNKNOWN;
|
||||
|
||||
state->speed.gen = -1;
|
||||
state->speed.width = -1;
|
||||
|
||||
@@ -575,6 +575,9 @@ void testSysmanPci(ze_device_handle_t &device) {
|
||||
std::cout << "properties.maxSpeed.gen = " << std::dec << properties.maxSpeed.gen << std::endl;
|
||||
std::cout << "properties.maxSpeed.width = " << std::dec << properties.maxSpeed.width << std::endl;
|
||||
std::cout << "properties.maxSpeed.maxBandwidth = " << std::dec << properties.maxSpeed.maxBandwidth << std::endl;
|
||||
std::cout << "properties.haveBandwidthCounters = " << static_cast<uint32_t>(properties.haveBandwidthCounters) << std::endl;
|
||||
std::cout << "properties.havePacketCounters = " << static_cast<uint32_t>(properties.havePacketCounters) << std::endl;
|
||||
std::cout << "properties.haveReplayCounters = " << static_cast<uint32_t>(properties.haveReplayCounters) << std::endl;
|
||||
}
|
||||
|
||||
uint32_t count = 0;
|
||||
@@ -595,10 +598,16 @@ void testSysmanPci(ze_device_handle_t &device) {
|
||||
zes_pci_stats_t pciStats = {};
|
||||
VALIDATECALL(zesDevicePciGetStats(device, &pciStats));
|
||||
if (verbose) {
|
||||
std::cout << "pciStats.replayCounter = " << std::dec << pciStats.replayCounter << std::endl;
|
||||
std::cout << "pciStats.packetCounter = " << std::dec << pciStats.packetCounter << std::endl;
|
||||
std::cout << "pciStats.rxCounter = " << std::dec << pciStats.rxCounter << std::endl;
|
||||
std::cout << "pciStats.txCounter = " << std::dec << pciStats.txCounter << std::endl;
|
||||
if (properties.haveReplayCounters) {
|
||||
std::cout << "pciStats.replayCounter = " << std::dec << pciStats.replayCounter << std::endl;
|
||||
}
|
||||
if (properties.havePacketCounters) {
|
||||
std::cout << "pciStats.packetCounter = " << std::dec << pciStats.packetCounter << std::endl;
|
||||
}
|
||||
if (properties.haveBandwidthCounters) {
|
||||
std::cout << "pciStats.rxCounter = " << std::dec << pciStats.rxCounter << std::endl;
|
||||
std::cout << "pciStats.txCounter = " << std::dec << pciStats.txCounter << std::endl;
|
||||
}
|
||||
std::cout << "pciStats.timestamp = " << std::dec << pciStats.timestamp << std::endl;
|
||||
std::cout << "pciStats.speed.gen = " << std::dec << pciStats.speed.gen << std::endl;
|
||||
std::cout << "pciStats.speed.width = " << std::dec << pciStats.speed.width << std::endl;
|
||||
|
||||
@@ -79,6 +79,8 @@ using IsDG2 = IsProduct<IGFX_DG2>;
|
||||
using IsPVC = IsProduct<IGFX_PVC>;
|
||||
|
||||
using IsBMG = IsProduct<IGFX_BMG>;
|
||||
using IsNotBMG = IsNotWithinProducts<IGFX_BMG, IGFX_BMG>;
|
||||
|
||||
using IsLNL = IsProduct<IGFX_LUNARLAKE>;
|
||||
|
||||
using IsAtLeastSkl = IsAtLeastProduct<IGFX_SKYLAKE>;
|
||||
|
||||
Reference in New Issue
Block a user