source: svn/newcon3bcm2_21bu/magnum/commonutils/vdb/3556/A0/bvdb_viddispmode_priv.c

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 6.0 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2008, 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_viddispmode_priv.c $
11 * $brcm_Revision: Hydra_Software_Devel/4 $
12 * $brcm_Date: 9/24/08 1:57p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/commonutils/vdb/3548/A0/bvdb_viddispmode_priv.c $
19 *
20 * Hydra_Software_Devel/4   9/24/08 1:57p jessem
21 * PR 47302: Removed PIG modes 3, 4, 5, and 6.
22 *
23 * Hydra_Software_Devel/3   7/18/08 4:56p jessem
24 * PR 44254:1. Added VGA inputs to  NTSC,  PAL,  480p, 576p, 720p @ 50,
25 * and 720p @ 60.
26 * 2. Added PIP_0 video display mode.
27 *
28 * Hydra_Software_Devel/2   7/14/08 3:23p jessem
29 * PR 43759: Updated API and implementation
30 *
31 * Hydra_Software_Devel/1   6/18/08 12:32p jessem
32 * PR 43759: Initial version.
33 *
34 ***************************************************************************/ 
35#include <stdio.h>
36#include <string.h>
37
38#include "bstd.h"
39#include "bdbg.h"
40#include "bvdb.h"
41#include "bvdb_priv.h"
42#include "bvdb_viddispmode_priv.h"
43
44BDBG_MODULE(BVDB);
45
46BVDB_VideoDisplayModeInfo astFull[] = 
47{
48        { 6,  6, BVDB_AspectRatio_eAllSrc },
49        { 6,  6, BVDB_AspectRatio_e4_3    },
50        { 6,  6, BVDB_AspectRatio_e16_9   },
51        { 6, 30, BVDB_AspectRatio_e16_9   },
52        { 6, 16, BVDB_AspectRatio_e16_9   },
53        { 0,  0, BVDB_AspectRatio_eAllSrc }
54};
55
56BVDB_VideoDisplayModeInfo astPig[] = 
57{
58        { 6,  6, BVDB_AspectRatio_eAllSrc },
59        { 6,  6, BVDB_AspectRatio_eAllSrc },
60        { 6,  6, BVDB_AspectRatio_eAllSrc },
61        { 6, 30, BVDB_AspectRatio_eAllSrc },
62        { 6, 16, BVDB_AspectRatio_eAllSrc },
63        { 0,  0, BVDB_AspectRatio_eAllSrc }
64};
65
66BVDB_VideoDisplayModeInfo astPip[] = 
67{
68        { 6, 30, BVDB_AspectRatio_eAllSrc },
69        { 6, 30, BVDB_AspectRatio_eAllSrc },
70        { 0,  0, BVDB_AspectRatio_eAllSrc }             
71};
72
73BVDB_VideoDisplayModeInfo astVcrOut[] = 
74{
75        { 0,  0, BVDB_AspectRatio_eAllSrc }, /* clip amount follows main window */
76        { 6, 30, BVDB_AspectRatio_eAllSrc }
77};
78
79BERR_Code BVDB_P_GetVideoDispModeInfo
80        ( BVDB_VideoDisplayMode      *pstVidDispMode,
81          BVDB_VideoDisplayModeInfo  *pstInfo )
82{
83        BERR_Code err = BERR_SUCCESS;
84
85        if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_FULL_1_MASK)
86                pstInfo = &astFull[0];
87        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_FULL_2_MASK)
88                pstInfo = &astFull[1];
89        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_FULL_3_MASK)
90                pstInfo = &astFull[2];
91        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_FULL_4_MASK)
92                pstInfo = &astFull[3];
93        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_FULL_5_MASK)
94                pstInfo = &astFull[4];
95        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_FULL_6_MASK)
96                pstInfo = &astFull[5];
97        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_PIG_1_MASK)
98                pstInfo = &astPig[0];
99        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_PIG_2_MASK)
100                pstInfo = &astPig[1];
101        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_PIP_1_MASK)
102                pstInfo = &astPip[0];
103        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_PIP_2_MASK)
104                pstInfo = &astPip[1];
105        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_PIP_3_MASK)
106                pstInfo = &astPip[2];
107        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_VCR_1_MASK)
108                pstInfo = &astVcrOut[0];       
109        else if (*(uint32_t *)pstVidDispMode & BVDB_P_DISPLAY_MODE_VCR_2_MASK)
110                pstInfo = &astVcrOut[1];
111        else
112        {
113                pstInfo = NULL;
114        }
115        return err;
116}
117
118BERR_Code BVDB_ValidateSourceClipAmount
119        ( BVDB_Handle                  hVdb, 
120          const BVDB_UsageMode        *pstUsageMode,
121          const uint32_t               ulSrcHeight,
122          const uint32_t               ulSrcWidth,
123          const uint32_t               ulHeightClipAmount,
124          const uint32_t               ulWidthClipAmount )
125{
126        BERR_Code                   err = BERR_SUCCESS;
127        BVDB_P_Context             *pVdb;
128        BVDB_VideoDisplayModeInfo  *pstInfo = NULL;
129        BVDB_VideoDisplayMode       stDispMode = pstUsageMode->stDisplayMode;
130
131        BVDB_P_GET_CONTEXT(hVdb, pVdb);
132
133        err = BVDB_P_GetVideoDispModeInfo(&stDispMode, pstInfo );
134        if (err == BERR_SUCCESS)
135        {
136                /* validate */ 
137                if (((ulHeightClipAmount * 100)/ulSrcHeight) > pstInfo->ulSrcHeightClipAmount)
138                {
139                        BDBG_ERR(("Total source height clip amount [%d percent] exceeds max[%d percent] allowed.",
140                                ((ulHeightClipAmount * 100)/ulSrcHeight), pstInfo->ulSrcHeightClipAmount));
141                        err = BERR_INVALID_PARAMETER;
142                }
143
144                if (((ulWidthClipAmount * 100)/ulSrcWidth)  > pstInfo->ulSrcWidthClipAmount)
145                {
146                        BDBG_ERR(("Total source width clip[%d percent] amount exceeds max[%d percent] allowed.",
147                                ((ulWidthClipAmount * 100)/ulSrcWidth), pstInfo->ulSrcWidthClipAmount));
148                        err = BERR_INVALID_PARAMETER;
149                }
150        }
151        return err;
152}
153
154#if 0
155uint32_t BVDB_GetOrientation
156        ( BVDB_FmtInfo         *pInputFmtInfo,
157          BVDB_FmtInfo         *pOutputFmtInfo )
158{
159        uint32_t ulOrientation ;
160        uint32_t ulDclk, ulDline;
161       
162        BDBG_ASSERT(pInputFmtInfo);
163        BDBG_ASSERT(pOutputFmtInfo);
164
165        ulDline = pOutputFmtInfo->ulHorLineSize/pInputFmtInfo->ulHorLineSize;
166        ulDclk = pOutputFmtInfo->ulPixelClock/pInputFmtInfo->ulPixelClock;
167
168        /* SCL orientation determines correct RTS set */
169        ulOrientation = (pOutputFmtInfo->ulWidth/pInputFmtInfo->ulWidth) *
170                                        ((pOutputFmtInfo->ulHeight/pInputFmtInfo->ulHeight)^2) *
171                                        (ulDline/ulDclk);
172
173        return ulOrientation;
174}
175
176uint32_t BVDB_GetSclCapHeightTransition
177        ( BVDB_FmtInfo         *pInputFmtInfo,
178          BVDB_FmtInfo         *pOutputFmtInfo )
179{
180        uint32_t ulHeightPercent;
181        uint32_t ulDclk, ulDline;
182
183        BDBG_ASSERT(pInputFmtInfo);
184        BDBG_ASSERT(pOutputFmtInfo);
185       
186        ulDline = pOutputFmtInfo->ulHorLineSize/pInputFmtInfo->ulHorLineSize;
187        ulDclk = pOutputFmtInfo->ulPixelClock/pInputFmtInfo->ulPixelClock;
188       
189        ulHeightPercent = (pOutputFmtInfo->ulWidth * (pOutputFmtInfo->ulHeight^2) * ulDline) /
190                                          (pInputFmtInfo->ulHeight/ulDclk);
191
192        return ulHeightPercent;
193}
194#endif
Note: See TracBrowser for help on using the repository browser.