mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move core specific windows ULT from opencl to shared
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
695958bd10
commit
e9eec1e828
@ -1,15 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen12lp_windows
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gmm_callbacks_tests_gen12lp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_tests_gen12lp.cpp
|
||||
)
|
||||
if(WIN32)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12lp_windows})
|
||||
add_subdirectories()
|
||||
endif()
|
@ -1,125 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/aub_command_stream_receiver_hw.h"
|
||||
#include "shared/source/command_stream/command_stream_receiver_with_aub_dump.h"
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/windows/gmm_callbacks.h"
|
||||
#include "shared/source/os_interface/windows/wddm_device_command_stream.h"
|
||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/common/fixtures/gmm_callbacks_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using Gen12LpGmmCallbacksTests = ::Test<GmmCallbacksFixture>;
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct MockAubCsrToTestNotifyAubCapture : public AUBCommandStreamReceiverHw<GfxFamily> {
|
||||
using AUBCommandStreamReceiverHw<GfxFamily>::AUBCommandStreamReceiverHw;
|
||||
using AUBCommandStreamReceiverHw<GfxFamily>::externalAllocations;
|
||||
};
|
||||
|
||||
GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCsrWithoutAubDumpWhenNotifyAubCaptureCallbackIsCalledThenDoNothing) {
|
||||
auto csr = std::make_unique<WddmCommandStreamReceiver<FamilyType>>(*executionEnvironment, 0, 1);
|
||||
uint64_t address = 0xFEDCBA9876543210;
|
||||
size_t size = 1024;
|
||||
|
||||
auto res = DeviceCallbacks<FamilyType>::notifyAubCapture(csr.get(), address, size, true);
|
||||
|
||||
EXPECT_EQ(1, res);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenWddmCsrWhenWriteL3CalledThenWriteTwoMmio) {
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
|
||||
UltCommandStreamReceiver<FamilyType> csr(*executionEnvironment, 0, 1);
|
||||
uint8_t buffer[128] = {};
|
||||
csr.commandStream.replaceBuffer(buffer, 128);
|
||||
|
||||
uint64_t address = 0x00234564002BCDEC;
|
||||
uint64_t value = 0xFEDCBA987654321C;
|
||||
|
||||
auto res = TTCallbacks<FamilyType>::writeL3Address(&csr, value, address);
|
||||
EXPECT_EQ(1, res);
|
||||
EXPECT_EQ(2 * sizeof(MI_LOAD_REGISTER_IMM), csr.commandStream.getUsed());
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parseCommands<FamilyType>(csr.commandStream, 0);
|
||||
EXPECT_EQ(2u, hwParse.cmdList.size());
|
||||
|
||||
auto cmd = genCmdCast<MI_LOAD_REGISTER_IMM *>(*hwParse.cmdList.begin());
|
||||
ASSERT_NE(nullptr, cmd);
|
||||
EXPECT_EQ(address & 0xFFFFFFFF, cmd->getRegisterOffset());
|
||||
EXPECT_EQ(value & 0xFFFFFFFF, cmd->getDataDword());
|
||||
|
||||
cmd = genCmdCast<MI_LOAD_REGISTER_IMM *>(*(++hwParse.cmdList.begin()));
|
||||
ASSERT_NE(nullptr, cmd);
|
||||
EXPECT_EQ(address >> 32, cmd->getRegisterOffset());
|
||||
EXPECT_EQ(value >> 32, cmd->getDataDword());
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCcsEnabledhenWriteL3CalledThenSetRemapBit) {
|
||||
typedef typename FamilyType::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM;
|
||||
HardwareInfo localHwInfo = *defaultHwInfo;
|
||||
localHwInfo.featureTable.flags.ftrCCSNode = true;
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1u);
|
||||
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&localHwInfo);
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
UltCommandStreamReceiver<FamilyType> csr(executionEnvironment, 0, 1);
|
||||
uint8_t buffer[128] = {};
|
||||
csr.commandStream.replaceBuffer(buffer, 128);
|
||||
|
||||
auto res = TTCallbacks<FamilyType>::writeL3Address(&csr, 1, 1);
|
||||
EXPECT_EQ(1, res);
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parseCommands<FamilyType>(csr.commandStream, 0);
|
||||
EXPECT_EQ(2u, hwParse.cmdList.size());
|
||||
|
||||
auto cmd = genCmdCast<MI_LOAD_REGISTER_IMM *>(*hwParse.cmdList.begin());
|
||||
ASSERT_NE(nullptr, cmd);
|
||||
EXPECT_TRUE(cmd->getMmioRemapEnable());
|
||||
|
||||
cmd = genCmdCast<MI_LOAD_REGISTER_IMM *>(*(++hwParse.cmdList.begin()));
|
||||
ASSERT_NE(nullptr, cmd);
|
||||
EXPECT_TRUE(cmd->getMmioRemapEnable());
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCcsDisabledhenWriteL3CalledThenSetRemapBitToTrue) {
|
||||
typedef typename FamilyType::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM;
|
||||
HardwareInfo localHwInfo = *defaultHwInfo;
|
||||
localHwInfo.featureTable.flags.ftrCCSNode = false;
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1u);
|
||||
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(&localHwInfo);
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
UltCommandStreamReceiver<FamilyType> csr(executionEnvironment, 0, 1);
|
||||
uint8_t buffer[128] = {};
|
||||
csr.commandStream.replaceBuffer(buffer, 128);
|
||||
|
||||
auto res = TTCallbacks<FamilyType>::writeL3Address(&csr, 1, 1);
|
||||
EXPECT_EQ(1, res);
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parseCommands<FamilyType>(csr.commandStream, 0);
|
||||
EXPECT_EQ(2u, hwParse.cmdList.size());
|
||||
|
||||
auto cmd = genCmdCast<MI_LOAD_REGISTER_IMM *>(*hwParse.cmdList.begin());
|
||||
ASSERT_NE(nullptr, cmd);
|
||||
EXPECT_TRUE(cmd->getMmioRemapEnable());
|
||||
|
||||
cmd = genCmdCast<MI_LOAD_REGISTER_IMM *>(*(++hwParse.cmdList.begin()));
|
||||
ASSERT_NE(nullptr, cmd);
|
||||
EXPECT_TRUE(cmd->getMmioRemapEnable());
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/windows/gdi_interface.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_wddm.h"
|
||||
#include "shared/test/common/mocks/windows/mock_gmm_memory_base.h"
|
||||
#include "shared/test/common/os_interface/windows/gdi_dll_fixture.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct Gen12LpWddmTest : public GdiDllFixture, ::testing::Test {
|
||||
void SetUp() override {
|
||||
GdiDllFixture::SetUp();
|
||||
|
||||
executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
|
||||
rootDeviceEnvironment->initGmm();
|
||||
wddm = static_cast<WddmMock *>(Wddm::createWddm(nullptr, *rootDeviceEnvironment));
|
||||
gmmMemory = new MockGmmMemoryBase(rootDeviceEnvironment->getGmmClientContext());
|
||||
wddm->gmmMemory.reset(gmmMemory);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
GdiDllFixture::TearDown();
|
||||
}
|
||||
|
||||
std::unique_ptr<MockExecutionEnvironment> executionEnvironment;
|
||||
RootDeviceEnvironment *rootDeviceEnvironment = nullptr;
|
||||
WddmMock *wddm = nullptr;
|
||||
MockGmmMemoryBase *gmmMemory = nullptr;
|
||||
};
|
||||
|
||||
GEN12LPTEST_F(Gen12LpWddmTest, whenConfigureDeviceAddressSpaceThenObtainMinAddress) {
|
||||
uintptr_t minAddress = 0x12345u;
|
||||
|
||||
EXPECT_NE(NEO::windowsMinAddress, minAddress);
|
||||
|
||||
gmmMemory->getInternalGpuVaRangeLimitResult = minAddress;
|
||||
|
||||
wddm->init();
|
||||
|
||||
EXPECT_EQ(minAddress, wddm->getWddmMinAddress());
|
||||
EXPECT_EQ(1u, gmmMemory->getInternalGpuVaRangeLimitCalled);
|
||||
}
|
||||
|
||||
using Gen12LpWddmHwInfoTest = ::testing::Test;
|
||||
|
||||
GEN12LPTEST_F(Gen12LpWddmHwInfoTest, givenIncorrectProductFamiliyWhenInitCalledThenOverride) {
|
||||
HardwareInfo localHwInfo = *defaultHwInfo;
|
||||
|
||||
localHwInfo.platform.eRenderCoreFamily = GFXCORE_FAMILY::IGFX_UNKNOWN_CORE;
|
||||
localHwInfo.platform.eDisplayCoreFamily = GFXCORE_FAMILY::IGFX_UNKNOWN_CORE;
|
||||
|
||||
std::unique_ptr<OsLibrary> mockGdiDll(setAdapterInfo(&localHwInfo.platform,
|
||||
&localHwInfo.gtSystemInfo,
|
||||
localHwInfo.capabilityTable.gpuAddressSpace));
|
||||
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
|
||||
rootDeviceEnvironment->osInterface = std::make_unique<OSInterface>();
|
||||
|
||||
auto localWddm = std::unique_ptr<Wddm>(Wddm::createWddm(nullptr, *rootDeviceEnvironment));
|
||||
localWddm->init();
|
||||
|
||||
auto newHwInfo = rootDeviceEnvironment->getHardwareInfo();
|
||||
|
||||
EXPECT_EQ(GFXCORE_FAMILY::IGFX_GEN12LP_CORE, newHwInfo->platform.eRenderCoreFamily);
|
||||
EXPECT_EQ(GFXCORE_FAMILY::IGFX_GEN12LP_CORE, newHwInfo->platform.eDisplayCoreFamily);
|
||||
|
||||
// reset mock gdi globals
|
||||
localHwInfo = *defaultHwInfo;
|
||||
mockGdiDll.reset(setAdapterInfo(&localHwInfo.platform,
|
||||
&localHwInfo.gtSystemInfo,
|
||||
localHwInfo.capabilityTable.gpuAddressSpace));
|
||||
}
|
Reference in New Issue
Block a user