2019-01-10 22:36:57 +08:00
|
|
|
/*
|
2023-01-17 00:40:13 +08:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-01-10 22:36:57 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/source/gen11/hw_cmds.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
2022-10-28 21:51:20 +08:00
|
|
|
#include "shared/test/common/fixtures/device_fixture.h"
|
2023-01-17 00:40:13 +08:00
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2019-01-10 22:36:57 +08:00
|
|
|
using namespace NEO;
|
|
|
|
|
2022-10-28 21:51:20 +08:00
|
|
|
using Gen11DeviceCaps = Test<DeviceFixture>;
|
2019-01-10 22:36:57 +08:00
|
|
|
|
2020-10-26 21:57:52 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, GivenDefaultWhenCheckingPreemptionModeThenMidThreadIsReturned) {
|
2019-01-10 22:36:57 +08:00
|
|
|
EXPECT_TRUE(PreemptionMode::MidThread == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
|
|
|
}
|
|
|
|
|
2020-10-26 21:57:52 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, WhenCheckingProfilingTimerResolutionThenCorrectResolutionIsReturned) {
|
2019-01-10 22:36:57 +08:00
|
|
|
const auto &caps = pDevice->getDeviceInfo();
|
|
|
|
EXPECT_EQ(83u, caps.outProfilingTimerResolution);
|
|
|
|
}
|
|
|
|
|
2020-10-26 21:57:52 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, GivenWhenGettingKmdNotifyPropertiesThenItIsDisabled) {
|
2019-01-10 22:36:57 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
|
|
|
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
|
|
|
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
|
|
|
|
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds);
|
2021-12-18 02:42:13 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
|
|
|
|
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds);
|
2019-01-10 22:36:57 +08:00
|
|
|
}
|
|
|
|
|
2020-10-26 21:57:52 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, WhenCheckingCompressionThenItIsDisabled) {
|
2019-01-10 22:36:57 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedBuffers);
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedImages);
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue) {
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
2022-12-08 20:22:35 +08:00
|
|
|
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
2019-05-08 22:00:24 +08:00
|
|
|
uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice * 8;
|
2019-01-10 22:36:57 +08:00
|
|
|
|
2022-12-08 20:22:35 +08:00
|
|
|
EXPECT_EQ(expectedValue, gfxCoreHelper.getComputeUnitsUsedForScratch(pDevice->getRootDeviceEnvironment()));
|
2019-01-10 22:36:57 +08:00
|
|
|
EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch);
|
|
|
|
}
|
|
|
|
|
2019-05-29 21:37:54 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenHwInfoWhenRequestedMaxFrontEndThreadsThenReturnValidValue) {
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
|
|
|
|
2022-12-08 20:22:35 +08:00
|
|
|
EXPECT_EQ(GfxCoreHelper::getMaxThreadsForVfe(hwInfo), pDevice->getDeviceInfo().maxFrontEndThreads);
|
2019-05-29 21:37:54 +08:00
|
|
|
}
|
|
|
|
|
2019-01-10 22:36:57 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckSupportCacheFlushAfterWalkerThenFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
|
|
|
|
}
|
|
|
|
|
2019-04-16 15:06:37 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckBlitterOperationsSupportThenReturnFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.blitterOperationsSupported);
|
|
|
|
}
|
|
|
|
|
2019-09-30 23:32:14 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingImageSupportThenReturnTrue) {
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages);
|
|
|
|
}
|
2020-02-06 22:10:59 +08:00
|
|
|
|
2021-05-13 22:58:26 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingMediaBlockSupportThenReturnTrue) {
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock);
|
|
|
|
}
|
|
|
|
|
2020-04-30 15:51:56 +08:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingCoherencySupportThenReturnFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsCoherency);
|
|
|
|
}
|