Skip to content

Commit

Permalink
[Media Common] [VP] [MCPY] Disable preemption for render copy
Browse files Browse the repository at this point in the history
Disable render copy preemption.
  • Loading branch information
MicroYY authored and intel-mediadev committed Jul 31, 2024
1 parent 7300aa7 commit 68edce6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions media_common/agnostic/common/renderhal/renderhal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,10 @@ typedef struct _RENDERHAL_INTERFACE
MediaPerfProfiler *pPerfProfiler = nullptr; //!< Performance data profiler
bool eufusionBypass = false;
MediaUserSettingSharedPtr userSettingPtr = nullptr; //!< Shared pointer to User Setting instance

// if it's true, will disable preemption by setting NeedsMidBatchPreEmptionSupport flag in command buffer attribute as false;
// will also skip preemption control bits configure.
bool forceDisablePreemption = false;
//---------------------------
// HW interface functions
//---------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ MOS_STATUS RenderCopyState::Initialize()
RenderHalSettings.iMediaStates = 32;
MCPY_CHK_STATUS_RETURN(m_renderHal->pfnInitialize(m_renderHal, &RenderHalSettings));

m_renderHal->sseuTable = VpDefaultSSEUTable;
m_renderHal->sseuTable = VpDefaultSSEUTable;
m_renderHal->forceDisablePreemption = true;

return MOS_STATUS_SUCCESS;
}

Expand Down
10 changes: 8 additions & 2 deletions media_softlet/agnostic/common/renderhal/renderhal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5132,7 +5132,8 @@ MOS_STATUS RenderHal_InitCommandBuffer(
pCmdBuffer->Attributes.bMediaPreemptionEnabled =
(pRenderHal->bEnableGpgpuMidBatchPreEmption ||
pRenderHal->bEnableGpgpuMidThreadPreEmption ||
pRenderHal->pRenderHalPltInterface->IsPreemptionEnabled(pRenderHal));
pRenderHal->pRenderHalPltInterface->IsPreemptionEnabled(pRenderHal)) &&
!pRenderHal->forceDisablePreemption;

if (pGenericPrologParams)
{
Expand Down Expand Up @@ -5535,7 +5536,12 @@ MOS_STATUS RenderHal_SendMediaStates(
// Send L3 Cache Configuration
MHW_RENDERHAL_CHK_STATUS_RETURN(pRenderHal->pRenderHalPltInterface->SetL3Cache(pRenderHal, pCmdBuffer));

MHW_RENDERHAL_CHK_STATUS_RETURN(pRenderHal->pRenderHalPltInterface->EnablePreemption(pRenderHal, pCmdBuffer));
// if forceDisablePreemption is true, preemption will be disabled by NeedsMidBatchPreEmptionSupport in command buffer header.
// skip preemption control bit configure as it won't take effect.
if (!pRenderHal->forceDisablePreemption)
{
MHW_RENDERHAL_CHK_STATUS_RETURN(pRenderHal->pRenderHalPltInterface->EnablePreemption(pRenderHal, pCmdBuffer));
}

// Send Debug Control, LRI commands used here & hence must be launched from a secure bb
MHW_RENDERHAL_CHK_STATUS_RETURN(RenderHal_AddDebugControl(pRenderHal, pCmdBuffer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ MOS_STATUS RenderCopyStateNext::Initialize()
RenderHalSettings.iMediaStates = 32;
MCPY_CHK_STATUS_RETURN(m_renderHal->pfnInitialize(m_renderHal, &RenderHalSettings));

m_renderHal->sseuTable = defaultSSEUTable;
m_renderHal->sseuTable = defaultSSEUTable;
m_renderHal->forceDisablePreemption = true;

return MOS_STATUS_SUCCESS;
}

Expand Down

0 comments on commit 68edce6

Please sign in to comment.