Extract functions to command_stream_receiver_simulated_common_hw_base.inl

Change-Id: Ide3cede86faa397d4df84a38f0f8a79c3273c266
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
Related-To: NEO-3016
This commit is contained in:
Maciej Dziuban 2019-05-13 09:53:19 +02:00 committed by sys_ocldev
parent b8fb5e683b
commit 03c05c3f77
7 changed files with 65 additions and 52 deletions

View File

@ -26,7 +26,8 @@ set(RUNTIME_SRCS_COMMAND_STREAM
${CMAKE_CURRENT_SOURCE_DIR}/csr_definitions.h
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/command_stream_receiver_simulated_hw.h
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw.h
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw.inl
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw_base.inl
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw_bdw_plus.inl
${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream.h
${CMAKE_CURRENT_SOURCE_DIR}/experimental_command_buffer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/experimental_command_buffer.h

View File

@ -22,13 +22,6 @@
namespace NEO {
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initGlobalMMIO() {
for (auto &mmioPair : AUBFamilyMapper<GfxFamily>::globalMMIO) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initAdditionalMMIO() {
if (DebugManager.flags.AubDumpAddMmioRegistersList.get() != "unk") {
@ -39,46 +32,6 @@ void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initAdditionalMMIO() {
}
}
template <typename GfxFamily>
uint64_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getPPGTTAdditionalBits(GraphicsAllocation *gfxAllocation) {
return BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit) | BIT(PageTableEntry::userSupervisorBit);
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getGTTData(void *memory, AubGTTData &data) {
data.present = true;
data.localMemory = false;
}
template <typename GfxFamily>
uint32_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getMemoryBankForGtt() const {
return MemoryBanks::getBank(this->deviceIndex);
}
template <typename GfxFamily>
const AubMemDump::LrcaHelper &CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getCsTraits(aub_stream::EngineType engineType) {
return *AUBFamilyMapper<GfxFamily>::csTraits[engineType];
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initEngineMMIO() {
auto mmioList = AUBFamilyMapper<GfxFamily>::perEngineMMIO[osContext->getEngineType()];
DEBUG_BREAK_IF(!mmioList);
for (auto &mmioPair : *mmioList) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::submitLRCA(const MiContextDescriptorReg &contextDescriptor) {
auto mmioBase = getCsTraits(osContext->getEngineType()).mmioBase;
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), 0);
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), 0);
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), contextDescriptor.ulData[1]);
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), contextDescriptor.ulData[0]);
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::setupContext(OsContext &osContext) {
CommandStreamReceiverHw<GfxFamily>::setupContext(osContext);

View File

@ -0,0 +1,59 @@
/*
* Copyright (C) 2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw_base.inl"
namespace NEO {
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initGlobalMMIO() {
for (auto &mmioPair : AUBFamilyMapper<GfxFamily>::globalMMIO) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
}
template <typename GfxFamily>
uint64_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getPPGTTAdditionalBits(GraphicsAllocation *gfxAllocation) {
return BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit) | BIT(PageTableEntry::userSupervisorBit);
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getGTTData(void *memory, AubGTTData &data) {
data.present = true;
data.localMemory = false;
}
template <typename GfxFamily>
uint32_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getMemoryBankForGtt() const {
return MemoryBanks::getBank(this->deviceIndex);
}
template <typename GfxFamily>
const AubMemDump::LrcaHelper &CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getCsTraits(aub_stream::EngineType engineType) {
return *AUBFamilyMapper<GfxFamily>::csTraits[engineType];
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initEngineMMIO() {
auto mmioList = AUBFamilyMapper<GfxFamily>::perEngineMMIO[osContext->getEngineType()];
DEBUG_BREAK_IF(!mmioList);
for (auto &mmioPair : *mmioList) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::submitLRCA(const MiContextDescriptorReg &contextDescriptor) {
auto mmioBase = getCsTraits(osContext->getEngineType()).mmioBase;
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), 0);
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), 0);
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), contextDescriptor.ulData[1]);
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), contextDescriptor.ulData[0]);
}
} // namespace NEO

View File

@ -5,7 +5,7 @@
*
*/
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw.inl"
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw_bdw_plus.inl"
namespace NEO {
typedef CNLFamily Family;

View File

@ -5,7 +5,7 @@
*
*/
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw.inl"
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw_bdw_plus.inl"
namespace NEO {
typedef ICLFamily Family;

View File

@ -5,7 +5,7 @@
*
*/
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw.inl"
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw_bdw_plus.inl"
namespace NEO {
typedef BDWFamily Family;

View File

@ -5,7 +5,7 @@
*
*/
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw.inl"
#include "runtime/command_stream/command_stream_receiver_simulated_common_hw_bdw_plus.inl"
namespace NEO {
typedef SKLFamily Family;