Skip to content

Commit

Permalink
[VP] Add packet reuse support
Browse files Browse the repository at this point in the history
Add packet reuse event
  • Loading branch information
wennibao authored and intel-mediadev committed Sep 5, 2023
1 parent cd39214 commit bf72cea
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
10 changes: 8 additions & 2 deletions media_common/agnostic/common/os/mos_os_trace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ typedef enum _MT_LOG_ID
MT_VP_USERFEATURE_CTRL,
MT_VP_FTR_REPORT,
MT_VP_FEATURE_GRAPH_ID_BASE = 0x02000200,
MT_VP_FEATURE_GRAPH_CREATESWFILTERPIPE_START,
MT_VP_FEATURE_GRAPH_CREATESWFILTERPIPE_END,
MT_VP_FEATURE_GRAPH_EXECUTE_VPPIPELINE_START,
MT_VP_FEATURE_GRAPH_EXECUTE_VPPIPELINE_END,
MT_VP_FEATURE_GRAPH_SETUPEXECUTESWFILTER_START,
MT_VP_FEATURE_GRAPH_SETUPEXECUTESWFILTER_END,
MT_VP_FEATURE_GRAPH_EXECUTEFILTER,
Expand Down Expand Up @@ -747,6 +747,9 @@ typedef enum _MT_LOG_ID
MT_VP_FEATURE_GRAPH_SURFACE_ALLOCATIONHANDLE,
MT_VP_FEATURE_GRAPH_GET_RENDERTARGETTYPE,
MT_VP_FEATURE_GRAPH_SWFILTERSR,
MT_VP_FEATURE_GRAPH_FEATUREPIPE_REUSE,
MT_VP_FEATURE_GRAPH_EXECUTE_SINGLE_VPPIPELINE_START,
MT_VP_FEATURE_GRAPH_EXECUTE_SINGLE_VPPIPELINE_END,
MT_VP_HAL_ID_BASE = 0x02000400,
MT_VP_HAL_PIPELINE_ADAPTER,
MT_VP_HAL_PIPELINE_ADAPTER_EXT_ENTRY,
Expand Down Expand Up @@ -1114,6 +1117,9 @@ typedef enum _MT_PARAM_ID
MT_VP_FEATURE_GRAPH_FILTER_FRAMENUMBER,
MT_VP_FEATURE_GRAPH_FILTER_FIRSTFRAME,
MT_VP_FEATURE_GRAPH_FILTER_ENABLESR,
MT_VP_FEATURE_GRAPH_FILTER_FRAMEID,
MT_VP_FEATURE_GRAPH_FILTER_PIPEID,
MT_VP_FEATURE_GRAPH_FILTER_PIPELINEBYPASS,
MT_PARAM_ID_VP_MHW_BASE = 0x02002000,
MT_VP_MHW_VE_SCALABILITY_EN,
MT_VP_MHW_VE_SCALABILITY_USE_SFC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ MOS_STATUS Policy::CreateHwFilter(SwFilterPipe &subSwFilterPipe, HwFilter *&pFil

HW_FILTER_PARAMS param = {};

MT_LOG1(MT_VP_FEATURE_GRAPH_SETUPEXECUTESWFILTER_START, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_LAYERINDEXES_COUNT, 1);
MT_LOG(MT_VP_FEATURE_GRAPH_SETUPEXECUTESWFILTER_START, MT_NORMAL);
MOS_STATUS status = GetHwFilterParam(subSwFilterPipe, param);

if (MOS_FAILED(status))
Expand All @@ -302,7 +302,7 @@ MOS_STATUS Policy::CreateHwFilter(SwFilterPipe &subSwFilterPipe, HwFilter *&pFil
MT_ERR2(MT_VP_HAL_POLICY, MT_ERROR_CODE, MOS_STATUS_UNIMPLEMENTED, MT_CODE_LINE, __LINE__);
return MOS_STATUS_UNIMPLEMENTED;
}
MT_LOG1(MT_VP_FEATURE_GRAPH_SETUPEXECUTESWFILTER_END, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_LAYERINDEXES_COUNT, 1);
MT_LOG(MT_VP_FEATURE_GRAPH_SETUPEXECUTESWFILTER_END, MT_NORMAL);
return MOS_STATUS_SUCCESS;
}

Expand Down
17 changes: 11 additions & 6 deletions media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ MOS_STATUS VpPipeline::ExecuteVpPipeline()
VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_INVALID_PARAMETER);
}

MT_LOG2(MT_VP_FEATURE_GRAPH_EXECUTE_VPPIPELINE_START, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_SWFILTERPIPE_COUNT, (int64_t)swFilterPipes.size(), MT_VP_FEATURE_GRAPH_FILTER_FRAMEID,m_vpPipeContexts[0]->GetFrameCounter());

if (PIPELINE_PARAM_TYPE_LEGACY == m_pvpParams.type)
{
params = m_pvpParams.renderParams;
Expand Down Expand Up @@ -410,20 +412,21 @@ MOS_STATUS VpPipeline::ExecuteVpPipeline()
VP_PUBLIC_CHK_STATUS_RETURN(eStatus);
if (isBypassNeeded)
{
MT_LOG3(MT_VP_FEATURE_GRAPH_EXECUTE_VPPIPELINE_END, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_SWFILTERPIPE_COUNT, (int64_t)swFilterPipes.size(),
MT_VP_FEATURE_GRAPH_FILTER_FRAMEID, m_vpPipeContexts[0]->GetFrameCounter(), MT_VP_FEATURE_GRAPH_FILTER_PIPELINEBYPASS, isBypassNeeded);
return MOS_STATUS_SUCCESS;
}

}

VP_PUBLIC_CHK_STATUS_RETURN(CreateSwFilterPipe(m_pvpParams, swFilterPipes));

// Increment frame ID for performance measurement
m_osInterface->pfnIncPerfFrameID(m_osInterface);

MT_LOG1(MT_VP_FEATURE_GRAPH_CREATESWFILTERPIPE_START, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_SWFILTERPIPE_COUNT, (int64_t)swFilterPipes.size());

for (uint32_t pipeIdx = 0; pipeIdx < swFilterPipes.size(); pipeIdx++)
{
MT_LOG3(MT_VP_FEATURE_GRAPH_EXECUTE_SINGLE_VPPIPELINE_START, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_SWFILTERPIPE_COUNT, (int64_t)swFilterPipes.size(),
MT_VP_FEATURE_GRAPH_FILTER_FRAMEID, m_vpPipeContexts[0]->GetFrameCounter(), MT_VP_FEATURE_GRAPH_FILTER_PIPEID, pipeIdx);
auto &pipe = swFilterPipes[pipeIdx];
if (pipe)
{
Expand All @@ -439,9 +442,12 @@ MOS_STATUS VpPipeline::ExecuteVpPipeline()
VP_PUBLIC_CHK_STATUS_RETURN(m_vpInterface->SwitchResourceManager(singlePipeCtx->GetVpResourceManager()));

VP_PUBLIC_CHK_STATUS_RETURN(ExecuteSingleswFilterPipe(singlePipeCtx, pipe, pPacketPipe, featureManagerNext));
MT_LOG3(MT_VP_FEATURE_GRAPH_EXECUTE_SINGLE_VPPIPELINE_END, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_SWFILTERPIPE_COUNT, (int64_t)swFilterPipes.size(),
MT_VP_FEATURE_GRAPH_FILTER_FRAMEID, m_vpPipeContexts[0]->GetFrameCounter(), MT_VP_FEATURE_GRAPH_FILTER_PIPEID, pipeIdx);
}

MT_LOG1(MT_VP_FEATURE_GRAPH_CREATESWFILTERPIPE_END, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_SWFILTERPIPE_COUNT, (int64_t)swFilterPipes.size());
MT_LOG3(MT_VP_FEATURE_GRAPH_EXECUTE_VPPIPELINE_END, MT_NORMAL, MT_VP_FEATURE_GRAPH_FILTER_SWFILTERPIPE_COUNT, (int64_t)swFilterPipes.size(),
MT_VP_FEATURE_GRAPH_FILTER_FRAMEID, m_vpPipeContexts[0]->GetFrameCounter(), MT_VP_FEATURE_GRAPH_FILTER_PIPELINEBYPASS, isBypassNeeded);
return eStatus;
}

Expand Down Expand Up @@ -493,7 +499,7 @@ MOS_STATUS VpPipeline::ExecuteSingleswFilterPipe(VpSinglePipeContext *singlePipe
if (isPacketPipeReused)
{
VP_PUBLIC_NORMALMESSAGE("Packet reused.");

MT_LOG(MT_VP_FEATURE_GRAPH_FEATUREPIPE_REUSE, MT_NORMAL);
singlePipeCtx->SetPacketReused(true);

PacketPipe *pipeReused = packetReuseMgr->GetPacketPipeReused();
Expand All @@ -502,7 +508,6 @@ MOS_STATUS VpPipeline::ExecuteSingleswFilterPipe(VpSinglePipeContext *singlePipe
// Update output pipe mode.
singlePipeCtx->SetOutputPipeMode(pipeReused->GetOutputPipeMode());
singlePipeCtx->SetIsVeboxFeatureInuse(pipeReused->IsVeboxFeatureInuse());

// MediaPipeline::m_statusReport is always nullptr in VP APO path right now.
eStatus = pipeReused->Execute(MediaPipeline::m_statusReport, m_scalability, m_mediaContext, MOS_VE_SUPPORTED(m_osInterface), m_numVebox);
MT_LOG1(MT_VP_HAL_VEBOXNUM_CHECK, MT_NORMAL, MT_VP_HAL_VEBOX_NUMBER, m_numVebox)
Expand Down

0 comments on commit bf72cea

Please sign in to comment.