Skip to content

Commit

Permalink
[VP] fallback to Render when sfc input hight > 3072
Browse files Browse the repository at this point in the history
fallback to Render when sfc input hight > 3072.
  • Loading branch information
Dylan-debug authored and intel-mediadev committed Nov 20, 2024
1 parent cb6d1f0 commit fd06c3d
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 5 deletions.
38 changes: 33 additions & 5 deletions media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,9 +1181,12 @@ MOS_STATUS Policy::GetScalingExecutionCaps(SwFilter *feature, bool isHdrEnabled,
VP_PUBLIC_CHK_NULL_RETURN(feature);
VP_PUBLIC_CHK_NULL_RETURN(m_vpInterface.GetHwInterface());
VP_PUBLIC_CHK_NULL_RETURN(m_vpInterface.GetHwInterface()->m_userFeatureControl);
VP_PUBLIC_CHK_NULL_RETURN(m_vpInterface.GetHwInterface()->m_reporting);

auto userFeatureControl = m_vpInterface.GetHwInterface()->m_userFeatureControl;
bool disableSfc = userFeatureControl->IsSfcDisabled();
bool fallbackScalingToRender8K = userFeatureControl->IsFallbackScalingToRender8K();
auto reporting = m_vpInterface.GetHwInterface()->m_reporting;
SwFilterScaling* scaling = (SwFilterScaling*)feature;
FeatureParamScaling *scalingParams = &scaling->GetSwFilterParams();
VP_EngineEntry *scalingEngine = &scaling->GetFilterEngineCaps();
Expand Down Expand Up @@ -1255,11 +1258,12 @@ MOS_STATUS Policy::GetScalingExecutionCaps(SwFilter *feature, bool isHdrEnabled,
(uint32_t)(scalingParams->input.rcDst.right - scalingParams->input.rcDst.left),
m_hwCaps.m_sfcHwEntry[scalingParams->formatOutput].horizontalAlignUnit);

bool isScalingNeeded = (dwOutputRegionHeight != dwSourceRegionHeight || dwOutputRegionWidth != dwSourceRegionWidth);

if (!m_hwCaps.m_veboxHwEntry[scalingParams->formatInput].inputSupported)
{
// For non-scaling cases with vebox unsupported format, will force to use fc.
scalingEngine->bEnabled = (dwOutputRegionHeight != dwSourceRegionHeight ||
dwOutputRegionWidth != dwSourceRegionWidth);
scalingEngine->bEnabled = isScalingNeeded;
scalingEngine->SfcNeeded = 0;
scalingEngine->VeboxNeeded = 0;
scalingEngine->RenderNeeded = 1;
Expand Down Expand Up @@ -1304,8 +1308,7 @@ MOS_STATUS Policy::GetScalingExecutionCaps(SwFilter *feature, bool isHdrEnabled,
OUT_OF_BOUNDS(dwSurfaceHeight, veboxMinHeight, veboxMaxHeight))
{
// For non-scaling cases with vebox unsupported format, will force to use fc.
scalingEngine->bEnabled = (dwOutputRegionHeight != dwSourceRegionHeight ||
dwOutputRegionWidth != dwSourceRegionWidth);
scalingEngine->bEnabled = isScalingNeeded;
scalingEngine->SfcNeeded = 0;
scalingEngine->VeboxNeeded = 0;
scalingEngine->forceEnableForSfc = 0;
Expand All @@ -1322,6 +1325,31 @@ MOS_STATUS Policy::GetScalingExecutionCaps(SwFilter *feature, bool isHdrEnabled,
return MOS_STATUS_SUCCESS;
}

if (MEDIA_IS_WA(m_vpInterface.GetHwInterface()->m_waTable, Wa_16025683853) &&
fallbackScalingToRender8K == true &&
scalingParams->input.dwHeight > 3072 &&
isScalingNeeded)
{
// For sfc input height > 3072 case, will force to use fc.
scalingEngine->bEnabled = 1;
scalingEngine->SfcNeeded = 0;
scalingEngine->VeboxNeeded = 0;
scalingEngine->RenderNeeded = 1;
scalingEngine->hdrKernelSupported = 1;
scalingEngine->fcSupported = 1;
scalingEngine->forceEnableForSfc = 0;
scalingEngine->forceEnableForFc = 1;
scalingEngine->sfcNotSupported = 1;
#if (_DEBUG || _RELEASE_INTERNAL)
reporting->GetFeatures().fallbackScalingToRender8K = fallbackScalingToRender8K;
#endif

VP_PUBLIC_NORMALMESSAGE("The input height %d is greater than 3072.", scalingParams->input.dwHeight);

PrintFeatureExecutionCaps(__FUNCTION__, *scalingEngine);
return MOS_STATUS_SUCCESS;
}

// Calculate the scaling ratio
// Both source region and scaled region are pre-rotated
// Need to take Interlace scaling into consideration next step
Expand Down Expand Up @@ -2699,7 +2727,7 @@ MOS_STATUS Policy::GetInputPipeEngineCaps(SwFilterPipe& featurePipe, VP_EngineEn
// not all features in input pipe can be processed by vebox/sfc and
// features in output pipe cannot be combined to vebox/sfc workload.
engineCapsForVeboxSfc.fcOnlyFeatureExists = true;
engineCapsForFc.fcOnlyFeatureExists = true;
engineCapsForFc.fcOnlyFeatureExists = true;
}
if (engineCaps.sfcNotSupported)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class VpFeatureReport
uint32_t diffLogOclFC = 0;
uint32_t featureLogOclFC = 0;
bool isLegacyFCInUse = false;
bool fallbackScalingToRender8K = false;
#endif
bool VeboxScalability = false; //!< Vebox Scalability flag
bool VPApogeios = false; //!< VP Apogeios flag
Expand Down
21 changes: 21 additions & 0 deletions media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ VpPipeline::VpPipeline(PMOS_INTERFACE osInterface) :

VpPipeline::~VpPipeline()
{
#if (_DEBUG || _RELEASE_INTERNAL)
if (m_reportOnceFlag)
{
ReportUserSettingForDebug(
m_userSettingPtr,
__MEDIA_USER_FEATURE_VALUE_FALLBACK_SCALING_TO_RENDER_8K_REPORT,
0,
MediaUserSetting::Group::Sequence);
}
#endif
// Delete m_featureManager before m_resourceManager, since
// m_resourceManager is referenced by m_featureManager.
MOS_Delete(m_featureManager);
Expand Down Expand Up @@ -261,6 +271,17 @@ MOS_STATUS VpPipeline::UserFeatureReport()
m_reporting->GetFeatures().isLegacyFCInUse = false;
}
}

if (m_reportOnceFlag && m_reporting->GetFeatures().fallbackScalingToRender8K)
{
ReportUserSettingForDebug(
m_userSettingPtr,
__MEDIA_USER_FEATURE_VALUE_FALLBACK_SCALING_TO_RENDER_8K_REPORT,
1,
MediaUserSetting::Group::Sequence);
m_reporting->GetFeatures().fallbackScalingToRender8K = false;
m_reportOnceFlag = false;
}

#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ class VpPipeline : public MediaPipeline
VpUserFeatureControl *m_userFeatureControl = nullptr;
std::vector<VpSinglePipeContext *> m_vpPipeContexts = {};
VpPipelineParamFactory *m_pipelineParamFactory = nullptr;
bool m_reportOnceFlag = true;

MEDIA_CLASS_DEFINE_END(vp__VpPipeline)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,20 @@ MOS_STATUS VpUserSetting::InitVpUserSetting(MediaUserSettingSharedPtr userSettin
0,
true);

DeclareUserSettingKeyForDebug(
userSettingPtr,
__MEDIA_USER_FEATURE_VALUE_FALLBACK_SCALING_TO_RENDER_8K,
MediaUserSetting::Group::Sequence,
0,
true);

DeclareUserSettingKeyForDebug(
userSettingPtr,
__MEDIA_USER_FEATURE_VALUE_FALLBACK_SCALING_TO_RENDER_8K_REPORT,
MediaUserSetting::Group::Sequence,
0,
true);

#endif

return MOS_STATUS_SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,27 @@ MOS_STATUS VpUserFeatureControl::CreateUserSettingForDebug()
}
VP_PUBLIC_NORMALMESSAGE("enableSFCLinearOutputByTileConvert value is set as %d.", m_ctrlValDefault.enableSFCLinearOutputByTileConvert);

#if (_DEBUG || _RELEASE_INTERNAL)
uint32_t fallbackScalingToRender8K = 0;
eRegKeyReadStatus = ReadUserSettingForDebug(
m_userSettingPtr,
fallbackScalingToRender8K,
__MEDIA_USER_FEATURE_VALUE_FALLBACK_SCALING_TO_RENDER_8K,
MediaUserSetting::Group::Sequence,
true,
true);
if (MOS_SUCCEEDED(eRegKeyReadStatus))
{
m_ctrlValDefault.fallbackScalingToRender8K = fallbackScalingToRender8K;
}
else
#endif
{
// WA ID need be added before code merge.
m_ctrlValDefault.fallbackScalingToRender8K = 1;
}
VP_PUBLIC_NORMALMESSAGE("fallbackScalingToRender8K %d", m_ctrlValDefault.fallbackScalingToRender8K);

return MOS_STATUS_SUCCESS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class VpUserFeatureControl
uint32_t splitFramePortions = 1;
bool decompForInterlacedSurfWaEnabled = false;
bool enableSFCLinearOutputByTileConvert = false;
bool fallbackScalingToRender8K = false;
};

uint32_t Is3DLutKernelOnly()
Expand Down Expand Up @@ -208,6 +209,11 @@ class VpUserFeatureControl
return m_ctrlVal.veboxTypeH;
}

bool IsFallbackScalingToRender8K()
{
return m_ctrlVal.fallbackScalingToRender8K;
}

MOS_STATUS SetClearVideoViewMode(bool mode)
{
m_ctrlVal.clearVideoViewMode = mode;
Expand Down
2 changes: 2 additions & 0 deletions media_softlet/agnostic/common/vp/hal/utils/vp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ class Trace

#define __MEDIA_USER_FEATURE_VALUE_ENABLE_VEBOX_ID_REPORT "Enable VEBOX ID REPORT"
#define __MEDIA_USER_FEATURE_VALUE_USED_VEBOX_ID "USED VEBOX ID"
#define __MEDIA_USER_FEATURE_VALUE_FALLBACK_SCALING_TO_RENDER_8K "VP Fallback Scaling To Render 8k"
#define __MEDIA_USER_FEATURE_VALUE_FALLBACK_SCALING_TO_RENDER_8K_REPORT "VP Fallback Scaling To Render 8k Report"
#endif //(_DEBUG || _RELEASE_INTERNAL)

class VpUtils
Expand Down

0 comments on commit fd06c3d

Please sign in to comment.