From bf72cea602ca86dbac767b67f5c3bdb6aec802e7 Mon Sep 17 00:00:00 2001 From: Bao_Wenni Date: Tue, 5 Sep 2023 13:49:33 +0800 Subject: [PATCH] [VP] Add packet reuse support Add packet reuse event --- .../agnostic/common/os/mos_os_trace_event.h | 10 ++++++++-- .../common/vp/hal/feature_manager/policy.cpp | 4 ++-- .../common/vp/hal/pipeline/vp_pipeline.cpp | 17 +++++++++++------ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/media_common/agnostic/common/os/mos_os_trace_event.h b/media_common/agnostic/common/os/mos_os_trace_event.h index 964f6c86c78..3d485fc1755 100644 --- a/media_common/agnostic/common/os/mos_os_trace_event.h +++ b/media_common/agnostic/common/os/mos_os_trace_event.h @@ -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, @@ -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, @@ -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, diff --git a/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp b/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp index e8ad2aadde9..ce39ef77b89 100644 --- a/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp +++ b/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp @@ -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)) @@ -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; } diff --git a/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp b/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp index 5cce9c01e3c..99790c5db2c 100644 --- a/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp +++ b/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp @@ -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; @@ -410,9 +412,10 @@ 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)); @@ -420,10 +423,10 @@ MOS_STATUS VpPipeline::ExecuteVpPipeline() // 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) { @@ -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; } @@ -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(); @@ -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)