diff --git a/runtime/command_stream/CMakeLists.txt b/runtime/command_stream/CMakeLists.txt index 626d5e5ef6..3a7ce1698a 100644 --- a/runtime/command_stream/CMakeLists.txt +++ b/runtime/command_stream/CMakeLists.txt @@ -22,6 +22,8 @@ set(RUNTIME_SRCS_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/create_command_stream_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/create_command_stream_impl.h ${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}/device_command_stream.h ${CMAKE_CURRENT_SOURCE_DIR}/experimental_command_buffer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/experimental_command_buffer.h diff --git a/runtime/command_stream/aub_command_stream_receiver_hw.h b/runtime/command_stream/aub_command_stream_receiver_hw.h index 99ba05035e..70fb787479 100644 --- a/runtime/command_stream/aub_command_stream_receiver_hw.h +++ b/runtime/command_stream/aub_command_stream_receiver_hw.h @@ -101,7 +101,6 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw::initializeEngine(EngineType engineTy engineInfo.pGlobalHWStatusPage = alignedMalloc(sizeHWSP, alignHWSP); engineInfo.ggttHWSP = gttRemap.map(engineInfo.pGlobalHWStatusPage, sizeHWSP); - auto physHWSP = ggtt->map(engineInfo.ggttHWSP, sizeHWSP, getGTTBits(), getMemoryBankForGtt()); + auto physHWSP = ggtt->map(engineInfo.ggttHWSP, sizeHWSP, this->getGTTBits(), getMemoryBankForGtt()); // Write our GHWSP { @@ -185,7 +185,7 @@ void AUBCommandStreamReceiverHw::initializeEngine(EngineType engineTy const size_t alignRingBuffer = 0x1000; engineInfo.pRingBuffer = alignedMalloc(engineInfo.sizeRingBuffer, alignRingBuffer); engineInfo.ggttRingBuffer = gttRemap.map(engineInfo.pRingBuffer, engineInfo.sizeRingBuffer); - auto physRingBuffer = ggtt->map(engineInfo.ggttRingBuffer, engineInfo.sizeRingBuffer, getGTTBits(), getMemoryBankForGtt()); + auto physRingBuffer = ggtt->map(engineInfo.ggttRingBuffer, engineInfo.sizeRingBuffer, this->getGTTBits(), getMemoryBankForGtt()); { std::ostringstream str; @@ -213,7 +213,7 @@ void AUBCommandStreamReceiverHw::initializeEngine(EngineType engineTy // Write our LRCA { engineInfo.ggttLRCA = gttRemap.map(engineInfo.pLRCA, sizeLRCA); - auto lrcAddressPhys = ggtt->map(engineInfo.ggttLRCA, sizeLRCA, getGTTBits(), getMemoryBankForGtt()); + auto lrcAddressPhys = ggtt->map(engineInfo.ggttLRCA, sizeLRCA, this->getGTTBits(), getMemoryBankForGtt()); { std::ostringstream str; @@ -365,7 +365,7 @@ FlushStamp AUBCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer memset(pTail, 0, sizeToWrap); // write remaining ring - auto physDumpStart = ggtt->map(ggttTail, sizeToWrap, getGTTBits(), getMemoryBankForGtt()); + auto physDumpStart = ggtt->map(ggttTail, sizeToWrap, this->getGTTBits(), getMemoryBankForGtt()); AUB::addMemoryWrite( *stream, physDumpStart, @@ -415,7 +415,7 @@ FlushStamp AUBCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer stream->addComment(str.str().c_str()); } - auto physDumpStart = ggtt->map(ggttDumpStart, dumpLength, getGTTBits(), getMemoryBankForGtt()); + auto physDumpStart = ggtt->map(ggttDumpStart, dumpLength, this->getGTTBits(), getMemoryBankForGtt()); AUB::addMemoryWrite( *stream, physDumpStart, @@ -431,7 +431,7 @@ FlushStamp AUBCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer stream->addComment(str.str().c_str()); } - auto physLRCA = ggtt->map(engineInfo.ggttLRCA, sizeof(engineInfo.tailRingBuffer), getGTTBits(), getMemoryBankForGtt()); + auto physLRCA = ggtt->map(engineInfo.ggttLRCA, sizeof(engineInfo.tailRingBuffer), this->getGTTBits(), getMemoryBankForGtt()); AUB::addMemoryWrite( *stream, physLRCA + 0x101c, @@ -764,11 +764,6 @@ int AUBCommandStreamReceiverHw::getAddressSpaceFromPTEBits(uint64_t e return AubMemDump::AddressSpaceValues::TraceNonlocal; } -template -uint64_t AUBCommandStreamReceiverHw::getGTTBits() const { - return 0; -} - template uint32_t AUBCommandStreamReceiverHw::getMemoryBankForGtt() const { return MemoryBanks::getBank(this->deviceIndex); diff --git a/runtime/command_stream/command_stream_receiver_simulated_common_hw.h b/runtime/command_stream/command_stream_receiver_simulated_common_hw.h new file mode 100644 index 0000000000..d1056c127a --- /dev/null +++ b/runtime/command_stream/command_stream_receiver_simulated_common_hw.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include "runtime/command_stream/command_stream_receiver_hw.h" +#include "runtime/memory_manager/memory_banks.h" + +namespace OCLRT { +class GraphicsAllocation; +template +class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw { + using CommandStreamReceiverHw::CommandStreamReceiverHw; + + public: + uint64_t getGTTBits() const { + return 0u; + } +}; +} // namespace OCLRT diff --git a/runtime/command_stream/definitions/command_stream_receiver_simulated_hw.h b/runtime/command_stream/definitions/command_stream_receiver_simulated_hw.h index 374632d7d1..c6297aa843 100644 --- a/runtime/command_stream/definitions/command_stream_receiver_simulated_hw.h +++ b/runtime/command_stream/definitions/command_stream_receiver_simulated_hw.h @@ -6,14 +6,14 @@ */ #pragma once -#include "runtime/command_stream/command_stream_receiver_hw.h" +#include "runtime/command_stream/command_stream_receiver_simulated_common_hw.h" #include "runtime/memory_manager/memory_banks.h" namespace OCLRT { class GraphicsAllocation; template -class CommandStreamReceiverSimulatedHw : public CommandStreamReceiverHw { - using CommandStreamReceiverHw::CommandStreamReceiverHw; +class CommandStreamReceiverSimulatedHw : public CommandStreamReceiverSimulatedCommonHw { + using CommandStreamReceiverSimulatedCommonHw::CommandStreamReceiverSimulatedCommonHw; public: uint32_t getMemoryBank(GraphicsAllocation *allocation) const { diff --git a/runtime/command_stream/tbx_command_stream_receiver_hw.h b/runtime/command_stream/tbx_command_stream_receiver_hw.h index 5d2f445475..55a67ebea4 100644 --- a/runtime/command_stream/tbx_command_stream_receiver_hw.h +++ b/runtime/command_stream/tbx_command_stream_receiver_hw.h @@ -73,7 +73,6 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw::initializeEngine(EngineType engineTy const size_t alignHWSP = 0x1000; engineInfo.pGlobalHWStatusPage = alignedMalloc(sizeHWSP, alignHWSP); engineInfo.ggttHWSP = gttRemap.map(engineInfo.pGlobalHWStatusPage, sizeHWSP); - auto physHWSP = ggtt->map(engineInfo.ggttHWSP, sizeHWSP, getGTTBits(), getMemoryBankForGtt()); + auto physHWSP = ggtt->map(engineInfo.ggttHWSP, sizeHWSP, this->getGTTBits(), getMemoryBankForGtt()); // Write our GHWSP AubGTTData data = {0}; @@ -129,7 +129,7 @@ void TbxCommandStreamReceiverHw::initializeEngine(EngineType engineTy const size_t alignRCS = 0x1000; engineInfo.pRCS = alignedMalloc(engineInfo.sizeRCS, alignRCS); engineInfo.ggttRCS = gttRemap.map(engineInfo.pRCS, engineInfo.sizeRCS); - auto physRCS = ggtt->map(engineInfo.ggttRCS, engineInfo.sizeRCS, getGTTBits(), getMemoryBankForGtt()); + auto physRCS = ggtt->map(engineInfo.ggttRCS, engineInfo.sizeRCS, this->getGTTBits(), getMemoryBankForGtt()); AubGTTData data = {0}; getGTTData(reinterpret_cast(physRCS), data); @@ -151,7 +151,7 @@ void TbxCommandStreamReceiverHw::initializeEngine(EngineType engineTy // Write our LRCA { engineInfo.ggttLRCA = gttRemap.map(engineInfo.pLRCA, sizeLRCA); - auto lrcAddressPhys = ggtt->map(engineInfo.ggttLRCA, sizeLRCA, getGTTBits(), getMemoryBankForGtt()); + auto lrcAddressPhys = ggtt->map(engineInfo.ggttLRCA, sizeLRCA, this->getGTTBits(), getMemoryBankForGtt()); AubGTTData data = {0}; getGTTData(reinterpret_cast(lrcAddressPhys), data); @@ -241,7 +241,7 @@ FlushStamp TbxCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer auto sizeToWrap = engineInfo.sizeRCS - engineInfo.tailRCS; memset(pTail, 0, sizeToWrap); // write remaining ring - auto physDumpStart = ggtt->map(ggttTail, sizeToWrap, getGTTBits(), getMemoryBankForGtt()); + auto physDumpStart = ggtt->map(ggttTail, sizeToWrap, this->getGTTBits(), getMemoryBankForGtt()); AUB::addMemoryWrite( stream, physDumpStart, @@ -281,7 +281,7 @@ FlushStamp TbxCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer auto dumpLength = engineInfo.tailRCS - previousTail; // write RCS - auto physDumpStart = ggtt->map(ggttDumpStart, dumpLength, getGTTBits(), getMemoryBankForGtt()); + auto physDumpStart = ggtt->map(ggttDumpStart, dumpLength, this->getGTTBits(), getMemoryBankForGtt()); AUB::addMemoryWrite( stream, physDumpStart, @@ -291,7 +291,7 @@ FlushStamp TbxCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer AubMemDump::DataTypeHintValues::TraceCommandBuffer); // update the RCS mmio tail in the LRCA - auto physLRCA = ggtt->map(engineInfo.ggttLRCA, sizeof(engineInfo.tailRCS), getGTTBits(), getMemoryBankForGtt()); + auto physLRCA = ggtt->map(engineInfo.ggttLRCA, sizeof(engineInfo.tailRCS), this->getGTTBits(), getMemoryBankForGtt()); AUB::addMemoryWrite( stream, physLRCA + 0x101c, @@ -419,11 +419,6 @@ int TbxCommandStreamReceiverHw::getAddressSpace(int hint) { return AubMemDump::AddressSpaceValues::TraceNonlocal; } -template -uint64_t TbxCommandStreamReceiverHw::getGTTBits() const { - return 0; -} - template uint32_t TbxCommandStreamReceiverHw::getMemoryBankForGtt() const { return MemoryBanks::getBank(this->deviceIndex);