Skip to content

Commit

Permalink
[VP] fix pipecontrol issue
Browse files Browse the repository at this point in the history
fix pipecontrol issue.
  • Loading branch information
Alex1Zhang authored and intel-mediadev committed Aug 30, 2023
1 parent 5444c83 commit 1c13afa
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions media_common/agnostic/common/hw/mhw_mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ typedef struct _MHW_PIPE_CONTROL_PARAMS
uint32_t bInvalidateTextureCache : 1;
uint32_t bGenericMediaStateClear : 1;
uint32_t bIndirectStatePointersDisable : 1;
uint32_t bUnTypedDataPortCacheFlush : 1;
uint32_t bHdcPipelineFlush : 1;
uint32_t bKernelFenceEnabled : 1;
uint32_t bPPCFlush : 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,8 @@ class Impl : public mi::Impl<Cmd>
cmd.DW1.StateCacheInvalidationEnable = params.bInvalidateStateCache;
cmd.DW1.ConstantCacheInvalidationEnable = params.bInvalidateConstantCache;
}

cmd.DW0.UnTypedDataPortCacheFlush = params.bUnTypedDataPortCacheFlush;
cmd.DW0.HdcPipelineFlush = params.bHdcPipelineFlush;
cmd.DW1.RenderTargetCacheFlushEnable = params.bFlushRenderTargetCache;
cmd.DW1.DcFlushEnable = params.bFlushRenderTargetCache; // same as above
cmd.DW1.VfCacheInvalidationEnable = params.bInvalidateVFECache;
Expand Down
1 change: 1 addition & 0 deletions media_softlet/agnostic/common/hw/mhw_mi_cmdpar.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ namespace mi
bool bInvalidateTextureCache = false;
bool bGenericMediaStateClear = false;
bool bIndirectStatePointersDisable = false;
bool bUnTypedDataPortCacheFlush = false;
bool bHdcPipelineFlush = false;
bool bKernelFenceEnabled = false;
bool bPPCFlush = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ MOS_STATUS XRenderHal_Platform_Interface_Next::AddMiPipeControl(
par.bInvalidateTextureCache = params->bInvalidateTextureCache;
par.bGenericMediaStateClear = params->bGenericMediaStateClear;
par.bIndirectStatePointersDisable = params->bIndirectStatePointersDisable;
par.bUnTypedDataPortCacheFlush = params->bUnTypedDataPortCacheFlush;
par.bHdcPipelineFlush = params->bHdcPipelineFlush;
par.bKernelFenceEnabled = params->bKernelFenceEnabled;
MHW_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(PIPE_CONTROL)(pCmdBuffer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ typedef struct _KERNEL_WALKER_PARAMS
RECT alignedRect;
bool isVerticalPattern;
bool bSyncFlag;
bool bFlushL1;
bool isGroupStartInvolvedInGroupSize; // true if group start need be involved in the group size.
bool calculateBlockXYByAlignedRect; // true if iBlocksX/iBlocksY is calculated by alignedRect in RenderCmdPacket instead of kernel object.
bool forcePreferredSLMZero; // true if preferredSLM need force to 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,7 @@ MOS_STATUS VpRenderCmdPacket::SendMediaStates(
MHW_MI_LOAD_REGISTER_IMM_PARAMS loadRegisterImmParams = {};
PMHW_MI_MMIOREGISTERS pMmioRegisters = nullptr;
MOS_OCA_BUFFER_HANDLE hOcaBuf = 0;

bool flushL1 = false;
//---------------------------------------
MHW_RENDERHAL_CHK_NULL(pRenderHal);
MHW_RENDERHAL_CHK_NULL(pRenderHal->pStateHeap);
Expand Down Expand Up @@ -1901,6 +1901,11 @@ MOS_STATUS VpRenderCmdPacket::SendMediaStates(
pipeCtlParams.dwFlushMode = MHW_FLUSH_CUSTOM;
pipeCtlParams.bInvalidateTextureCache = true;
pipeCtlParams.bFlushRenderTargetCache = true;
if (flushL1)
{ //Flush L1 cache after consumer walker when there is a producer-consumer relationship walker.
pipeCtlParams.bUnTypedDataPortCacheFlush = true;
pipeCtlParams.bHdcPipelineFlush = true;
}
MHW_RENDERHAL_CHK_STATUS(pRenderHal->pRenderHalPltInterface->AddMiPipeControl(pRenderHal,
pCmdBuffer,
&pipeCtlParams));
Expand Down Expand Up @@ -1941,7 +1946,8 @@ MOS_STATUS VpRenderCmdPacket::SendMediaStates(
pCmdBuffer,
&m_gpgpuWalkerParams));

PrintWalkerParas(m_mediaWalkerParams);
flushL1 = it->second.walkerParam.bFlushL1;
PrintWalkerParas(m_mediaWalkerParams);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void VpRenderKernelObj::OcaDumpKernelInfo(MOS_COMMAND_BUFFER &cmdBuffer, MOS_CON
}

// Only for Adv kernels.
MOS_STATUS VpRenderKernelObj::SetWalkerSetting(KERNEL_THREAD_SPACE& threadSpace, bool bSyncFlag)
MOS_STATUS VpRenderKernelObj::SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag, bool flushL1)
{
VP_FUNC_CALL();
VP_RENDER_CHK_STATUS_RETURN(MOS_STATUS_UNIMPLEMENTED);
Expand Down Expand Up @@ -139,7 +139,7 @@ MOS_STATUS VpRenderKernelObj::SetKernelConfigs(

VP_RENDER_CHK_STATUS_RETURN(SetSamplerStates(samplerStateGroup));

VP_RENDER_CHK_STATUS_RETURN(SetWalkerSetting(kernelParams.kernelThreadSpace, kernelParams.syncFlag));
VP_RENDER_CHK_STATUS_RETURN(SetWalkerSetting(kernelParams.kernelThreadSpace, kernelParams.syncFlag,kernelParams.flushL1));

return MOS_STATUS_SUCCESS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ typedef struct _KERNEL_PARAMS
KERNEL_ARGS kernelArgs;
KERNEL_THREAD_SPACE kernelThreadSpace;
bool syncFlag;
bool flushL1;
} KERNEL_PARAMS;

struct MEDIA_OBJECT_KA2_INLINE_DATA
Expand Down Expand Up @@ -502,7 +503,7 @@ class VpRenderKernelObj

protected:

virtual MOS_STATUS SetWalkerSetting(KERNEL_THREAD_SPACE& threadSpace, bool bSyncFlag);
virtual MOS_STATUS SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag, bool flushL1 = false);

virtual MOS_STATUS SetKernelArgs(KERNEL_ARGS &kernelArgs, VP_PACKET_SHARED_CONTEXT *sharedContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ MOS_STATUS VpRenderHdr3DLutKernelCM::GetWalkerSetting(KERNEL_WALKER_PARAMS &walk
}

// Only for Adv kernels.
MOS_STATUS VpRenderHdr3DLutKernelCM::SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag)
MOS_STATUS VpRenderHdr3DLutKernelCM::SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag, bool flushL1)
{
VP_FUNC_CALL();
MOS_ZeroMemory(&m_walkerParam, sizeof(KERNEL_WALKER_PARAMS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class VpRenderHdr3DLutKernelCM : public VpRenderHdr3DLutKernel
protected:
virtual MOS_STATUS SetupSurfaceState() override;
virtual MOS_STATUS CpPrepareResources() override;
virtual MOS_STATUS SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag) override;
virtual MOS_STATUS SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag, bool flushL1 = false) override;
virtual MOS_STATUS SetKernelArgs(KERNEL_ARGS &kernelArgs, VP_PACKET_SHARED_CONTEXT *sharedContext) override;
virtual MOS_STATUS SetKernelConfigs(KERNEL_CONFIGS &kernelConfigs) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ MOS_STATUS VpRenderHVSKernel::GetWalkerSetting(KERNEL_WALKER_PARAMS &walkerParam
}

// Only for Adv kernels.
MOS_STATUS VpRenderHVSKernel::SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag)
MOS_STATUS VpRenderHVSKernel::SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag, bool flushL1)
{
VP_FUNC_CALL();
MOS_ZeroMemory(&m_walkerParam, sizeof(KERNEL_WALKER_PARAMS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class VpRenderHVSKernel : public VpRenderKernelObj

protected:
virtual MOS_STATUS SetupSurfaceState() override;
virtual MOS_STATUS SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag) override;
virtual MOS_STATUS SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag, bool flushL1 = false) override;
virtual MOS_STATUS SetKernelArgs(KERNEL_ARGS &kernelArgs, VP_PACKET_SHARED_CONTEXT *sharedContext) override;
virtual MOS_STATUS SetKernelConfigs(KERNEL_CONFIGS &kernelConfigs) override;

Expand Down

0 comments on commit 1c13afa

Please sign in to comment.