Skip to content

Commit

Permalink
[VP] Enable 3DLut kernel case w/o vebox workload
Browse files Browse the repository at this point in the history
Enable 3DLut kernel case w/o vebox workload.
  • Loading branch information
VickyZengg authored and intel-mediadev committed Sep 5, 2024
1 parent 628bf90 commit 3edea6f
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 2 deletions.
51 changes: 50 additions & 1 deletion media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ MOS_STATUS Policy::CreateHwFilter(SwFilterPipe &subSwFilterPipe, HwFilter *&pFil
{
VP_PUBLIC_ASSERTMESSAGE("Create HW Filter Failed, Return Error");
MT_ERR2(MT_VP_HAL_POLICY, MT_ERROR_CODE, MOS_STATUS_UNIMPLEMENTED, MT_CODE_LINE, __LINE__);
if (m_vpInterface.GetHwInterface()->m_userFeatureControl->Is3DLutKernelOnly())
{
VP_PUBLIC_NORMALMESSAGE("Bypass This Workload due to 3dlut kenrel test, Return True");
return MOS_STATUS_SUCCESS;
}
return MOS_STATUS_UNIMPLEMENTED;
}
MT_LOG(MT_VP_FEATURE_GRAPH_SETUPEXECUTESWFILTER_END, MT_NORMAL);
Expand Down Expand Up @@ -2048,6 +2053,11 @@ MOS_STATUS Policy::GetHdrExecutionCaps(SwFilter *feature)
}
else if (Is3DLutKernelSupported())
{
if (userFeatureControl->Is3DLutKernelOnly())
{
hdrParams->is3DLutKernelOnly = true;
}

if (hdrParams->uiMaxContentLevelLum != m_savedMaxCLL || hdrParams->uiMaxDisplayLum != m_savedMaxDLL ||
hdrParams->hdrMode != m_savedHdrMode)
{
Expand Down Expand Up @@ -2403,6 +2413,13 @@ MOS_STATUS Policy::InitExecuteCaps(VP_EXECUTE_CAPS &caps, VP_EngineEntry &engine
caps.bSFC = !engineCapsOutputPipe.sfcNotSupported && engineCaps.nonVeboxFeatureExists;
}
}
else if (engineCapsInputPipe.forceBypassWorkload)
{
caps.bVebox = 0;
caps.bSFC = 0;
caps.bRender = 0;
caps.forceBypassWorkload = 1;
}
else
{
if (!engineCapsInputPipe.fcSupported)
Expand Down Expand Up @@ -2553,7 +2570,7 @@ MOS_STATUS Policy::GetInputPipeEngineCaps(SwFilterPipe& featurePipe, VP_EngineEn
VP_EngineEntry engineCapsIsolated = {}; // Input pipe engine caps for isolated feature exists case.
VP_EngineEntry engineCapsForVeboxSfc = {}; // Input pipe engine caps for non-fc feature exists case.
VP_EngineEntry engineCapsForFc = {}; // Input pipe engine caps for fc supported by all features cases.
VP_EngineEntry engineCapsForHdrKernel = {0}; // Input pipe engine caps for hdr kernel supported by all features cases.
VP_EngineEntry engineCapsForHdrKernel = {0}; // Input pipe engine caps for hdr kernel supported by all features cases.
for (uint32_t pipeIndex = 0; pipeIndex < featurePipe.GetSurfaceCount(true); ++pipeIndex)
{
SwFilterSubPipe *featureSubPipe = featurePipe.GetSwFilterSubPipe(true, pipeIndex);
Expand Down Expand Up @@ -2599,6 +2616,11 @@ MOS_STATUS Policy::GetInputPipeEngineCaps(SwFilterPipe& featurePipe, VP_EngineEn
engineCapsForFc.veboxNotSupported = engineCaps.veboxNotSupported;
VP_PUBLIC_NORMALMESSAGE("veboxNotSupported flag is set.");
}
if (engineCaps.forceBypassWorkload)
{
engineCapsInputPipe.forceBypassWorkload = engineCaps.forceBypassWorkload;
VP_PUBLIC_NORMALMESSAGE("Set engineCapsInputPipe forceDisableForVebox true.");
}
continue;
}

Expand Down Expand Up @@ -2747,6 +2769,10 @@ MOS_STATUS Policy::GetInputPipeEngineCaps(SwFilterPipe& featurePipe, VP_EngineEn
VP_PUBLIC_NORMALMESSAGE("engineCapsForVeboxSfc selected.");
engineCapsInputPipe = engineCapsForVeboxSfc;
}
else if (engineCapsInputPipe.forceBypassWorkload)
{
VP_PUBLIC_NORMALMESSAGE("Still use engineCapsInputPipe forceBypassWorkload set true.");
}
else
{
VP_PUBLIC_NORMALMESSAGE("engineCapsForFc selected.");
Expand Down Expand Up @@ -2892,6 +2918,24 @@ MOS_STATUS Policy::FilterFeatureCombination(SwFilterPipe &swFilterPipe, bool isI
}
}
}
else if (engineCapsCombined.forceBypassWorkload)
{
for (auto filterID : m_featurePool)
{
auto feature = pipe->GetSwFilter(FeatureType(filterID));
if (feature && feature->GetFilterEngineCaps().bEnabled)
{
feature->GetFilterEngineCaps().bEnabled = 0;
feature->GetFilterEngineCaps().VeboxNeeded = 0;
feature->GetFilterEngineCaps().SfcNeeded = 0;
feature->GetFilterEngineCaps().RenderNeeded = 0;
feature->GetFilterEngineCaps() = {0};
feature->GetFilterEngineCaps().forceBypassWorkload = 1;
VP_PUBLIC_NORMALMESSAGE("Disable feature 0x%x because of bypass this workload.", filterID);
PrintFeatureExecutionCaps("Disable feature because of bypass this workload.", feature->GetFilterEngineCaps());
}
}
}

// For DI on render with scaling case, force to do scaling on render.
if (engineCapsCombined.SfcNeeded)
Expand Down Expand Up @@ -3081,6 +3125,11 @@ MOS_STATUS Policy::BuildExecuteHwFilter(VP_EXECUTE_CAPS& caps, HW_FILTER_PARAMS&
}
}
}
else if (caps.forceBypassWorkload)
{
VP_PUBLIC_NORMALMESSAGE("No engine is assigned. Skip this process for test usage.");
VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_SUCCESS);
}
else
{
VP_PUBLIC_ASSERTMESSAGE("No engine is assigned.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ struct FeatureParamHdr : public FeatureParam
VPHAL_HDR_LUT_MODE lutMode = VPHAL_HDR_LUT_MODE_NONE; //!< LUT Mode
VPHAL_HDR_LUT_MODE globalLutMode = VPHAL_HDR_LUT_MODE_NONE; //!< Global LUT mode control for debugging purpose
bool bGpuGenerate3DLUT = false; //!< Flag for per frame GPU generation of 3DLUT
bool is3DLutKernelOnly = false;

PVPHAL_COLORFILL_PARAMS pColorFillParams = nullptr; //!< ColorFill - BG only
bool bDisableAutoMode = false; //!< Force to disable Hdr auto mode tone mapping for debugging purpose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,10 @@ MOS_STATUS PolicyRenderHdr3DLutCalHandler::UpdateFeaturePipe(VP_EXECUTE_CAPS cap
filter2ndPass->GetFilterEngineCaps().RenderNeeded = 0;
filter2ndPass->GetFilterEngineCaps().VeboxNeeded = 1;
filter2ndPass->GetFilterEngineCaps().isolated = 0;

if (featureHdr->GetSwFilterParams().is3DLutKernelOnly)
{
filter2ndPass->GetFilterEngineCaps().forceBypassWorkload = 1;
}
if (featureHdr->GetSwFilterParams().formatOutput == Format_A8B8G8R8 || featureHdr->GetSwFilterParams().formatOutput == Format_A8R8G8B8)
{
filter2ndPass->GetFilterEngineCaps().VeboxARGBOut = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ struct _VP_EXECUTE_CAPS
uint64_t bSegmentation : 1;
uint64_t bHdr : 1;
uint64_t bFallbackLegacyFC : 1; // only valid when vpUserFeatureControl->EnableL0FC() is true
uint64_t forceBypassWorkload : 1; // If true, force to bypass workload.
};
uint64_t value;
};
Expand Down Expand Up @@ -253,6 +254,7 @@ typedef struct _VP_EngineEntry
uint64_t bTemperalInputInuse : 1; // true if replace input
uint64_t outputWithLumaKey : 1;
uint64_t enableSFCLinearOutputByTileConvert : 1; //true if do tileconvert from tileF to linear for SFC linear output
uint64_t forceBypassWorkload : 1; // If true, force to bypass workload.
};
uint64_t value;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ MOS_STATUS VpUserSetting::InitVpUserSetting(MediaUserSettingSharedPtr userSettin
0,
true);

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

DeclareUserSettingKeyForDebug( //Enable 1K 1DLUT
userSettingPtr,
__VPHAL_ENABLE_1K_1DLUT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,22 @@ MOS_STATUS VpUserFeatureControl::CreateUserSettingForDebug()
m_ctrlValDefault.force3DLutInterpolation = 0;
}

uint32_t is3DLutKernelOnly = 0;
eRegKeyReadStatus = ReadUserSettingForDebug(
m_userSettingPtr,
is3DLutKernelOnly,
__VPHAL_FORCE_VP_3DLUT_KERNEL_ONLY,
MediaUserSetting::Group::Sequence);
if (MOS_SUCCEEDED(eRegKeyReadStatus))
{
m_ctrlValDefault.is3DLutKernelOnly = is3DLutKernelOnly;
}
else
{
// Default value
m_ctrlValDefault.is3DLutKernelOnly = 0;
}

//SFC NV12/P010 Linear Output.
uint32_t enabledSFCNv12P010LinearOutput = 0;
eRegKeyReadStatus = ReadUserSettingForDebug(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class VpUserFeatureControl
bool cscCosffPatchModeDisabled = false;
bool ForceEnableVeboxOutputSurf = false;
bool veboxTypeH = false;
bool is3DLutKernelOnly = false;

#if (_DEBUG || _RELEASE_INTERNAL)
bool forceDecompressedOutput = false;
Expand All @@ -76,6 +77,11 @@ class VpUserFeatureControl
bool enableSFCLinearOutputByTileConvert = false;
};

uint32_t Is3DLutKernelOnly()
{
return m_ctrlVal.is3DLutKernelOnly;
}

#if (_DEBUG || _RELEASE_INTERNAL)
bool IsForceDecompressedOutput()
{
Expand Down
1 change: 1 addition & 0 deletions media_softlet/agnostic/common/vp/hal/utils/vp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ class Trace
#define __VPHAL_HDR_ENABLE_KERNEL_DUMP "VPHAL HDR Enable Kernel Dump"
#define __VPHAL_HDR_H2S_RGB_TM "VPHAL H2S TM RGB Based"
#define __VPHAL_HDR_3DLUT_CPU_PATH "HDR 3DLut Table Use CPU Caculate"
#define __VPHAL_FORCE_VP_3DLUT_KERNEL_ONLY "Force VP 3DLut Kernel Only"

// Compression
#define __VPHAL_MMC_ENABLE "VP MMC In Use"
Expand Down

0 comments on commit 3edea6f

Please sign in to comment.