Skip to content

Commit

Permalink
[VP] remove item in tems packet when color fill and no support reuse …
Browse files Browse the repository at this point in the history
…feature

remove item in tems packet when color fill and no support reuse feature.
  • Loading branch information
Dylan-debug authored and intel-mediadev committed Sep 24, 2024
1 parent 9aadf63 commit e0fbbc1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ MOS_STATUS VpPacketReuseManager::PreparePacketPipeReuse(SwFilterPipe *&swFilterP

if (m_pipeReused)
{
m_packetPipeFactory.ReturnPacketPipe(m_pipeReused);
ReturnPacketPipeReused();
}

return MOS_STATUS_SUCCESS;
Expand All @@ -834,7 +834,7 @@ MOS_STATUS VpPacketReuseManager::PreparePacketPipeReuse(SwFilterPipe *&swFilterP
isPacketPipeReused = false;
if (m_pipeReused)
{
m_packetPipeFactory.ReturnPacketPipe(m_pipeReused);
ReturnPacketPipeReused();
}
return MOS_STATUS_SUCCESS;
}
Expand Down Expand Up @@ -948,29 +948,7 @@ MOS_STATUS VpPacketReuseManager::PreparePacketPipeReuse(SwFilterPipe *&swFilterP

m_TeamsPacket_reuse = false;

foundPipe = false;
for (index = 0; index < m_pipeReused_TeamsPacket.size(); index++)
{
auto pipeReuseHandle = m_pipeReused_TeamsPacket.find(index);
if (pipeReuseHandle != m_pipeReused_TeamsPacket.end() &&
m_pipeReused == pipeReuseHandle->second)
{
foundPipe = true;
break;
}
}

if (foundPipe == false)
{
if (m_pipeReused)
{
m_packetPipeFactory.ReturnPacketPipe(m_pipeReused);
}
}
else
{
m_pipeReused = nullptr;
}
ReturnPacketPipeReused();

return MOS_STATUS_SUCCESS;
}
Expand Down Expand Up @@ -1014,29 +992,7 @@ MOS_STATUS VpPacketReuseManager::PreparePacketPipeReuse(SwFilterPipe *&swFilterP
// m_pipeReused will be udpated in UpdatePacketPipeConfig.
VP_PUBLIC_NORMALMESSAGE("Packet cannot be reused.");

foundPipe = false;
for (index = 0; index < m_pipeReused_TeamsPacket.size(); index++)
{
auto pipeReuseHandle = m_pipeReused_TeamsPacket.find(index);
if (pipeReuseHandle != m_pipeReused_TeamsPacket.end() &&
m_pipeReused == pipeReuseHandle->second)
{
foundPipe = true;
break;
}
}

if (foundPipe == false)
{
if (m_pipeReused)
{
m_packetPipeFactory.ReturnPacketPipe(m_pipeReused);
}
}
else
{
m_pipeReused = nullptr;
}
ReturnPacketPipeReused();

return MOS_STATUS_SUCCESS;
}
Expand Down Expand Up @@ -1133,10 +1089,7 @@ MOS_STATUS VpPacketReuseManager::UpdatePacketPipeConfig(PacketPipe *&pipe)

if (!m_TeamsPacket)
{
if (m_pipeReused)
{
m_packetPipeFactory.ReturnPacketPipe(m_pipeReused);
}
ReturnPacketPipeReused();
}

m_pipeReused = pipe;
Expand All @@ -1146,3 +1099,21 @@ MOS_STATUS VpPacketReuseManager::UpdatePacketPipeConfig(PacketPipe *&pipe)
return MOS_STATUS_SUCCESS;
}

void VpPacketReuseManager::ReturnPacketPipeReused()
{
VP_FUNC_CALL();
if (nullptr == m_pipeReused)
{
return;
}
for (const auto &pair : m_pipeReused_TeamsPacket)
{
if (pair.second == m_pipeReused)
{
m_pipeReused = nullptr;
return;
}
}
m_packetPipeFactory.ReturnPacketPipe(m_pipeReused);
return;
}
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ class VpPacketReuseManager
return m_pipeReused;
}

protected:
void ReturnPacketPipeReused();

protected:
bool m_reusable = false; // Current parameter can be reused.
PacketPipe *m_pipeReused = nullptr;
Expand Down

0 comments on commit e0fbbc1

Please sign in to comment.