From 7ddf1d554b827ed05284881c5c1041a9fd192f1c Mon Sep 17 00:00:00 2001 From: "Hoppe, Mateusz" Date: Thu, 27 Sep 2018 09:56:02 -0700 Subject: [PATCH] Move getAddressSpace from AUB & TBX CSRs to CSRSimulatedHw Change-Id: Iaa6164445f55efba3681fc41e2ec614f999e1362 --- .../aub_command_stream_receiver_hw.h | 1 - .../aub_command_stream_receiver_hw.inl | 17 ++++++----------- .../command_stream_receiver_simulated_hw.h | 3 +++ .../tbx_command_stream_receiver_hw.h | 3 +-- .../tbx_command_stream_receiver_hw.inl | 15 +++++---------- unit_tests/command_stream/CMakeLists.txt | 1 + 6 files changed, 16 insertions(+), 24 deletions(-) diff --git a/runtime/command_stream/aub_command_stream_receiver_hw.h b/runtime/command_stream/aub_command_stream_receiver_hw.h index b0ce1e2171..ace4c669a2 100644 --- a/runtime/command_stream/aub_command_stream_receiver_hw.h +++ b/runtime/command_stream/aub_command_stream_receiver_hw.h @@ -111,7 +111,6 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw::initializeEngine(EngineType engineTy lrcAddressPhys, pLRCABase, sizeLRCA, - getAddressSpace(csTraits.aubHintLRCA), + this->getAddressSpace(csTraits.aubHintLRCA), csTraits.aubHintLRCA); } @@ -335,7 +335,7 @@ FlushStamp AUBCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer physBatchBuffer, pBatchBuffer, sizeBatchBuffer, - getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary), + this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary), AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary); } @@ -384,7 +384,7 @@ FlushStamp AUBCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer physDumpStart, pTail, sizeToWrap, - getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer), + this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer), AubMemDump::DataTypeHintValues::TraceCommandBuffer); previousTail = 0; engineInfo.tailRingBuffer = 0; @@ -434,7 +434,7 @@ FlushStamp AUBCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer physDumpStart, dumpStart, dumpLength, - getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer), + this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer), AubMemDump::DataTypeHintValues::TraceCommandBuffer); // update the ring mmio tail in the LRCA @@ -450,7 +450,7 @@ FlushStamp AUBCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer physLRCA + 0x101c, &engineInfo.tailRingBuffer, sizeof(engineInfo.tailRingBuffer), - getAddressSpace(getCsTraits(engineType).aubHintLRCA)); + this->getAddressSpace(getCsTraits(engineType).aubHintLRCA)); DEBUG_BREAK_IF(engineInfo.tailRingBuffer >= engineInfo.sizeRingBuffer); } @@ -744,7 +744,7 @@ void AUBCommandStreamReceiverHw::addGUCStartMessage(uint64_t batchBuf physBufferAddres, buffer.get(), bufferSize, - getAddressSpace(AubMemDump::DataTypeHintValues::TraceNotype)); + this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceNotype)); PatchInfoData patchInfoData(batchBufferAddress, 0u, PatchInfoAllocationType::Default, reinterpret_cast(buffer.get()), sizeof(uint32_t) + sizeof(MI_BATCH_BUFFER_START) - sizeof(uint64_t), PatchInfoAllocationType::GUCStartMessage); this->flatBatchBufferHelper->setPatchInfoData(patchInfoData); @@ -767,11 +767,6 @@ void AUBCommandStreamReceiverHw::getGTTData(void *memory, AubGTTData data.localMemory = false; } -template -int AUBCommandStreamReceiverHw::getAddressSpace(int hint) { - return AubMemDump::AddressSpaceValues::TraceNonlocal; -} - template int AUBCommandStreamReceiverHw::getAddressSpaceFromPTEBits(uint64_t entryBits) const { return AubMemDump::AddressSpaceValues::TraceNonlocal; 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 c6297aa843..6baf196ce2 100644 --- a/runtime/command_stream/definitions/command_stream_receiver_simulated_hw.h +++ b/runtime/command_stream/definitions/command_stream_receiver_simulated_hw.h @@ -19,5 +19,8 @@ class CommandStreamReceiverSimulatedHw : public CommandStreamReceiverSimulatedCo uint32_t getMemoryBank(GraphicsAllocation *allocation) const { return MemoryBanks::getBank(this->deviceIndex); } + int getAddressSpace(int hint) { + return AubMemDump::AddressSpaceValues::TraceNonlocal; + } }; } // namespace OCLRT diff --git a/runtime/command_stream/tbx_command_stream_receiver_hw.h b/runtime/command_stream/tbx_command_stream_receiver_hw.h index 55a67ebea4..c27051a94d 100644 --- a/runtime/command_stream/tbx_command_stream_receiver_hw.h +++ b/runtime/command_stream/tbx_command_stream_receiver_hw.h @@ -25,10 +25,10 @@ class TbxMemoryManager : public OsAgnosticMemoryManager { template class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw { - using CommandStreamReceiverHw::memoryManager; typedef CommandStreamReceiverSimulatedHw BaseClass; typedef typename OCLRT::AUBFamilyMapper::AUB AUB; typedef typename AUB::MiContextDescriptorReg MiContextDescriptorReg; + using CommandStreamReceiverHw::memoryManager; public: FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override; @@ -90,7 +90,6 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw::initializeEngine(EngineType engineTy lrcAddressPhys, pLRCABase, sizeLRCA, - getAddressSpace(csTraits.aubHintLRCA), + this->getAddressSpace(csTraits.aubHintLRCA), csTraits.aubHintLRCA); } } @@ -215,7 +215,7 @@ FlushStamp TbxCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer physBatchBuffer, pBatchBuffer, sizeBatchBuffer, - getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary), + this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary), AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary); } @@ -247,7 +247,7 @@ FlushStamp TbxCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer physDumpStart, pTail, sizeToWrap, - getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer), + this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer), AubMemDump::DataTypeHintValues::TraceCommandBuffer); previousTail = 0; engineInfo.tailRCS = 0; @@ -287,7 +287,7 @@ FlushStamp TbxCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer physDumpStart, dumpStart, dumpLength, - getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer), + this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer), AubMemDump::DataTypeHintValues::TraceCommandBuffer); // update the RCS mmio tail in the LRCA @@ -297,7 +297,7 @@ FlushStamp TbxCommandStreamReceiverHw::flush(BatchBuffer &batchBuffer physLRCA + 0x101c, &engineInfo.tailRCS, sizeof(engineInfo.tailRCS), - getAddressSpace(AubMemDump::DataTypeHintValues::TraceNotype)); + this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceNotype)); DEBUG_BREAK_IF(engineInfo.tailRCS >= engineInfo.sizeRCS); } @@ -414,11 +414,6 @@ void TbxCommandStreamReceiverHw::getGTTData(void *memory, AubGTTData data.localMemory = false; } -template -int TbxCommandStreamReceiverHw::getAddressSpace(int hint) { - return AubMemDump::AddressSpaceValues::TraceNonlocal; -} - template uint32_t TbxCommandStreamReceiverHw::getMemoryBankForGtt() const { return MemoryBanks::getBank(this->deviceIndex); diff --git a/unit_tests/command_stream/CMakeLists.txt b/unit_tests/command_stream/CMakeLists.txt index ea4107e2e4..e641b79143 100644 --- a/unit_tests/command_stream/CMakeLists.txt +++ b/unit_tests/command_stream/CMakeLists.txt @@ -28,3 +28,4 @@ set(IGDRCL_SRCS_tests_command_stream ${CMAKE_CURRENT_SOURCE_DIR}/tbx_command_stream_tests.cpp ) target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_command_stream}) +add_subdirectories()