diff --git a/media_common/agnostic/common/hw/mhw_state_heap.h b/media_common/agnostic/common/hw/mhw_state_heap.h index fc68d288294..8405033e5cd 100644 --- a/media_common/agnostic/common/hw/mhw_state_heap.h +++ b/media_common/agnostic/common/hw/mhw_state_heap.h @@ -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 diff --git a/media_softlet/agnostic/common/renderhal/renderhal.cpp b/media_softlet/agnostic/common/renderhal/renderhal.cpp index ce6013aff0a..1168331a582 100644 --- a/media_softlet/agnostic/common/renderhal/renderhal.cpp +++ b/media_softlet/agnostic/common/renderhal/renderhal.cpp @@ -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; @@ -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;