/******************************************************************************* * 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/5 $ * $brcm_Date: 7/20/11 1:44p $ * * 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); * * // 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/35233/A0/bvdb.h $ * * Hydra_Software_Devel/5 7/20/11 1:44p jerrylim * SWDTV-7684: Selectively choose VDC buffer heap based on 3D display * * Hydra_Software_Devel/4 6/22/11 11:07p jerrylim * SWDTV-7593, SWDTV-7587: Force CAP-SCL for RP1080p and Corrected * blockout for FRC clients to support 3D * * Hydra_Software_Devel/3 6/15/11 1:30p jerrylim * SWDTV-7385, SWDTV-6738: Added 3D support to config23301 * * Hydra_Software_Devel/2 6/3/11 3:23p jerrylim * SWDTV-7358, SWDTV-7300, SWDTV-7132, SWDTV-5753: Restructured VDB for * 35233 * * Hydra_Software_Devel/1 3/17/11 7:22p jerrylim * SWDTV-5980: Added 35233 VDB * ***************************************************************************/ #ifndef __BVDB_H__ #define __BVDB_H__ #include "bstd.h" #include "berr.h" #include "bfmt.h" #include "bpxl.h" #ifdef __cplusplus extern "C" { #endif /* VDB revisions */ #define BVDB_P_VDB_VER_1 (1) #define BVDB_P_VDB_VER_2 (2) #define BVDB_P_VDB_VER_3 (3) #if (BCHP_CHIP == 35233) #if (BCHP_VER == BCHP_VER_A0) #define BVDB_P_VDB_VER BVDB_P_VDB_VER_2 #else #define BVDB_P_VDB_VER BVDB_P_VDB_VER_3 #endif #else #define BVDB_P_VDB_VER BVDB_P_VDB_VER_3 #endif #define BVDB_P_EXPAND_3D_SOURCES 1 #define BVDB_P_ENABLE_PDP_RR 1 /************************* 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 91 #define BVDB_SCL_CAP_TOLERANCE_FACTOR 10000 /******************************************************************************* * 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 enumeration represents source groups that the current RTS * supports * * Description: * See below * * See Also: * BVDB_UsageMode */ typedef enum { /* Compressed 2D source */ BVDB_SourceGroup_Avc_e576i2d = 1 << 0, /* Interlaced SD - 480i/576i*/ BVDB_SourceGroup_Avc_e720p2d = 1 << 1, /* 480p, 576p, 720p */ BVDB_SourceGroup_Avc_e1080i2d = 1 << 2, /* 1080i */ BVDB_SourceGroup_Avc_e1080psf2d = 1 << 3, /* 1080p 24/25/30Hz */ BVDB_SourceGroup_Avc_e1080p2d = 1 << 4, /* 1080p 50Hz and above */ /* All other non 444 2D sources (RP stands for Rear Panel, and what it * actually means is the 422 sources coming throught HD-DVI */ BVDB_SourceGroup_Rp_e576i2d = 1 << 5, /* Interlaced SD - 480i/576i*/ BVDB_SourceGroup_Rp_e720p2d = 1 << 6, /* 480p, 576p, 720p */ BVDB_SourceGroup_Rp_e1080i2d = 1 << 7, /* 1080i */ BVDB_SourceGroup_Rp_e1080psf2d = 1 << 8, /* 1080p 24/25/30Hz */ BVDB_SourceGroup_Rp_e1080p2d = 1 << 9, /* 1080p 50Hz and above */ /* Compressed 3D source */ #if BVDB_P_EXPAND_3D_SOURCES BVDB_SourceGroup_Avc_e576i3d = 1 << 10, /* Interlaced 3D SD - 480i/576i*/ BVDB_SourceGroup_Avc_e720p3d = 1 << 11, /* 3D 480p, 576p, 720p */ BVDB_SourceGroup_Avc_e1080i3d = 1 << 12, /* 3D 1080i */ BVDB_SourceGroup_Avc_e1080psf3d = 1 << 13, /* 3D 1080p 24/25/30Hz */ BVDB_SourceGroup_Avc_e1080p3d = 1 << 14, /* 3D 1080p 50Hz and above */ #else BVDB_SourceGroup_Avc_e3d = 1 << 14, /* 3D 1080p 50Hz and above */ #endif /* All other non 444 3D sources */ #if BVDB_P_EXPAND_3D_SOURCES BVDB_SourceGroup_Rp_e576i3d = 1 << 15, /* 3D Interlaced SD - 480i/576i*/ BVDB_SourceGroup_Rp_e720p3d = 1 << 16, /* 3D 480p, 576p, 720p */ BVDB_SourceGroup_Rp_e1080i3d = 1 << 17, /* 3D 1080i */ BVDB_SourceGroup_Rp_e1080psf3d = 1 << 18, /* 3D 1080p 24/25/30Hz */ BVDB_SourceGroup_Rp_e1080p3d = 1 << 19, /* 3D 1080p 50Hz and above */ #else BVDB_SourceGroup_Rp_e3d = 1 << 19, /* 3D 1080p 50Hz and above */ #endif /* PC is defined as a source with 444 chroma subsampling */ BVDB_SourceGroup_ePc2d = 1 << 20,/* PC */ /* JPEG sources */ BVDB_SourceGroup_eJpeg2d = 1 << 21,/* JPEG */ /* ADC Calibration */ BVDB_SourceGroup_eAdcCalibration2d = 1 << 22, /* ADC Calibration */ /* If a given source doesn't fall under any source group, it is always * handleed as a worst case source */ BVDB_SourceGroup_eWorst = 1 << 23 /* Worst case source */ } BVDB_SourceGroup; #define BVDB_SourceGroup_None (0) #define BVDB_SourceGroup_Any (0xffffffff) #define BVDB_SourceGroup_Avc2d (BVDB_SourceGroup_Avc_e576i2d | \ BVDB_SourceGroup_Avc_e720p2d | \ BVDB_SourceGroup_Avc_e1080i2d | \ BVDB_SourceGroup_Avc_e1080psf2d | \ BVDB_SourceGroup_Avc_e1080p2d) #if BVDB_P_EXPAND_3D_SOURCES #define BVDB_SourceGroup_Avc3d (BVDB_SourceGroup_Avc_e576i3d | \ BVDB_SourceGroup_Avc_e720p3d | \ BVDB_SourceGroup_Avc_e1080i3d | \ BVDB_SourceGroup_Avc_e1080psf3d | \ BVDB_SourceGroup_Avc_e1080p3d) #else #define BVDB_SourceGroup_Avc3d (BVDB_SourceGroup_Avc_e3d) #endif #define BVDB_SourceGroup_AvcAll (BVDB_SourceGroup_Avc2d | \ BVDB_SourceGroup_Avc3d) #define BVDB_SourceGroup_Rp2d (BVDB_SourceGroup_Rp_e576i2d | \ BVDB_SourceGroup_Rp_e720p2d | \ BVDB_SourceGroup_Rp_e1080i2d | \ BVDB_SourceGroup_Rp_e1080psf2d | \ BVDB_SourceGroup_Rp_e1080p2d) #if BVDB_P_EXPAND_3D_SOURCES #define BVDB_SourceGroup_Rp3d (BVDB_SourceGroup_Rp_e576i3d | \ BVDB_SourceGroup_Rp_e720p3d | \ BVDB_SourceGroup_Rp_e1080i3d | \ BVDB_SourceGroup_Rp_e1080psf3d | \ BVDB_SourceGroup_Rp_e1080p3d) #else #define BVDB_SourceGroup_Rp3d (BVDB_SourceGroup_Rp_e3d) #endif #define BVDB_SourceGroup_RpAll (BVDB_SourceGroup_Rp2d | \ BVDB_SourceGroup_Rp3d) #define BVDB_SourceGroup_PcAll (BVDB_SourceGroup_ePc2d) #define BVDB_SourceGroup_Rp2d_Pc2d (BVDB_SourceGroup_Rp2d | \ BVDB_SourceGroup_ePc2d) #define BVDB_SourceGroup_RpAll_PcAll (BVDB_SourceGroup_RpAll | \ BVDB_SourceGroup_PcAll) #define BVDB_SourceGroup_eJpegAll (BVDB_SourceGroup_eJpeg2d) #define BVDB_SourceGroup_eAdcCalibrationAll (BVDB_SourceGroup_eAdcCalibration2d) #define BVDB_SourceGroup_3dAll (BVDB_SourceGroup_Rp3d | \ BVDB_SourceGroup_Avc3d) /******************************************************************************* * 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 display mode where it's in 3D or 2D. * * Description: * * See Also: * BVDB_UsageMode */ typedef enum { BVDB_DisplayOrientation_e2d = 1 << 0, /* Display is in 2D */ BVDB_DisplayOrientation_e3d = 1 << 1, /* Display is in 3D */ } BVDB_DisplayOrientation; #define BVDB_DisplayOrientation_Any (0xffffffff) /******************************************************************************* * Summary: * This describes the display configuration for the specified usage mode * * Description: * eType - Display Type (Main, Secondary, etc) * eResolution - Display resolution * eOrientation - 2D or 3D * * See Also: * BVDB_UsageMode, BVDB_DisplayType, BVDB_AspectRatio */ typedef struct { BVDB_DisplayType eType; BVDB_OutputResolution eResolution; BVDB_DisplayOrientation eOrientation; } 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_eInvalid = 0, BVDB_Input_eCvbsSvidIfd = 1 << 0, BVDB_Input_eComponent = 1 << 1, BVDB_Input_eHdmi = 1 << 2, BVDB_Input_eMfd = 1 << 3, BVDB_Input_eVga = 1 << 4, BVDB_Input_e656 = 1 << 5 } BVDB_Input; #define BVDB_Input_Rp (BVDB_Input_eCvbsSvidIfd | \ BVDB_Input_eComponent | \ BVDB_Input_eHdmi | \ BVDB_Input_e656) #define BVDB_Input_All (BVDB_Input_eCvbsSvidIfd | \ BVDB_Input_eComponent | \ BVDB_Input_eHdmi | \ BVDB_Input_eMfd | \ BVDB_Input_eVga | \ BVDB_Input_e656) /******************************************************************************* * 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 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: * ulWidth - max OSD width * ulHeight - max OSD height * ulBpp - max OSD Bits Per Pixel * * See Also: * BVDB_UsageMode */ typedef struct { uint32_t ulWidth; uint32_t ulHeight; uint32_t ulBpp; } BVDB_OsdInfo; /******************************************************************************* * 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. * ulReserved - 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; typedef BVDB_Mad BVDB_Anr; /******************************************************************************* * 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_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_State */ typedef struct { BVDB_State eState; uint32_t ulReserved; } BVDB_Frc; /******************************************************************************* * Summary: * This describes the RTC configuration for the specified usage mode. * * Description: * eState - whether RTC is enabled or not * eReserved - for future use * * See Also: * BVDB_UsageMode, BVDB_State */ typedef struct { BVDB_State eState; uint32_t ulReserved; } BVDB_Rtc; /******************************************************************************* * 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 { /* Input parameters to be filled by a caller (i.e., Nexus VDB) */ BVDB_SourceGroup eInputFormatGroup; BVDB_Display stDisplay; BVDB_Window eWindow; BVDB_Input eInput; /* Output parameters to be filled by VDB */ uint32_t usageId; BVDB_OsdInfo stOsd; BVDB_State e3dComb; BVDB_State eOversample; BVDB_State eDnr; BVDB_CaptureFeeder stCapVfd; BVDB_Mad stMad; /* It refers to MCVP in 35230 and * later chips */ BVDB_Pdp stPdp; BVDB_Rtc stRtc; 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; /* to be oboslete */ } 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 configuration determined * by either driver 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 (obsolete) * ePixelMode - selects pixel format to use (422 or 444) * See Also: * BVDB_PixelMode */ 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 * * Returns: * BERR_INVALID_PARAMETER - Invalid function parameters. * BERR_SUCCESS - Function succeed * * See Also: * BVDB_WriteVdbFile */ BERR_Code BVDB_CreateVdb (BVDB_Handle *phVdb); /******************************************************************************* * 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: * hVdb - the VDB handle * pstUsageMode - the user specified usage mode * * Returns: * BERR_INVALID_PARAMETER - Invalid function parameters. * BERR_SUCCESS - Function succeed * * See Also: * */ #if BDBG_DEBUG_BUILD BERR_Code BVDB_PrintUsageMode (BVDB_Handle hVdb, const BVDB_UsageMode *pstUsageMode ); #else #define BVDB_PrintUsageMode(a, b) (BERR_SUCCESS) #endif /******************************************************************************* * 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. * bJpeg - is a JPEG source * bAdcCalibration - is in ADC calibration mode * b3dSource - is a 3D source * bProgressive - is the source inerlaced or progressive * eInput - the input used with the source * * Returns: * input source group * * See Also: */ BVDB_SourceGroup BVDB_GetInputFormatGroup (BVDB_Handle hVdb, uint32_t ulHeight, uint32_t ulWidth, uint32_t ulFrameRate, bool bProgressive, bool bJpeg, bool bAdcCalibration, bool b3dSource, BVDB_Input eInput); /******************************************************************************* * 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: * configId - the ID of the configuration * eWindow - the window path, main, pip, or monitor * eInput - the input type, digital or analog * b3dDisplay - true if the system uses 3D panel * * 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 (uint32_t configId, const BVDB_Window eWindow, const BVDB_Input eInput, bool b3dDisplay, 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__ */