Skip to content

Commit ec87330

Browse files
Move some logic to separate helper
Change-Id: I09cf50b44b38b193d1491f6dcea6b4dd6987dd5e Signed-off-by: Maciej Dziuban <[email protected]>
1 parent d408b82 commit ec87330

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

unit_tests/gen12lp/special_ult_helper_gen12lp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
namespace NEO {
1313

14+
bool SpecialUltHelperGen12lp::shouldCompressionBeEnabledAfterConfigureHardwareCustom(const HardwareInfo &hwInfo) {
15+
return hwInfo.featureTable.ftrE2ECompression;
16+
}
17+
1418
bool SpecialUltHelperGen12lp::shouldEnableHdcFlush(PRODUCT_FAMILY productFamily) {
1519
return true;
1620
}

unit_tests/gen12lp/special_ult_helper_gen12lp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace NEO {
1515
struct HardwareInfo;
1616

1717
struct SpecialUltHelperGen12lp {
18+
static bool shouldCompressionBeEnabledAfterConfigureHardwareCustom(const HardwareInfo &hwInfo);
1819
static bool shouldEnableHdcFlush(PRODUCT_FAMILY productFamily);
1920
static bool additionalCoherencyCheck(PRODUCT_FAMILY productFamily, bool coherency);
2021
static bool shouldPerformimagePitchAlignment(PRODUCT_FAMILY productFamily);

unit_tests/gen12lp/windows/hw_info_config_tests_gen12lp.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "core/unit_tests/helpers/debug_manager_state_restore.h"
99
#include "runtime/os_interface/windows/os_interface.h"
10+
#include "unit_tests/gen12lp/special_ult_helper_gen12lp.h"
1011
#include "unit_tests/os_interface/windows/hw_info_config_win_tests.h"
1112

1213
using namespace NEO;
@@ -21,11 +22,13 @@ GEN12LPTEST_F(HwInfoConfigTestWindowsGen12lp, givenE2ECSetByKmdWhenConfiguringHw
2122

2223
localFeatureTable.ftrE2ECompression = true;
2324
hwInfoConfig->configureHardwareCustom(&outHwInfo, nullptr);
24-
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
25-
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
25+
bool expectedValue = SpecialUltHelperGen12lp::shouldCompressionBeEnabledAfterConfigureHardwareCustom(outHwInfo);
26+
EXPECT_EQ(expectedValue, outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
27+
EXPECT_EQ(expectedValue, outHwInfo.capabilityTable.ftrRenderCompressedImages);
2628

2729
localFeatureTable.ftrE2ECompression = false;
2830
hwInfoConfig->configureHardwareCustom(&outHwInfo, nullptr);
29-
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
30-
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
31+
expectedValue = SpecialUltHelperGen12lp::shouldCompressionBeEnabledAfterConfigureHardwareCustom(outHwInfo);
32+
EXPECT_EQ(expectedValue, outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
33+
EXPECT_EQ(expectedValue, outHwInfo.capabilityTable.ftrRenderCompressedImages);
3134
}

0 commit comments

Comments
 (0)