Skip to content

Commit

Permalink
[VP] Fix RenderHal Using Wrong State Heap
Browse files Browse the repository at this point in the history
renderhal is always using the root state heap even after reallocation
  • Loading branch information
peiyigu-intel authored and intel-mediadev committed Nov 27, 2023
1 parent f591dc4 commit 929db10
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions media_common/agnostic/common/hw/mhw_state_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,8 @@ class XMHW_STATE_HEAP_INTERFACE

uint32_t GetSizeofSamplerStateAvs() { return m_HwSizes.dwSizeSamplerStateAvs;};

int8_t GetDynamicMode() { return m_bDynamicMode; }

//!
//! \brief Initializes the MI StateHeap interface
//! \details Internal MHW function to initialize all function pointers and some parameters
Expand Down
18 changes: 16 additions & 2 deletions media_softlet/agnostic/common/renderhal/renderhal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1449,8 +1449,15 @@ MOS_STATUS RenderHal_AllocateStateHeaps(
{
break;
}

pDshHeap = pRenderHal->pMhwStateHeap->GetDSHPointer();

pDshHeap = pRenderHal->pMhwStateHeap->GetDSHPointer();
if (pRenderHal->pMhwStateHeap->GetDynamicMode() == MHW_RENDER_HAL_MODE)
{
while (pDshHeap->pNext != nullptr)
{
pDshHeap = pDshHeap->pNext;
}
}
if (pRenderHal->pMhwStateHeap->LockStateHeap(pDshHeap) != MOS_STATUS_SUCCESS)
{
break;
Expand All @@ -1461,6 +1468,13 @@ MOS_STATUS RenderHal_AllocateStateHeaps(
pStateHeap->bGshLocked = true;

pIshHeap = pRenderHal->pMhwStateHeap->GetISHPointer();
if (pRenderHal->pMhwStateHeap->GetDynamicMode() == MHW_RENDER_HAL_MODE)
{
while (pIshHeap->pNext != nullptr)
{
pIshHeap = pIshHeap->pNext;
}
}
if (pRenderHal->pMhwStateHeap->LockStateHeap(pIshHeap) != MOS_STATUS_SUCCESS)
{
break;
Expand Down

0 comments on commit 929db10

Please sign in to comment.