diff --git a/media_driver/agnostic/gen12/codec/hal/codechal_decode_hevc_g12.cpp b/media_driver/agnostic/gen12/codec/hal/codechal_decode_hevc_g12.cpp index 01856c25404..72fffaa10e9 100644 --- a/media_driver/agnostic/gen12/codec/hal/codechal_decode_hevc_g12.cpp +++ b/media_driver/agnostic/gen12/codec/hal/codechal_decode_hevc_g12.cpp @@ -1467,7 +1467,7 @@ MOS_STATUS CodechalDecodeHevcG12::AddPictureLongFormatCmds( // Send VD_CONTROL_STATE Pipe Initialization MOS_ZeroMemory(&vdCtrlParam, sizeof(MHW_MI_VD_CONTROL_STATE_PARAMS)); vdCtrlParam.initialization = true; - static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam); + CODECHAL_DECODE_CHK_STATUS_RETURN(static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam)); CODECHAL_DECODE_CHK_STATUS_RETURN(m_hcpInterface->AddHcpPipeModeSelectCmd( cmdBufferInUse, @@ -1479,7 +1479,7 @@ MOS_STATUS CodechalDecodeHevcG12::AddPictureLongFormatCmds( // Send VD_CONTROL_STATE HcpPipeLock MOS_ZeroMemory(&vdCtrlParam, sizeof(MHW_MI_VD_CONTROL_STATE_PARAMS)); vdCtrlParam.scalableModePipeLock = true; - static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam); + CODECHAL_DECODE_CHK_STATUS_RETURN(static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam)); } #ifdef _DECODE_PROCESSING_SUPPORTED @@ -2089,7 +2089,7 @@ MOS_STATUS CodechalDecodeHevcG12::DecodePrimitiveLevel() // Send VD_CONTROL_STATE Memory Implict Flush MOS_ZeroMemory(&vdCtrlParam, sizeof(MHW_MI_VD_CONTROL_STATE_PARAMS)); vdCtrlParam.memoryImplicitFlush = true; - static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam); + CODECHAL_DECODE_CHK_STATUS_RETURN(static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam)); if (CodecHalDecodeScalabilityIsBEPhaseG12(m_scalabilityState) || m_isRealTile) diff --git a/media_driver/agnostic/gen12/codec/hal/codechal_decode_vp9_g12.cpp b/media_driver/agnostic/gen12/codec/hal/codechal_decode_vp9_g12.cpp index 1fa9fb5d6fd..8629385d867 100644 --- a/media_driver/agnostic/gen12/codec/hal/codechal_decode_vp9_g12.cpp +++ b/media_driver/agnostic/gen12/codec/hal/codechal_decode_vp9_g12.cpp @@ -546,7 +546,7 @@ MOS_STATUS CodechalDecodeVp9G12::AddPicStateMhwCmds( // Send VD_CONTROL_STATE Pipe Initialization MOS_ZeroMemory(&vdCtrlParam, sizeof(MHW_MI_VD_CONTROL_STATE_PARAMS)); vdCtrlParam.initialization = true; - static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBuffer, &vdCtrlParam); + CODECHAL_DECODE_CHK_STATUS_RETURN(static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBuffer, &vdCtrlParam)); CODECHAL_DECODE_CHK_STATUS_RETURN(m_hcpInterface->AddHcpPipeModeSelectCmd( cmdBuffer, @@ -558,7 +558,7 @@ MOS_STATUS CodechalDecodeVp9G12::AddPicStateMhwCmds( // Send VD_CONTROL_STATE HcpPipeLock MOS_ZeroMemory(&vdCtrlParam, sizeof(MHW_MI_VD_CONTROL_STATE_PARAMS)); vdCtrlParam.scalableModePipeLock = true; - static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBuffer, &vdCtrlParam); + CODECHAL_DECODE_CHK_STATUS_RETURN(static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBuffer, &vdCtrlParam)); } #ifdef _DECODE_PROCESSING_SUPPORTED if (!CodecHalDecodeScalabilityIsFEPhase(m_scalabilityState)) @@ -925,7 +925,7 @@ MOS_STATUS CodechalDecodeVp9G12 :: DecodePrimitiveLevel() // Send VD_CONTROL_STATE Memory Implict Flush MOS_ZeroMemory(&vdCtrlParam, sizeof(MHW_MI_VD_CONTROL_STATE_PARAMS)); vdCtrlParam.memoryImplicitFlush = true; - static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam); + CODECHAL_DECODE_CHK_STATUS_RETURN(static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam)); if (CodecHalDecodeScalabilityIsScalableMode(m_scalabilityState) && CodecHalDecodeScalabilityIsBEPhaseG12(m_scalabilityState)) @@ -933,7 +933,7 @@ MOS_STATUS CodechalDecodeVp9G12 :: DecodePrimitiveLevel() // Send VD_CONTROL_STATE HCP Pipe Unlock MOS_ZeroMemory(&vdCtrlParam, sizeof(MHW_MI_VD_CONTROL_STATE_PARAMS)); vdCtrlParam.scalableModePipeUnlock = true; - static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam); + CODECHAL_DECODE_CHK_STATUS_RETURN(static_cast(m_miInterface)->AddMiVdControlStateCmd(cmdBufferInUse, &vdCtrlParam)); } // Send VD Pipe Flush command for SKL+ diff --git a/media_softlet/agnostic/common/codec/hal/dec/hevc/packet/decode_huc_s2l_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/hevc/packet/decode_huc_s2l_packet.cpp index 465c8cb4e26..08e34c4c2ae 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/hevc/packet/decode_huc_s2l_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/hevc/packet/decode_huc_s2l_packet.cpp @@ -256,7 +256,7 @@ namespace decode { auto &par = m_hucItf->MHW_GETPAR_F(HUC_IMEM_STATE)(); par = {}; par.kernelDescriptor = m_vdboxHucHevcS2lKernelDescriptor; - m_hucItf->MHW_ADDCMD_F(HUC_IMEM_STATE)(&cmdBuffer); + DECODE_CHK_STATUS(m_hucItf->MHW_ADDCMD_F(HUC_IMEM_STATE)(&cmdBuffer)); auto &mfxWaitParams = m_miItf->MHW_GETPAR_F(MFX_WAIT)(); mfxWaitParams = {}; @@ -278,7 +278,7 @@ namespace decode { auto &par = m_hucItf->MHW_GETPAR_F(HUC_PIPE_MODE_SELECT)(); par = {}; par.streamOutEnabled = false; - m_hucItf->MHW_ADDCMD_F(HUC_PIPE_MODE_SELECT)(&cmdBuffer); + DECODE_CHK_STATUS(m_hucItf->MHW_ADDCMD_F(HUC_PIPE_MODE_SELECT)(&cmdBuffer)); mfxWaitParams = {}; mfxWaitParams.iStallVdboxPipeline = true; @@ -341,7 +341,7 @@ namespace decode { par.StartCodeByte1 = 0; par.StartCodeByte2 = 1; - m_hucItf->MHW_ADDCMD_F(HUC_STREAM_OBJECT)(&cmdBuffer); + DECODE_CHK_STATUS(m_hucItf->MHW_ADDCMD_F(HUC_STREAM_OBJECT)(&cmdBuffer)); return MOS_STATUS_SUCCESS; } @@ -352,7 +352,7 @@ namespace decode { auto &par = m_hucItf->MHW_GETPAR_F(HUC_START)(); par = {}; par.lastStreamObject = laststreamobject; - m_hucItf->MHW_ADDCMD_F(HUC_START)(&cmdBuffer); + DECODE_CHK_STATUS(m_hucItf->MHW_ADDCMD_F(HUC_START)(&cmdBuffer)); return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/common/os/mos_utilities_next.cpp b/media_softlet/agnostic/common/os/mos_utilities_next.cpp index 6c83ddb3fa2..ec780d9c713 100644 --- a/media_softlet/agnostic/common/os/mos_utilities_next.cpp +++ b/media_softlet/agnostic/common/os/mos_utilities_next.cpp @@ -404,6 +404,7 @@ void MosUtilities::MosFreeMemory(void *ptr) MT_MEMORY_PTR, (int64_t)(ptr), functionName, filename, line); free(ptr); + ptr = nullptr; } }