| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bvdb_priv.c $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/3 $ |
|---|
| 12 | * $brcm_Date: 6/15/11 1:30p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/commonutils/vdb/35233/A0/bvdb_priv.c $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/3 6/15/11 1:30p jerrylim |
|---|
| 21 | * SWDTV-7385, SWDTV-6738: Added 3D support to config23301 |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/2 6/3/11 3:23p jerrylim |
|---|
| 24 | * SWDTV-7358, SWDTV-7300, SWDTV-7132, SWDTV-5753: Restructured VDB for |
|---|
| 25 | * 35233 |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/1 3/17/11 7:22p jerrylim |
|---|
| 28 | * SWDTV-5980: Added 35233 VDB |
|---|
| 29 | * |
|---|
| 30 | ***************************************************************************/ |
|---|
| 31 | #include "bstd.h" |
|---|
| 32 | #include "berr.h" |
|---|
| 33 | #include "bkni.h" |
|---|
| 34 | #include "bdbg.h" |
|---|
| 35 | #include "bvdb.h" |
|---|
| 36 | #include "bvdb_priv.h" |
|---|
| 37 | |
|---|
| 38 | BDBG_MODULE(BVDB); |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | /******************************************************************************* |
|---|
| 42 | * BVDB_P_GetDisplaySize - maps display size enumeration to display size and |
|---|
| 43 | * returns display size |
|---|
| 44 | * |
|---|
| 45 | * Input: eDispResolution - display resolution enumeration |
|---|
| 46 | * Output: pDispHeight - height of the display |
|---|
| 47 | * pDispWidth - width of the display |
|---|
| 48 | * Return: BERR_Code |
|---|
| 49 | */ |
|---|
| 50 | BERR_Code BVDB_P_GetDisplaySize |
|---|
| 51 | (BVDB_OutputResolution eDispResolution, |
|---|
| 52 | uint32_t *pDispHeight, |
|---|
| 53 | uint32_t *pDispWidth) |
|---|
| 54 | { |
|---|
| 55 | BERR_Code err = BERR_SUCCESS; |
|---|
| 56 | |
|---|
| 57 | switch (eDispResolution) |
|---|
| 58 | { |
|---|
| 59 | case BVDB_OutputResolution_e1080p: |
|---|
| 60 | *pDispHeight = BFMT_1080P_HEIGHT; |
|---|
| 61 | *pDispWidth = BFMT_1080P_WIDTH; |
|---|
| 62 | break; |
|---|
| 63 | case BVDB_OutputResolution_e1080i: |
|---|
| 64 | *pDispHeight = BFMT_1080I_HEIGHT; |
|---|
| 65 | *pDispWidth = BFMT_1080I_WIDTH; |
|---|
| 66 | break; |
|---|
| 67 | case BVDB_OutputResolution_eWxga: |
|---|
| 68 | *pDispHeight = 768; |
|---|
| 69 | *pDispWidth = 1366; |
|---|
| 70 | break; |
|---|
| 71 | case BVDB_OutputResolution_e720p: |
|---|
| 72 | *pDispHeight = BFMT_720P_HEIGHT; |
|---|
| 73 | *pDispWidth = BFMT_720P_WIDTH; |
|---|
| 74 | break; |
|---|
| 75 | case BVDB_OutputResolution_eXga: |
|---|
| 76 | *pDispHeight = 768; |
|---|
| 77 | *pDispWidth = 1024; |
|---|
| 78 | break; |
|---|
| 79 | case BVDB_OutputResolution_e480p: |
|---|
| 80 | *pDispHeight = BFMT_480P_HEIGHT; |
|---|
| 81 | *pDispWidth = BFMT_480P_WIDTH; |
|---|
| 82 | break; |
|---|
| 83 | case BVDB_OutputResolution_e576p: |
|---|
| 84 | *pDispHeight = BFMT_576P_HEIGHT; |
|---|
| 85 | *pDispWidth = BFMT_576P_WIDTH; |
|---|
| 86 | break; |
|---|
| 87 | case BVDB_OutputResolution_e480i: |
|---|
| 88 | *pDispHeight = BFMT_NTSC_HEIGHT; |
|---|
| 89 | *pDispWidth = BFMT_NTSC_WIDTH; |
|---|
| 90 | break; |
|---|
| 91 | case BVDB_OutputResolution_e576i: |
|---|
| 92 | *pDispHeight = BFMT_PAL_HEIGHT; |
|---|
| 93 | *pDispWidth = BFMT_PAL_WIDTH; |
|---|
| 94 | break; |
|---|
| 95 | case BVDB_OutputResolution_e1920x2160i: |
|---|
| 96 | *pDispHeight = 2160; |
|---|
| 97 | *pDispWidth = 1920; |
|---|
| 98 | break; |
|---|
| 99 | case BVDB_OutputResolution_e1280x1440p: |
|---|
| 100 | *pDispHeight = 1440; |
|---|
| 101 | *pDispWidth = 1280; |
|---|
| 102 | break; |
|---|
| 103 | case BVDB_OutputResolution_e1920x2205p: |
|---|
| 104 | *pDispHeight = 2205; |
|---|
| 105 | *pDispWidth = 1920; |
|---|
| 106 | break; |
|---|
| 107 | case BVDB_OutputResolution_e1280x1470p: |
|---|
| 108 | *pDispHeight = 1470; |
|---|
| 109 | *pDispWidth = 1280; |
|---|
| 110 | break; |
|---|
| 111 | default: |
|---|
| 112 | *pDispHeight = 0; |
|---|
| 113 | *pDispWidth = 0; |
|---|
| 114 | err = BERR_INVALID_PARAMETER; |
|---|
| 115 | } |
|---|
| 116 | |
|---|
| 117 | return err; |
|---|
| 118 | } |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | /******************************************************************************* |
|---|
| 122 | * BVDB_P_IsPcFormat - returns if the given resolution is found in PC format |
|---|
| 123 | * table. |
|---|
| 124 | * |
|---|
| 125 | * Input: ulWidth - width |
|---|
| 126 | * ulHeight - height |
|---|
| 127 | * bProgressive - true if progressive |
|---|
| 128 | * pstPcFormats - PC format table pointer |
|---|
| 129 | * Output: N/A |
|---|
| 130 | * return: true if the given format is found in the table pointed by |
|---|
| 131 | * pstPcFormats |
|---|
| 132 | */ |
|---|
| 133 | bool BVDB_P_IsPcFormat |
|---|
| 134 | (uint32_t ulWidth, |
|---|
| 135 | uint32_t ulHeight, |
|---|
| 136 | bool bProgressive, |
|---|
| 137 | BVDB_P_SourceResolution *pstPcFormats) |
|---|
| 138 | { |
|---|
| 139 | uint32_t i = 0; |
|---|
| 140 | |
|---|
| 141 | /* If it's an interlaced source, it needs MCVP and thus it should be a non-PC |
|---|
| 142 | * source */ |
|---|
| 143 | if (!bProgressive || ulWidth == 0 || ulHeight == 0) |
|---|
| 144 | { |
|---|
| 145 | return false; |
|---|
| 146 | } |
|---|
| 147 | |
|---|
| 148 | for (;;) |
|---|
| 149 | { |
|---|
| 150 | if (ulWidth == pstPcFormats[i].ulWidth && |
|---|
| 151 | ulHeight == pstPcFormats[i].ulHeight) |
|---|
| 152 | { |
|---|
| 153 | return true; |
|---|
| 154 | } |
|---|
| 155 | else if ((0 == pstPcFormats[i].ulWidth) && |
|---|
| 156 | (0 == pstPcFormats[i].ulHeight)) |
|---|
| 157 | { |
|---|
| 158 | return false; |
|---|
| 159 | } |
|---|
| 160 | i++; |
|---|
| 161 | } |
|---|
| 162 | } |
|---|
| 163 | |
|---|