| 1 |
/* |
| 2 |
* Copyright (c) 2021, Intel Corporation |
| 3 |
* |
| 4 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 5 |
* copy of this software and associated documentation files (the "Software"), |
| 6 |
* to deal in the Software without restriction, including without limitation |
| 7 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 |
* and/or sell copies of the Software, and to permit persons to whom the |
| 9 |
* Software is furnished to do so, subject to the following conditions: |
| 10 |
* |
| 11 |
* The above copyright notice and this permission notice shall be included |
| 12 |
* in all copies or substantial portions of the Software. |
| 13 |
* |
| 14 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 |
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 |
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 |
* OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
*/ |
| 22 |
|
| 23 |
//! |
| 24 |
//! \file vp_user_feature_control.h |
| 25 |
//! \brief vp user feature control. |
| 26 |
//! |
| 27 |
#ifndef __VP_USER_FEATURE_CONTROL_H__ |
| 28 |
#define __VP_USER_FEATURE_CONTROL_H__ |
| 29 |
|
| 30 |
#include "mos_os.h" |
| 31 |
#include "vp_pipeline_common.h" |
| 32 |
#include "vp_platform_interface.h" |
| 33 |
|
| 34 |
namespace vp |
| 35 |
{ |
| 36 |
|
| 37 |
class VpUserFeatureControl |
| 38 |
{ |
| 39 |
|
| 40 |
public: |
| 41 |
VpUserFeatureControl(MOS_INTERFACE &osInterface, VpPlatformInterface *vpPlatformInterface, void *owner = nullptr); |
| 42 |
virtual ~VpUserFeatureControl(); |
| 43 |
|
| 44 |
struct CONTROL_VALUES |
| 45 |
{ |
| 46 |
// Control values |
| 47 |
bool disableVeboxOutput = false; // If true (VPHAL_COMP_BYPASS_DISABLED), output from vebox directly is not allowed, otherwise, output from vebox is allowed. |
| 48 |
bool disableSfc = false; |
| 49 |
bool computeContextEnabled = true; |
| 50 |
bool eufusionBypassWaEnabled = false; |
| 51 |
bool disableDn = false; |
| 52 |
bool cscCosffPatchModeDisabled = false; |
| 53 |
bool ForceEnableVeboxOutputSurf = false; |
| 54 |
bool veboxTypeH = false; |
| 55 |
bool is3DLutKernelOnly = false; |
| 56 |
|
| 57 |
#if (_DEBUG || _RELEASE_INTERNAL) |
| 58 |
bool forceDecompressedOutput = false; |
| 59 |
uint32_t force3DLutInterpolation = 0; |
| 60 |
uint32_t enabledSFCNv12P010LinearOutput = 0; |
| 61 |
uint32_t enabledSFCRGBPRGB24Output = 0; |
| 62 |
bool enableIFNCC = false; |
| 63 |
bool enable3DLutNewLayout = false; // Enable 3DLUT new layout feature |
| 64 |
std::string lut3DFilePath = ""; // File path for 3DLUT data |
| 65 |
#endif |
| 66 |
VP_CTRL enableOcl3DLut = VP_CTRL_DEFAULT; |
| 67 |
VP_CTRL forceOclFC = VP_CTRL_DEFAULT; |
| 68 |
bool bDisableOclFcFp = false; |
| 69 |
|
| 70 |
bool disablePacketReuse = false; |
| 71 |
bool enablePacketReuseTeamsAlways = false; |
| 72 |
|
| 73 |
VPHAL_HDR_LUT_MODE globalLutMode = VPHAL_HDR_LUT_MODE_NONE; //!< Global LUT mode control for debugging purpose |
| 74 |
bool gpuGenerate3DLUT = false; //!< Flag for per frame GPU generation of 3DLUT |
| 75 |
bool isExternal3DLutSupport = true; |
| 76 |
bool disableAutoMode = false; |
| 77 |
bool clearVideoViewMode = false; |
| 78 |
uint32_t splitFramePortions = 1; |
| 79 |
bool decompForInterlacedSurfWaEnabled = false; |
| 80 |
bool enableSFCLinearOutputByTileConvert = false; |
| 81 |
bool fallbackScalingToRender8K = false; |
| 82 |
uint64_t hybridMgrSubmitMode = 0; |
| 83 |
}; |
| 84 |
|
| 85 |
uint32_t Is3DLutKernelOnly() |
| 86 |
{ |
| 87 |
return m_ctrlVal.is3DLutKernelOnly; |
| 88 |
} |
| 89 |
|
| 90 |
#if (_DEBUG || _RELEASE_INTERNAL) |
| 91 |
bool IsForceDecompressedOutput() |
| 92 |
{ |
| 93 |
return m_ctrlVal.forceDecompressedOutput; |
| 94 |
} |
| 95 |
|
| 96 |
uint32_t Force3DLutInterpolation() |
| 97 |
{ |
| 98 |
return m_ctrlVal.force3DLutInterpolation; |
| 99 |
} |
| 100 |
|
| 101 |
uint32_t EnabledSFCNv12P010LinearOutput() |
| 102 |
{ |
| 103 |
return m_ctrlVal.enabledSFCNv12P010LinearOutput; |
| 104 |
} |
| 105 |
|
| 106 |
uint32_t EnabledSFCRGBPRGB24Output() |
| 107 |
{ |
| 108 |
return m_ctrlVal.enabledSFCRGBPRGB24Output; |
| 109 |
} |
| 110 |
|
| 111 |
bool EnableIFNCC() |
| 112 |
{ |
| 113 |
return m_ctrlVal.enableIFNCC; |
| 114 |
} |
| 115 |
|
| 116 |
bool DisableOclFcFp() |
| 117 |
{ |
| 118 |
return m_ctrlVal.bDisableOclFcFp; |
| 119 |
} |
| 120 |
bool Is3DLutNewLayoutEnabled() |
| 121 |
{ |
| 122 |
return m_ctrlVal.enable3DLutNewLayout; |
| 123 |
} |
| 124 |
|
| 125 |
std::string Get3DLutFilePath() |
| 126 |
{ |
| 127 |
return m_ctrlVal.lut3DFilePath; |
| 128 |
} |
| 129 |
#endif |
| 130 |
|
| 131 |
bool IsSFCLinearOutputByTileConvertEnabled() |
| 132 |
{ |
| 133 |
return m_ctrlVal.enableSFCLinearOutputByTileConvert; |
| 134 |
} |
| 135 |
|
| 136 |
virtual MOS_STATUS CreateUserSettingForDebug(); |
| 137 |
|
| 138 |
virtual MOS_STATUS Update(PVP_PIPELINE_PARAMS params); |
| 139 |
|
| 140 |
virtual MOS_STATUS UpdateOnNewPipe(SwFilterPipe *swFilterPipe, uint32_t pipeCnt); |
| 141 |
|
| 142 |
bool EnableOclFC(); |
| 143 |
|
| 144 |
bool EnableOcl3DLut(); |
| 145 |
|
| 146 |
bool IsVeboxOutputSurfEnabled() |
| 147 |
{ |
| 148 |
return m_ctrlVal.ForceEnableVeboxOutputSurf; |
| 149 |
} |
| 150 |
|
| 151 |
bool IsVeboxOutputDisabled() |
| 152 |
{ |
| 153 |
return m_ctrlVal.disableVeboxOutput; |
| 154 |
} |
| 155 |
|
| 156 |
bool IsSfcDisabled() |
| 157 |
{ |
| 158 |
return m_ctrlVal.disableSfc; |
| 159 |
} |
| 160 |
|
| 161 |
bool IsComputeContextEnabled() |
| 162 |
{ |
| 163 |
return m_ctrlVal.computeContextEnabled; |
| 164 |
} |
| 165 |
|
| 166 |
bool IsEufusionBypassWaEnabled() |
| 167 |
{ |
| 168 |
return m_ctrlVal.eufusionBypassWaEnabled; |
| 169 |
} |
| 170 |
|
| 171 |
bool IsDisableDn() |
| 172 |
{ |
| 173 |
return m_ctrlVal.disableDn; |
| 174 |
} |
| 175 |
|
| 176 |
bool IsCscCosffPatchModeDisabled() |
| 177 |
{ |
| 178 |
return m_ctrlVal.cscCosffPatchModeDisabled; |
| 179 |
} |
| 180 |
|
| 181 |
bool IsPacketReuseDisabled() |
| 182 |
{ |
| 183 |
return m_ctrlVal.disablePacketReuse; |
| 184 |
} |
| 185 |
|
| 186 |
bool IsPacketReuseEnabledTeamsAlways() |
| 187 |
{ |
| 188 |
return m_ctrlVal.enablePacketReuseTeamsAlways; |
| 189 |
} |
| 190 |
|
| 191 |
uint32_t GetGlobalLutMode() |
| 192 |
{ |
| 193 |
return m_ctrlVal.globalLutMode; |
| 194 |
} |
| 195 |
|
| 196 |
bool IsGpuGenerate3DLUT() |
| 197 |
{ |
| 198 |
return m_ctrlVal.gpuGenerate3DLUT; |
| 199 |
} |
| 200 |
|
| 201 |
bool IsExternal3DLutSupport() |
| 202 |
{ |
| 203 |
return m_ctrlVal.isExternal3DLutSupport; |
| 204 |
} |
| 205 |
|
| 206 |
bool IsDisableAutoMode() |
| 207 |
{ |
| 208 |
return m_ctrlVal.disableAutoMode; |
| 209 |
} |
| 210 |
|
| 211 |
bool IsClearVideoViewMode() |
| 212 |
{ |
| 213 |
return m_ctrlVal.clearVideoViewMode; |
| 214 |
} |
| 215 |
|
| 216 |
bool IsDecompForInterlacedSurfWaEnabled() |
| 217 |
{ |
| 218 |
return m_ctrlVal.decompForInterlacedSurfWaEnabled; |
| 219 |
} |
| 220 |
|
| 221 |
bool IsVeboxTypeHMode() |
| 222 |
{ |
| 223 |
return m_ctrlVal.veboxTypeH; |
| 224 |
} |
| 225 |
|
| 226 |
bool IsFallbackScalingToRender8K() |
| 227 |
{ |
| 228 |
return m_ctrlVal.fallbackScalingToRender8K; |
| 229 |
} |
| 230 |
|
| 231 |
MOS_STATUS SetClearVideoViewMode(bool mode) |
| 232 |
{ |
| 233 |
m_ctrlVal.clearVideoViewMode = mode; |
| 234 |
return MOS_STATUS_SUCCESS; |
| 235 |
} |
| 236 |
|
| 237 |
uint32_t GetSplitFramePortions() |
| 238 |
{ |
| 239 |
return m_ctrlVal.splitFramePortions; |
| 240 |
} |
| 241 |
|
| 242 |
uint64_t GetHybridMgrSubmitMode() |
| 243 |
{ |
| 244 |
return m_ctrlVal.hybridMgrSubmitMode; |
| 245 |
} |
| 246 |
|
| 247 |
MOS_STATUS ForceRenderPath(bool status) |
| 248 |
{ |
| 249 |
m_ctrlVal.disableSfc = status; |
| 250 |
m_ctrlVal.disableVeboxOutput = status; |
| 251 |
m_ctrlValDefault.disableSfc = status; |
| 252 |
m_ctrlValDefault.disableVeboxOutput = status; |
| 253 |
|
| 254 |
return MOS_STATUS_SUCCESS; |
| 255 |
} |
| 256 |
|
| 257 |
virtual PMOS_OCA_LOG_USER_FEATURE_CONTROL_INFO GetOcaFeautreControlInfo(); |
| 258 |
|
| 259 |
const void *m_owner = nullptr; // The object who create current instance. |
| 260 |
|
| 261 |
protected: |
| 262 |
PMOS_INTERFACE m_osInterface = nullptr; |
| 263 |
VpPlatformInterface *m_vpPlatformInterface = nullptr; |
| 264 |
|
| 265 |
CONTROL_VALUES m_ctrlValDefault = {}; |
| 266 |
CONTROL_VALUES m_ctrlVal = {}; |
| 267 |
MediaUserSettingSharedPtr m_userSettingPtr = nullptr; //!< usersettingInstance |
| 268 |
PMOS_OCA_LOG_USER_FEATURE_CONTROL_INFO m_pOcaFeatureControlInfo = nullptr; |
| 269 |
|
| 270 |
MEDIA_CLASS_DEFINE_END(vp__VpUserFeatureControl) |
| 271 |
}; |
| 272 |
|
| 273 |
|
| 274 |
} |
| 275 |
#endif // !__VP_USER_FEATURE_CONTROL_H__ |