Move getAddressSpace from AUB & TBX CSRs to CSRSimulatedHw

Change-Id: Iaa6164445f55efba3681fc41e2ec614f999e1362
This commit is contained in:
Hoppe, Mateusz
2018-09-27 09:56:02 -07:00
parent 7a3515e882
commit 7ddf1d554b
6 changed files with 16 additions and 24 deletions

View File

@ -111,7 +111,6 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
int getAddressSpaceFromPTEBits(uint64_t entryBits) const;
protected:
int getAddressSpace(int hint);
PhysicalAddressAllocator *createPhysicalAddressAllocator();
bool dumpAubNonWritable = false;

View File

@ -242,7 +242,7 @@ void AUBCommandStreamReceiverHw<GfxFamily>::initializeEngine(EngineType engineTy
lrcAddressPhys,
pLRCABase,
sizeLRCA,
getAddressSpace(csTraits.aubHintLRCA),
this->getAddressSpace(csTraits.aubHintLRCA),
csTraits.aubHintLRCA);
}
@ -335,7 +335,7 @@ FlushStamp AUBCommandStreamReceiverHw<GfxFamily>::flush(BatchBuffer &batchBuffer
physBatchBuffer,
pBatchBuffer,
sizeBatchBuffer,
getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary),
this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary),
AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary);
}
@ -384,7 +384,7 @@ FlushStamp AUBCommandStreamReceiverHw<GfxFamily>::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<GfxFamily>::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<GfxFamily>::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<GfxFamily>::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<uintptr_t>(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<GfxFamily>::getGTTData(void *memory, AubGTTData
data.localMemory = false;
}
template <typename GfxFamily>
int AUBCommandStreamReceiverHw<GfxFamily>::getAddressSpace(int hint) {
return AubMemDump::AddressSpaceValues::TraceNonlocal;
}
template <typename GfxFamily>
int AUBCommandStreamReceiverHw<GfxFamily>::getAddressSpaceFromPTEBits(uint64_t entryBits) const {
return AubMemDump::AddressSpaceValues::TraceNonlocal;

View File

@ -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

View File

@ -25,10 +25,10 @@ class TbxMemoryManager : public OsAgnosticMemoryManager {
template <typename GfxFamily>
class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFamily> {
using CommandStreamReceiverHw<GfxFamily>::memoryManager;
typedef CommandStreamReceiverSimulatedHw<GfxFamily> BaseClass;
typedef typename OCLRT::AUBFamilyMapper<GfxFamily>::AUB AUB;
typedef typename AUB::MiContextDescriptorReg MiContextDescriptorReg;
using CommandStreamReceiverHw<GfxFamily>::memoryManager;
public:
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override;
@ -90,7 +90,6 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
}
protected:
int getAddressSpace(int hint);
void createPhysicalAddressAllocator();
};
} // namespace OCLRT

View File

@ -161,7 +161,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::initializeEngine(EngineType engineTy
lrcAddressPhys,
pLRCABase,
sizeLRCA,
getAddressSpace(csTraits.aubHintLRCA),
this->getAddressSpace(csTraits.aubHintLRCA),
csTraits.aubHintLRCA);
}
}
@ -215,7 +215,7 @@ FlushStamp TbxCommandStreamReceiverHw<GfxFamily>::flush(BatchBuffer &batchBuffer
physBatchBuffer,
pBatchBuffer,
sizeBatchBuffer,
getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary),
this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary),
AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary);
}
@ -247,7 +247,7 @@ FlushStamp TbxCommandStreamReceiverHw<GfxFamily>::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<GfxFamily>::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<GfxFamily>::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<GfxFamily>::getGTTData(void *memory, AubGTTData
data.localMemory = false;
}
template <typename GfxFamily>
int TbxCommandStreamReceiverHw<GfxFamily>::getAddressSpace(int hint) {
return AubMemDump::AddressSpaceValues::TraceNonlocal;
}
template <typename GfxFamily>
uint32_t TbxCommandStreamReceiverHw<GfxFamily>::getMemoryBankForGtt() const {
return MemoryBanks::getBank(this->deviceIndex);

View File

@ -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()