refactor: extract common logic from wddm and drm product helpers

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-07-15 19:33:26 +00:00
committed by Compute-Runtime-Automation
parent 400f2d03dc
commit 585caab757
12 changed files with 67 additions and 72 deletions

View File

@@ -213,7 +213,7 @@ bool ProductHelperHw<IGFX_UNKNOWN>::heapInLocalMem(const HardwareInfo &hwInfo) c
}
template <>
void ProductHelperHw<IGFX_UNKNOWN>::setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) {
void ProductHelperHw<IGFX_UNKNOWN>::setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) const {
}
template <>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -80,17 +80,16 @@ TEST_F(ProductHelperTestWindows, givenInstrumentationForHardwareIsEnabledOrDisab
}
HWTEST_F(ProductHelperTestWindows, givenFtrIaCoherencyFlagWhenConfiguringHwInfoThenSetCoherencySupportCorrectly) {
HardwareInfo initialHwInfo = *defaultHwInfo;
bool initialCoherencyStatus = false;
productHelper->setCapabilityCoherencyFlag(outHwInfo, initialCoherencyStatus);
initialHwInfo.featureTable.flags.ftrL3IACoherency = false;
productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
outHwInfo.featureTable.flags.ftrL3IACoherency = false;
productHelper->configureHwInfoWddm(&outHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
EXPECT_FALSE(outHwInfo.capabilityTable.ftrSupportsCoherency);
initialHwInfo.featureTable.flags.ftrL3IACoherency = true;
productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
outHwInfo.featureTable.flags.ftrL3IACoherency = true;
productHelper->configureHwInfoWddm(&outHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
EXPECT_EQ(initialCoherencyStatus, outHwInfo.capabilityTable.ftrSupportsCoherency);
}
} // namespace NEO