Refactor Pipe Control setup before VFE command

Change-Id: Iaed34cb9cf0e5a628c54950d97df7d8c4b5bf69b
This commit is contained in:
Dunajski, Bartosz
2018-02-23 14:01:12 +01:00
committed by sys_ocldev
parent 103b560655
commit 3c4bc00eae
5 changed files with 17 additions and 16 deletions

View File

@@ -46,7 +46,7 @@ struct PreambleHelper {
static uint32_t getDefaultThreadArbitrationPolicy();
static void programThreadArbitration(LinearStream *pCommandStream, uint32_t requiredThreadArbitrationPolicy);
static void programPreemption(LinearStream *pCommandStream, const Device &device, GraphicsAllocation *preemptionCsr);
static void setupPipeControlInFrontOfCommand(void *pCmd, const HardwareInfo *hwInfo, bool isVfeCommand);
static void addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo);
static void programVFEState(LinearStream *pCommandStream, const HardwareInfo &hwInfo, int scratchSize, uint64_t scratchAddress);
static void programPreamble(LinearStream *pCommandStream, const Device &device, uint32_t l3Config,
uint32_t requiredThreadArbitrationPolicy, GraphicsAllocation *preemptionCsr);

View File

@@ -54,11 +54,7 @@ template <typename GfxFamily>
void PreambleHelper<GfxFamily>::programVFEState(LinearStream *pCommandStream, const HardwareInfo &hwInfo, int scratchSize, uint64_t scratchAddress) {
typedef typename GfxFamily::MEDIA_VFE_STATE MEDIA_VFE_STATE;
// Add a PIPE_CONTROL w/ CS_stall
auto pPipeControl = (PIPE_CONTROL *)pCommandStream->getSpace(sizeof(PIPE_CONTROL));
*pPipeControl = PIPE_CONTROL::sInit();
pPipeControl->setCommandStreamerStallEnable(true);
setupPipeControlInFrontOfCommand(pPipeControl, &hwInfo, true);
addPipeControlBeforeVfeCmd(pCommandStream, &hwInfo);
auto pMediaVfeState = (MEDIA_VFE_STATE *)pCommandStream->getSpace(sizeof(MEDIA_VFE_STATE));
*pMediaVfeState = MEDIA_VFE_STATE::sInit();