source: svn/trunk/newcon3bcm2_21bu/magnum/commonutils/vdb/35233/A0/bvdb.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 34.2 KB
Line 
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.h $
11 * $brcm_Revision: Hydra_Software_Devel/5 $
12 * $brcm_Date: 7/20/11 1:44p $
13 *
14 * Module Description:
15 *   The VDB (Video Usage Modes Database) is a database of all possible video
16 *   usage modes for a given chipset. This was created to support VDC's
17 *   new source pending feature that allows applications to configure the
18 *   BVN according to their requirements.
19 *
20 *   Sample use:
21 *
22 *   BVDB_Handle *hVdb;
23 *   uint32_t ulEntries;
24 *   BVDB_UsageMode stUsageMode;
25 *   const BVDB_RtsTable *pstRtsTbl = NULL;
26 *
27 *   // Create VDB
28 *   BVDB_CreateVdb(&hVdb);
29 *
30 *   // Get a usage mode given the following parameters
31 *  strcpy(stUsageMode.acId, "1"); configuration 1
32 *  stUsageMode.eInputFormatGroup = BVDB_InputFormatGroup_eNTSC;
33 *  stUsageMode.eDisplay = BVDB_Display_ePrimary60;
34 *  stUsageMode.eWindow = BVDB_Window_eMain;
35 *  stUsageMode.eIput = BVDB_Input_eComponent;
36 *  stUsageMode.eOsd = BVDB_Osd_e1920_1080p_32bpp
37 *  stUsageMode.stDisplayMode = 0x3f; "all_FULL_modes"
38 *
39 *  err = BVDB_GetVdbEntry(hVdb, &stUsageMode);
40 *  if (err != BERR_SUCCESS)
41 *  {
42 *      BDBG_ERR(("Usage mode with given paramters not found"));
43 *  }
44 *
45 *  // Get the RTS table associated with the obtained usage mode
46 *  pstRtsTbl = BVDB_GetRtsTable(hVdb, stUsageMode.eRtsSet);
47 *
48 *
49 *  // Destroy VDB
50 *  BVDB_DestroyVdb(hVdb);
51 *
52 *
53 *
54 * Revision History:
55 *
56 * $brcm_Log: /magnum/commonutils/vdb/35233/A0/bvdb.h $
57 *
58 * Hydra_Software_Devel/5   7/20/11 1:44p jerrylim
59 * SWDTV-7684: Selectively choose VDC buffer heap based on 3D display
60 *
61 * Hydra_Software_Devel/4   6/22/11 11:07p jerrylim
62 * SWDTV-7593, SWDTV-7587: Force CAP-SCL for RP1080p and Corrected
63 * blockout for FRC clients to support 3D
64 *
65 * Hydra_Software_Devel/3   6/15/11 1:30p jerrylim
66 * SWDTV-7385, SWDTV-6738: Added 3D support to config23301
67 *
68 * Hydra_Software_Devel/2   6/3/11 3:23p jerrylim
69 * SWDTV-7358, SWDTV-7300, SWDTV-7132, SWDTV-5753: Restructured VDB for
70 * 35233
71 *
72 * Hydra_Software_Devel/1   3/17/11 7:22p jerrylim
73 * SWDTV-5980: Added 35233 VDB
74 *
75 ***************************************************************************/
76#ifndef __BVDB_H__
77#define __BVDB_H__
78
79#include "bstd.h"
80#include "berr.h"
81#include "bfmt.h"
82#include "bpxl.h"
83
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
89
90/* VDB revisions */
91#define BVDB_P_VDB_VER_1    (1)
92#define BVDB_P_VDB_VER_2    (2)
93#define BVDB_P_VDB_VER_3    (3)
94
95#if (BCHP_CHIP == 35233)
96    #if (BCHP_VER == BCHP_VER_A0)
97        #define BVDB_P_VDB_VER  BVDB_P_VDB_VER_2
98    #else
99        #define BVDB_P_VDB_VER  BVDB_P_VDB_VER_3
100    #endif
101#else
102    #define BVDB_P_VDB_VER  BVDB_P_VDB_VER_3
103#endif
104
105#define BVDB_P_EXPAND_3D_SOURCES        1
106#define BVDB_P_ENABLE_PDP_RR            1
107
108/************************* Module Overview ************************************
109The Video Usage Modes Database (VDB) intends to capture all the BVN and RTS
110information found in the usage modes spreadsheet and put these in a form
111that can be used readily by an application.
112***************************************************************************/
113#define BVDB_RTS_TABLE_SIZE             91
114
115#define BVDB_SCL_CAP_TOLERANCE_FACTOR   10000
116
117/*******************************************************************************
118 * Summary:
119 *     This enumeration represents the state of a particular BVN component.
120 *
121 * Description:
122 *     BVDB_State_eNo            - the BVN component is disabled.
123 *     BVDB_State_eYes           - the BVN component is enabled.
124 *     BVDB_State_eNotApplicable - the BVN component is not applicable for
125 *                                 the usage mode it is used with.
126 *
127 * See Also:
128 *     BVDB_Anr, BVBD_CaptureFeeder, BVDB_Mad
129 */
130typedef enum
131{
132    BVDB_State_eNo = 0,
133    BVDB_State_eYes,
134    BVDB_State_eNotApplicable
135} BVDB_State;
136
137
138/*******************************************************************************
139 * Summary:
140 *    This enumeration represents source groups that the current RTS
141 *    supports
142 *
143 * Description:
144 *   See below
145 *
146 * See Also:
147 *     BVDB_UsageMode
148 */
149typedef enum
150{
151    /* Compressed 2D source */
152    BVDB_SourceGroup_Avc_e576i2d       = 1 << 0, /* Interlaced SD - 480i/576i*/
153    BVDB_SourceGroup_Avc_e720p2d       = 1 << 1, /* 480p, 576p, 720p */
154    BVDB_SourceGroup_Avc_e1080i2d      = 1 << 2, /* 1080i */
155    BVDB_SourceGroup_Avc_e1080psf2d    = 1 << 3, /* 1080p 24/25/30Hz */
156    BVDB_SourceGroup_Avc_e1080p2d      = 1 << 4, /* 1080p 50Hz and above */
157
158    /* All other non 444 2D sources (RP stands for Rear Panel, and what it
159     * actually means is the 422 sources coming throught HD-DVI */
160    BVDB_SourceGroup_Rp_e576i2d        = 1 << 5, /* Interlaced SD - 480i/576i*/
161    BVDB_SourceGroup_Rp_e720p2d        = 1 << 6, /* 480p, 576p, 720p */
162    BVDB_SourceGroup_Rp_e1080i2d       = 1 << 7, /* 1080i */
163    BVDB_SourceGroup_Rp_e1080psf2d     = 1 << 8, /* 1080p 24/25/30Hz */
164    BVDB_SourceGroup_Rp_e1080p2d       = 1 << 9, /* 1080p 50Hz and above */
165
166    /* Compressed 3D source */
167#if BVDB_P_EXPAND_3D_SOURCES
168    BVDB_SourceGroup_Avc_e576i3d       = 1 << 10, /* Interlaced 3D SD - 480i/576i*/
169    BVDB_SourceGroup_Avc_e720p3d       = 1 << 11, /* 3D 480p, 576p, 720p */
170    BVDB_SourceGroup_Avc_e1080i3d      = 1 << 12, /* 3D 1080i */
171    BVDB_SourceGroup_Avc_e1080psf3d    = 1 << 13, /* 3D 1080p 24/25/30Hz */
172    BVDB_SourceGroup_Avc_e1080p3d      = 1 << 14, /* 3D 1080p 50Hz and above */
173#else
174    BVDB_SourceGroup_Avc_e3d           = 1 << 14, /* 3D 1080p 50Hz and above */
175#endif
176
177    /* All other non 444 3D sources */
178#if BVDB_P_EXPAND_3D_SOURCES
179    BVDB_SourceGroup_Rp_e576i3d        = 1 << 15, /* 3D Interlaced SD - 480i/576i*/
180    BVDB_SourceGroup_Rp_e720p3d        = 1 << 16, /* 3D 480p, 576p, 720p */
181    BVDB_SourceGroup_Rp_e1080i3d       = 1 << 17, /* 3D 1080i */
182    BVDB_SourceGroup_Rp_e1080psf3d     = 1 << 18, /* 3D 1080p 24/25/30Hz */
183    BVDB_SourceGroup_Rp_e1080p3d       = 1 << 19, /* 3D 1080p 50Hz and above */
184#else
185    BVDB_SourceGroup_Rp_e3d            = 1 << 19, /* 3D 1080p 50Hz and above */
186#endif
187
188    /* PC is defined as a source with 444 chroma subsampling */
189    BVDB_SourceGroup_ePc2d             = 1 << 20,/* PC */
190
191    /* JPEG sources */
192    BVDB_SourceGroup_eJpeg2d           = 1 << 21,/* JPEG */
193
194    /* ADC Calibration */
195    BVDB_SourceGroup_eAdcCalibration2d = 1 << 22, /* ADC Calibration */
196
197    /* If a given source doesn't fall under any source group, it is always
198     * handleed as a worst case source */
199    BVDB_SourceGroup_eWorst            = 1 << 23 /* Worst case source */
200} BVDB_SourceGroup;
201
202#define BVDB_SourceGroup_None        (0)
203#define BVDB_SourceGroup_Any         (0xffffffff)
204#define BVDB_SourceGroup_Avc2d       (BVDB_SourceGroup_Avc_e576i2d    | \
205                                      BVDB_SourceGroup_Avc_e720p2d    | \
206                                      BVDB_SourceGroup_Avc_e1080i2d   | \
207                                      BVDB_SourceGroup_Avc_e1080psf2d | \
208                                      BVDB_SourceGroup_Avc_e1080p2d)
209
210#if BVDB_P_EXPAND_3D_SOURCES
211#define BVDB_SourceGroup_Avc3d       (BVDB_SourceGroup_Avc_e576i3d    | \
212                                      BVDB_SourceGroup_Avc_e720p3d    | \
213                                      BVDB_SourceGroup_Avc_e1080i3d   | \
214                                      BVDB_SourceGroup_Avc_e1080psf3d | \
215                                      BVDB_SourceGroup_Avc_e1080p3d)
216#else
217#define BVDB_SourceGroup_Avc3d       (BVDB_SourceGroup_Avc_e3d)
218#endif
219
220#define BVDB_SourceGroup_AvcAll      (BVDB_SourceGroup_Avc2d          | \
221                                      BVDB_SourceGroup_Avc3d)
222
223#define BVDB_SourceGroup_Rp2d        (BVDB_SourceGroup_Rp_e576i2d     | \
224                                      BVDB_SourceGroup_Rp_e720p2d     | \
225                                      BVDB_SourceGroup_Rp_e1080i2d    | \
226                                      BVDB_SourceGroup_Rp_e1080psf2d  | \
227                                      BVDB_SourceGroup_Rp_e1080p2d)
228
229#if BVDB_P_EXPAND_3D_SOURCES
230#define BVDB_SourceGroup_Rp3d        (BVDB_SourceGroup_Rp_e576i3d     | \
231                                      BVDB_SourceGroup_Rp_e720p3d     | \
232                                      BVDB_SourceGroup_Rp_e1080i3d    | \
233                                      BVDB_SourceGroup_Rp_e1080psf3d  | \
234                                      BVDB_SourceGroup_Rp_e1080p3d)
235#else
236#define BVDB_SourceGroup_Rp3d        (BVDB_SourceGroup_Rp_e3d)
237#endif
238
239#define BVDB_SourceGroup_RpAll       (BVDB_SourceGroup_Rp2d           | \
240                                      BVDB_SourceGroup_Rp3d)
241
242#define BVDB_SourceGroup_PcAll       (BVDB_SourceGroup_ePc2d)
243
244#define BVDB_SourceGroup_Rp2d_Pc2d   (BVDB_SourceGroup_Rp2d           | \
245                                      BVDB_SourceGroup_ePc2d)
246
247#define BVDB_SourceGroup_RpAll_PcAll (BVDB_SourceGroup_RpAll          | \
248                                      BVDB_SourceGroup_PcAll)
249
250#define BVDB_SourceGroup_eJpegAll    (BVDB_SourceGroup_eJpeg2d)
251
252#define BVDB_SourceGroup_eAdcCalibrationAll (BVDB_SourceGroup_eAdcCalibration2d)
253
254#define BVDB_SourceGroup_3dAll       (BVDB_SourceGroup_Rp3d           | \
255                                      BVDB_SourceGroup_Avc3d)
256
257
258/*******************************************************************************
259 * Summary:
260 *     This enumerates the supported display types. Each usage mode entry
261 *     must have this.
262 *
263 * Description:
264 *
265 * See Also:
266 *     BVDB_UsageMode
267 */
268typedef enum
269{
270    BVDB_Display_ePrimary24 = 0,
271    BVDB_Display_ePrimary48,
272    BVDB_Display_ePrimary50,
273    BVDB_Display_ePrimary60,
274    BVDB_Display_eSecondary50,
275    BVDB_Display_eSecondary60,
276    BVDB_Display_eInvalid
277} BVDB_DisplayType;
278
279/*******************************************************************************
280 * Summary:
281 *     This enumerates the supported output resolutions. Each usage mode
282 *     entry must have this.
283 *
284 * Description:
285 *
286 * See Also:
287 *     BVDB_UsageMode
288 */
289typedef enum
290{
291    BVDB_OutputResolution_eInvalid      = 0,
292    BVDB_OutputResolution_e1080p        = 1 << 0,
293    BVDB_OutputResolution_eWxga         = 1 << 1,
294    BVDB_OutputResolution_e1080i        = 1 << 2,
295    BVDB_OutputResolution_e720p         = 1 << 3,
296    BVDB_OutputResolution_eXga          = 1 << 4,
297    BVDB_OutputResolution_e480p         = 1 << 5,
298    BVDB_OutputResolution_e576p         = 1 << 6,
299    BVDB_OutputResolution_e480i         = 1 << 7,
300    BVDB_OutputResolution_e576i         = 1 << 8,
301    BVDB_OutputResolution_e1920x2160i   = 1 << 9,
302    BVDB_OutputResolution_e1280x1440p   = 1 << 10,
303    BVDB_OutputResolution_e1920x2205p   = 1 << 11,
304    BVDB_OutputResolution_e1280x1470p   = 1 << 12
305} BVDB_OutputResolution;
306
307#define BVDB_OutputResolution_Any   (0xffffffff)
308
309/*******************************************************************************
310 * Summary:
311 *     This enumerates display mode where it's in 3D or 2D.
312 *
313 * Description:
314 *
315 * See Also:
316 *     BVDB_UsageMode
317 */
318typedef enum
319{
320    BVDB_DisplayOrientation_e2d = 1 << 0,   /* Display is in 2D */
321    BVDB_DisplayOrientation_e3d = 1 << 1,   /* Display is in 3D */
322} BVDB_DisplayOrientation;
323
324#define BVDB_DisplayOrientation_Any (0xffffffff)
325
326/*******************************************************************************
327 * Summary:
328 *     This describes the display configuration for the specified usage mode
329 *
330 * Description:
331 *     eType        - Display Type (Main, Secondary, etc)
332 *     eResolution  - Display resolution
333 *     eOrientation - 2D or 3D
334 *
335 * See Also:
336 *     BVDB_UsageMode, BVDB_DisplayType, BVDB_AspectRatio
337 */
338typedef struct
339{
340    BVDB_DisplayType        eType;
341    BVDB_OutputResolution   eResolution;
342    BVDB_DisplayOrientation eOrientation;
343} BVDB_Display;
344
345/*******************************************************************************
346 * Summary:
347 *     This enumerates the supported windows. Each usage mode entry must
348 *     have this.
349 *
350 * Description:
351 *
352 * See Also:
353 *     BVDB_UsageMode
354 */
355typedef enum
356{
357    BVDB_Window_eMain = 0,
358    BVDB_Window_ePip,
359    BVDB_Window_eMonitor,
360    BVDB_Window_eInvalid
361} BVDB_Window;
362
363/*******************************************************************************
364 * Summary:
365 *     This enumerates the supported intputs. Each usage mode entry must
366 *     have this.
367 *
368 * Description:
369 *
370 * See Also:
371 *     BVDB_UsageMode
372 */
373typedef enum
374{
375    BVDB_Input_eInvalid     = 0,
376    BVDB_Input_eCvbsSvidIfd = 1 << 0,
377    BVDB_Input_eComponent   = 1 << 1,
378    BVDB_Input_eHdmi        = 1 << 2,
379    BVDB_Input_eMfd         = 1 << 3,
380    BVDB_Input_eVga         = 1 << 4,
381    BVDB_Input_e656         = 1 << 5
382} BVDB_Input;
383
384#define BVDB_Input_Rp   (BVDB_Input_eCvbsSvidIfd | \
385                         BVDB_Input_eComponent   | \
386                         BVDB_Input_eHdmi        | \
387                         BVDB_Input_e656)
388
389#define BVDB_Input_All  (BVDB_Input_eCvbsSvidIfd | \
390                         BVDB_Input_eComponent   | \
391                         BVDB_Input_eHdmi        | \
392                         BVDB_Input_eMfd         | \
393                         BVDB_Input_eVga         | \
394                         BVDB_Input_e656)
395
396
397/*******************************************************************************
398 * Summary:
399 *     This enumerates the supported deinterlacer field store count. This is
400 *     used with BVDB_Mad only.
401 *
402 * Description:
403 *
404 * See Also:
405 *     BVDB_Mad, BVDB_UsageMode
406 */
407typedef enum
408{
409    BVDB_FieldStore_e5Fields,
410    BVDB_FieldStore_e4Fields,
411    BVDB_FieldStore_e3Fields,
412    BVDB_FieldStore_eNotApplicable
413} BVDB_DeinterlacerFieldStore;
414
415
416/*******************************************************************************
417 * Summary:
418 *     This enumerates the SCL-CAP bias used for orienting the Scaler
419 *     relative to the Capture block
420 *
421 * Description:
422 *     BVDB_SclCapBias_eAuto   - indicates the VDC will determine the
423 *                               orientation automatically given certain
424 *                               parameters
425 *     BVDB_SclCapBias_eSclCap - indicates a SCL-CAP orientation bias
426 *     BVDB_SclCapBias_eCapScl - indicates a CAP-SCL orientation bias
427 * See Also:
428 *     BVDB_UsageMode
429 */
430typedef enum
431{
432    BVDB_SclCapBias_eAuto = 0,
433    BVDB_SclCapBias_eSclCap,
434    BVDB_SclCapBias_eCapScl,
435    BVDB_SclCapBias_eInvalid
436} BVDB_ScalerCaptureBias;
437
438
439/*******************************************************************************
440 * Summary:
441 *     This enumerates the pixel formats supported. Applies to BVBD_Mad,
442 *     BVBD_CaptureFeeder, and BVDB_Anr.
443 *
444 * Description:
445 *
446 * See Also:
447 *     BVDB_Mad, BVBD_CaptureFeeder, BVDB_Anr
448 */
449typedef enum
450{
451    BVDB_PixelFmt_e8Bit422 = 0,
452    BVDB_PixelFmt_e10Bit422,
453    BVDB_PixelFmt_e10Bit444,
454    BVDB_PixelFmt_eInvalid
455} BVDB_PixelFormat;
456
457
458/*******************************************************************************
459 * Summary:
460 *     This describes the OSD setting for the specified usage mode.
461 *
462 * Description:
463 *     ulWidth  - max OSD width
464 *     ulHeight - max OSD height
465 *     ulBpp    - max OSD Bits Per Pixel
466 *
467 * See Also:
468 *     BVDB_UsageMode
469 */
470typedef struct
471{
472    uint32_t ulWidth;
473    uint32_t ulHeight;
474    uint32_t ulBpp;
475} BVDB_OsdInfo;
476
477/*******************************************************************************
478 * Summary:
479 *     This describes the CAP/VFD configuration for the specified usage mode
480 *
481 * Description:
482 *     eState       - whether capture is enabled or not
483 *     ePixelFormat - the capture buffer's pixel format
484 *     eReserved    - for future use
485 *
486 * See Also:
487 *     BVDB_UsageMode, BVDB_PixelFormat, BVDB_State
488 */
489typedef struct
490{
491    BVDB_State       eState;
492    BVDB_PixelFormat ePixelFormat;
493    uint32_t         ulReserved;
494} BVDB_CaptureFeeder;
495
496/*******************************************************************************
497 * Summary:
498 *     This describes the MAD configuration for the specified usage mode.
499 *     Note that MAD refers to MCVP in 35230
500 *
501 * Description:
502 *     eState       - whether MAD is enabled or not
503 *     eFieldStore  - the max number of MAD fields
504 *     ePixelFormat - the MAD buffer's pixel format.
505 *     ulReserved   - for future use
506 *
507 * See Also:
508 *     BVDB_UsageMode, BVDB_PixelFormat, BVDB_State,
509 *     BVDB_DeinterlacerFieldStore
510 */
511typedef struct
512{
513    BVDB_State                  eState;
514    BVDB_DeinterlacerFieldStore eFieldStore;
515    BVDB_PixelFormat            ePixelFormat;
516    uint32_t                    ulReserved;
517} BVDB_Mad;
518
519typedef BVDB_Mad BVDB_Anr;
520
521/*******************************************************************************
522 * Summary:
523 *     This describes the PDP configuration for the specified usage mode.
524 *
525 * Description:
526 *     eState    - whether PDP is enabled or not
527 *     eReserved - for future use
528 *
529 * See Also:
530 *     BVDB_UsageMode, BVDB_State
531 */
532typedef struct
533{
534    BVDB_State eState;
535    uint32_t   ulReserved;
536} BVDB_Pdp;
537
538
539/*******************************************************************************
540 * Summary:
541 *     This describes the FRC configuration for the specified usage mode.
542 *
543 * Description:
544 *     eState    - whether FRC is enabled or not
545 *     eReserved - for future use
546 *
547 * See Also:
548 *     BVDB_UsageMode, BVDB_State
549 */
550typedef struct
551{
552    BVDB_State eState;
553    uint32_t   ulReserved;
554} BVDB_Frc;
555
556
557/*******************************************************************************
558 * Summary:
559 *     This describes the RTC configuration for the specified usage mode.
560 *
561 * Description:
562 *     eState    - whether RTC is enabled or not
563 *     eReserved - for future use
564 *
565 * See Also:
566 *     BVDB_UsageMode, BVDB_State
567 */
568typedef struct
569{
570    BVDB_State eState;
571    uint32_t   ulReserved;
572} BVDB_Rtc;
573
574
575
576/*******************************************************************************
577 * Summary:
578 *     This contains the ID and the RTS register value for a given SCB
579 *     client.
580 *
581 * Description:
582 *     ulId       - the client ID
583 *     ulRegValue - the value to be written to the client's SCB register
584 *
585 * See Also:
586 *     BVDB_RtsTable
587 */
588typedef struct
589{
590    uint32_t ulId;
591    uint32_t ulRegValue;
592} BVDB_Rts;
593
594/*******************************************************************************
595 * Summary:
596 *     This contains the table of SCB client's RTS values. A usage mode has
597 *     this. Certain usage modes do not have this and are marked as n/a
598 *     since the clients for that particular usage modes do not requirea new
599 *     RTS setting.
600 *
601 * Description:
602 *     ulValidTableEntries - the number of valid entries in the table.
603 *     astRts              - the table of SCB client's RTS values
604 *
605 * See Also:
606 *     BVDB_Rts, BVDB_RTS_TABLE_SIZE
607 */
608typedef struct
609{
610    uint32_t ulRtsRegisterTableId;
611    uint32_t ulValidTableEntries;
612    BVDB_Rts astRts[BVDB_RTS_TABLE_SIZE];
613} BVDB_RtsTable;
614
615/*******************************************************************************
616 * Summary:
617 *     Usage Mode database record.
618 *
619 * Description:
620 *     This is the structure used for database entries (record).
621 *
622 * See Also:
623 *
624 */
625typedef struct BVDB_UsageMode
626{
627    /* Input parameters to be filled by a caller (i.e., Nexus VDB) */
628    BVDB_SourceGroup       eInputFormatGroup;
629    BVDB_Display           stDisplay;
630    BVDB_Window            eWindow;
631    BVDB_Input             eInput;
632
633    /* Output parameters to be filled by VDB */
634    uint32_t               usageId;
635    BVDB_OsdInfo           stOsd;
636    BVDB_State             e3dComb;
637    BVDB_State             eOversample;
638    BVDB_State             eDnr;
639    BVDB_CaptureFeeder     stCapVfd;
640    BVDB_Mad               stMad; /* It refers to MCVP in 35230 and
641                                   * later chips */
642    BVDB_Pdp               stPdp;
643    BVDB_Rtc               stRtc;
644    BVDB_Frc               stFrc;
645    BVDB_RtsTable          *pRtsSet;
646    uint32_t               ulSclCapTolerance; /* This must be divided
647                                               * by BVDB_SCL_CAP_TOLERANCE_FACTOR
648                                               * to get the actual value. */
649    BVDB_ScalerCaptureBias eSclCapBias; /* to be oboslete */
650} BVDB_UsageMode;
651
652/*******************************************************************************
653 * Summary:
654 *     This structure describes the memory allocation requirements for a
655 *     given window heap.
656 *
657 * Description:
658 *     BVDB_Heap_Settings is a structure that use to describe the public
659 *     settings of a window heap.
660 *
661 *     ulBufferCnt_2HD -
662 *         The number of double HD buffers required.
663 *
664 *     ePixelFormat_2HD -
665 *         The pixel format for double HD buffer.
666 *
667 *     eBufferFormat_2HD  -
668 *         The double HD buffer format. This is typically
669 *         BFMT_VideoFmt_e1080p_30Hz.
670 *
671 *      ulBufferCnt_2HD_Pip -
672 *          The numbfer 2HD PIP buffers required.  This max PIP size
673 *         is 1/4 of 2HD buffers. Only PIP windows smaller or equal to 1/4
674 *         2HD buffer size can use these buffers. PIP windows bigger than 1/4
675 *         of 2HD buffer size needs to use 2HD buffers.
676 *
677 *     ulBufferCnt_HD -
678 *         The number of HD buffers required.
679 *
680 *     ePixelFormat_HD -
681 *         The pixel format for single HD buffer.
682 *
683 *     eBufferFormat_HD -
684 *         The HD buffer format. Typically this is BFMT_VideoFmt_e1080i.
685 *
686 *     ulBufferCnt_HD_Pip -
687 *         The number HD PIP buffers required.  This max PIP size
688 *         is 1/4 of HD buffers. Only PIP windows smaller or equal to 1/4 HD
689 *         buffer size can use these buffers. PIP windows bigger than 1/4 of
690 *         HD buffer size needs to use HD buffers.
691 *
692 *     ulBufferCnt_SD -
693 *         The number of SD buffers required.
694 *
695 *     ePixelFormat_SD -
696 *         The pixel format for SD buffer.
697 *
698 *     eBufferFormat_SD -
699 *         The SD buffer format. This is typically BFMT_VideoFmt_ePAL_G.
700 *
701 *
702 * See Also:
703 *     BVDB_GetMemoryAllocation
704 */
705typedef struct
706{
707    /* Double HD Buffer settings */
708    uint32_t      ulBufferCnt_2HD;
709    BPXL_Format   ePixelFormat_2HD;
710    BFMT_VideoFmt eBufferFormat_2HD;
711    uint32_t      ulBufferCnt_2HD_Pip;
712
713    /* HD Buffer settings */
714    uint32_t      ulBufferCnt_HD;
715    BPXL_Format   ePixelFormat_HD;
716    BFMT_VideoFmt eBufferFormat_HD;
717    uint32_t      ulBufferCnt_HD_Pip;
718
719    /* SD Buffer settings */
720    uint32_t      ulBufferCnt_SD;
721    BPXL_Format   ePixelFormat_SD;
722    BFMT_VideoFmt eBufferFormat_SD;
723    uint32_t      ulBufferCnt_SD_Pip;
724}BVDB_Heap_Settings;
725
726
727/*******************************************************************************
728 * Summary:
729 *     This structure describes the supported feature set of the selected
730 *     RTS configuration.
731 *
732 * Description:
733 *     bPipSupport           - true if PIP is supported
734 *     bMonitorSupport       - true if monitor output is supported
735 *     bFrcSupport           - true if FRC is supported
736 *     bRtcSupport           - true if RTS is supported
737 *     bPanelReversalSupport - true if panel reversal supported
738 *     worstPdpBpp           - largest bpp of FRC block
739 *     maxPipWinHeight       - maximum PIP window height if bPipSupport is
740 *                             true
741 *     maxPipWinWidth        - maximum PIP window width if bPipSupport is
742 *                              true
743 *
744 * See Also:
745 *     None
746 */
747typedef struct
748{
749    bool     bPipSupport;
750    bool     bMonitorSupport;
751    bool     bFrcSupport;
752    bool     bRtcSupport;
753    bool     bPanelReversalSupport;
754    uint32_t worstPdpBpp;
755    uint32_t maxPipWinHeight;
756    uint32_t maxPipWinWidth;
757} BVDB_Config_Features;
758
759
760/*******************************************************************************
761 * Summary:
762 *     This enum determines pixel format to use.
763 *
764 *     BVDB_PixelMode_eByRtsTable - the pixel format in the RTS table to
765 *                                  used
766 *     BVDB_PixelMode_e422Forced  - regardless of the pixel format of the
767 *                                  selected usgae mode, a usage mode with
768 *                                  422 will replace it
769 *     BVDB_PixelMode_e444Forced; - regardless of the pixel format of the
770 *                                  selected usage mode, a usage mode with
771 *                                  444 will replace it.
772 */
773typedef enum
774{
775    BVDB_PixelMode_eByRtsTable = 0,
776    BVDB_PixelMode_e422Forced,
777    BVDB_PixelMode_e444Forced
778} BVDB_PixelMode;
779
780/*******************************************************************************
781 * Summary:
782 *     This structure describes the current system configuration determined
783 *     by either driver internal operations or app.
784 *
785 *     bPipVisible           - true if currently PIP window is visible
786 *     bPanelReversed        - true if currently the system has panel
787 *                             reversal
788 *     b3dDualPathProcessing - true if 3D source is required processed in
789 *                             dual paths (obsolete)
790 *     ePixelMode            - selects pixel format to use (422 or 444)
791 * See Also:
792 *     BVDB_PixelMode
793 */
794typedef struct
795{
796    bool bPipVisible;
797    bool bPanelReversed;
798    bool b3dDualPathProcessing;
799    BVDB_PixelMode ePixelMode;
800} BVDB_System_Configurations;
801
802
803/*******************************************************************************
804 * Summary:
805 *     Video Usage Modes Database (VDB) context handle.
806 *
807 * Description:
808 *     This is a handle that the application created with BVDB_CreateVdb.
809 *     BVDB_Handle holds the context of the VDB.  There should only one
810 *     BVDB_Handle at any given instant.  The main VDB handle is use to add,
811 *     delete, and query databse entries.
812 *
813 * See Also:
814 *     BVDB_CreateVdb, BVDB_DestroyVdb.
815 */
816typedef struct BVDB_P_Context  *BVDB_Handle;
817
818
819/*******************************************************************************
820 * Summary:
821 *     Creates the database. The database is created using a generated C
822 *     file that contains all the usage modes an their information.
823 *
824 * Input:
825 *
826 * Output:
827 *     phVdb                  - the VDB handle
828 *
829 * Returns:
830 *     BERR_INVALID_PARAMETER - Invalid function parameters.
831 *     BERR_SUCCESS           - Function succeed
832 *
833 * See Also:
834 *     BVDB_WriteVdbFile
835 */
836BERR_Code BVDB_CreateVdb
837    (BVDB_Handle *phVdb);
838
839
840/*******************************************************************************
841 * Summary:
842 *     Destroys the database.
843 *
844 * Input:
845 *     hVDb                   - the VDB handle
846 *
847 * Returns:
848 *     BERR_INVALID_PARAMETER - Invalid function parameters.
849 *     BERR_SUCCESS           - Function succeed
850 *
851 * See Also:
852 *     BVDB_CreateVdb
853 */
854BERR_Code BVDB_DestroyVdb
855    (BVDB_Handle hVdb);
856
857
858/*******************************************************************************
859 * Summary:
860 *     Gets a VDB entry based on the Config #, Input Format Group, Display,
861 *     Window, Input, OSD, and Video Display usage mode. This function takes
862 *     in a BVDB_Usage mode structure partially filled with the required
863 *     info. It will then be completely filled if the usage mode requested
864 *     is found. Otherwise an error will be returned.
865 *
866 * Description:
867 *     Example on filling the required fields:
868 *
869 *     strcpy(pstUsageMode->acId, "1"); configuration 1
870 *     pstUsageMode->eInputFormatGroup = BVDB_InputFormatGroup_eNTSC;
871 *     pstUsageMode->eDisplay = BVDB_Display_ePrimary60;
872 *     pstUsageMode->eWindow = BVDB_Window_eMain;
873 *     pstUsageMode->eIput = BVDB_Input_eComponent;
874 *     pstUsageMode->eOsd = BVDB_Osd_e1920_1080p_32bpp
875 *     pstUsageMode->stDisplayMode = 0x3f; "all_FULL_modes"
876 *
877 *     err = BVDB_GetVdbEntry(hVdb, pstUsageMode);
878 *
879 * Input:
880 *     hVdb                   - the VDB handle
881 *     pstUsageMode           - the usage mode with the required info
882 *     pstSysConfig           - current system configurations that VDB needs
883 *                              to use
884 *
885 * Output:
886 *     pstUsageMode           - the usage mode with the required info plus
887 *                              the remaining info, if found
888 * Returns:
889 *     BERR_INVALID_PARAMETER - Invalid function parameters.
890 *     BERR_SUCCESS           - Function succeed
891 *
892 * See Also:
893 *
894 */
895BERR_Code BVDB_GetVdbEntry
896    (BVDB_Handle                hVdb,
897     BVDB_UsageMode             *pstUsageMode,
898     BVDB_System_Configurations *pstSysConfig);
899
900
901/*******************************************************************************
902 * Summary:
903 *     Prints the usage mode on the console.
904 *
905 * Input:
906 *     hVdb                   - the VDB handle
907 *     pstUsageMode           - the user specified usage mode
908 *
909 * Returns:
910 *     BERR_INVALID_PARAMETER - Invalid function parameters.
911 *     BERR_SUCCESS           - Function succeed
912 *
913 * See Also:
914 *
915 */
916#if BDBG_DEBUG_BUILD
917BERR_Code BVDB_PrintUsageMode
918    (BVDB_Handle          hVdb,
919     const BVDB_UsageMode *pstUsageMode );
920#else
921#define BVDB_PrintUsageMode(a, b)  (BERR_SUCCESS)
922#endif
923
924
925
926/*******************************************************************************
927 * Summary:
928 *     This gets the input format group given the source's information. A
929 *     BVDB_InputFormatGroup_eInvalid is returned if a match is not found.
930 *
931 * Input:
932 *     hVdb            - the handle to VDB
933 *     ulHeight        - the source's height
934 *     ulWidth         - the source's width
935 *     ulFrameRate     - the source's frame rate. The frame rate
936 *                       must be multiplied by 1000 to handle
937 *                       float rates, eg., 23.976 will be passed in
938 *                       as 23976 and 60 will be passed in as 60000.
939 *     bJpeg           - is a JPEG source
940 *     bAdcCalibration - is in ADC calibration mode
941 *     b3dSource       - is a 3D source
942 *     bProgressive    - is the source inerlaced or progressive
943 *     eInput          - the input used with the source
944 *
945 * Returns:
946 *     input source group
947 *
948 * See Also:
949 */
950BVDB_SourceGroup BVDB_GetInputFormatGroup
951    (BVDB_Handle hVdb,
952     uint32_t    ulHeight,
953     uint32_t    ulWidth,
954     uint32_t    ulFrameRate,
955     bool        bProgressive,
956     bool        bJpeg,
957     bool        bAdcCalibration,
958     bool        b3dSource,
959     BVDB_Input  eInput);
960
961/*******************************************************************************
962 * Summary:
963 *     This validates the configuration ID.
964 *
965 * Input:
966 *     hVdb       - the handle to VDB
967 *     ulConfigId - the configuration ID
968 *
969 * Returns:
970 *     BERR_INVALID_PARAMETER - Invalid function parameters.
971 *     BERR_SUCCESS           - Function succeed
972 *
973 * See Also:
974 */
975BERR_Code BVDB_ValidateConfigId
976    (BVDB_Handle    hVdb,
977     const uint32_t ulConfigId);
978
979
980/*******************************************************************************
981 * Summary:
982 *     This returns the features that the slected RTS configuration supports
983 *
984 * Input:
985 *     hVdb                   - the handle to VDB
986 *     *pConfigFeatures       - pointer to which the features are copied
987 *
988 * Returns:
989 *     BERR_INVALID_PARAMETER - Invalid function parameters.
990 *     BERR_SUCCESS           - Function succeed
991 *
992 * See Also:
993 *     N/A
994 */
995BERR_Code BVDB_GetFeatures
996    (BVDB_Handle          hVdb,
997     BVDB_Config_Features *pConfigFeatures);
998
999
1000/*******************************************************************************
1001 * Summary:
1002 *     This returns the memory allocation requirements of a given
1003 *     configuration.
1004 *
1005 *     Memory allocation depends on the window path, i.e., MAIN, PIP, or MON
1006 *     and on the input type, i.e., digital (MPEG) or analog (VDEC, HDDVI,
1007 *     VGA, or 656). This is necessary to allow the use of memory sharing
1008 *     between the XVD and VDC.
1009 *
1010 *     The memory allocation requirement is specified by the buffer type,
1011 *     the number of buffers, and the buffer format. Please refer to the
1012 *     BVDB_Heap_Settings struct as this will be used to return the memory
1013 *     allocation requirement.
1014 *
1015 *     The heap size in bytes is also returned as this will aid the
1016 *     application in determining the total heap size required for the
1017 *     window path when memory sharing is employed.
1018 *
1019 * Input:
1020 *     configId         - the ID of the configuration
1021 *     eWindow          - the window path, main, pip, or monitor
1022 *     eInput           - the input type, digital or analog
1023 *     b3dDisplay       - true if the system uses 3D panel
1024 *
1025 * Output:
1026 *     pHeapSettings    - the memory buffer allocation
1027 *     pulHeapSize      - the heap size in Kilobytes
1028 *
1029 * Returns:
1030 *     BERR_INVALID_PARAMETER - Invalid function parameters.
1031 *     BERR_SUCCESS           - Function succeed
1032 *
1033 * See Also: BVDB_Window, BVDB_Input, BVDB_Heap_Settings
1034 */
1035BERR_Code BVDB_GetMemoryAllocation
1036    (uint32_t           configId,
1037     const BVDB_Window  eWindow,
1038     const BVDB_Input   eInput,
1039     bool               b3dDisplay,
1040     BVDB_Heap_Settings *pstHeapSettings,
1041     uint32_t           *pulHeapSize );
1042
1043/*******************************************************************************
1044 * Summary:
1045 *     This function sets the current window size and clip size and this
1046 *     information will be used when finding a matching VDB entry.
1047 *
1048 * Input:
1049 *     hVdb                  - the handle to VDB
1050 *     pstDisplay            - the target display
1051 *     eWindow               - the destination window
1052 *     ulSrcHeight           - the height of the source
1053 *     ulSrcWidth            - the width of the source
1054 *     ulSrcHeightClipAmount - the total amount to clip from the source
1055 *                             height
1056 *     ulSrcWidthClipAmount  - the total amount to clip from the source
1057 *                             width
1058 *     ulDestHeight          - the destination window height
1059 *     ulDestWidth           - the destination window width
1060 *
1061 * Output:
1062 *     None
1063 *
1064 * Returns:
1065 *     BERR_INVALID_PARAMETER - Invalid function parameters.
1066 *     BERR_SUCCESS           - Function succeeded
1067 *
1068 * See Also: BVDB_VideoDisplayMode, BVDB_UsageMode, BVDB_GetDisplaySrcAs
1069 */
1070BERR_Code BVDB_SetVideoDisplayMode
1071    (BVDB_Handle        hVdb,
1072     const BVDB_Display *pstDisplay,
1073     const BVDB_Window  eWindow,
1074     const uint32_t     ulSrcHeight,
1075     const uint32_t     ulSrcWidth,
1076     const uint32_t     ulSrcHeightClipAmount,
1077     const uint32_t     ulSrcWidthClipAmount,
1078     const uint32_t     ulDestHeight,
1079     const uint32_t     ulDestWidth,
1080     const bool         bAutomaticAspectRatioBoxMode);
1081
1082#ifdef __cplusplus
1083}
1084#endif
1085
1086#endif /* __BVDB_H__ */
Note: See TracBrowser for help on using the repository browser.