/*************************************************************************** * Copyright (c) 2003-2011, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: bvdb.h $ * $brcm_Revision: Hydra_Software_Devel/40 $ * $brcm_Date: 8/24/11 4:57p $ * * Module Description: * The VDB (Video Usage Modes Database) is a database of all possible video * usage modes for a given chipset. This was created to support VDC's * new source pending feature that allows applications to configure the * BVN according to their requirements. * * Sample use: * * BVDB_Handle *hVdb; * uint32_t ulEntries; * BVDB_UsageMode stUsageMode; * const BVDB_RtsTable *pstRtsTbl = NULL; * // Create VDB * BVDB_CreateVdb(&hVdb, &ulEntries); * * // Get a usage mode given the following parameters * strcpy(stUsageMode.acId, "1"); configuration 1 * stUsageMode.eInputFormatGroup = BVDB_InputFormatGroup_eNTSC; * stUsageMode.eDisplay = BVDB_Display_ePrimary60; * stUsageMode.eWindow = BVDB_Window_eMain; * stUsageMode.eIput = BVDB_Input_eComponent; * stUsageMode.eOsd = BVDB_Osd_e1920_1080p_32bpp * stUsageMode.stDisplayMode = 0x3f; "all_FULL_modes" * * err = BVDB_GetVdbEntry(hVdb, &stUsageMode); * if (err != BERR_SUCCESS) * { * BDBG_ERR(("Usage mode with given paramters not found")); * } * * // Get the RTS table associated with the obtained usage mode * pstRtsTbl = BVDB_GetRtsTable(hVdb, stUsageMode.eRtsSet); * * * // Destroy VDB * BVDB_DestroyVdb(hVdb); * * * * Revision History: * * $brcm_Log: /magnum/commonutils/vdb/35230/A0/bvdb.h $ * * Hydra_Software_Devel/40 8/24/11 4:57p yingh * SWDTV-7983: Merged back into main branch * * Hydra_Software_Devel/SWDTV-7983/1 8/4/11 8:06p yingh * SWDTV-7983: Merged avc modes for config401 * * Hydra_Software_Devel/39 6/28/11 6:09p jerrylim * SWDTV-7243: Added config205 * * Hydra_Software_Devel/38 6/21/11 6:18p yingh * SWDTV-7186: Updated config200 to support seamless switching between * different source formats * * Hydra_Software_Devel/37 5/27/11 5:26p yingh * SWDTV-5785: Modified window and clipping sizes for config402 * * Hydra_Software_Devel/36 5/2/11 12:40p yingh * SWDTV-6375: Added config204 with RTS supported * * Hydra_Software_Devel/35 4/20/11 6:07p jerrylim * SWDTV-5823: modified full modes to support smooth transition within * required zoom levels * * Hydra_Software_Devel/34 4/8/11 4:18p jerrylim * SWDTV-6314: Revised config202 to support 1080p3d@30 * * Hydra_Software_Devel/33 4/6/11 10:45a jerrylim * SWDTV-5931: Added config101 for CAP1 buffer capture * * Hydra_Software_Devel/32 3/16/11 5:32p yingh * SWDTV-5403: Added config402 with RTS supported * * Hydra_Software_Devel/31 2/22/11 3:39p jerrylim * SWDTV-5417: Added config203 with RTS supported * * Hydra_Software_Devel/30 2/14/11 12:11p jerrylim * SW35230-2804: Added PC processing option (422 or 444) * * Hydra_Software_Devel/29 2/9/11 7:31p jerrylim * SW35230-3000: Print source mapping table for debug * * Hydra_Software_Devel/28 2/9/11 4:28p jerrylim * SW35230-2843: Added config202 * * Hydra_Software_Devel/27 2/4/11 3:30p jerrylim * SW35230-1724: Added a 3D dual path processing to config200 * * Hydra_Software_Devel/26 1/27/11 11:58a jerrylim * SW35230-2162: updated config300/301 in MCVP0_RWC2 to allocate proper BW * * Hydra_Software_Devel/25 12/16/10 2:29p jerrylim * SW35230-2579: Replaced user mode functions with kernel mode functions * * Hydra_Software_Devel/24 12/14/10 2:48p jerrylim * SWGERRARD-1145: Removed config400 (config401 covers it) and increased * OSD size to 1920x1080 in config401 * * Hydra_Software_Devel/23 10/27/10 10:14a jerrylim * SW35230-1957: Integrated update for C0 * * Hydra_Software_Devel/22 10/7/10 4:26p jerrylim * SW35230-1610, SW35230-1607: Put back panel reversal support and * extended cropping size to 32% * * Hydra_Software_Devel/21 9/22/10 4:03p jerrylim * SW35230-1464: Add display formats for 3D sources * * Hydra_Software_Devel/20 9/16/10 3:50p jerrylim * SW35230-1335: Add config400, 401 * * Hydra_Software_Devel/19 9/10/10 5:57p jerrylim * SW35230-1332: Add VDB support for PDP and FRC * * Hydra_Software_Devel/18 8/31/10 10:23a jerrylim * SW35230-1203: Changed max clipping size of pig mode in config20x to * (25,25) * * Hydra_Software_Devel/17 8/26/10 5:55p jerrylim * SW35230-1170: Added support for OSD size for 3D sources * * Hydra_Software_Devel/16 8/23/10 6:21p jerrylim * SW35230-785: Added support for Auto Aspect Ratio Correction * * Hydra_Software_Devel/15 8/13/10 4:07p jerrylim * SW35230-224: Added a get function which returns feature set that each * RTS configuration supports * * Hydra_Software_Devel/14 7/29/10 5:38p jerrylim * SW35230-817: Added 3D support to config200 * * Hydra_Software_Devel/13 7/23/10 5:47p jerrylim * SW35230-670: CAP bpp with panel reversal compensated * * Hydra_Software_Devel/12 7/22/10 7:51p jerrylim * SW35230-742: Modified config200 with 667Mhz support w/o FRC, Added * initial revision of config201 * * Hydra_Software_Devel/11 7/19/10 4:01p jerrylim * SW35230-630: Changes made based on usage mode Ver. 3.0 * * Hydra_Software_Devel/10 7/15/10 5:39p jerrylim * SW35230-320: Added initial revision of config300 and config301 * * Hydra_Software_Devel/9 7/12/10 3:51p jerrylim * SW35230-297: Added PIP support. Added more message for easier problem * identification * * Hydra_Software_Devel/8 7/8/10 1:11p jerrylim * SW35230-297: Simplified display modes * * Hydra_Software_Devel/7 7/7/10 4:16p jerrylim * SW35230-297: Simplified Get display Mode * * Hydra_Software_Devel/6 7/6/10 4:03p jerrylim * SW35230-297: Made usage mode obey VDB * * Hydra_Software_Devel/5 7/2/10 5:44p jerrylim * SW35230-297: Changed config100 to the new design style * * Hydra_Software_Devel/4 7/2/10 3:49p jerrylim * SW35230-297: Added RTS status print, Added usagemode version print, * Removed cfg101(obsolete), Added RTS table ID, Adjusted win to max * * Hydra_Software_Devel/3 6/29/10 11:18a jerrylim * SW35230-297: cleaned up old design. Corrected VDB dump * * Hydra_Software_Devel/2 6/23/10 5:53p jerrylim * SW35230-309: Added config 200 based on Usage Mode Rev.2.0 * * Hydra_Software_Devel/1 4/30/10 3:06p jerrylim * SW35230-99: Added real VDB files * ***************************************************************************/ #ifndef __BVDB_H__ #define __BVDB_H__ #include "bstd.h" #include "berr.h" #include "bfmt.h" #include "bpxl.h" #include "blst_circleq.h" #ifdef __cplusplus extern "C" { #endif /* TODO: To be moved to RTS Configuration Context */ #define BVDB_USAGE_MODE_VER_CFG100 (11) #define BVDB_USAGE_MODE_VER_CFG101 (10) #define BVDB_USAGE_MODE_VER_CFG200 (40) #define BVDB_USAGE_MODE_VER_CFG201 (32) #define BVDB_USAGE_MODE_VER_CFG202 (12) #define BVDB_USAGE_MODE_VER_CFG203 (10) #define BVDB_USAGE_MODE_VER_CFG204 (10) #define BVDB_USAGE_MODE_VER_CFG205 (10) #define BVDB_USAGE_MODE_VER_CFG300 (20) #define BVDB_USAGE_MODE_VER_CFG301 (20) #define BVDB_USAGE_MODE_VER_CFG401 (30) #define BVDB_USAGE_MODE_VER_CFG402 (11) /************************* Module Overview ******************************** The Video Usage Modes Database (VDB) intends to capture all the BVN and RTS information found in the usage modes spreadsheet and put these in a form that can be used readily by an application. ***************************************************************************/ #define BVDB_RTS_TABLE_SIZE 77 #define BVDB_SCL_CAP_TOLERANCE_FACTOR 10000 #define BVDB_MAX_STRLEN 80 /*************************************************************************** Summary: This enumeration represents the state of a particular BVN component. Description: BVDB_State_eNo - the BVN component is disabled. BVDB_State_eYes - the BVN component is enabled. BVDB_State_eNotApplicable - the BVN component is not applicable for the usage mode it is used with. See Also: BVDB_Anr, BVBD_CaptureFeeder, BVDB_Mad ****************************************************************************/ typedef enum { BVDB_State_eNo = 0, BVDB_State_eYes, BVDB_State_eNotApplicable } BVDB_State; /*************************************************************************** Summary: This enumerates the supported source format sets. Each entry represents several actual formats. Each usage mode entry must have this. Description: See Also: BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_InputFormatGroup_eNtsc = 1, BVDB_InputFormatGroup_ePal, BVDB_InputFormatGroup_e480p, BVDB_InputFormatGroup_e576p, BVDB_InputFormatGroup_e720p_50, BVDB_InputFormatGroup_e720p_60, BVDB_InputFormatGroup_e1080i_50, BVDB_InputFormatGroup_e1080i_60, BVDB_InputFormatGroup_e1080p_24, BVDB_InputFormatGroup_e1080p_25, BVDB_InputFormatGroup_e1080p_30, BVDB_InputFormatGroup_e1080p_50, BVDB_InputFormatGroup_e1080p_60, BVDB_InputFormatGroup_ePal_60, BVDB_InputFormatGroup_e720p_24, BVDB_InputFormatGroup_e720p_25, BVDB_InputFormatGroup_e720p_30, BVDB_InputFormatGroup_e544_576i_50 = 20, BVDB_InputFormatGroup_e1440_1080i_50, BVDB_InputFormatGroup_e1440_1080p_25, BVDB_InputFormatGroup_e544_480i_60, BVDB_InputFormatGroup_e1440_1080i_60, BVDB_InputFormatGroup_e1440_1080p_30, BVDB_InputFormatGroup_e1440_1080p_24, BVDB_InputFormatGroup_e1024_768_60_PC = 30, BVDB_InputFormatGroup_e1024_768_85_PC, BVDB_InputFormatGroup_e1366_768_60_PC, BVDB_InputFormatGroup_e1366_768_85_PC, BVDB_InputFormatGroup_e1400_1050_60_PC, BVDB_InputFormatGroup_e1400_1050_75_PC, BVDB_InputFormatGroup_e1920_1080_60_PC, BVDB_InputFormatGroup_e1600_1200_60_PC, BVDB_InputFormatGroup_eAdcCalibration = 40, BVDB_InputFormatGroup_eJpeg_540, BVDB_InputFormatGroup_eJpeg_1080, BVDB_InputFormatGroup_e1080p3d_24, BVDB_InputFormatGroup_e1080p3d_30, BVDB_InputFormatGroup_e720p3d_60, BVDB_InputFormatGroup_e720p3d_50, BVDB_InputFormatGroup_eInvalid } BVDB_InputFormatGroup; /* If a source is split, the split source groups will be added to the end */ typedef enum { /* Compressed source */ BVDB_SourceGroup_Avc_e576i = 1 << 0, /* Interlaced SD - 480i/576i*/ BVDB_SourceGroup_Avc_e720p = 1 << 1, /* 480p, 576p, 720p */ BVDB_SourceGroup_Avc_e1080i = 1 << 2, /* 1080i */ BVDB_SourceGroup_Avc_e1080psf = 1 << 3, /* 1080p 24/25/30Hz */ BVDB_SourceGroup_Avc_e1080p = 1 << 4, /* 1080p 50Hz and above */ /* All other non 444 sources */ BVDB_SourceGroup_Rp_e576i = 1 << 5, /* Interlaced SD - 480i/576i*/ BVDB_SourceGroup_Rp_e720p = 1 << 6, /* 480p, 576p, 720p */ BVDB_SourceGroup_Rp_e1080i = 1 << 7, /* 1080i */ BVDB_SourceGroup_Rp_e1080psf = 1 << 8, /* 1080p 24/25/30Hz */ BVDB_SourceGroup_Rp_e1080p = 1 << 9, /* 1080p 50Hz and above */ BVDB_SourceGroup_Rp_e720p3d = 1 << 10, /* 720p 3D 50Hz and above */ BVDB_SourceGroup_Rp_e720p3dDual = 1 << 11, /* 720p 3D 50Hz and above dual path processing */ BVDB_SourceGroup_Rp_e1080p3d = 1 << 12, /* 1080p 3D 50Hz and above */ BVDB_SourceGroup_Rp_e1080p3dDual = 1 << 13, /* 1080p 3D 50Hz and above dual path processing */ BVDB_SourceGroup_Rp_e1080i3d = 1 << 14, /* 1080i 3D 50Hz and above dual path processing */ BVDB_SourceGroup_Rp_e1080i3dDual = 1 << 15, /* 1080p 3D 50Hz and above */ /* PC is defined as a source with 444 chroma subsampling */ BVDB_SourceGroup_ePc = 1 << 16,/* PC */ /* JPEG sources */ BVDB_SourceGroup_eJpeg = 1 << 17,/* JPEG */ BVDB_SourceGroup_eAdcCalibration = 1 << 18 /* ADC Calibration */ } BVDB_SourceGroup; #define BVDB_SourceGroup_Any 0xffffffff #define BVDB_SourceGroup_None 0 #define BVDB_SourceGroup_Rp_Pc (BVDB_SourceGroup_Rp_e576i | \ BVDB_SourceGroup_Rp_e720p | \ BVDB_SourceGroup_Rp_e1080i | \ BVDB_SourceGroup_Rp_e1080psf | \ BVDB_SourceGroup_Rp_e1080p | \ BVDB_SourceGroup_ePc) #define BVDB_SourceGroup_Rp (BVDB_SourceGroup_Rp_e576i | \ BVDB_SourceGroup_Rp_e720p | \ BVDB_SourceGroup_Rp_e1080i | \ BVDB_SourceGroup_Rp_e1080psf | \ BVDB_SourceGroup_Rp_e1080p) #define BVDB_SourceGroup_Avc (BVDB_SourceGroup_Avc_e576i | \ BVDB_SourceGroup_Avc_e720p | \ BVDB_SourceGroup_Avc_e1080i | \ BVDB_SourceGroup_Avc_e1080psf | \ BVDB_SourceGroup_Avc_e1080p) #define BVDB_SourceGroup_Avc_no1080p (BVDB_SourceGroup_Avc_e576i | \ BVDB_SourceGroup_Avc_e720p | \ BVDB_SourceGroup_Avc_e1080i | \ BVDB_SourceGroup_Avc_e1080psf) #define BVDB_SourceGroup_3d (BVDB_SourceGroup_Rp_e720p3d | \ BVDB_SourceGroup_Rp_e1080p3d | \ BVDB_SourceGroup_Rp_e1080i3d) #define BVDB_SourceGroup_3dDual (BVDB_SourceGroup_Rp_e720p3dDual | \ BVDB_SourceGroup_Rp_e1080p3dDual | \ BVDB_SourceGroup_Rp_e1080i3dDual) typedef struct { BVDB_InputFormatGroup oldFormat; bool bMfdSource; BVDB_SourceGroup newFormat; } BVDB_P_MapToNewSourceGroup; typedef enum { BVDB_DisplayMode_Full = 1 << 0, BVDB_DisplayMode_Pig = 1 << 1, BVDB_DisplayMode_Mheg = 1 << 2, BVDB_DisplayMode_Pbp = 1 << 3 } BVDB_P_DisplayMode; #define BVDB_DisplayMode_Any 0xffffffff /*************************************************************************** Summary: This enumerates the supported display types. Each usage mode entry must have this. Description: See Also: BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_Display_ePrimary24 = 0, BVDB_Display_ePrimary48, BVDB_Display_ePrimary50, BVDB_Display_ePrimary60, BVDB_Display_eSecondary50, BVDB_Display_eSecondary60, BVDB_Display_eInvalid } BVDB_DisplayType; /*************************************************************************** Summary: This enumerates the supported output resolutions. Each usage mode entry must have this. Description: See Also: BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_OutputResolution_eInvalid = 0, BVDB_OutputResolution_e1080p = 1 << 0, BVDB_OutputResolution_eWxga = 1 << 1, BVDB_OutputResolution_e1080i = 1 << 2, BVDB_OutputResolution_e720p = 1 << 3, BVDB_OutputResolution_eXga = 1 << 4, BVDB_OutputResolution_e480p = 1 << 5, BVDB_OutputResolution_e576p = 1 << 6, BVDB_OutputResolution_e480i = 1 << 7, BVDB_OutputResolution_e576i = 1 << 8, BVDB_OutputResolution_e1920x2160i = 1 << 9, BVDB_OutputResolution_e1280x1440p = 1 << 10, BVDB_OutputResolution_e1920x2205p = 1 << 11, BVDB_OutputResolution_e1280x1470p = 1 << 12 } BVDB_OutputResolution; #define BVDB_OutputResolution_Any 0xffffffff /*************************************************************************** Summary: This enumerates the supported aspect ratios. Description: See Also: BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_AspectRatio_e4_3 = 0, BVDB_AspectRatio_e5_4, BVDB_AspectRatio_e15_9, BVDB_AspectRatio_e16_9, BVDB_AspectRatio_eAllSrc, BVDB_AspectRatio_eAllDest, BVDB_AspectRatio_eCustom, BVDB_AspectRatio_eBypass, BVDB_AspectRatio_eInvalid } BVDB_AspectRatio; /*************************************************************************** Summary: This describes the display configuration for the specified usage mode. Description: See Also: BVDB_UsageMode, BVDB_DisplayType, BVDB_AspectRatio ****************************************************************************/ typedef struct { BVDB_DisplayType eType; BVDB_OutputResolution eResolution; BVDB_AspectRatio eAspectRatio; } BVDB_Display; /*************************************************************************** Summary: This enumerates the supported windows. Each usage mode entry must have this. Description: See Also: BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_Window_eMain = 0, BVDB_Window_ePip, BVDB_Window_eMonitor, BVDB_Window_eInvalid } BVDB_Window; /*************************************************************************** Summary: This enumerates the supported intputs. Each usage mode entry must have this. Description: See Also: BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_Input_eCvbsSvidIfd = 0, BVDB_Input_eComponent, BVDB_Input_eHdDvi, BVDB_Input_eMfd, BVDB_Input_eVga, BVDB_Input_e656, BVDB_Input_eInvalid } BVDB_Input; /*************************************************************************** Summary: This enumerates the supported deinterlacer field store count. This is used with BVDB_Mad only. Description: See Also: BVDB_Mad, BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_FieldStore_e5Fields, BVDB_FieldStore_e4Fields, BVDB_FieldStore_e3Fields, BVDB_FieldStore_eNotApplicable } BVDB_DeinterlacerFieldStore; /*************************************************************************** Summary: This enumerates the SCL-CAP bias used for orienting the Scaler relative to the Capture block Description: BVDB_SclCapBias_eAuto - indicates the VDC will determine the orientation automatically given certain parameters BVDB_SclCapBias_eSclCap - indicates a SCL-CAP orientation bias BVDB_SclCapBias_eCapScl - indicates a CAP-SCL orientation bias See Also: BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_SclCapBias_eAuto = 0, BVDB_SclCapBias_eSclCap, BVDB_SclCapBias_eCapScl, BVDB_SclCapBias_eInvalid } BVDB_ScalerCaptureBias; /*************************************************************************** Summary: This enumerates the maximum size of OSD that can be used for the specified usage mode. Description: The difference between BVDB_Osd_eNone and BVDB_Osd_eInvalid is that BVDB_Osd_None means OSD is possible with the usage mode but is disabled. See Also: BVDB_UsageMode ****************************************************************************/ typedef enum { BVDB_Osd_e1920_1080p_32bpp = 0, BVDB_Osd_e1920_2205p_32bpp, BVDB_Osd_e1366_1080p_32bpp, BVDB_Osd_e960_1080p_32bpp, BVDB_Osd_e1366_768p_32bpp, BVDB_Osd_e1280_1080p_32bpp, BVDB_Osd_e1280_800p_32bpp, BVDB_Osd_e1280_720p_32bpp, BVDB_Osd_e1024_768p_32bpp, BVDB_Osd_e720_1080p_32bpp, BVDB_Osd_e960_540p_32bpp, BVDB_Osd_e720_720p_32bpp, BVDB_Osd_e720_480p_32bpp, BVDB_Osd_e720_576p_32bpp, BVDB_Osd_e480i_8bpp, BVDB_Osd_e576i_8bpp, BVDB_Osd_eNone, BVDB_Osd_eInvalid } BVDB_Osd; /*************************************************************************** Summary: This enumerates the pixel formats supported. Applies to BVBD_Mad, BVBD_CaptureFeeder, and BVDB_Anr. Description: See Also: BVDB_Mad, BVBD_CaptureFeeder, BVDB_Anr ****************************************************************************/ typedef enum { BVDB_PixelFmt_e8Bit422 = 0, BVDB_PixelFmt_e10Bit422, BVDB_PixelFmt_e10Bit444, BVDB_PixelFmt_eInvalid } BVDB_PixelFormat; /*************************************************************************** Summary: This describes the OSD setting for the specified usage mode. Description: eOsd - the OSD type ulReserved - reserved See Also: BVDB_UsageMode, BVDB_Osd ****************************************************************************/ typedef struct { BVDB_Osd eOsd; uint32_t ulReserved; } BVDB_OsdInfo; /*************************************************************************** Summary: This describes the ANR configuration for the specified usage mode. Description: eState - whether ANR is enabled or not ePixelFormat - the ANR buffer's pixel format. eReserved - for future use See Also: BVDB_UsageMode, BVDB_PixelFormat, BVDB_State ****************************************************************************/ typedef struct { BVDB_State eState; BVDB_PixelFormat ePixelFormat; uint32_t ulReserved; } BVDB_Anr; /*************************************************************************** Summary: This describes the CAP/VFD configuration for the specified usage mode. Description: eState - whether capture is enabled or not ePixelFormat - the capture buffer's pixel format eReserved - for future use See Also: BVDB_UsageMode, BVDB_PixelFormat, BVDB_State ****************************************************************************/ typedef struct { BVDB_State eState; BVDB_PixelFormat ePixelFormat; uint32_t ulReserved; } BVDB_CaptureFeeder; /*************************************************************************** Summary: This describes the MAD configuration for the specified usage mode. Note that MAD refers to MCVP in 35230 Description: eState - whether MAD is enabled or not eFieldStore - the max number of MAD fields ePixelFormat - the MAD buffer's pixel format. eReserved - for future use See Also: BVDB_UsageMode, BVDB_PixelFormat, BVDB_State, BVDB_DeinterlacerFieldStore ****************************************************************************/ typedef struct { BVDB_State eState; BVDB_DeinterlacerFieldStore eFieldStore; BVDB_PixelFormat ePixelFormat; uint32_t ulReserved; } BVDB_Mad; /*************************************************************************** Summary: This describes the PDP configuration for the specified usage mode. Description: eState - whether PDP is enabled or not eReserved - for future use See Also: BVDB_UsageMode, BVDB_PixelFormat, BVDB_State ****************************************************************************/ typedef struct { BVDB_State eState; uint32_t ulReserved; } BVDB_Pdp; /*************************************************************************** Summary: This describes the FRC configuration for the specified usage mode. Description: eState - whether FRC is enabled or not eReserved - for future use See Also: BVDB_UsageMode, BVDB_PixelFormat, BVDB_State ****************************************************************************/ typedef struct { BVDB_State eState; uint32_t ulReserved; } BVDB_Frc; /*************************************************************************** Summary: This contains the ID and the RTS register value for a given SCB client. Description: ulId - the client ID ulRegValue - the value to be written to the client's SCB register See Also: BVDB_RtsTable ****************************************************************************/ typedef struct { uint32_t ulId; uint32_t ulRegValue; } BVDB_Rts; /*************************************************************************** Summary: This contains the table of SCB client's RTS values. A usage mode has this. Certain usage modes do not have this and are marked as n/a since the clients for that particular usage modes do not requirea new RTS setting. Description: ulValidTableEntries - the number of valid entries in the table. astRts - the table of SCB client's RTS values See Also: BVDB_Rts, BVDB_RTS_TABLE_SIZE ****************************************************************************/ typedef struct { uint32_t ulRtsRegisterTableId; uint32_t ulValidTableEntries; BVDB_Rts astRts[BVDB_RTS_TABLE_SIZE]; } BVDB_RtsTable; /*************************************************************************** Summary: Usage Mode database record. Description: This is the structure used for database entries (record). See Also: ***************************************************************************/ typedef struct BVDB_UsageMode { uint32_t usageId; BVDB_InputFormatGroup eInputFormatGroup; BVDB_Display stDisplay; BVDB_Window eWindow; BVDB_Input eInput; BVDB_P_DisplayMode eDisplayMode; uint32_t ulDisplayModeNum; BVDB_OsdInfo stOsd; BVDB_State e3dComb; BVDB_State eOversample; BVDB_State eDnr; BVDB_Anr stAnr; BVDB_CaptureFeeder stCapVfd; BVDB_Mad stMad; /* it refers to MCVP in 35230 */ BVDB_Pdp stPdp; BVDB_Frc stFrc; BVDB_RtsTable *pRtsSet; uint32_t ulSclCapTolerance; /* This must be divided by BVDB_SCL_CAP_TOLERANCE_FACTOR to get the actual value. */ BVDB_ScalerCaptureBias eSclCapBias; bool b3dDualPathProcessing; } BVDB_UsageMode; /*************************************************************************** Summary: This structure describes the memory allocation requirements for a given window heap. Description: BVDB_Heap_Settings is a structure that use to describe the public settings of a window heap. ulBufferCnt_2HD - The number of double HD buffers required. ePixelFormat_2HD - The pixel format for double HD buffer. eBufferFormat_2HD - The double HD buffer format. This is typically BFMT_VideoFmt_e1080p_30Hz. ulBufferCnt_2HD_Pip - The numbfer 2HD PIP buffers required. This max PIP size is 1/4 of 2HD buffers. Only PIP windows smaller or equal to 1/4 2HD buffer size can use these buffers. PIP windows bigger than 1/4 of 2HD buffer size needs to use 2HD buffers. ulBufferCnt_HD - The number of HD buffers required. ePixelFormat_HD - The pixel format for single HD buffer. eBufferFormat_HD - The HD buffer format. Typically this is BFMT_VideoFmt_e1080i. ulBufferCnt_HD_Pip - The number HD PIP buffers required. This max PIP size is 1/4 of HD buffers. Only PIP windows smaller or equal to 1/4 HD buffer size can use these buffers. PIP windows bigger than 1/4 of HD buffer size needs to use HD buffers. ulBufferCnt_SD - The number of SD buffers required. ePixelFormat_SD - The pixel format for SD buffer. eBufferFormat_SD - The SD buffer format. This is typically BFMT_VideoFmt_ePAL_G. See Also: BVDB_GetMemoryAllocation ***************************************************************************/ typedef struct { /* Double HD Buffer settings */ uint32_t ulBufferCnt_2HD; BPXL_Format ePixelFormat_2HD; BFMT_VideoFmt eBufferFormat_2HD; uint32_t ulBufferCnt_2HD_Pip; /* HD Buffer settings */ uint32_t ulBufferCnt_HD; BPXL_Format ePixelFormat_HD; BFMT_VideoFmt eBufferFormat_HD; uint32_t ulBufferCnt_HD_Pip; /* SD Buffer settings */ uint32_t ulBufferCnt_SD; BPXL_Format ePixelFormat_SD; BFMT_VideoFmt eBufferFormat_SD; uint32_t ulBufferCnt_SD_Pip; }BVDB_Heap_Settings; /*************************************************************************** Summary: This structure describes the supported feature set of the selected RTS configuration. Description: bPipSupport - true if PIP is supported bMonitorSupport - true if monitor output is supported bFrcSupport - true if FRC is supported bRtcSupport - true if RTS is supported bPanelReversalSupport - true if panel reversal supported worstPdpBpp - largest bpp of FRC block maxPipWinHeight - maximum PIP window height if bPipSupport is true. maxPipWinWidth - maximum PIP window width if bPipSupport is true. See Also: None ***************************************************************************/ typedef struct { bool bPipSupport; bool bMonitorSupport; bool bFrcSupport; bool bRtcSupport; bool bPanelReversalSupport; uint32_t worstPdpBpp; uint32_t maxPipWinHeight; uint32_t maxPipWinWidth; } BVDB_Config_Features; /*************************************************************************** Summary: This enum determines pixel format to use. BVDB_PixelMode_eByRtsTable - the pixel format in the RTS table to used BVDB_PixelMode_e422Forced - regardless of the pixel format of the selected usgae mode, a usage mode with 422 will replace it BVDB_PixelMode_e444Forced; - regardless of the pixel format of the selected usage mode, a usage mode with 444 will replace it. **************************************************************************/ typedef enum { BVDB_PixelMode_eByRtsTable = 0, BVDB_PixelMode_e422Forced, BVDB_PixelMode_e444Forced } BVDB_PixelMode; /*************************************************************************** Summary: This structure describes the current system configurations determined by either internal operations or app. bPipVisible - true if currently PIP window is visible bPanelReversed - true if currently the system has panel reversal b3dDualPathProcessing - true if 3D source is required processed in dual paths ePixelMode - selects pixel format to use **************************************************************************/ typedef struct { bool bPipVisible; bool bPanelReversed; bool b3dDualPathProcessing; BVDB_PixelMode ePixelMode; } BVDB_System_Configurations; /*************************************************************************** Summary: Video Usage Modes Database (VDB) context handle. Description: This is a handle that the application created with BVDB_CreateVdb. BVDB_Handle holds the context of the VDB. There should only one BVDB_Handle at any given instant. The main VDB handle is use to add, delete, and query databse entries. See Also: BVDB_CreateVdb, BVDB_DestroyVdb. ***************************************************************************/ typedef struct BVDB_P_Context *BVDB_Handle; /*************************************************************************** Summary: Creates the database. The database is created using a generated C file that contains all the usage modes an their information. Input: Output: phVdb - the VDB handle pulEntries - obsolete Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeed See Also: BVDB_WriteVdbFile **************************************************************************/ BERR_Code BVDB_CreateVdb ( BVDB_Handle *phVdb, uint32_t *pulEntries); /*************************************************************************** Summary: Destroys the database. Input: hVDb - the VDB handle Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeed See Also: BVDB_CreateVdb **************************************************************************/ BERR_Code BVDB_DestroyVdb ( BVDB_Handle hVdb ); /*************************************************************************** Summary: Gets a VDB entry based on the Config #, Input Format Group, Display, Window, Input, OSD, and Video Display usage mode. This function takes in a BVDB_Usage mode structure partially filled with the required info. It will then be completely filled if the usage mode requested is found. Otherwise an error will be returned. Description: Example on filling the required fields: strcpy(pstUsageMode->acId, "1"); configuration 1 pstUsageMode->eInputFormatGroup = BVDB_InputFormatGroup_eNTSC; pstUsageMode->eDisplay = BVDB_Display_ePrimary60; pstUsageMode->eWindow = BVDB_Window_eMain; pstUsageMode->eIput = BVDB_Input_eComponent; pstUsageMode->eOsd = BVDB_Osd_e1920_1080p_32bpp pstUsageMode->stDisplayMode = 0x3f; "all_FULL_modes" err = BVDB_GetVdbEntry(hVdb, pstUsageMode); Input: hVdb - the VDB handle pstUsageMode - the usage mode with the required info pstSysConfig - current system configurations that VDB needs to use Output: pstUsageMode - the usage mode with the required info plus the remaining info, if found Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeed See Also: **************************************************************************/ BERR_Code BVDB_GetVdbEntry ( BVDB_Handle hVdb, BVDB_UsageMode *pstUsageMode, BVDB_System_Configurations *pstSysConfig); /*************************************************************************** Summary: Prints the usage mode on the console. Input: pstUsageMode - the user specified usage mode Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeed See Also: **************************************************************************/ BERR_Code BVDB_PrintUsageMode ( const BVDB_UsageMode *pstUsageMode ); /*************************************************************************** Summary: This gets the input format group given the source's information. A BVDB_InputFormatGroup_eInvalid is returned if a match is not found. Input: hVdb - the handle to VDB ulHeight - the source's height ulWidth - the source's width ulFrameRate - the source's frame rate. The frame rate must be multiplied by 1000 to handle float rates, eg., 23.976 will be passed in as 23976 and 60 will be passed in as 60000. bProgressive - is the source inerlaced or progressive eInput - the input used with the source Output: peInputFormatGroup - the input format group Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeed See Also: **************************************************************************/ BERR_Code BVDB_GetInputFormatGroup ( const BVDB_Handle hVdb, const uint32_t ulHeight, const uint32_t ulWidth, const uint32_t ulFrameRate, const bool bProgressive, const bool bJpeg, const BVDB_Input eInput, BVDB_InputFormatGroup *peInputFormatGroup ); /*************************************************************************** Summary: This validates the configuration ID. Input: hVdb - the handle to VDB ulConfigId - the configuration ID Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeed See Also: **************************************************************************/ BERR_Code BVDB_ValidateConfigId ( BVDB_Handle hVdb, const uint32_t ulConfigId); /*************************************************************************** Summary: This returns the features that the slected RTS configuration supports Input: hVdb - the handle to VDB *pConfigFeatures - pointer to which the features are copied Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeed See Also: N/A **************************************************************************/ BERR_Code BVDB_GetFeatures ( BVDB_Handle hVdb, BVDB_Config_Features *pConfigFeatures); /*************************************************************************** Summary: This returns the memory allocation requirements of a given configuration. Memory allocation depends on the window path, i.e., MAIN, PIP, or MON and on the input type, i.e., digital (MPEG) or analog (VDEC, HDDVI, VGA, or 656). This is necessary to allow the use of memory sharing between the XVD and VDC. The memory allocation requirement is specified by the buffer type, the number of buffers, and the buffer format. Please refer to the BVDB_Heap_Settings struct as this will be used to return the memory allocation requirement. The heap size in bytes is also returned as this will aid the application in determining the total heap size required for the window path when memory sharing is employed. Input: ulConfigId - the ID of the configuration eWindow - the window path, main, pip, or monitor eInput - the input type, digital or analog Output: pHeapSettings - the memory buffer allocation pulHeapSize - the heap size in Kilobytes Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeed See Also: BVDB_Window, BVDB_Input, BVDB_Heap_Settings **************************************************************************/ BERR_Code BVDB_GetMemoryAllocation (const uint32_t ulConfigId, const BVDB_Window eWindow, const BVDB_Input eInput, BVDB_Heap_Settings *pstHeapSettings, uint32_t *pulHeapSize ); /*************************************************************************** Summary: This function sets the current window size and clip size and this information will be used when finding a matching VDB entry. Input: hVdb - the handle to VDB pstDisplay - the target display eWindow - the destination window ulSrcHeight - the height of the source ulSrcWidth - the width of the source ulSrcHeightClipAmount - the total amount to clip from the source height ulSrcWidthClipAmount - the total amount to clip from the source width ulDestHeight - the destination window height ulDestWidth - the destination window width Output: None Returns: BERR_INVALID_PARAMETER - Invalid function parameters. BERR_SUCCESS - Function succeeded See Also: BVDB_VideoDisplayMode, BVDB_UsageMode, BVDB_GetDisplaySrcAs **************************************************************************/ BERR_Code BVDB_SetVideoDisplayMode ( BVDB_Handle hVdb, const BVDB_Display *pstDisplay, const BVDB_Window eWindow, const uint32_t ulSrcHeight, const uint32_t ulSrcWidth, const uint32_t ulSrcHeightClipAmount, const uint32_t ulSrcWidthClipAmount, const uint32_t ulDestHeight, const uint32_t ulDestWidth, const bool bAutomaticAspectRatioBoxMode); #ifdef __cplusplus } #endif #endif /* __BVDB_H__ */