Skip to content

Commit

Permalink
[Media Common] [VP] fix coverityent issue
Browse files Browse the repository at this point in the history
fix coverityent issue!
  • Loading branch information
Dylan-debug authored and intel-mediadev committed Sep 5, 2023
1 parent 964ffce commit 82a4eb9
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
4 changes: 3 additions & 1 deletion media_driver/agnostic/common/os/mos_os_virtualengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ MOS_STATUS Mos_VirtualEngineInterface_Initialize(

if (pOsInterface->apoMosEnabled)
{
MOS_OS_CHK_NULL(pOsInterface->osStreamState);
if (pVEInitParms->bScalabilitySupported)
{
pVEInterf->veInterface = MOS_New(MosOsVeScalabilitySpecific);
Expand All @@ -106,12 +107,13 @@ MOS_STATUS Mos_VirtualEngineInterface_Initialize(
pVEInterf->veInterface = MOS_New(MosOsVeSinglePipeSpecific);
}
MOS_OS_CHK_NULL(pVEInterf->veInterface);
MOS_OS_CHK_NULL(pOsInterface->osStreamState);
pVEInterf->veInterface->Initialize(pOsInterface->osStreamState, pVEInitParms);
pOsInterface->osStreamState->virtualEngineInterface = pVEInterf->veInterface;
}
return eStatus;

finish:
MOS_SafeFreeMemory(pVEInterf);
return eStatus;
}

7 changes: 6 additions & 1 deletion media_driver/agnostic/common/vp/hal/vphal_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,12 @@ void VphalRenderer::UpdateReport(
{
MOS_ZeroMemory(&Info, sizeof(VPHAL_GET_SURFACE_INFO));

VpHal_GetSurfaceInfo(m_pOsInterface, &Info, pRenderParams->pTarget[0]);
MOS_STATUS status = VpHal_GetSurfaceInfo(m_pOsInterface, &Info, pRenderParams->pTarget[0]);
if (MOS_STATUS_SUCCESS != status)
{
VPHAL_PUBLIC_ASSERTMESSAGE("VpHal_GetSurfaceInfo failed!");
return;
}
m_reporting->GetFeatures().rtCompressible = true;
m_reporting->GetFeatures().rtCompressMode = (uint8_t)(pRenderParams->pTarget[0]->CompressionMode);
}
Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/gen12/hw/mhw_state_heap_g12.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ MOS_STATUS MHW_STATE_HEAP_INTERFACE_G12_X::AddInterfaceDescriptorData(

// need to subtract memory block's offset in current state heap for AddData API
offset -= pParams->memoryBlock->GetOffset();
pParams->memoryBlock->AddData(pInterfaceDescriptor, offset,
sizeof(mhw_state_heap_g12_X::INTERFACE_DESCRIPTOR_DATA_CMD));
MHW_MI_CHK_STATUS(pParams->memoryBlock->AddData(pInterfaceDescriptor, offset,
sizeof(mhw_state_heap_g12_X::INTERFACE_DESCRIPTOR_DATA_CMD)));

MOS_SafeFreeMemory(pInterfaceDescriptor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class CompositeStateG12 : virtual public CompositeState
m_bYV12iAvsScaling = true; // On Gen9+, iAVS scaling can support YV12 input format
m_bEnableSamplerLumakey = true;

if (!peStatus)
{
VPHAL_PUBLIC_ASSERTMESSAGE("Got null peStatus!");
return;
}

if (*peStatus != MOS_STATUS_SUCCESS)
{
// super class constructor failed, return directly
Expand Down
6 changes: 0 additions & 6 deletions media_softlet/agnostic/common/hw/mhw_sfc_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ class Impl : public Itf, public mhw::Impl
m_indexofSfc = 0;
m_numofSfc = 1;

if (osItf == nullptr)
{
MHW_ASSERTMESSAGE("Invalid Input Parameter: m_osInterface is nullptr");
return;
}

// Get Memory control object directly from MOS.
// If any override is needed, something like pfnOverrideMemoryObjectCtrl() / pfnComposeSurfaceCacheabilityControl()
// will need to be implemented.
Expand Down
2 changes: 1 addition & 1 deletion media_softlet/agnostic/common/hw/mhw_state_heap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ MOS_STATUS XMHW_STATE_HEAP_INTERFACE::InitializeInterface(

m_dshManager.RegisterOsInterface(m_pOsInterface);
m_dshManager.SetDefaultBehavior(StateHeapSettings.m_dshBehavior);
m_dshManager.SetInitialHeapSize(StateHeapSettings.dwDshSize);
MHW_MI_CHK_STATUS(m_dshManager.SetInitialHeapSize(StateHeapSettings.dwDshSize));
if (StateHeapSettings.m_dshBehavior == HeapManager::Behavior::extend ||
StateHeapSettings.m_dshBehavior == HeapManager::Behavior::destructiveExtend ||
StateHeapSettings.m_dshBehavior == HeapManager::Behavior::waitAndExtend)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3107,6 +3107,7 @@ MOS_STATUS Policy::LayerSelectForProcess(std::vector<int> &layerIndexes, SwFilte
VP_PUBLIC_NORMALMESSAGE("target, gpuVa = 0x%llx", gpuVa);

PolicyFcHandler *fcHandler = dynamic_cast<PolicyFcHandler *>(it->second);
VP_PUBLIC_CHK_NULL_RETURN(fcHandler);
VP_PUBLIC_CHK_STATUS_RETURN(fcHandler->LayerSelectForProcess(layerIndexes, featurePipe, caps));

if (layerIndexes.size() < featurePipe.GetSurfaceCount(true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ MOS_STATUS VpCscFilter::CalculateSfcEngineParams()
m_sfcCSCParams->iefParams = m_cscParams.pIEFParams;
}

m_cscParams.input.colorSpace = m_cscParams.input.colorSpace;
m_sfcCSCParams->inputColorSpace = m_cscParams.input.colorSpace;

// IsDitheringNeeded should be called before input format being updated by GetSfcInputFormat
m_sfcCSCParams->isDitheringNeeded = IsDitheringNeeded(m_cscParams.formatInput, m_cscParams.formatOutput);
Expand Down

0 comments on commit 82a4eb9

Please sign in to comment.