Skip to content

Commit

Permalink
[Decode] Fix memory issues for stage code
Browse files Browse the repository at this point in the history
remove the resource free in interface caused some know issue
  • Loading branch information
pengxin99 authored and intel-mediadev committed Dec 1, 2023
1 parent 474256a commit 72e0613
Showing 1 changed file with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,16 @@ MOS_STATUS CodechalKernelOlpMdf::Execute(PMOS_SURFACE src, uint16_t *srcMemory_o
CODECHAL_DECODE_CHK_STATUS_RETURN(m_cmDevice->CreateThreadGroupSpace(1, 1, threadWidth, threadHeight, m_threadGroupSpaces[0]));
CODECHAL_DECODE_CHK_STATUS_RETURN(m_cmKernels[0]->AssociateThreadGroupSpace(m_threadGroupSpaces[0]));
CODECHAL_DECODE_CHK_STATUS_RETURN(m_cmTask->AddKernel(m_cmKernels[0]));

auto delete_event = [&]()
{
MOS_Delete(event);
};

if (!m_SingleTaskPhase)
{
auto sts = m_cmQueue->EnqueueWithGroup(m_cmTask, event);
MOS_STATUS stmtStatus = (MOS_STATUS)(sts);
if (stmtStatus != MOS_STATUS_SUCCESS)
{
event = CM_NO_EVENT;
return stmtStatus;
}
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_cmTask->Reset());
CODECHAL_ENCODE_CHK_STATUS_WITH_DESTROY_RETURN(m_cmQueue->EnqueueWithGroup(m_cmTask, event), delete_event);
CODECHAL_ENCODE_CHK_STATUS_WITH_DESTROY_RETURN(m_cmTask->Reset(), delete_event);
}

threadWidth = MOS_ALIGN_CEIL(src->dwWidth, 16) / 16;
Expand All @@ -180,14 +180,9 @@ MOS_STATUS CodechalKernelOlpMdf::Execute(PMOS_SURFACE src, uint16_t *srcMemory_o
CODECHAL_DECODE_CHK_STATUS_RETURN(m_cmDevice->CreateThreadGroupSpace(1, 1, threadWidth, threadHeight, m_threadGroupSpaces[1]));
CODECHAL_DECODE_CHK_STATUS_RETURN(m_cmKernels[1]->AssociateThreadGroupSpace(m_threadGroupSpaces[1]));
CODECHAL_DECODE_CHK_STATUS_RETURN(m_cmTask->AddKernel(m_cmKernels[1]));
auto sts = m_cmQueue->EnqueueWithGroup(m_cmTask, event);
MOS_STATUS stmtStatus = (MOS_STATUS)(sts);
if (stmtStatus != MOS_STATUS_SUCCESS)
{
event = CM_NO_EVENT;
return stmtStatus;
}
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_cmTask->Reset());
CODECHAL_ENCODE_CHK_STATUS_WITH_DESTROY_RETURN(m_cmQueue->EnqueueWithGroup(m_cmTask, event), delete_event);
CODECHAL_ENCODE_CHK_STATUS_WITH_DESTROY_RETURN(m_cmTask->Reset(), delete_event);


return MOS_STATUS_SUCCESS;
}
Expand Down

0 comments on commit 72e0613

Please sign in to comment.