| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
#ifndef __VP_PIPELINE_COMMON_H__ |
| 28 |
#define __VP_PIPELINE_COMMON_H__ |
| 29 |
|
| 30 |
#include "mos_utilities.h" |
| 31 |
#include "vp_common.h" |
| 32 |
#include "renderhal.h" |
| 33 |
#include "vp_base.h" |
| 34 |
|
| 35 |
namespace vp |
| 36 |
{ |
| 37 |
class VpPlatformInterface; |
| 38 |
class VpUserFeatureControl; |
| 39 |
} |
| 40 |
|
| 41 |
using VP_PIPELINE_PARAMS = VPHAL_RENDER_PARAMS; |
| 42 |
using PVP_PIPELINE_PARAMS = VPHAL_RENDER_PARAMS*; |
| 43 |
using PCVP_PIPELINE_PARAMS = const VPHAL_RENDER_PARAMS*; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
#define VP_VEBOX_FLAG_ENABLE_KERNEL_COPY 0x00000001 |
| 49 |
#define VP_VEBOX_FLAG_ENABLE_KERNEL_COPY_DEBUG 0x00000002 |
| 50 |
#define VP_VEBOX_FLAG_ENABLE_KERNEL_DN_UPDATE 0x00000004 |
| 51 |
#define VP_VEBOX_FLAG_ENABLE_KERNEL_DN_UPDATE_DEBUG 0x00000008 |
| 52 |
#define VP_VEBOX_FLAG_ENABLE_KERNEL_FMD_SUMMATION 0x00000010 |
| 53 |
|
| 54 |
#define RESOURCE_ASSIGNMENT_HINT_BITS_DI \ |
| 55 |
uint32_t bDi : 1; \ |
| 56 |
uint32_t b60fpsDi : 1; |
| 57 |
|
| 58 |
#define RESOURCE_ASSIGNMENT_HINT_BITS_SCALING \ |
| 59 |
uint32_t isIScalingTypeNone : 1; \ |
| 60 |
uint32_t isFieldWeaving : 1; |
| 61 |
|
| 62 |
#define RESOURCE_ASSIGNMENT_HINT_BITS_HDR \ |
| 63 |
uint32_t is3DLut2DNeeded : 1; |
| 64 |
|
| 65 |
#define RESOURCE_ASSIGNMENT_HINT_BITS_DENOISE \ |
| 66 |
uint32_t isHVSTableNeeded : 1; |
| 67 |
|
| 68 |
#define RESOURCE_ASSIGNMENT_HINT_BITS_STD_ALONE \ |
| 69 |
uint32_t isSkinScoreDumpNeededForSTDonly : 1; \ |
| 70 |
uint32_t isSkinScoreOutputNeededForSTDOnly : 1; |
| 71 |
|
| 72 |
#define RESOURCE_ASSIGNMENT_HINT_BITS \ |
| 73 |
RESOURCE_ASSIGNMENT_HINT_BITS_DI \ |
| 74 |
RESOURCE_ASSIGNMENT_HINT_BITS_SCALING \ |
| 75 |
RESOURCE_ASSIGNMENT_HINT_BITS_HDR \ |
| 76 |
RESOURCE_ASSIGNMENT_HINT_BITS_DENOISE \ |
| 77 |
RESOURCE_ASSIGNMENT_HINT_BITS_STD_ALONE |
| 78 |
|
| 79 |
#define RESOURCE_ASSIGNMENT_HINT_SIZE 4 |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
typedef enum _VPHAL_COMP_BYPASS_MODE |
| 85 |
{ |
| 86 |
VPHAL_COMP_BYPASS_NOT_SET = 0xffffffff, |
| 87 |
VPHAL_COMP_BYPASS_DISABLED = 0x0, |
| 88 |
VPHAL_COMP_BYPASS_ENABLED = 0x1, |
| 89 |
VPHAL_COMP_BYPASS_DEFAULT = 0x2 |
| 90 |
} VPHAL_COMP_BYPASS_MODE, *PVPHAL_COMP_BYPASS_MODE; |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
typedef enum _VP_CTRL |
| 96 |
{ |
| 97 |
VP_CTRL_DISABLE = 0, |
| 98 |
VP_CTRL_ENABLE, |
| 99 |
VP_CTRL_DEFAULT |
| 100 |
} VP_CTRL; |
| 101 |
|
| 102 |
struct VP_SURFACE |
| 103 |
{ |
| 104 |
MOS_SURFACE *osSurface = nullptr; |
| 105 |
bool isResourceOwner = false; |
| 106 |
VPHAL_CSPACE ColorSpace = CSpace_None; |
| 107 |
uint32_t ChromaSiting = 0; |
| 108 |
|
| 109 |
bool bQueryVariance = false; |
| 110 |
int32_t FrameID = 0; |
| 111 |
bool ExtendedGamut = false; |
| 112 |
VPHAL_PALETTE Palette = {}; |
| 113 |
VPHAL_SURFACE_TYPE SurfType = SURF_NONE; |
| 114 |
uint32_t uFwdRefCount = 0; |
| 115 |
uint32_t uBwdRefCount = 0; |
| 116 |
VPHAL_SURFACE *pFwdRef = nullptr; |
| 117 |
VPHAL_SURFACE *pBwdRef = nullptr; |
| 118 |
VPHAL_SAMPLE_TYPE SampleType = SAMPLE_PROGRESSIVE; |
| 119 |
|
| 120 |
RECT rcSrc = {0, 0, 0, 0}; |
| 121 |
RECT rcDst = {0, 0, 0, 0}; |
| 122 |
RECT rcMaxSrc = {0, 0, 0, 0}; |
| 123 |
bool bVEBOXCroppingUsed = false; |
| 124 |
uint32_t bufferWidth = 0; |
| 125 |
uint32_t bufferHeight = 0; |
| 126 |
|
| 127 |
|
| 128 |
void *zeNpuHostMem = nullptr; |
| 129 |
|
| 130 |
|
| 131 |
bool IsEmpty(); |
| 132 |
|
| 133 |
MOS_STATUS Clean(); |
| 134 |
|
| 135 |
|
| 136 |
uint64_t GetAllocationHandle(MOS_INTERFACE *osIntf); |
| 137 |
}; |
| 138 |
|
| 139 |
struct _VP_SETTINGS |
| 140 |
{ |
| 141 |
|
| 142 |
uint32_t disableDnDi = 0; |
| 143 |
uint32_t kernelUpdate = 0; |
| 144 |
uint32_t disableHdr = 0; |
| 145 |
uint32_t veboxParallelExecution = 0; |
| 146 |
bool clearVideoViewMode = 0; |
| 147 |
}; |
| 148 |
|
| 149 |
using VP_SETTINGS = _VP_SETTINGS; |
| 150 |
|
| 151 |
|
| 152 |
struct _VP_EXECUTE_CAPS |
| 153 |
{ |
| 154 |
union { |
| 155 |
struct { |
| 156 |
uint64_t bVebox : 1; |
| 157 |
uint64_t bSFC : 1; |
| 158 |
uint64_t bRender : 1; |
| 159 |
uint64_t bNpu : 1; |
| 160 |
uint64_t bSecureVebox : 1; |
| 161 |
uint64_t bRenderHdr : 1; |
| 162 |
|
| 163 |
uint64_t bOutputPipeFeatureInuse : 1; |
| 164 |
uint64_t bForceCscToRender : 1; |
| 165 |
uint64_t bForceProcampToRender : 1; |
| 166 |
uint64_t lastSubmission : 1; |
| 167 |
uint64_t bTemperalInputInuse : 1; |
| 168 |
|
| 169 |
|
| 170 |
uint64_t bDN : 1; |
| 171 |
uint64_t bDI : 1; |
| 172 |
uint64_t bDiProcess2ndField : 1; |
| 173 |
uint64_t bDIFmdKernel : 1; |
| 174 |
uint64_t bIECP : 1; |
| 175 |
uint64_t bSTE : 1; |
| 176 |
uint64_t bACE : 1; |
| 177 |
uint64_t bTCC : 1; |
| 178 |
uint64_t bCGC : 1; |
| 179 |
uint64_t bBt2020ToRGB : 1; |
| 180 |
uint64_t bProcamp : 1; |
| 181 |
uint64_t bBeCSC : 1; |
| 182 |
uint64_t bFeCSC : 1; |
| 183 |
uint64_t bLACE : 1; |
| 184 |
uint64_t bQueryVariance : 1; |
| 185 |
uint64_t bRefValid : 1; |
| 186 |
uint64_t bSTD : 1; |
| 187 |
uint64_t bDnKernelUpdate: 1; |
| 188 |
uint64_t bVeboxSecureCopy : 1; |
| 189 |
uint64_t bHDR3DLUT : 1; |
| 190 |
uint64_t bH2S : 1; |
| 191 |
uint64_t b1K1DLutInited : 1; |
| 192 |
uint64_t bDV : 1; |
| 193 |
uint64_t b3DlutOutput : 1; |
| 194 |
uint64_t bHdr33lutsize : 1; |
| 195 |
uint64_t bLutCompound : 1; |
| 196 |
uint64_t bCappipe : 1; |
| 197 |
uint64_t bLgca : 1; |
| 198 |
uint64_t bFDFB : 1; |
| 199 |
uint64_t bColorBalance : 1; |
| 200 |
uint64_t b1K1DLutInUse : 1; |
| 201 |
uint64_t bCcmCsc : 1; |
| 202 |
uint64_t bDemosaicInUse : 1; |
| 203 |
uint64_t enableSFCLinearOutputByTileConvert : 1; |
| 204 |
|
| 205 |
|
| 206 |
uint64_t bSfcCsc : 1; |
| 207 |
uint64_t bSfcRotMir : 1; |
| 208 |
uint64_t bSfcScaling : 1; |
| 209 |
uint64_t bSfcIef : 1; |
| 210 |
uint64_t b1stPassOfSfc2PassScaling : 1; |
| 211 |
|
| 212 |
|
| 213 |
uint64_t bComposite : 1; |
| 214 |
uint64_t bSR : 1; |
| 215 |
uint64_t b3DLutCalc : 1; |
| 216 |
uint64_t bHVSCalc : 1; |
| 217 |
uint64_t bSegmentation : 1; |
| 218 |
uint64_t bHdr : 1; |
| 219 |
uint64_t bFallbackLegacyFC : 1; |
| 220 |
uint64_t forceBypassWorkload : 1; |
| 221 |
|
| 222 |
|
| 223 |
uint64_t bAiPath : 1; |
| 224 |
}; |
| 225 |
uint64_t value; |
| 226 |
}; |
| 227 |
}; |
| 228 |
|
| 229 |
C_ASSERT(sizeof(_VP_EXECUTE_CAPS) == sizeof(uint64_t)); |
| 230 |
|
| 231 |
typedef struct _VP_EngineEntry |
| 232 |
{ |
| 233 |
union |
| 234 |
{ |
| 235 |
struct |
| 236 |
{ |
| 237 |
|
| 238 |
uint64_t bEnabled : 1; |
| 239 |
uint64_t SfcNeeded : 1; |
| 240 |
uint64_t VeboxNeeded : 1; |
| 241 |
uint64_t RenderNeeded : 1; |
| 242 |
uint64_t npuNeeded : 1; |
| 243 |
uint64_t hdrKernelNeeded : 1; |
| 244 |
uint64_t fcSupported : 1; |
| 245 |
uint64_t hdrKernelSupported : 1; |
| 246 |
uint64_t isolated : 1; |
| 247 |
uint64_t bt2020ToRGB : 1; |
| 248 |
uint64_t is1K1DLutSurfaceInUse : 1; |
| 249 |
uint64_t isHdr33LutSizeEnabled : 1; |
| 250 |
uint64_t isH2S : 1; |
| 251 |
uint64_t isBayerInputInUse : 1; |
| 252 |
uint64_t frontEndCscNeeded : 1; |
| 253 |
uint64_t forceLegacyFC : 1; |
| 254 |
|
| 255 |
|
| 256 |
uint64_t bypassIfVeboxSfcInUse : 1; |
| 257 |
|
| 258 |
uint64_t forceEnableForSfc : 1; |
| 259 |
uint64_t forceEnableForFc : 1; |
| 260 |
uint64_t forceEnableForHdrKernel : 1; |
| 261 |
uint64_t nonFcFeatureExists : 1; |
| 262 |
uint64_t nonVeboxFeatureExists : 1; |
| 263 |
uint64_t fcOnlyFeatureExists : 1; |
| 264 |
uint64_t multiPassNeeded : 1; |
| 265 |
uint64_t VeboxARGBOut : 1; |
| 266 |
uint64_t VeboxARGB10bitOutput : 1; |
| 267 |
uint64_t VeboxIECPNeeded : 1; |
| 268 |
uint64_t bypassVeboxFeatures : 1; |
| 269 |
uint64_t diProcess2ndField : 1; |
| 270 |
uint64_t sfc2PassScalingNeededX : 1; |
| 271 |
uint64_t sfc2PassScalingNeededY : 1; |
| 272 |
uint64_t usedForNextPass : 1; |
| 273 |
uint64_t sfcNotSupported : 1; |
| 274 |
uint64_t veboxNotSupported : 1; |
| 275 |
uint64_t isOutputPipeNeeded : 1; |
| 276 |
uint64_t sfcOnlyFeatureExists : 1; |
| 277 |
uint64_t bTemperalInputInuse : 1; |
| 278 |
uint64_t outputWithLumaKey : 1; |
| 279 |
uint64_t enableSFCLinearOutputByTileConvert : 1; |
| 280 |
uint64_t forceBypassWorkload : 1; |
| 281 |
}; |
| 282 |
uint64_t value; |
| 283 |
}; |
| 284 |
}VP_EngineEntry; |
| 285 |
|
| 286 |
C_ASSERT(sizeof(_VP_EngineEntry) == sizeof(uint64_t)); |
| 287 |
|
| 288 |
enum _VP_PACKET_ENGINE |
| 289 |
{ |
| 290 |
VP_PACKET_COMP = 0, |
| 291 |
VP_PACKET_VEBOX, |
| 292 |
}; |
| 293 |
|
| 294 |
enum VP_RGB_OUTPUT_OVERRIDE_ID |
| 295 |
{ |
| 296 |
VP_RGB_OUTPUT_OVERRIDE_ID_INVALID = 0, |
| 297 |
VP_RGB_OUTPUT_OVERRIDE_ID_RGBP_LINEAR, |
| 298 |
VP_RGB_OUTPUT_OVERRIDE_ID_RGBP_TILE, |
| 299 |
VP_RGB_OUTPUT_OVERRIDE_ID_RGB24LINEAR, |
| 300 |
VP_RGB_OUTPUT_OVERRIDE_ID_BGRP_LINEAR, |
| 301 |
VP_RGB_OUTPUT_OVERRIDE_ID_BGRP_TILE, |
| 302 |
VP_RGB_OUTPUT_OVERRIDE_ID_MAX, |
| 303 |
}; |
| 304 |
|
| 305 |
typedef enum _VP_COMP_BYPASS_MODE |
| 306 |
{ |
| 307 |
VP_COMP_BYPASS_NOT_SET = 0xffffffff, |
| 308 |
VP_COMP_BYPASS_DISABLED = 0x0, |
| 309 |
VP_COMP_BYPASS_ENABLED = 0x1 |
| 310 |
} VP_COMP_BYPASS_MODE, * PVP_COMP_BYPASS_MODE; |
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
union RESOURCE_ASSIGNMENT_HINT |
| 315 |
{ |
| 316 |
struct |
| 317 |
{ |
| 318 |
RESOURCE_ASSIGNMENT_HINT_BITS; |
| 319 |
}; |
| 320 |
uint32_t value[RESOURCE_ASSIGNMENT_HINT_SIZE]; |
| 321 |
}; |
| 322 |
|
| 323 |
using VP_EXECUTE_CAPS = _VP_EXECUTE_CAPS; |
| 324 |
using VP_PACKET_ENGINE = _VP_PACKET_ENGINE; |
| 325 |
using PVP_SURFACE = VP_SURFACE*; |
| 326 |
|
| 327 |
inline bool IsVeboxFeatureInuse(VP_EXECUTE_CAPS &caps) |
| 328 |
{ |
| 329 |
return (caps.bVebox && (!caps.bSFC || caps.bDN || caps.bDI || caps.bIECP || caps.bSTE || |
| 330 |
caps.bACE || caps.bTCC || caps.bBeCSC || caps.bQueryVariance || caps.bLACE || caps.bSTD || |
| 331 |
caps.bHDR3DLUT || caps.bDV)); |
| 332 |
} |
| 333 |
|
| 334 |
#endif |