| 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/3 $ |
|---|
| 12 | * $brcm_Date: 4/8/11 2:56p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * See Module Overview below. |
|---|
| 16 | * |
|---|
| 17 | * Revision History: |
|---|
| 18 | * |
|---|
| 19 | * $brcm_Log: /magnum/commonutils/vdb/35125/C0/bvdb_priv.h $ |
|---|
| 20 | * |
|---|
| 21 | * Hydra_Software_Devel/3 4/8/11 2:56p yingh |
|---|
| 22 | * SW35125-102: Added PDP buffer allocation flag |
|---|
| 23 | * |
|---|
| 24 | * Hydra_Software_Devel/2 11/17/10 3:33p jerrylim |
|---|
| 25 | * SW35125-22: Removed all 35230 configs except config100 |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/1 11/17/10 2:53p jerrylim |
|---|
| 28 | * SW35125-22: Added 35125 VDB files |
|---|
| 29 | * |
|---|
| 30 | ***************************************************************************/ |
|---|
| 31 | |
|---|
| 32 | #ifndef __BVDB_PRIV_H__ |
|---|
| 33 | #define __BVDB_PRIV_H__ |
|---|
| 34 | |
|---|
| 35 | #include "bvdb.h" |
|---|
| 36 | #include "blst_circleq.h" |
|---|
| 37 | |
|---|
| 38 | #ifdef __cplusplus |
|---|
| 39 | extern "C" { |
|---|
| 40 | #endif |
|---|
| 41 | |
|---|
| 42 | #if BDBG_DEBUG_BUILD |
|---|
| 43 | #define BVDB_P_GENERIC_GET_CONTEXT(handle, context, structname) \ |
|---|
| 44 | do { \ |
|---|
| 45 | (context) = (handle); \ |
|---|
| 46 | BDBG_ASSERT(context); \ |
|---|
| 47 | } while(0) |
|---|
| 48 | #else |
|---|
| 49 | #define BVDB_P_GENERIC_GET_CONTEXT(handle, context, structname) \ |
|---|
| 50 | (context) = (handle) |
|---|
| 51 | #endif |
|---|
| 52 | |
|---|
| 53 | #define BVDB_P_GET_CONTEXT(handle, context) \ |
|---|
| 54 | BVDB_P_GENERIC_GET_CONTEXT(handle, context, BVDB_P_Context) |
|---|
| 55 | |
|---|
| 56 | /* helper macros */ |
|---|
| 57 | #define BVDB_P_STRCPY(DSTR, SSTR) \ |
|---|
| 58 | strncpy(DSTR, SSTR, BVDB_MAX_STRLEN) |
|---|
| 59 | |
|---|
| 60 | #define BVDB_P_STRCAT(DSTR, SSTR) \ |
|---|
| 61 | strncat(DSTR, SSTR, BVDB_MAX_STRLEN) |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | /* Get the min / max of two numbers */ |
|---|
| 65 | #define BVDB_P_MIN(a, b) (((a) < (b)) ? (a) : (b)) |
|---|
| 66 | #define BVDB_P_MAX(a, b) (((a) > (b)) ? (a) : (b)) |
|---|
| 67 | |
|---|
| 68 | /* constants */ |
|---|
| 69 | #define BVDB_P_NUM_WINDOW_HEAPS 4 /* MAIN(analog), MAIN(digital), PIP, MONITOR */ |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | /*************************************************************************** |
|---|
| 73 | * BVDB_P_Context |
|---|
| 74 | * Head of the doubly-linked list |
|---|
| 75 | ***************************************************************************/ |
|---|
| 76 | typedef struct BVDB_P_Context BVDB_P_Context; |
|---|
| 77 | BLST_CQ_HEAD(BVDB_P_Context, BVDB_UsageMode); |
|---|
| 78 | |
|---|
| 79 | typedef struct |
|---|
| 80 | { |
|---|
| 81 | uint32_t ulConfigId; |
|---|
| 82 | BVDB_Window eWindow; |
|---|
| 83 | BVDB_Input eInput; |
|---|
| 84 | uint32_t ulHeapSize; |
|---|
| 85 | BVDB_Heap_Settings stHeapSettings; |
|---|
| 86 | } BVDB_P_Config_MemAlloc; |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | typedef struct |
|---|
| 90 | { |
|---|
| 91 | uint32_t width; |
|---|
| 92 | uint32_t height; |
|---|
| 93 | bool bProgressive; |
|---|
| 94 | uint32_t frameRate; |
|---|
| 95 | bool b3dSource; |
|---|
| 96 | BVDB_InputFormatGroup eInputFormatGroup; |
|---|
| 97 | } BVDB_P_SourceFormat; |
|---|
| 98 | |
|---|
| 99 | typedef struct |
|---|
| 100 | { |
|---|
| 101 | uint32_t sourceGroup; /* ORed BVDB_SourceGroup */ |
|---|
| 102 | uint32_t minWinWidth; /* all in percent win_size*100/disp_size */ |
|---|
| 103 | uint32_t minWinHeight; |
|---|
| 104 | uint32_t maxWinWidth; |
|---|
| 105 | uint32_t maxWinHeight; |
|---|
| 106 | uint32_t maxClippingWidth; |
|---|
| 107 | uint32_t maxClippingHeight; |
|---|
| 108 | bool bfrc; /* invalid for sub */ |
|---|
| 109 | bool bdnr; /* invalid for sub */ |
|---|
| 110 | bool banr; /* invalid for sub */ |
|---|
| 111 | bool bmad; /* invalid for sub */ |
|---|
| 112 | bool bcap; |
|---|
| 113 | bool b3dcomb; |
|---|
| 114 | uint32_t mc; /* mcvp bpp * 2, invalid for sub */ |
|---|
| 115 | uint32_t c; /* cap/vfd bpp * 2 */ |
|---|
| 116 | uint32_t dc; /* pdp bpp * 2, invalid for sub */ |
|---|
| 117 | uint32_t frcc; /* frc bpp * 2, invalid for sub */ |
|---|
| 118 | BVDB_ScalerCaptureBias eSclCap; |
|---|
| 119 | uint32_t bias; |
|---|
| 120 | } BVDB_P_BvnTopology; |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | typedef struct |
|---|
| 124 | { |
|---|
| 125 | uint32_t id; /* AAAABBBB: AAAA=config#, BBBB=serial# */ |
|---|
| 126 | BVDB_P_DisplayMode eDisplayMode; |
|---|
| 127 | uint32_t ulDisplayModeNum; /* for full0, full1, etc */ |
|---|
| 128 | uint32_t ulMainOutputResolution; |
|---|
| 129 | uint32_t priority; |
|---|
| 130 | BVDB_P_BvnTopology main; |
|---|
| 131 | BVDB_P_BvnTopology sub; |
|---|
| 132 | BVDB_RtsTable * pRtsRegisterTable; /* register table pointer */ |
|---|
| 133 | } BVDB_P_RtsData; |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | typedef struct |
|---|
| 137 | { |
|---|
| 138 | uint32_t ulConfigId; |
|---|
| 139 | char vdbVerString[BVDB_MAX_VER_STRING]; |
|---|
| 140 | BVDB_P_RtsData * pUsageMode; |
|---|
| 141 | uint32_t usageModeNum; |
|---|
| 142 | BVDB_P_RtsData curUsageMode; |
|---|
| 143 | BVDB_Osd eMainOsdResolution; |
|---|
| 144 | BVDB_Osd eVcrOsdResolution; |
|---|
| 145 | struct |
|---|
| 146 | { |
|---|
| 147 | bool bDotByDot; /* true if (cropped) source size == win size */ |
|---|
| 148 | uint32_t winHeight; /* in percentage */ |
|---|
| 149 | uint32_t winWidth; /* in percentage */ |
|---|
| 150 | uint32_t clipHeight;/* in percentage */ |
|---|
| 151 | uint32_t clipWidth; /* in percentage */ |
|---|
| 152 | bool bAutomaticAspectRatioBoxMode; |
|---|
| 153 | } main, sub; |
|---|
| 154 | |
|---|
| 155 | uint32_t panelReversalCompensation; |
|---|
| 156 | |
|---|
| 157 | bool bPipSupport; |
|---|
| 158 | bool bMonitorSupport; |
|---|
| 159 | bool bFrcSupport; |
|---|
| 160 | bool bRtcSupport; |
|---|
| 161 | bool bPanelReversalSupport; |
|---|
| 162 | bool bBacklightSupport; |
|---|
| 163 | |
|---|
| 164 | uint32_t worstPdpBpp; |
|---|
| 165 | |
|---|
| 166 | uint32_t maxPipWinHeight; |
|---|
| 167 | uint32_t maxPipWinWidth; |
|---|
| 168 | } BVDB_P_TContext; |
|---|
| 169 | |
|---|
| 170 | /* Functions */ |
|---|
| 171 | BERR_Code BVDB_P_GetDisplaySize |
|---|
| 172 | ( BVDB_OutputResolution eDispResolution, |
|---|
| 173 | uint32_t *pDispHeight, |
|---|
| 174 | uint32_t *pDispWidth ); |
|---|
| 175 | |
|---|
| 176 | void BVDB_P_GetInputFormatGroupStr |
|---|
| 177 | ( BVDB_InputFormatGroup eInputFmtGrp, |
|---|
| 178 | char *pcStr ); |
|---|
| 179 | |
|---|
| 180 | void BVDB_P_GetDisplayTypeStr |
|---|
| 181 | ( BVDB_DisplayType eDisplay, |
|---|
| 182 | char *pcStr ); |
|---|
| 183 | |
|---|
| 184 | void BVDB_P_GetOutputResolutionStr |
|---|
| 185 | ( BVDB_OutputResolution eResolution, |
|---|
| 186 | char *pcStr ); |
|---|
| 187 | |
|---|
| 188 | void BVDB_P_GetAspectRatioStr |
|---|
| 189 | ( BVDB_AspectRatio eAspectRatio, |
|---|
| 190 | char *pcStr ); |
|---|
| 191 | |
|---|
| 192 | void BVDB_P_GetWindowStr |
|---|
| 193 | ( BVDB_Window eWin, |
|---|
| 194 | char *pcStr ); |
|---|
| 195 | |
|---|
| 196 | void BVDB_P_GetInputStr |
|---|
| 197 | ( BVDB_Input eInput, |
|---|
| 198 | char *pcStr ); |
|---|
| 199 | |
|---|
| 200 | void BVDB_P_GetOsdStr |
|---|
| 201 | ( BVDB_Osd eOsd, |
|---|
| 202 | char *pcStr ); |
|---|
| 203 | |
|---|
| 204 | void BVDB_P_GetPixelFormatStr |
|---|
| 205 | ( BVDB_PixelFormat ePxlFormat, |
|---|
| 206 | BVDB_State eState, |
|---|
| 207 | char *pcStr ); |
|---|
| 208 | |
|---|
| 209 | void BVDB_P_GetFieldStoreCntStr |
|---|
| 210 | ( BVDB_DeinterlacerFieldStore eFieldStore, |
|---|
| 211 | char *pcStr ); |
|---|
| 212 | |
|---|
| 213 | void BVDB_P_GetStateStr |
|---|
| 214 | ( BVDB_State eState, |
|---|
| 215 | char *pcStr ); |
|---|
| 216 | |
|---|
| 217 | void BVDB_P_GetSclCapBiasStr |
|---|
| 218 | ( BVDB_ScalerCaptureBias eBias, |
|---|
| 219 | char *pcStr ); |
|---|
| 220 | |
|---|
| 221 | BERR_Code BVDB_P_GetConfigMemAllocArray |
|---|
| 222 | ( BVDB_P_Config_MemAlloc *pstConfigMemAllocArray ); |
|---|
| 223 | |
|---|
| 224 | BERR_Code BVDB_P_GetRtsData |
|---|
| 225 | (uint32_t ulConfigId, |
|---|
| 226 | BVDB_P_RtsData ** pUsageMode, |
|---|
| 227 | uint32_t * pUsageModeNum); |
|---|
| 228 | |
|---|
| 229 | BERR_Code BVDB_P_GetNumConfigs |
|---|
| 230 | ( uint32_t *pulNumConfigs); |
|---|
| 231 | |
|---|
| 232 | #ifdef __cplusplus |
|---|
| 233 | } |
|---|
| 234 | #endif |
|---|
| 235 | |
|---|
| 236 | #endif /* __BVDB_PRIV_H__ */ |
|---|