Debian Codegraph @

shared/test/unit_test/gen12lp/linux/product_helper_tests_gen12lp.cpp

raw
1 /*
2 * Copyright (C) 2021-2023 Intel Corporation
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 */
7
8 #include "shared/source/helpers/gfx_core_helper.h"
9 #include "shared/source/os_interface/os_interface.h"
10 #include "shared/test/common/helpers/debug_manager_state_restore.h"
11 #include "shared/test/common/helpers/default_hw_info.h"
12 #include "shared/test/common/test_macros/header/per_product_test_definitions.h"
13 #include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h"
14
15 #include "hw_cmds.h"
16
17 using namespace NEO;
18
19 using Gen12lpProductHelperLinux = ProductHelperTestLinux;
20
21 GEN12LPTEST_F(Gen12lpProductHelperLinux, givenGen12LpProductWhenAdjustPlatformForProductFamilyCalledThenOverrideWithCorrectFamily) {
22
23 PLATFORM *testPlatform = &outHwInfo.platform;
24 testPlatform->eDisplayCoreFamily = IGFX_GEN11_CORE;
25 testPlatform->eRenderCoreFamily = IGFX_GEN11_CORE;
26 productHelper->adjustPlatformForProductFamily(&outHwInfo);
27
28 EXPECT_EQ(IGFX_GEN12LP_CORE, testPlatform->eRenderCoreFamily);
29 EXPECT_EQ(IGFX_GEN12LP_CORE, testPlatform->eDisplayCoreFamily);
30 }
31
32 GEN12LPTEST_F(Gen12lpProductHelperLinux, givenCompressionFtrEnabledWhenAskingForPageTableManagerThenReturnCorrectValue) {
33
34 outHwInfo.capabilityTable.ftrRenderCompressedBuffers = false;
35 outHwInfo.capabilityTable.ftrRenderCompressedImages = false;
36 EXPECT_FALSE(productHelper->isPageTableManagerSupported(outHwInfo));
37
38 outHwInfo.capabilityTable.ftrRenderCompressedBuffers = true;
39 outHwInfo.capabilityTable.ftrRenderCompressedImages = false;
40 EXPECT_TRUE(productHelper->isPageTableManagerSupported(outHwInfo));
41
42 outHwInfo.capabilityTable.ftrRenderCompressedBuffers = false;
43 outHwInfo.capabilityTable.ftrRenderCompressedImages = true;
44 EXPECT_TRUE(productHelper->isPageTableManagerSupported(outHwInfo));
45
46 outHwInfo.capabilityTable.ftrRenderCompressedBuffers = true;
47 outHwInfo.capabilityTable.ftrRenderCompressedImages = true;
48 EXPECT_TRUE(productHelper->isPageTableManagerSupported(outHwInfo));
49 }