| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2012, 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: bxdm_pp_dbg.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/11 $ |
|---|
| 12 | * $brcm_Date: 1/13/12 3:01p $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/commonutils/xdm/bxdm_pp_dbg.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/11 1/13/12 3:01p btosi |
|---|
| 21 | * SW7405-4736: added debug support for MFD.bLast and picture-less |
|---|
| 22 | * pictures |
|---|
| 23 | * |
|---|
| 24 | * Hydra_Software_Devel/10 11/28/11 3:21p btosi |
|---|
| 25 | * SW7405-4736: winnowed down the BXDM_PPQM and BXDM_PPDBG messages |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/9 5/10/11 1:41p btosi |
|---|
| 28 | * SW7405-4736: added range checking and debug messages for the input |
|---|
| 29 | * parameters |
|---|
| 30 | * |
|---|
| 31 | * Hydra_Software_Devel/8 5/2/11 9:14a btosi |
|---|
| 32 | * SW7405-4736: moved location of BXDM_PPDBG_P_PrintMFD |
|---|
| 33 | * |
|---|
| 34 | * Hydra_Software_Devel/7 4/21/11 1:53p btosi |
|---|
| 35 | * SW7405-4736: moved BXDM_PPQM_P_PrintUnifiedPicture to bxdm_pp_dbg.c, |
|---|
| 36 | * tweaked the BXDM_PPQM message |
|---|
| 37 | * |
|---|
| 38 | * Hydra_Software_Devel/6 4/12/11 2:19p btosi |
|---|
| 39 | * SW7405-4736: added support for MFD debug messages |
|---|
| 40 | * |
|---|
| 41 | * Hydra_Software_Devel/5 4/5/11 2:26p btosi |
|---|
| 42 | * SW7405-4736: removed BXDM_PP_ENABLE_YUV_GRAB_MODE, grab is implemented |
|---|
| 43 | * in bxvd_decoder.c |
|---|
| 44 | * |
|---|
| 45 | * Hydra_Software_Devel/4 7/12/10 8:51a delkert |
|---|
| 46 | * SW7335-781: removed temporary (broken) comment |
|---|
| 47 | * |
|---|
| 48 | * Hydra_Software_Devel/3 7/12/10 8:05a delkert |
|---|
| 49 | * SW7335-781: Output warning when forcing picture selection override to |
|---|
| 50 | * allow easier detection of conditions such as drop@decode and pcr |
|---|
| 51 | * discontinuity |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/2 3/9/10 3:12p btosi |
|---|
| 54 | * SW7405-3245: build strings locally instead of calling BKNI_Vsnprintf, |
|---|
| 55 | * shaved ~140 usec off the ISR execution time |
|---|
| 56 | * |
|---|
| 57 | * Hydra_Software_Devel/1 2/16/10 10:51a nilesh |
|---|
| 58 | * SW7405-2993: Initial XDM version |
|---|
| 59 | * |
|---|
| 60 | ***************************************************************************/ |
|---|
| 61 | |
|---|
| 62 | #ifndef bxdm_pp_DBG_H__ |
|---|
| 63 | #define bxdm_pp_DBG_H__ |
|---|
| 64 | |
|---|
| 65 | #include "bxdm_pp.h" |
|---|
| 66 | #include "bxdm_pp_priv.h" |
|---|
| 67 | #include "bavc.h" |
|---|
| 68 | |
|---|
| 69 | #ifdef __cplusplus |
|---|
| 70 | extern "C" { |
|---|
| 71 | #endif |
|---|
| 72 | |
|---|
| 73 | #if 0 |
|---|
| 74 | } |
|---|
| 75 | #endif |
|---|
| 76 | |
|---|
| 77 | #define BXDM_PPDBG_P_MAX_VSYNC_DEPTH 12 |
|---|
| 78 | #define BXDM_PPDBG_P_MAX_DBG_LENGTH 1024 |
|---|
| 79 | |
|---|
| 80 | typedef enum BXDM_PPDBG_Selection |
|---|
| 81 | { |
|---|
| 82 | BXDM_PPDBG_Selection_ePPBNotFound, |
|---|
| 83 | BXDM_PPDBG_Selection_ePPBFound, |
|---|
| 84 | BXDM_PPDBG_Selection_ePass, |
|---|
| 85 | BXDM_PPDBG_Selection_eForce, |
|---|
| 86 | BXDM_PPDBG_Selection_eLate, |
|---|
| 87 | BXDM_PPDBG_Selection_eWait, |
|---|
| 88 | BXDM_PPDBG_Selection_eFreeze, |
|---|
| 89 | BXDM_PPDBG_Selection_eTooEarly, |
|---|
| 90 | BXDM_PPDBG_Selection_eDrop, |
|---|
| 91 | BXDM_PPDBG_Selection_eDelay, |
|---|
| 92 | BXDM_PPDBG_Selection_eDependentPicture, |
|---|
| 93 | |
|---|
| 94 | BXDM_PPDBG_Selection_PolarityOverride_eBothField, |
|---|
| 95 | BXDM_PPDBG_Selection_PolarityOverride_eProgressive, |
|---|
| 96 | BXDM_PPDBG_Selection_PolarityOverride_e1stSlotRepeat, |
|---|
| 97 | BXDM_PPDBG_Selection_PolarityOverride_e2ndSlotNextElement, |
|---|
| 98 | BXDM_PPDBG_Selection_PolarityOverride_e2ndSlotNextPPB, |
|---|
| 99 | BXDM_PPDBG_Selection_PolarityOverride_e2ndSlotInversion, |
|---|
| 100 | BXDM_PPDBG_Selection_PolarityOverride_eSelectPrevious, |
|---|
| 101 | BXDM_PPDBG_Selection_PolarityOverride_eRepeatPrevious, |
|---|
| 102 | BXDM_PPDBG_Selection_PolarityOverride_eFICReset, |
|---|
| 103 | |
|---|
| 104 | /* Add new enums above this line */ |
|---|
| 105 | BXDM_PPDBG_Selection_eMax |
|---|
| 106 | } BXDM_PPDBG_Selection; |
|---|
| 107 | |
|---|
| 108 | /* |
|---|
| 109 | * Defines and macro(s) for building the debug messages. |
|---|
| 110 | */ |
|---|
| 111 | #define BXDM_PPDBG_P_STR_PREFIX 5 /* All the strings start with a five character prefix. */ |
|---|
| 112 | #define BXDM_PPDBG_P_STR_SUFFIX 1 /* Always want a NULL terminator at the end of the string. */ |
|---|
| 113 | #define BXDM_PPDBG_P_STR_PER_VSYNC 15 /* Except for the "stTSMString" string, 8 characters will be appended on each vsync. |
|---|
| 114 | * Typically 5 or 7 characters will be appended to "stTSMString" on each vsync, but it |
|---|
| 115 | * could be more than that if pictures are dropped. A value of 15 will give us a little |
|---|
| 116 | * wiggle room. */ |
|---|
| 117 | |
|---|
| 118 | #define BXDM_PPDBG_P_STR_LENGTH BXDM_PPDBG_P_STR_PREFIX \ |
|---|
| 119 | + ( BXDM_PPDBG_P_STR_PER_VSYNC * BXDM_PPDBG_P_MAX_VSYNC_DEPTH ) \ |
|---|
| 120 | + BXDM_PPDBG_P_STR_SUFFIX \ |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | #define BXDM_PPDBG_P_APPEND_CHAR( _pStr, _char ) \ |
|---|
| 124 | if ( _pStr->uiDebugStrOffset < BXDM_PPDBG_P_STR_LENGTH - 2 ) \ |
|---|
| 125 | { \ |
|---|
| 126 | _pStr->szDebugStr[ _pStr->uiDebugStrOffset++ ] = _char; \ |
|---|
| 127 | } \ |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | typedef struct BXDM_PPDBG_P_String |
|---|
| 131 | { |
|---|
| 132 | char szDebugStr[BXDM_PPDBG_P_MAX_DBG_LENGTH]; |
|---|
| 133 | uint32_t uiDebugStrOffset; |
|---|
| 134 | } BXDM_PPDBG_P_String; |
|---|
| 135 | |
|---|
| 136 | typedef struct BXDM_PPDBG_P_Info |
|---|
| 137 | { |
|---|
| 138 | uint32_t uiVsyncCount; |
|---|
| 139 | |
|---|
| 140 | BXDM_PPDBG_P_String stHeaderString; |
|---|
| 141 | BXDM_PPDBG_P_String stTSMString; |
|---|
| 142 | BXDM_PPDBG_P_String stPendingDropString; |
|---|
| 143 | BXDM_PPDBG_P_String stInterruptString; |
|---|
| 144 | BXDM_PPDBG_P_String stSourcePolarityOverrideString; |
|---|
| 145 | BXDM_PPDBG_P_String stCallbackString; |
|---|
| 146 | BXDM_PPDBG_P_String stStateString; |
|---|
| 147 | |
|---|
| 148 | bool bPrintSPO; |
|---|
| 149 | bool bPrintCallbacks; |
|---|
| 150 | |
|---|
| 151 | uint32_t abSelectionLogHeader[BXDM_PPDBG_P_MAX_VSYNC_DEPTH]; |
|---|
| 152 | } BXDM_PPDBG_P_Info; |
|---|
| 153 | |
|---|
| 154 | #define BXDM_PPDBG_Output_SPO_UNUSED_0 0x0001 |
|---|
| 155 | #define BXDM_PPDBG_Output_SPO_UNUSED_1 0x0002 |
|---|
| 156 | #define BXDM_PPDBG_Output_SPO_UNUSED_2 0x0004 |
|---|
| 157 | #define BXDM_PPDBG_Output_SPO_UNUSED_4 0x0008 |
|---|
| 158 | |
|---|
| 159 | #define BXDM_PPDBG_Output_SPO_TopField 0x0010 |
|---|
| 160 | #define BXDM_PPDBG_Output_SPO_BottomField 0x0020 |
|---|
| 161 | #define BXDM_PPDBG_Output_SPO_SingleField 0x0040 |
|---|
| 162 | |
|---|
| 163 | #define BXDM_PPDBG_Output_SPO_Interlaced 0x0100 |
|---|
| 164 | #define BXDM_PPDBG_Output_SPO_Progressive 0x0200 |
|---|
| 165 | #define BXDM_PPDBG_Output_SPO_pToi 0x0400 |
|---|
| 166 | #define BXDM_PPDBG_Output_SPO_iTop 0x0800 |
|---|
| 167 | |
|---|
| 168 | #define BXDM_PPDBG_Output_SPO_ProgBothField 0x1000 |
|---|
| 169 | #define BXDM_PPDBG_Output_SPO_UNUSED_5 0x2000 |
|---|
| 170 | #define BXDM_PPDBG_Output_SPO_UNUSED_6 0x4000 |
|---|
| 171 | #define BXDM_PPDBG_Output_SPO_ProgRepeat 0x8000 |
|---|
| 172 | |
|---|
| 173 | #define BXDM_PPDBG_Callback_FirstPtsReady 0x00001 |
|---|
| 174 | #define BXDM_PPDBG_Callback_FirstCodedPtsReady 0x00002 |
|---|
| 175 | #define BXDM_PPDBG_Callback_FirstPtsPassed 0x00004 |
|---|
| 176 | #define BXDM_PPDBG_Callback_PtsError 0x00008 |
|---|
| 177 | |
|---|
| 178 | #define BXDM_PPDBG_Callback_PtsStcOffset 0x00010 |
|---|
| 179 | #define BXDM_PPDBG_Callback_IFrame 0x00020 |
|---|
| 180 | #define BXDM_PPDBG_Callback_PictureParameters 0x00040 |
|---|
| 181 | #define BXDM_PPDBG_Callback_TsmPassInASTMMode 0x00080 |
|---|
| 182 | |
|---|
| 183 | #define BXDM_PPDBG_Callback_RequestSTC 0x00100 |
|---|
| 184 | #define BXDM_PPDBG_Callback_ClipStart 0x00200 |
|---|
| 185 | #define BXDM_PPDBG_Callback_ClipStop 0x00400 |
|---|
| 186 | #define BXDM_PPDBG_Callback_PictureMarker 0x00800 |
|---|
| 187 | |
|---|
| 188 | #define BXDM_PPDBG_Callback_PPBReceived 0x01000 |
|---|
| 189 | #define BXDM_PPDBG_Callback_PictureUnderEvaluation 0x02000 |
|---|
| 190 | #define BXDM_PPDBG_Callback_DecodeError 0x04000 |
|---|
| 191 | #define BXDM_PPDBG_Callback_TSMResult 0x08000 |
|---|
| 192 | |
|---|
| 193 | #define BXDM_PPDBG_Callback_ExtensionData 0x10000 |
|---|
| 194 | |
|---|
| 195 | #define BXDM_PPDBG_State_SelectionMode_TSM 0x00001 |
|---|
| 196 | #define BXDM_PPDBG_State_SelectionMode_VSYNC 0x00002 |
|---|
| 197 | #define BXDM_PPDBG_State_DisplayMode_TSM 0x00004 |
|---|
| 198 | #define BXDM_PPDBG_State_DisplayMode_VSYNC 0x00008 |
|---|
| 199 | |
|---|
| 200 | #define BXDM_PPDBG_State_IgnoreCadenceMatch 0x00010 |
|---|
| 201 | #define BXDM_PPDBG_State_PCRDiscontinuity 0x00020 |
|---|
| 202 | #define BXDM_PPDBG_State_PCRPresent 0x00040 |
|---|
| 203 | #define BXDM_PPDBG_State_STCInvalid 0x00080 |
|---|
| 204 | |
|---|
| 205 | #define BXDM_PPDBG_State_ProgressiveFramePulldown 0x00100 |
|---|
| 206 | #define BXDM_PPDBG_State_ProgressiveStreamPulldown 0x00200 |
|---|
| 207 | #define BXDM_PPDBG_State_ProgressiveSourceFormat 0x00400 |
|---|
| 208 | #define BXDM_PPDBG_State_ProgressiveSequence 0x00800 |
|---|
| 209 | |
|---|
| 210 | #define BXDM_PPDBG_State_UseHwPcrOffset 0x01000 |
|---|
| 211 | #define BXDM_PPDBG_State_480pTo480i 0x02000 |
|---|
| 212 | #define BXDM_PPDBG_State_1080pTo1080i 0x04000 |
|---|
| 213 | #define BXDM_PPDBG_State_60iTo60p 0x08000 |
|---|
| 214 | #define BXDM_PPDBG_State_24iTo24p 0x10000 |
|---|
| 215 | #define BXDM_PPDBG_State_240iTo240p 0x20000 |
|---|
| 216 | |
|---|
| 217 | #if BDBG_DEBUG_BUILD |
|---|
| 218 | BERR_Code BXDM_PPDBG_P_OutputLog( |
|---|
| 219 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 220 | const BXDM_PictureProvider_P_LocalState *pLocalState, |
|---|
| 221 | const BAVC_MFD_Picture *pMFDPicture |
|---|
| 222 | ); |
|---|
| 223 | |
|---|
| 224 | BERR_Code BXDM_PPDBG_P_Print( |
|---|
| 225 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 226 | const BXDM_PictureProvider_P_LocalState* pLocalState |
|---|
| 227 | ); |
|---|
| 228 | |
|---|
| 229 | BERR_Code BXDM_PPDBG_P_SelectionLog( |
|---|
| 230 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 231 | BXDM_PPDBG_Selection eSelectionInfo |
|---|
| 232 | ); |
|---|
| 233 | |
|---|
| 234 | BERR_Code BXDM_PPDBG_P_OutputSPOLog( |
|---|
| 235 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 236 | const uint32_t uiOverrideBits |
|---|
| 237 | ); |
|---|
| 238 | |
|---|
| 239 | BERR_Code BXDM_PPDBG_P_CallbackTriggeredLog( |
|---|
| 240 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 241 | const uint32_t uiCallbackTriggeredBits |
|---|
| 242 | ); |
|---|
| 243 | |
|---|
| 244 | BERR_Code BXDM_PPDBG_P_StateLog( |
|---|
| 245 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 246 | const uint32_t uiStateBits |
|---|
| 247 | ); |
|---|
| 248 | |
|---|
| 249 | BERR_Code BXDM_PPDBG_P_DecoderDropLog( |
|---|
| 250 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 251 | const uint32_t uiPendingDrop |
|---|
| 252 | ); |
|---|
| 253 | |
|---|
| 254 | void BXDM_PPDBG_P_PrintNodes( |
|---|
| 255 | const BXDM_PictureProvider_Handle hXdmPP |
|---|
| 256 | ); |
|---|
| 257 | |
|---|
| 258 | void BXDM_PPDBG_P_PrintSelectionModeOverride( |
|---|
| 259 | char *pMsg, |
|---|
| 260 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 261 | BXDM_PictureProvider_P_Picture_Context *pPicture); |
|---|
| 262 | |
|---|
| 263 | void BXDM_PPDBG_P_PrintEndSelectionModeOverride( |
|---|
| 264 | const BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 265 | BXDM_PictureProvider_P_Picture_Context *pPicture); |
|---|
| 266 | |
|---|
| 267 | void BXDM_PPDBG_P_PrintMFD( |
|---|
| 268 | BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 269 | BXDM_PictureProvider_P_LocalState* pLocalState, |
|---|
| 270 | BAVC_MFD_Picture* pMFDPicture |
|---|
| 271 | ); |
|---|
| 272 | |
|---|
| 273 | void BXDM_PPDBG_P_PrintUnifiedPicture( |
|---|
| 274 | BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 275 | BXDM_PictureProvider_P_LocalState * pLocalState, |
|---|
| 276 | BXDM_PictureProvider_P_Picture_Context * pstPicture |
|---|
| 277 | ); |
|---|
| 278 | |
|---|
| 279 | void BXDM_PPDBG_P_PrintDMConfig( |
|---|
| 280 | BXDM_PictureProvider_Handle hXdmPP, |
|---|
| 281 | BXDM_PictureProvider_P_LocalState * pLocalState, |
|---|
| 282 | bool bLastCall |
|---|
| 283 | ); |
|---|
| 284 | |
|---|
| 285 | #else |
|---|
| 286 | /* Non-DEBUG build */ |
|---|
| 287 | |
|---|
| 288 | #define BXDM_PPDBG_P_OutputLog( hXdmPP, pLocalState, pMFDPicture ) |
|---|
| 289 | #define BXDM_PPDBG_P_Print( hXdmPP, pLocalState ) |
|---|
| 290 | #define BXDM_PPDBG_P_SelectionLog( hXdmPP, eSelectionInfo ) |
|---|
| 291 | #define BXDM_PPDBG_P_OutputSPOLog( hXdmPP, uiOverrideBits ) |
|---|
| 292 | #define BXDM_PPDBG_P_CallbackTriggeredLog( hXdmPP, uiCallbackTriggeredBits ) |
|---|
| 293 | #define BXDM_PPDBG_P_StateLog( hXdmPP, uiStateBits ) |
|---|
| 294 | #define BXDM_PPDBG_P_DecoderDropLog( hXdmPP, uiPendingDrop ) |
|---|
| 295 | #define BXDM_PPDBG_P_PrintNodes( hXdmPP ) |
|---|
| 296 | #define BXDM_PPDBG_P_PrintSelectionModeOverride( pMsg, hXdmPP, pPicture ) |
|---|
| 297 | #define BXDM_PPDBG_P_PrintEndSelectionModeOverride( hXdmPP, pPicture ) |
|---|
| 298 | #define BXDM_PPDBG_P_PrintMFD( hXdmPP, pLocalState, pMFDPicture ) |
|---|
| 299 | #define BXDM_PPDBG_P_PrintUnifiedPicture( hXdmPP, pLocalState, pstPicture ) |
|---|
| 300 | #define BXDM_PPDBG_P_PrintDMConfig( hXdmPP, pLocalState, bLastCall ) |
|---|
| 301 | |
|---|
| 302 | #endif |
|---|
| 303 | |
|---|
| 304 | #ifdef __cplusplus |
|---|
| 305 | } |
|---|
| 306 | #endif |
|---|
| 307 | |
|---|
| 308 | #endif /* #ifndef bxdm_pp_DBG_H__ */ |
|---|