1 /* 2 * Copyright (c) 2022-2023, 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 //! \file vp_common_tools.h 24 //! \brief vphal tools interface clarification 25 //! \details vphal tools interface clarification inlcuding: 26 //! some marcro, enum, structure, function 27 //! 28 #ifndef __VP_COMMON_TOOLS_H__ 29 #define __VP_COMMON_TOOLS_H__ 30 31 // max size of status table, this value must be power of 2 such as 256, 512, 1024, etc. 32 // so VPHAL_STATUS_TABLE_MAX_SIZE-1 can form a one-filled mask to wind back a VPHAL_STATUS_TABLE ring table. 33 #define VPHAL_STATUS_TABLE_MAX_SIZE 512 34 35 //! 36 //! Structure VPHAL_STATUS_ENTRY 37 //! \brief Pre-Processing - Query status struct 38 //! 39 typedef struct _VPHAL_STATUS_ENTRY 40 { 41 uint32_t StatusFeedBackID; 42 MOS_GPU_CONTEXT GpuContextOrdinal; 43 uint32_t dwTag; // software tag, updated by driver for every command submit. 44 uint32_t dwStatus; // 0:OK; 1:Not Ready; 2:Not Available; 3:Error; 45 uint16_t streamIndex; // stream index corresponding to the gpucontext 46 bool isStreamIndexSet; 47 } VPHAL_STATUS_ENTRY, *PVPHAL_STATUS_ENTRY; 48 49 //! 50 //! \brief Structure to VPHAL Status table 51 //! 52 typedef struct _VPHAL_STATUS_TABLE 53 { 54 VPHAL_STATUS_ENTRY aTableEntries[VPHAL_STATUS_TABLE_MAX_SIZE]; 55 uint32_t uiHead; 56 uint32_t uiCurrent; 57 } VPHAL_STATUS_TABLE, *PVPHAL_STATUS_TABLE; 58 59 //! 60 //! Structure STATUS_TABLE_UPDATE_PARAMS 61 //! \brief Pre-Processing - params for updating status report table 62 //! 63 typedef struct _STATUS_TABLE_UPDATE_PARAMS 64 { 65 bool bReportStatus; 66 bool bSurfIsRenderTarget; 67 PVPHAL_STATUS_TABLE pStatusTable; 68 uint32_t StatusFeedBackID; 69 #if (_DEBUG || _RELEASE_INTERNAL) 70 bool bTriggerGPUHang; 71 #endif 72 bool bUpdateStreamIndex; 73 } STATUS_TABLE_UPDATE_PARAMS, *PSTATUS_TABLE_UPDATE_PARAMS; 74 75 //! 76 //! \brief Structure to query status params from application 77 //! be noted that the structure is defined by app (msdk) so we cannot reorder its entries or size 78 //! 79 typedef struct _QUERY_STATUS_REPORT_APP 80 { 81 uint32_t StatusFeedBackID; 82 uint32_t dwStatus : 8; //!< 0: OK; 1: Not Ready; 2: Not Available; 3: Error; 83 uint32_t : 24; //!< Reserved 84 uint32_t dwReserved[4]; //!< keep this to align what application (msdk lib) defined 85 } QUERY_STATUS_REPORT_APP, *PQUERY_STATUS_REPORT_APP; 86 87 //! 88 //! \brief VPreP status 89 //! 90 typedef enum _VPREP_STATUS 91 { 92 VPREP_OK = 0, 93 VPREP_NOTREADY = 1, 94 VPREP_NOTAVAILABLE = 2, 95 VPREP_ERROR = 3 96 } VPREP_STATUS; 97 98 //! 99 //! \brief Internal Override/Reporting Video Processing Configuration Values 100 //! 101 typedef struct _VP_CONFIG 102 { 103 bool featureReportInitialized; // feature report has been initialized 104 bool bVpComponentReported; // Vp Component has been reported 105 uint32_t dwVpPath; // Video Processing path 106 uint32_t dwVpComponent; // Video Processing Component 107 uint32_t dwCreatedDeinterlaceMode; // Created Deinterlace mode 108 uint32_t dwCurrentDeinterlaceMode; // Current Deinterlace mode 109 uint32_t dwReportedDeinterlaceMode; // Reported Deinterlace mode 110 uint32_t dwCreatedScalingMode; // Created Scaling mode 111 uint32_t dwCurrentScalingMode; // Current Scaling mode 112 uint32_t dwReportedScalingMode; // Reported Scaling mode 113 uint32_t dwReportedFastCopyMode; // Reported FastCopy mode 114 uint32_t dwCurrentXVYCCState; // Current xvYCC State 115 uint32_t dwReportedXVYCCState; // Reported xvYCC state 116 uint32_t dwCurrentOutputPipeMode; // Current Output Pipe Mode 117 uint32_t dwReportedOutputPipeMode; // Reported Ouput Pipe Mode 118 uint32_t dwCurrentVEFeatureInUse; // Current VEFeatureInUse 119 uint32_t dwReportedVEFeatureInUse; // Reported VEFeatureInUse 120 uint32_t dwCurrentFrcMode; // Current Frame Rate Conversion Mode 121 uint32_t dwReportedFrcMode; // Reported Frame Rate Conversion Mode 122 uint32_t dwVPMMCInUse; // Memory compression enable flag 123 uint32_t dwVPMMCInUseReported; // Reported Memory compression enable flag 124 uint32_t dwRTCompressible; // RT MMC Compressible flag 125 uint32_t dwRTCompressibleReported; // RT MMC Reported compressible flag 126 uint32_t dwRTCompressMode; // RT MMC Compression Mode 127 uint32_t dwRTCompressModeReported; // RT MMC Reported Compression Mode 128 uint32_t dwRTCacheSetting; // RT cache usage 129 uint32_t dwRTCacheSettingReported; // RT cache Reported usage 130 #if (_DEBUG || _RELEASE_INTERNAL) 131 uint32_t dwRTOldCacheSetting; 132 uint32_t dwRTOldCacheSettingReported; 133 #endif 134 uint32_t dwFFDICompressible; // FFDI Compressible flag 135 uint32_t dwFFDICompressMode; // FFDI Compression mode 136 uint32_t dwFFDNCompressible; // FFDN Compressible flag 137 uint32_t dwFFDNCompressMode; // FFDN Compression mode 138 uint32_t dwSTMMCompressible; // STMM Compressible flag 139 uint32_t dwSTMMCompressMode; // STMM Compression mode 140 uint32_t dwScalerCompressible; // Scaler Compressible flag for Gen10 141 uint32_t dwScalerCompressMode; // Scaler Compression mode for Gen10 142 uint32_t dwPrimaryCompressible; // Input Primary Surface Compressible flag 143 uint32_t dwPrimaryCompressMode; // Input Primary Surface Compression mode 144 uint32_t dwFFDICompressibleReported; // FFDI Reported Compressible flag 145 uint32_t dwFFDICompressModeReported; // FFDI Reported Compression mode 146 uint32_t dwFFDNCompressibleReported; // FFDN Reported Compressible flag 147 uint32_t dwFFDNCompressModeReported; // FFDN Reported Compression mode 148 uint32_t dwSTMMCompressibleReported; // STMM Reported Compressible flag 149 uint32_t dwSTMMCompressModeReported; // STMM Reported Compression mode 150 uint32_t dwScalerCompressibleReported; // Scaler Reported Compressible flag for Gen10 151 uint32_t dwScalerCompressModeReported; // Scaler Reported Compression mode for Gen10 152 uint32_t dwPrimaryCompressibleReported; // Input Primary Surface Reported Compressible flag 153 uint32_t dwPrimaryCompressModeReported; // Input Primary Surface Reported Compression mode 154 uint32_t dwCapturePipeInUse; // Capture pipe 155 uint32_t dwCapturePipeInUseReported; // Reported Capture pipe 156 uint32_t dwCurrentCompositionMode; // In Place or Legacy Composition 157 uint32_t dwReportedCompositionMode; // Reported Composition Mode 158 uint32_t dwCurrentHdrMode; // Current Hdr Mode 159 uint32_t dwReportedHdrMode; // Reported Hdr Mode 160 uint32_t dwCurrentScdMode; // Current Scd Mode 161 uint32_t dwReportedScdMode; // Reported Scd Mode 162 uint32_t dwTCCPreprocessInUse; // Vebox TCC Pre-process for HDR 163 uint32_t dwTCCPreprocessInUseReported; // Reported Vebox TCC Pre-process for HDR 164 uint32_t dwIEFPreprocessInUse; // Vebox IEF Pre-process for HDR 165 uint32_t dwIEFPreprocessInUseReported; // Reported Vebox IEF Pre-process for HDR 166 bool bAdvancedScalingInUse; // Advanced Scaling Enabled 167 bool bAdvancedScalingInUseReported; // Reported Advanced Scaling Enabled 168 bool isPacketReused; // true if vp packet reused. 169 bool isPacketReusedReported; // Reported vp packet reused. 170 bool isDnEnabled; // true if vp Dn enabled. 171 bool isDnEnabledReported; // Reported vp Dn reported 172 uint32_t dwCurrentVeboxScalability; // Current Vebox Scalability 173 uint32_t dwReportedVeboxScalability; // Reported Vebox Scalability 174 uint32_t dwCurrentVPApogeios; // Current VP Apogieos 175 uint32_t dwReportedVPApogeios; // Reported VP Apogieos 176 uint32_t dwCurrentSFCLinearOutputByTileConvert; // Current enableSFCLinearOutputByTileConvert 177 uint32_t dwReportedSFCLinearOutputByTileConvert; // Reported enableSFCLinearOutputByTileConvert 178 179 // Configurations for cache control 180 uint32_t dwDndiReferenceBuffer; 181 uint32_t dwDndiOutputBuffer; 182 uint32_t dwIecpOutputBuffer; 183 uint32_t dwDnOutputBuffer; 184 uint32_t dwStmmBuffer; 185 uint32_t dwPhase2RenderTarget; 186 uint32_t dwPhase2Source; 187 uint32_t dwPhase1Source; 188 189 // For Deinterlace Mode - the flags reflect the content size and SKU, 190 // should not be changed after initialized. 191 bool bFFDI; 192 193 //Debug enhancement to force color fill 194 //FALSE(0): no force color fill, TRUE(1): force color fill with default color, 195 //ELSE(other non-zero value): force color fill with color info from dwForceColorFill 196 uint32_t dwForceColorFill; 197 198 //VEBOX perf is not enough for 8K@60fps processing 199 //add config to switch 8K resolution on VEBOX or render 200 //default is use render for 8k 201 uint32_t dwUseVeboxFor8K; 202 203 // Optimize Cpu timing for VEBOX/SFC 204 bool bOptimizeCpuTiming; 205 206 // Output Regkey for whitelist 207 bool bOutputRegkey; 208 } VP_CONFIG, *PVP_CONFIG; 209 210 //! 211 //! \brief status query param 212 //! 213 typedef struct _VPHAL_STATUS_PARAM 214 { 215 uint32_t FrameId; 216 VPREP_STATUS BltStatus; 217 } VPHAL_STATUS_PARAM, *PVPHAL_STATUS_PARAM; 218 219 //! 220 //! Structure VPHAL_QUERYVARIANCE_PARAMS 221 //! \brief Query Variance Parameters 222 //! 223 typedef struct _VPHAL_QUERYVARIANCE_PARAMS 224 { 225 uint32_t dwFrameNumber; 226 void* pVariances; 227 } VPHAL_QUERYVARIANCE_PARAMS, *PVPHAL_QUERYVARIANCE_PARAMS; 228 229 //! 230 //! \brief Query Multiple Variance Parameters 231 //! 232 typedef struct _VPHAL_BATCHQUERYVARIANCE_PARAMS 233 { 234 uint32_t FrameCount; 235 uint32_t BufferSize; 236 void *pBuffer; 237 } VPHAL_BATCHQUERYVARIANCE_PARAMS, *PVPHAL_BATCHQUERYVARIANCE_PARAMS; 238 239 240 #endif // __VP_COMMON_TOOLS_H__ 241