1 /*
2  * Copyright (C) 2020-2021 Intel Corporation
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  */
7 
8 #include "shared/source/command_stream/preemption.h"
9 #include "shared/source/os_interface/hw_info_config.h"
10 #include "shared/source/os_interface/os_interface.h"
11 #include "shared/test/common/helpers/hw_helper_tests.h"
12 
13 using HwHelperTestGen12Lp = HwHelperTest;
14 
DG1TEST_F(HwHelperTestGen12Lp,GivenDG1WhenConfigureHardwareCustomThenMTPIsNotSet)15 DG1TEST_F(HwHelperTestGen12Lp, GivenDG1WhenConfigureHardwareCustomThenMTPIsNotSet) {
16     HwInfoConfig *hwInfoConfig = HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
17 
18     OSInterface osIface;
19     hardwareInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::ThreadGroup;
20     PreemptionHelper::adjustDefaultPreemptionMode(hardwareInfo.capabilityTable, true, true, true);
21 
22     hwInfoConfig->configureHardwareCustom(&hardwareInfo, &osIface);
23     EXPECT_FALSE(hardwareInfo.featureTable.flags.ftrGpGpuMidThreadLevelPreempt);
24 }
25 
DG1TEST_F(HwHelperTestGen12Lp,GivenDG1WhenConfigureHardwareCustomThenKmdNotifyIsEnabled)26 DG1TEST_F(HwHelperTestGen12Lp, GivenDG1WhenConfigureHardwareCustomThenKmdNotifyIsEnabled) {
27     HwInfoConfig *hwInfoConfig = HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
28 
29     OSInterface osIface;
30     hwInfoConfig->configureHardwareCustom(&hardwareInfo, &osIface);
31     EXPECT_TRUE(hardwareInfo.capabilityTable.kmdNotifyProperties.enableKmdNotify);
32     EXPECT_EQ(300ll, hardwareInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
33 }
34