| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bvdb_priv.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/16 $ |
|---|
| 12 | * $brcm_Date: 2/9/11 7:31p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * See Module Overview below. |
|---|
| 16 | * |
|---|
| 17 | * Revision History: |
|---|
| 18 | * |
|---|
| 19 | * $brcm_Log: /magnum/commonutils/vdb/35230/A0/bvdb_priv.h $ |
|---|
| 20 | * |
|---|
| 21 | * Hydra_Software_Devel/16 2/9/11 7:31p jerrylim |
|---|
| 22 | * SW35230-3000: Print source mapping table for debug |
|---|
| 23 | * |
|---|
| 24 | * Hydra_Software_Devel/15 2/9/11 4:29p jerrylim |
|---|
| 25 | * SW35230-2843: Added config202 |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/14 12/20/10 3:51p jerrylim |
|---|
| 28 | * SW35230-2613, SW35230-2594: Updated config401 to support high bitrate |
|---|
| 29 | * streams and wider range of window and clipping size |
|---|
| 30 | * |
|---|
| 31 | * Hydra_Software_Devel/13 12/16/10 2:29p jerrylim |
|---|
| 32 | * SW35230-2579: Replaced user mode functions with kernel mode functions |
|---|
| 33 | * |
|---|
| 34 | * Hydra_Software_Devel/12 9/29/10 4:12p jerrylim |
|---|
| 35 | * SW35230-1530: Added dot-by-dot mode |
|---|
| 36 | * |
|---|
| 37 | * Hydra_Software_Devel/11 9/16/10 3:50p jerrylim |
|---|
| 38 | * SW35230-1335: Add config400, 401 |
|---|
| 39 | * |
|---|
| 40 | * Hydra_Software_Devel/10 8/23/10 6:21p jerrylim |
|---|
| 41 | * SW35230-785: Added support for Auto Aspect Ratio Correction |
|---|
| 42 | * |
|---|
| 43 | * Hydra_Software_Devel/9 8/13/10 4:07p jerrylim |
|---|
| 44 | * SW35230-224: Added a get function which returns feature set that each |
|---|
| 45 | * RTS configuration supports |
|---|
| 46 | * |
|---|
| 47 | * Hydra_Software_Devel/8 8/2/10 12:06a jerrylim |
|---|
| 48 | * SW35230-778: Make sure that all MFD formats fall under a predefined |
|---|
| 49 | * source format group |
|---|
| 50 | * |
|---|
| 51 | * Hydra_Software_Devel/7 7/23/10 5:47p jerrylim |
|---|
| 52 | * SW35230-670: CAP bpp with panel reversal compensated |
|---|
| 53 | * |
|---|
| 54 | * Hydra_Software_Devel/6 7/8/10 1:11p jerrylim |
|---|
| 55 | * SW35230-297: Simplified display modes |
|---|
| 56 | * |
|---|
| 57 | * Hydra_Software_Devel/5 7/7/10 9:35a jerrylim |
|---|
| 58 | * SW35230-567: Fixed a coverity error |
|---|
| 59 | * |
|---|
| 60 | * Hydra_Software_Devel/4 7/6/10 4:03p jerrylim |
|---|
| 61 | * SW35230-297: Made usage mode obey VDB |
|---|
| 62 | * |
|---|
| 63 | * Hydra_Software_Devel/3 6/29/10 11:19a jerrylim |
|---|
| 64 | * SW35230-297: cleaned up old design. Corrected VDB dump |
|---|
| 65 | * |
|---|
| 66 | * Hydra_Software_Devel/2 6/23/10 5:54p jerrylim |
|---|
| 67 | * SW35230-309: Added config 200 based on Usage Mode Rev.2.0 |
|---|
| 68 | * |
|---|
| 69 | * Hydra_Software_Devel/1 4/30/10 3:06p jerrylim |
|---|
| 70 | * SW35230-99: Added real VDB files |
|---|
| 71 | * |
|---|
| 72 | ***************************************************************************/ |
|---|
| 73 | |
|---|
| 74 | #ifndef __BVDB_PRIV_H__ |
|---|
| 75 | #define __BVDB_PRIV_H__ |
|---|
| 76 | |
|---|
| 77 | #include "bvdb.h" |
|---|
| 78 | #include "blst_circleq.h" |
|---|
| 79 | |
|---|
| 80 | #ifdef __cplusplus |
|---|
| 81 | extern "C" { |
|---|
| 82 | #endif |
|---|
| 83 | |
|---|
| 84 | #if BDBG_DEBUG_BUILD |
|---|
| 85 | #define BVDB_P_GENERIC_GET_CONTEXT(handle, context, structname) \ |
|---|
| 86 | do { \ |
|---|
| 87 | (context) = (handle); \ |
|---|
| 88 | BDBG_ASSERT(context); \ |
|---|
| 89 | } while(0) |
|---|
| 90 | #else |
|---|
| 91 | #define BVDB_P_GENERIC_GET_CONTEXT(handle, context, structname) \ |
|---|
| 92 | (context) = (handle) |
|---|
| 93 | #endif |
|---|
| 94 | |
|---|
| 95 | #define BVDB_P_GET_CONTEXT(handle, context) \ |
|---|
| 96 | BVDB_P_GENERIC_GET_CONTEXT(handle, context, BVDB_P_Context) |
|---|
| 97 | |
|---|
| 98 | /* helper macros */ |
|---|
| 99 | #define BVDB_P_STRCPY(DSTR, SSTR) \ |
|---|
| 100 | BKNI_Memcpy(DSTR, SSTR, BVDB_MAX_STRLEN) |
|---|
| 101 | |
|---|
| 102 | /* Get the min / max of two numbers */ |
|---|
| 103 | #define BVDB_P_MIN(a, b) (((a) < (b)) ? (a) : (b)) |
|---|
| 104 | #define BVDB_P_MAX(a, b) (((a) > (b)) ? (a) : (b)) |
|---|
| 105 | |
|---|
| 106 | /* constants */ |
|---|
| 107 | #define BVDB_P_NUM_WINDOW_HEAPS 4 /* MAIN(analog), MAIN(digital), PIP, MONITOR */ |
|---|
| 108 | |
|---|
| 109 | /* Client IDs */ |
|---|
| 110 | #define BVDB_P_CLIENT_ID_AUD_AIO 0 |
|---|
| 111 | #define BVDB_P_CLIENT_ID_AVD0_BLK 1 |
|---|
| 112 | #define BVDB_P_CLIENT_ID_AVD0_CABAC 2 |
|---|
| 113 | #define BVDB_P_CLIENT_ID_AVD0_ILA 3 |
|---|
| 114 | #define BVDB_P_CLIENT_ID_AVD0_OLA 4 |
|---|
| 115 | #define BVDB_P_CLIENT_ID_AVD0_SYM 5 |
|---|
| 116 | #define BVDB_P_CLIENT_ID_AVFE_TTX_DECODER 6 |
|---|
| 117 | #define BVDB_P_CLIENT_ID_AVFE_VDEC_MD_RD 7 |
|---|
| 118 | #define BVDB_P_CLIENT_ID_AVFE_VDEC_MD_WR 8 |
|---|
| 119 | #define BVDB_P_CLIENT_ID_AVFE_VDEC_VD_RD 9 |
|---|
| 120 | #define BVDB_P_CLIENT_ID_AVFE_VDEC_VD_WR 10 |
|---|
| 121 | #define BVDB_P_CLIENT_ID_AVFE_VIDBLK_CAP0 11 |
|---|
| 122 | #define BVDB_P_CLIENT_ID_AVFE_VIDBLK_CAP1 12 |
|---|
| 123 | #define BVDB_P_CLIENT_ID_BVN_CAP0 13 |
|---|
| 124 | #define BVDB_P_CLIENT_ID_BVN_CAP1 14 |
|---|
| 125 | #define BVDB_P_CLIENT_ID_BVN_DNR_RW 15 |
|---|
| 126 | #define BVDB_P_CLIENT_ID_BVN_GFD0 16 |
|---|
| 127 | #define BVDB_P_CLIENT_ID_BVN_GFD1 17 |
|---|
| 128 | #define BVDB_P_CLIENT_ID_BVN_MFD1 18 |
|---|
| 129 | #define BVDB_P_CLIENT_ID_BVN_MCVP0_RRC1 19 |
|---|
| 130 | #define BVDB_P_CLIENT_ID_BVN_MCVP0_RWC0 20 |
|---|
| 131 | #define BVDB_P_CLIENT_ID_BVN_MFD0 21 |
|---|
| 132 | #define BVDB_P_CLIENT_ID_BVN_PDP_RD0 23 |
|---|
| 133 | #define BVDB_P_CLIENT_ID_BVN_PDP_WR0 24 |
|---|
| 134 | #define BVDB_P_CLIENT_ID_BVN_RDC 25 |
|---|
| 135 | #define BVDB_P_CLIENT_ID_BVN_VEC_TTXE 26 |
|---|
| 136 | #define BVDB_P_CLIENT_ID_BVN_VFD0 27 |
|---|
| 137 | #define BVDB_P_CLIENT_ID_BVN_VFD1 28 |
|---|
| 138 | #define BVDB_P_CLIENT_ID_CPU 29 |
|---|
| 139 | #define BVDB_P_CLIENT_ID_ENET0 30 |
|---|
| 140 | #define BVDB_P_CLIENT_ID_ENET1 31 |
|---|
| 141 | #define BVDB_P_CLIENT_ID_V3D 32 |
|---|
| 142 | #define BVDB_P_CLIENT_ID_GFX_M2MC0 33 |
|---|
| 143 | #define BVDB_P_CLIENT_ID_GFX_SID 34 |
|---|
| 144 | #define BVDB_P_CLIENT_ID_HIF_PCI 35 |
|---|
| 145 | #define BVDB_P_CLIENT_ID_PCU 36 |
|---|
| 146 | #define BVDB_P_CLIENT_ID_RAAGA 37 |
|---|
| 147 | #define BVDB_P_CLIENT_ID_TDI_READ 40 |
|---|
| 148 | #define BVDB_P_CLIENT_ID_TDI_WR 41 |
|---|
| 149 | #define BVDB_P_CLIENT_ID_USB11 42 |
|---|
| 150 | #define BVDB_P_CLIENT_ID_USB20 43 |
|---|
| 151 | #define BVDB_P_CLIENT_ID_XPT_MEM2MEM 44 |
|---|
| 152 | #define BVDB_P_CLIENT_ID_XPT_RD0 45 |
|---|
| 153 | #define BVDB_P_CLIENT_ID_XPT_RD1 46 |
|---|
| 154 | #define BVDB_P_CLIENT_ID_XPT_RD2 47 |
|---|
| 155 | #define BVDB_P_CLIENT_ID_XPT_WR0 48 |
|---|
| 156 | #define BVDB_P_CLIENT_ID_XPT_WR1 49 |
|---|
| 157 | #define BVDB_P_CLIENT_ID_XPT_WR2 50 |
|---|
| 158 | #define BVDB_P_CLIENT_ID_BVN_PDP_RD1 51 |
|---|
| 159 | #define BVDB_P_CLIENT_ID_BVN_PDP_WR1 52 |
|---|
| 160 | #define BVDB_P_CLIENT_ID_BVN_FRC0_CE 53 |
|---|
| 161 | #define BVDB_P_CLIENT_ID_BVN_FRC0_TRMV 54 |
|---|
| 162 | #define BVDB_P_CLIENT_ID_BVN_FRC0_PROF 55 |
|---|
| 163 | #define BVDB_P_CLIENT_ID_BVN_FRC0_WS2 56 |
|---|
| 164 | #define BVDB_P_CLIENT_ID_BVN_FRC0_WS1B 57 |
|---|
| 165 | #define BVDB_P_CLIENT_ID_BVN_FRC0_WS1 58 |
|---|
| 166 | #define BVDB_P_CLIENT_ID_BVN_FRC0_WS0 59 |
|---|
| 167 | #define BVDB_P_CLIENT_ID_BVN_FRC0_RSM 60 |
|---|
| 168 | #define BVDB_P_CLIENT_ID_BVN_FRC0_RS2 61 |
|---|
| 169 | #define BVDB_P_CLIENT_ID_BVN_FRC0_RS1 62 |
|---|
| 170 | #define BVDB_P_CLIENT_ID_BVN_FRC0_RS0P 63 |
|---|
| 171 | #define BVDB_P_CLIENT_ID_BVN_FRC0_RS0N 64 |
|---|
| 172 | #define BVDB_P_CLIENT_ID_BVN_FRC0_SRD 65 |
|---|
| 173 | #define BVDB_P_CLIENT_ID_BVN_FRC0_RS1B 66 |
|---|
| 174 | #define BVDB_P_CLIENT_ID_BVN_FRC0_WSM 67 |
|---|
| 175 | #define BVDB_P_CLIENT_ID_AVD_PFRI_0 120 |
|---|
| 176 | #define BVDB_P_CLIENT_ID_CPU_CACHE0 124 |
|---|
| 177 | #define BVDB_P_CLIENT_ID_CPU_CACHE1 125 |
|---|
| 178 | #define BVDB_P_CLIENT_ID_MSA 126 |
|---|
| 179 | #define BVDB_P_CLIENT_ID_REFRESH 127 |
|---|
| 180 | |
|---|
| 181 | /* Client's Round Robin Enabled */ |
|---|
| 182 | #define BVDB_P_CLIENT_INFO_RR_EN 0x80 |
|---|
| 183 | |
|---|
| 184 | /*************************************************************************** |
|---|
| 185 | * BVDB_P_Context |
|---|
| 186 | * Head of the doubly-linked list |
|---|
| 187 | ***************************************************************************/ |
|---|
| 188 | typedef struct BVDB_P_Context BVDB_P_Context; |
|---|
| 189 | BLST_CQ_HEAD(BVDB_P_Context, BVDB_UsageMode); |
|---|
| 190 | |
|---|
| 191 | typedef struct |
|---|
| 192 | { |
|---|
| 193 | uint32_t ulConfigId; |
|---|
| 194 | BVDB_Window eWindow; |
|---|
| 195 | BVDB_Input eInput; |
|---|
| 196 | uint32_t ulHeapSize; |
|---|
| 197 | BVDB_Heap_Settings stHeapSettings; |
|---|
| 198 | } BVDB_P_Config_MemAlloc; |
|---|
| 199 | |
|---|
| 200 | |
|---|
| 201 | typedef struct |
|---|
| 202 | { |
|---|
| 203 | uint32_t width; |
|---|
| 204 | uint32_t height; |
|---|
| 205 | bool bProgressive; |
|---|
| 206 | uint32_t frameRate; |
|---|
| 207 | bool b3dSource; |
|---|
| 208 | BVDB_InputFormatGroup eInputFormatGroup; |
|---|
| 209 | } BVDB_P_SourceFormat; |
|---|
| 210 | |
|---|
| 211 | typedef struct |
|---|
| 212 | { |
|---|
| 213 | uint32_t sourceGroup; /* ORed BVDB_SourceGroup */ |
|---|
| 214 | uint32_t minWinWidth; /* all in percent win_size*100/disp_size */ |
|---|
| 215 | uint32_t minWinHeight; |
|---|
| 216 | uint32_t maxWinWidth; |
|---|
| 217 | uint32_t maxWinHeight; |
|---|
| 218 | uint32_t maxClippingWidth; |
|---|
| 219 | uint32_t maxClippingHeight; |
|---|
| 220 | bool bfrc; /* invalid for sub */ |
|---|
| 221 | bool bdnr; /* invalid for sub */ |
|---|
| 222 | bool banr; /* invalid for sub */ |
|---|
| 223 | bool bmad; /* invalid for sub */ |
|---|
| 224 | bool bcap; |
|---|
| 225 | bool b3dcomb; |
|---|
| 226 | uint32_t mc; /* mcvp bpp * 2, invalid for sub */ |
|---|
| 227 | uint32_t c; /* cap/vfd bpp * 2 */ |
|---|
| 228 | uint32_t dc; /* pdp bpp * 2, invalid for sub */ |
|---|
| 229 | uint32_t frcc; /* frc bpp * 2, invalid for sub */ |
|---|
| 230 | BVDB_ScalerCaptureBias eSclCap; |
|---|
| 231 | uint32_t bias; |
|---|
| 232 | } BVDB_P_BvnTopology; |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | typedef struct |
|---|
| 236 | { |
|---|
| 237 | uint32_t id; /* AAAABBBB: AAAA=config#, BBBB=serial# */ |
|---|
| 238 | BVDB_P_DisplayMode eDisplayMode; |
|---|
| 239 | uint32_t ulDisplayModeNum; /* for full0, full1, etc */ |
|---|
| 240 | uint32_t ulMainOutputResolution; |
|---|
| 241 | uint32_t priority; |
|---|
| 242 | BVDB_P_BvnTopology main; |
|---|
| 243 | BVDB_P_BvnTopology sub; |
|---|
| 244 | BVDB_RtsTable * pRtsRegisterTable; /* register table pointer */ |
|---|
| 245 | } BVDB_P_RtsData; |
|---|
| 246 | |
|---|
| 247 | |
|---|
| 248 | typedef struct |
|---|
| 249 | { |
|---|
| 250 | uint32_t ulConfigId; |
|---|
| 251 | uint32_t ulVdbVer; |
|---|
| 252 | BVDB_P_RtsData * pUsageMode; |
|---|
| 253 | uint32_t usageModeNum; |
|---|
| 254 | BVDB_P_RtsData curUsageMode; |
|---|
| 255 | BVDB_Osd eMainOsdResolution; |
|---|
| 256 | BVDB_Osd eVcrOsdResolution; |
|---|
| 257 | struct |
|---|
| 258 | { |
|---|
| 259 | bool bDotByDot; /* true if (cropped) source size == win size */ |
|---|
| 260 | uint32_t winHeight; /* in percentage */ |
|---|
| 261 | uint32_t winWidth; /* in percentage */ |
|---|
| 262 | uint32_t clipHeight;/* in percentage */ |
|---|
| 263 | uint32_t clipWidth; /* in percentage */ |
|---|
| 264 | bool bAutomaticAspectRatioBoxMode; |
|---|
| 265 | } main, sub; |
|---|
| 266 | |
|---|
| 267 | uint32_t panelReversalCompensation; |
|---|
| 268 | |
|---|
| 269 | bool bPipSupport; |
|---|
| 270 | bool bMonitorSupport; |
|---|
| 271 | bool bFrcSupport; |
|---|
| 272 | bool bRtcSupport; |
|---|
| 273 | bool bPanelReversalSupport; |
|---|
| 274 | bool b3dDualPathProcessingSupport; |
|---|
| 275 | |
|---|
| 276 | uint32_t worstPdpBpp; |
|---|
| 277 | |
|---|
| 278 | uint32_t maxPipWinHeight; |
|---|
| 279 | uint32_t maxPipWinWidth; |
|---|
| 280 | } BVDB_P_TContext; |
|---|
| 281 | |
|---|
| 282 | /* Functions */ |
|---|
| 283 | BERR_Code BVDB_P_GetDisplaySize |
|---|
| 284 | ( BVDB_OutputResolution eDispResolution, |
|---|
| 285 | uint32_t *pDispHeight, |
|---|
| 286 | uint32_t *pDispWidth ); |
|---|
| 287 | |
|---|
| 288 | void BVDB_P_GetInputFormatGroupStr |
|---|
| 289 | ( BVDB_InputFormatGroup eInputFmtGrp, |
|---|
| 290 | char *pcStr ); |
|---|
| 291 | |
|---|
| 292 | void BVDB_P_GetDisplayTypeStr |
|---|
| 293 | ( BVDB_DisplayType eDisplay, |
|---|
| 294 | char *pcStr ); |
|---|
| 295 | |
|---|
| 296 | void BVDB_P_GetOutputResolutionStr |
|---|
| 297 | ( BVDB_OutputResolution eResolution, |
|---|
| 298 | char *pcStr ); |
|---|
| 299 | |
|---|
| 300 | void BVDB_P_GetAspectRatioStr |
|---|
| 301 | ( BVDB_AspectRatio eAspectRatio, |
|---|
| 302 | char *pcStr ); |
|---|
| 303 | |
|---|
| 304 | void BVDB_P_GetWindowStr |
|---|
| 305 | ( BVDB_Window eWin, |
|---|
| 306 | char *pcStr ); |
|---|
| 307 | |
|---|
| 308 | void BVDB_P_GetInputStr |
|---|
| 309 | ( BVDB_Input eInput, |
|---|
| 310 | char *pcStr ); |
|---|
| 311 | |
|---|
| 312 | void BVDB_P_GetOsdStr |
|---|
| 313 | ( BVDB_Osd eOsd, |
|---|
| 314 | char *pcStr ); |
|---|
| 315 | |
|---|
| 316 | void BVDB_P_GetPixelFormatStr |
|---|
| 317 | ( BVDB_PixelFormat ePxlFormat, |
|---|
| 318 | BVDB_State eState, |
|---|
| 319 | char *pcStr ); |
|---|
| 320 | |
|---|
| 321 | void BVDB_P_GetFieldStoreCntStr |
|---|
| 322 | ( BVDB_DeinterlacerFieldStore eFieldStore, |
|---|
| 323 | char *pcStr ); |
|---|
| 324 | |
|---|
| 325 | void BVDB_P_GetStateStr |
|---|
| 326 | ( BVDB_State eState, |
|---|
| 327 | char *pcStr ); |
|---|
| 328 | |
|---|
| 329 | void BVDB_P_GetSclCapBiasStr |
|---|
| 330 | ( BVDB_ScalerCaptureBias eBias, |
|---|
| 331 | char *pcStr ); |
|---|
| 332 | |
|---|
| 333 | BERR_Code BVDB_P_GetConfigMemAllocArray |
|---|
| 334 | ( BVDB_P_Config_MemAlloc *pstConfigMemAllocArray ); |
|---|
| 335 | |
|---|
| 336 | BERR_Code BVDB_P_GetRtsData |
|---|
| 337 | (uint32_t ulConfigId, |
|---|
| 338 | BVDB_P_RtsData ** pUsageMode, |
|---|
| 339 | uint32_t * pUsageModeNum); |
|---|
| 340 | |
|---|
| 341 | BERR_Code BVDB_P_GetNumConfigs |
|---|
| 342 | ( uint32_t *pulNumConfigs); |
|---|
| 343 | |
|---|
| 344 | #ifdef __cplusplus |
|---|
| 345 | } |
|---|
| 346 | #endif |
|---|
| 347 | |
|---|
| 348 | #endif /* __BVDB_PRIV_H__ */ |
|---|