| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-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: bvdc_dbg.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/8 $ |
|---|
| 12 | * $brcm_Date: 8/15/11 4:21p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * This module print out helpful information to debug BVN |
|---|
| 16 | * |
|---|
| 17 | * Revision History: |
|---|
| 18 | * |
|---|
| 19 | * $brcm_Log: /magnum/portinginterface/vdc/7038/bvdc_dbg.h $ |
|---|
| 20 | * |
|---|
| 21 | * Hydra_Software_Devel/8 8/15/11 4:21p tdo |
|---|
| 22 | * SW7420-2017: Add debug function to get SCL status register |
|---|
| 23 | * |
|---|
| 24 | * Hydra_Software_Devel/7 3/15/11 4:23p yuxiaz |
|---|
| 25 | * SW7400-2882: Added support to enable / disable multi-buffering logging |
|---|
| 26 | * for a specific window. |
|---|
| 27 | * |
|---|
| 28 | * Hydra_Software_Devel/6 2/9/11 3:59p yuxiaz |
|---|
| 29 | * SW7400-2882: Ported multi-buffing event logging scheme to VDC. Move |
|---|
| 30 | * related APIs to bvdc_dbg.h |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/3 11/7/08 6:39p darnstein |
|---|
| 33 | * PR46484: move new diagnostic commands into bvdc_dbg.h, where they |
|---|
| 34 | * belong. |
|---|
| 35 | * |
|---|
| 36 | * Hydra_Software_Devel/2 1/29/08 6:08p pntruong |
|---|
| 37 | * PR34870: Added get handle debug functions for video tool library. |
|---|
| 38 | * |
|---|
| 39 | * Hydra_Software_Devel/1 4/25/06 4:30p pntruong |
|---|
| 40 | * PR20252: Develope a program/function that dumps out BVN |
|---|
| 41 | * configuration/status to aid debugging. |
|---|
| 42 | * |
|---|
| 43 | ***************************************************************************/ |
|---|
| 44 | #ifndef BVDC_DBG_H__ |
|---|
| 45 | #define BVDC_DBG_H__ |
|---|
| 46 | |
|---|
| 47 | #include "bstd.h" |
|---|
| 48 | #include "bvdc.h" |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | /*************************************************************************** |
|---|
| 52 | * Output VDC Debug information |
|---|
| 53 | * |
|---|
| 54 | */ |
|---|
| 55 | BERR_Code BVDC_Dbg_Dump |
|---|
| 56 | ( BVDC_Handle hVdc ); |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | /*************************************************************************** |
|---|
| 60 | Summary: |
|---|
| 61 | This function gets a source handle. |
|---|
| 62 | |
|---|
| 63 | Description: |
|---|
| 64 | Get the current active source by id. |
|---|
| 65 | |
|---|
| 66 | DBG function for VTLib (Video Tool Library) getting vdc handles |
|---|
| 67 | that was created _bsp_ software that already abstract these handles from |
|---|
| 68 | VTLib but only expose thru hVdc main handle. For eId there are eAuto, but |
|---|
| 69 | these are for the _Create() function. BVDC_Dbg_GetXXXHandle functions will |
|---|
| 70 | accept these and treat them as invalid parameter. If the handle is not |
|---|
| 71 | active it will return NULL. |
|---|
| 72 | |
|---|
| 73 | WARNING: It's expected that APPLICATION/DRIVER does not call of any of these |
|---|
| 74 | get handle function. These get handle function only return what the current |
|---|
| 75 | state VDC. Caller expted to be VTLib equivalent, and caller must ensure |
|---|
| 76 | the synchronization between APPLICATION/DRIVER and VTLib. |
|---|
| 77 | |
|---|
| 78 | Input: |
|---|
| 79 | hVdc - The VDC handle that application created earlier. |
|---|
| 80 | |
|---|
| 81 | eSourceId - Specify what source Id should VDC tries to get. eId must |
|---|
| 82 | be a valid source id for this chip set. |
|---|
| 83 | |
|---|
| 84 | Returns: |
|---|
| 85 | Return current active handle if success. Otherwise return NULL. |
|---|
| 86 | |
|---|
| 87 | See Also: |
|---|
| 88 | BVDC_Source_Create. |
|---|
| 89 | **************************************************************************/ |
|---|
| 90 | BVDC_Source_Handle BVDC_Dbg_GetSourceHandle |
|---|
| 91 | ( const BVDC_Handle hVdc, |
|---|
| 92 | BAVC_SourceId eSourceId ); |
|---|
| 93 | |
|---|
| 94 | /*************************************************************************** |
|---|
| 95 | Summary: |
|---|
| 96 | This function gets a compositor handle. |
|---|
| 97 | |
|---|
| 98 | Description: |
|---|
| 99 | Get the current active compositor by id. |
|---|
| 100 | |
|---|
| 101 | Input: |
|---|
| 102 | hVdc - The VDC handle that application created earlier. |
|---|
| 103 | |
|---|
| 104 | eCompositorId - Specify what compositor Id should VDC tries to get. |
|---|
| 105 | eCompositorId must be a valid compositor id for this chip set. |
|---|
| 106 | |
|---|
| 107 | Returns: |
|---|
| 108 | Return current active handle if success. Otherwise return NULL. |
|---|
| 109 | |
|---|
| 110 | See Also: |
|---|
| 111 | BVDC_Compositor_Create. |
|---|
| 112 | **************************************************************************/ |
|---|
| 113 | BVDC_Compositor_Handle BVDC_Dbg_GetCompositorHandle |
|---|
| 114 | ( const BVDC_Handle hVdc, |
|---|
| 115 | BVDC_CompositorId eCompositorId ); |
|---|
| 116 | |
|---|
| 117 | /*************************************************************************** |
|---|
| 118 | Summary: |
|---|
| 119 | This function gets a window handle. |
|---|
| 120 | |
|---|
| 121 | Description: |
|---|
| 122 | Get the current active window by id. |
|---|
| 123 | |
|---|
| 124 | Input: |
|---|
| 125 | hVdc - The VDC handle that application created earlier. |
|---|
| 126 | |
|---|
| 127 | eCompositorId - Specify what compositor Id should VDC tries to get the |
|---|
| 128 | window from. |
|---|
| 129 | |
|---|
| 130 | eWindowId - Specify what compositor Id should VDC tries to get. eWindowId |
|---|
| 131 | must be a valid window id for this chip set. |
|---|
| 132 | |
|---|
| 133 | Returns: |
|---|
| 134 | Return current active handle if success. Otherwise return NULL. |
|---|
| 135 | |
|---|
| 136 | See Also: |
|---|
| 137 | BVDC_Window_Create. |
|---|
| 138 | **************************************************************************/ |
|---|
| 139 | BVDC_Window_Handle BVDC_Dbg_GetWindowHandle |
|---|
| 140 | ( const BVDC_Handle hVdc, |
|---|
| 141 | BVDC_CompositorId eCompositorId, |
|---|
| 142 | BVDC_WindowId eWindowId ); |
|---|
| 143 | |
|---|
| 144 | /*************************************************************************** |
|---|
| 145 | Summary: |
|---|
| 146 | This function gets a source handle. |
|---|
| 147 | |
|---|
| 148 | Description: |
|---|
| 149 | Get the current active source from a given window. |
|---|
| 150 | |
|---|
| 151 | Input: |
|---|
| 152 | hWindow - The VDC handle that application created earlier. |
|---|
| 153 | |
|---|
| 154 | Returns: |
|---|
| 155 | Return current active handle if success. Otherwise return NULL. |
|---|
| 156 | |
|---|
| 157 | See Also: |
|---|
| 158 | BVDC_Dbg_GetWindowHandle. |
|---|
| 159 | **************************************************************************/ |
|---|
| 160 | BVDC_Source_Handle BVDC_Dbg_Window_GetSourceHandle |
|---|
| 161 | ( const BVDC_Window_Handle hWindow ); |
|---|
| 162 | |
|---|
| 163 | /*************************************************************************** |
|---|
| 164 | Summary: |
|---|
| 165 | This function gets a compositor handle. |
|---|
| 166 | |
|---|
| 167 | Description: |
|---|
| 168 | Get the current active compositor from a given window. |
|---|
| 169 | |
|---|
| 170 | Input: |
|---|
| 171 | hWindow - The VDC handle that application created earlier. |
|---|
| 172 | |
|---|
| 173 | Returns: |
|---|
| 174 | Return current active handle if success. Otherwise return NULL. |
|---|
| 175 | |
|---|
| 176 | See Also: |
|---|
| 177 | BVDC_Dbg_GetWindowHandle. |
|---|
| 178 | **************************************************************************/ |
|---|
| 179 | BVDC_Compositor_Handle BVDC_Dbg_Window_GetCompositorHandle |
|---|
| 180 | ( const BVDC_Window_Handle hWindow ); |
|---|
| 181 | |
|---|
| 182 | /*************************************************************************** |
|---|
| 183 | Summary: |
|---|
| 184 | This function gets Scaler Status. |
|---|
| 185 | |
|---|
| 186 | Description: |
|---|
| 187 | Get the status register value of the Scaler associate with the current |
|---|
| 188 | window. |
|---|
| 189 | |
|---|
| 190 | Input: |
|---|
| 191 | hWindow - The VDC handle that application created earlier. |
|---|
| 192 | |
|---|
| 193 | Returns: |
|---|
| 194 | Return the SCL BVB status register value. 0 if window not created. |
|---|
| 195 | |
|---|
| 196 | See Also: |
|---|
| 197 | **************************************************************************/ |
|---|
| 198 | uint32_t BVDC_Dbg_Window_GetScalerStatus |
|---|
| 199 | ( const BVDC_Window_Handle hWindow ); |
|---|
| 200 | |
|---|
| 201 | /*************************************************************************** |
|---|
| 202 | Summary: |
|---|
| 203 | This function gets a display handle. |
|---|
| 204 | |
|---|
| 205 | Description: |
|---|
| 206 | Get the current active display from a given compositor. |
|---|
| 207 | |
|---|
| 208 | Input: |
|---|
| 209 | hCompositor - The VDC handle that application created earlier. |
|---|
| 210 | |
|---|
| 211 | Returns: |
|---|
| 212 | Return current active handle if success. Otherwise return NULL. |
|---|
| 213 | |
|---|
| 214 | See Also: |
|---|
| 215 | BVDC_Dbg_GetCompositorHandle. |
|---|
| 216 | **************************************************************************/ |
|---|
| 217 | BVDC_Display_Handle BVDC_Dbg_Compositor_GetDisplayHandle |
|---|
| 218 | ( const BVDC_Compositor_Handle hCompositor ); |
|---|
| 219 | |
|---|
| 220 | #if (BVDC_BUF_LOG == 1) |
|---|
| 221 | /***************************************************************************** |
|---|
| 222 | Summary: |
|---|
| 223 | Enum for users to specify how they want the multi-buffering events |
|---|
| 224 | be logged and dumped. |
|---|
| 225 | |
|---|
| 226 | See Also: |
|---|
| 227 | BVDC_SetBufLogStateAndDumpTrigger |
|---|
| 228 | *****************************************************************************/ |
|---|
| 229 | |
|---|
| 230 | typedef enum { |
|---|
| 231 | BVDC_BufLogState_eReset=0, /* Reset/inactive */ |
|---|
| 232 | BVDC_BufLogState_eManual, /* Manually trigger the dump */ |
|---|
| 233 | BVDC_BufLogState_eAutomatic, /* Automatic trigger - whenever a skip/repeat event occurs */ |
|---|
| 234 | BVDC_BufLogState_eAutomaticReduced /* Automatic trigger - whenever a skip/repeat event occurs, only shows skip/repeat */ |
|---|
| 235 | } BVDC_BufLogState; |
|---|
| 236 | |
|---|
| 237 | /*************************************************************************** |
|---|
| 238 | Summary: |
|---|
| 239 | Set when to start logging multi-buffering events and how to notify user |
|---|
| 240 | the log can be dumped. |
|---|
| 241 | |
|---|
| 242 | Description: |
|---|
| 243 | This function allows user to specify how the log can be dumped. |
|---|
| 244 | If BVDC_BufLogState_eAutomatic or BVDC_BufLogState_eAutomaticReduced is |
|---|
| 245 | chosen, a user callback function must be registered. |
|---|
| 246 | |
|---|
| 247 | Inputs: |
|---|
| 248 | eLogState - Log and dump trigger state |
|---|
| 249 | pfCallback - User callback function |
|---|
| 250 | pvParam1 - User defined data structure casted to void. |
|---|
| 251 | iParam2 - Additional user defined value. |
|---|
| 252 | |
|---|
| 253 | Returns: |
|---|
| 254 | |
|---|
| 255 | BERR_SUCCESS - The function call succeeded. |
|---|
| 256 | BERR_INVALID_PARAMETER - A supplied parameter was invalid, |
|---|
| 257 | possibly NULL. |
|---|
| 258 | |
|---|
| 259 | See Also: |
|---|
| 260 | BVDC_P_BufLogState |
|---|
| 261 | ****************************************************************************/ |
|---|
| 262 | BERR_Code BVDC_SetBufLogStateAndDumpTrigger |
|---|
| 263 | ( BVDC_BufLogState eLogState, |
|---|
| 264 | const BVDC_CallbackFunc_isr pfCallback, |
|---|
| 265 | void *pvParm1, |
|---|
| 266 | int iParm2 ); |
|---|
| 267 | |
|---|
| 268 | |
|---|
| 269 | /*************************************************************************** |
|---|
| 270 | Summary: |
|---|
| 271 | Print out the captured multi-buffering events log. |
|---|
| 272 | |
|---|
| 273 | Description: |
|---|
| 274 | This function dumps the captured multi-buffering events log. |
|---|
| 275 | |
|---|
| 276 | Inputs: |
|---|
| 277 | |
|---|
| 278 | Returns: |
|---|
| 279 | |
|---|
| 280 | See Also: |
|---|
| 281 | |
|---|
| 282 | ****************************************************************************/ |
|---|
| 283 | void BVDC_DumpBufLog (void ); |
|---|
| 284 | |
|---|
| 285 | /*************************************************************************** |
|---|
| 286 | Summary: |
|---|
| 287 | Prepares the manual trigger of the multi-buffering event log |
|---|
| 288 | |
|---|
| 289 | Description: |
|---|
| 290 | This function prepares the multi-buffering log internals such that |
|---|
| 291 | the next BVDC_DumpBufLog() dumps up to the most recent events, |
|---|
| 292 | regardless any skip/repeat event have been logged in the recent past. |
|---|
| 293 | |
|---|
| 294 | Inputs: |
|---|
| 295 | |
|---|
| 296 | Returns: |
|---|
| 297 | |
|---|
| 298 | See Also: |
|---|
| 299 | |
|---|
| 300 | ****************************************************************************/ |
|---|
| 301 | void BVDC_SetBufLogManualTrigger(void); |
|---|
| 302 | |
|---|
| 303 | /*************************************************************************** |
|---|
| 304 | Summary: |
|---|
| 305 | Enable/Disable multi-buffering logging for a specific window |
|---|
| 306 | |
|---|
| 307 | Description: |
|---|
| 308 | This function allows user to specify whether to enable or disable |
|---|
| 309 | multi-buffering logging for a specific window. Multi-buffering logging |
|---|
| 310 | is enabled for all video window by default. |
|---|
| 311 | |
|---|
| 312 | Inputs: |
|---|
| 313 | hWindow - The VDC handle that application created earlier. |
|---|
| 314 | bEnable - flag to indicate whether to enable or disable multi-buffering |
|---|
| 315 | logging. |
|---|
| 316 | |
|---|
| 317 | Returns: |
|---|
| 318 | |
|---|
| 319 | BERR_SUCCESS - The function call succeeded. |
|---|
| 320 | |
|---|
| 321 | See Also: |
|---|
| 322 | BVDC_P_BufLogState |
|---|
| 323 | |
|---|
| 324 | ****************************************************************************/ |
|---|
| 325 | BERR_Code BVDC_Window_EnableBufLog |
|---|
| 326 | ( const BVDC_Window_Handle hWindow, |
|---|
| 327 | bool bEnable ); |
|---|
| 328 | |
|---|
| 329 | #endif |
|---|
| 330 | |
|---|
| 331 | #ifdef BVDC_P_DISPLAY_DUMP |
|---|
| 332 | void BVDC_Display_DumpAll_aulVfTable (void); |
|---|
| 333 | void BVDC_Display_DumpAll_aulChFilterTbl (void); |
|---|
| 334 | void BVDC_Display_DumpAll_aulRmTable (void); |
|---|
| 335 | void BVDC_Display_DumpAll_aulItTable (void); |
|---|
| 336 | void BVDC_Display_DumpAll_ulItConfig (void); |
|---|
| 337 | void BVDC_Display_DumpAll_aulSmTable (void); |
|---|
| 338 | void BVDC_Display_DumpTables (void); |
|---|
| 339 | |
|---|
| 340 | void BVDC_Display_MV_DumpAll_aulVfTable (void); |
|---|
| 341 | void BVDC_Display_MV_DumpAll_aulItTable (void); |
|---|
| 342 | void BVDC_Display_MV_DumpAll_ulItConfig (void); |
|---|
| 343 | void BVDC_Display_MV_DumpTables (void); |
|---|
| 344 | #endif |
|---|
| 345 | |
|---|
| 346 | #endif /* #ifndef BVDC_DBG_H__ */ |
|---|
| 347 | |
|---|
| 348 | /* end of file */ |
|---|