Refactor mmio programming.

Change-Id: I2ec9294b800adcd537f03d69fd4ba4e015e8db7a
This commit is contained in:
Mrozek, Michal
2018-11-26 11:20:50 +01:00
committed by sys_ocldev
parent 91c4a952a7
commit 38fb8cd9c3
10 changed files with 74 additions and 68 deletions

View File

@@ -226,7 +226,7 @@ void AUBCommandStreamReceiverHw<GfxFamily>::initializeEngine(size_t engineIndex)
AubGTTData data = {0};
getGTTData(reinterpret_cast<void *>(physHWSP), data);
AUB::reserveAddressGGTT(*stream, engineInfo.ggttHWSP, sizeHWSP, physHWSP, data);
stream->writeMMIO(csTraits.mmioBase + 0x2080, engineInfo.ggttHWSP);
stream->writeMMIO(AubMemDump::computeRegisterOffset(csTraits.mmioBase, 0x2080), engineInfo.ggttHWSP);
}
// Allocate the LRCA
@@ -505,7 +505,7 @@ void AUBCommandStreamReceiverHw<GfxFamily>::submitBatchBuffer(size_t engineIndex
} else if (engineInfo.tailRingBuffer == 0) {
// Add a LRI if this is our first submission
auto lri = MI_LOAD_REGISTER_IMM::sInit();
lri.setRegisterOffset(csTraits.mmioBase + 0x2244);
lri.setRegisterOffset(AubMemDump::computeRegisterOffset(csTraits.mmioBase, 0x2244));
lri.setDataDword(0x00010000);
*(MI_LOAD_REGISTER_IMM *)pTail = lri;
pTail = ((MI_LOAD_REGISTER_IMM *)pTail) + 1;
@@ -591,10 +591,10 @@ void AUBCommandStreamReceiverHw<GfxFamily>::submitBatchBuffer(size_t engineIndex
template <typename GfxFamily>
void AUBCommandStreamReceiverHw<GfxFamily>::submitLRCA(EngineInstanceT engineInstance, const typename AUBCommandStreamReceiverHw<GfxFamily>::MiContextDescriptorReg &contextDescriptor) {
auto mmioBase = getCsTraits(engineInstance).mmioBase;
stream->writeMMIO(mmioBase + 0x2230, 0);
stream->writeMMIO(mmioBase + 0x2230, 0);
stream->writeMMIO(mmioBase + 0x2230, contextDescriptor.ulData[1]);
stream->writeMMIO(mmioBase + 0x2230, contextDescriptor.ulData[0]);
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>
@@ -609,7 +609,7 @@ void AUBCommandStreamReceiverHw<GfxFamily>::pollForCompletion(EngineInstanceT en
auto mmioBase = getCsTraits(engineInstance).mmioBase;
bool pollNotEqual = false;
stream->registerPoll(
mmioBase + 0x2234, //EXECLIST_STATUS
AubMemDump::computeRegisterOffset(mmioBase, 0x2234), //EXECLIST_STATUS
0x100,
0x100,
pollNotEqual,

View File

@@ -106,7 +106,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::initializeEngine(EngineType engineTy
AubGTTData data = {0};
getGTTData(reinterpret_cast<void *>(physHWSP), data);
AUB::reserveAddressGGTT(tbxStream, engineInfo.ggttHWSP, sizeHWSP, physHWSP, data);
tbxStream.writeMMIO(mmioBase + 0x2080, engineInfo.ggttHWSP);
tbxStream.writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2080), engineInfo.ggttHWSP);
}
// Allocate the LRCA
@@ -252,7 +252,7 @@ FlushStamp TbxCommandStreamReceiverHw<GfxFamily>::flush(BatchBuffer &batchBuffer
} else if (engineInfo.tailRCS == 0) {
// Add a LRI if this is our first submission
auto lri = MI_LOAD_REGISTER_IMM::sInit();
lri.setRegisterOffset(mmioBase + 0x2244);
lri.setRegisterOffset(AubMemDump::computeRegisterOffset(mmioBase, 0x2244));
lri.setDataDword(0x00010000);
*(MI_LOAD_REGISTER_IMM *)pTail = lri;
pTail = ((MI_LOAD_REGISTER_IMM *)pTail) + 1;
@@ -325,10 +325,10 @@ FlushStamp TbxCommandStreamReceiverHw<GfxFamily>::flush(BatchBuffer &batchBuffer
template <typename GfxFamily>
void TbxCommandStreamReceiverHw<GfxFamily>::submitLRCA(EngineType engineType, const MiContextDescriptorReg &contextDescriptor) {
auto mmioBase = getCsTraits(engineType).mmioBase;
tbxStream.writeMMIO(mmioBase + 0x2230, 0);
tbxStream.writeMMIO(mmioBase + 0x2230, 0);
tbxStream.writeMMIO(mmioBase + 0x2230, contextDescriptor.ulData[1]);
tbxStream.writeMMIO(mmioBase + 0x2230, contextDescriptor.ulData[0]);
tbxStream.writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), 0);
tbxStream.writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), 0);
tbxStream.writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), contextDescriptor.ulData[1]);
tbxStream.writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), contextDescriptor.ulData[0]);
}
template <typename GfxFamily>
@@ -338,7 +338,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::pollForCompletion(EngineType engineT
auto mmioBase = getCsTraits(engineType).mmioBase;
bool pollNotEqual = false;
tbxStream.registerPoll(
mmioBase + 0x2234, //EXECLIST_STATUS
AubMemDump::computeRegisterOffset(mmioBase, 0x2234), //EXECLIST_STATUS
0x100,
0x100,
pollNotEqual,