Skip to content

Commit

Permalink
[VP] Fix engine id overwrite issues in multi-processes/multi-threads
Browse files Browse the repository at this point in the history
Fix engine id overwrite issues
  • Loading branch information
LhGu authored and intel-mediadev committed Jan 17, 2025
1 parent 28fff67 commit 30daede
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion media_softlet/agnostic/common/hw/mhw_vebox_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ class Impl : public Itf, public mhw::Impl
{
MHW_CHK_NULL_RETURN(m_veboxHeap);
MHW_CHK_NULL_RETURN(m_veboxHeap->pStates);
uint32_t reportedUsedID = 0;
for (uint32_t index = 0; index < m_veboxSettings.uiNumInstances; index++)
{
const MHW_VEBOX_HEAP_STATE &curInstance = m_veboxHeap->pStates[index];
Expand All @@ -909,10 +910,21 @@ class Impl : public Itf, public mhw::Impl
m_usedVeboxID |= 1 << (*curInstance.engineData).instanceId;
}
}
// It is only used in debugging scenarios for multi-Vebox platforms.
// No need to add any locks here.
// This approach can handle all current debugging scenarios with multiple threads/processes.
ReadUserSettingForDebug(
m_userSettingPtr,
reportedUsedID,
__MEDIA_USER_FEATURE_VALUE_USED_VEBOX_ID,
MediaUserSetting::Group::Sequence,
0,
false,
MEDIA_USER_SETTING_INTERNAL_REPORT);
ReportUserSettingForDebug(
m_userSettingPtr,
__MEDIA_USER_FEATURE_VALUE_USED_VEBOX_ID,
m_usedVeboxID,
reportedUsedID | m_usedVeboxID,
MediaUserSetting::Group::Sequence);
}
return MOS_STATUS_SUCCESS;
Expand Down

0 comments on commit 30daede

Please sign in to comment.