source: svn/trunk/newcon3bcm2_21bu/nexus/modules/display/7552/include/nexus_display.h

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

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 31.0 KB
Line 
1/***************************************************************************
2 *     (c)2007-2011 Broadcom Corporation
3 *
4 *  This program is the proprietary software of Broadcom Corporation and/or its licensors,
5 *  and may only be used, duplicated, modified or distributed pursuant to the terms and
6 *  conditions of a separate, written license agreement executed between you and Broadcom
7 *  (an "Authorized License").  Except as set forth in an Authorized License, Broadcom grants
8 *  no license (express or implied), right to use, or waiver of any kind with respect to the
9 *  Software, and Broadcom expressly reserves all rights in and to the Software and all
10 *  intellectual property rights therein.  IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU
11 *  HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY
12 *  NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE.
13 *
14 *  Except as expressly set forth in the Authorized License,
15 *
16 *  1.     This program, including its structure, sequence and organization, constitutes the valuable trade
17 *  secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof,
18 *  and to use this information only in connection with your use of Broadcom integrated circuit products.
19 *
20 *  2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
21 *  AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
22 *  WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
23 *  THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES
24 *  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE,
25 *  LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION
26 *  OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF
27 *  USE OR PERFORMANCE OF THE SOFTWARE.
28 *
29 *  3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
30 *  LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
31 *  EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
32 *  USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF
33 *  THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT
34 *  ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
35 *  LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF
36 *  ANY LIMITED REMEDY.
37 *
38 * $brcm_Workfile: nexus_display.h $
39 * $brcm_Revision: 55 $
40 * $brcm_Date: 10/27/11 3:32p $
41 *
42 * Module Description:
43 *
44 * Revision History:
45 *
46 * $brcm_Log: /nexus/modules/display/7400/include/nexus_display.h $
47 *
48 * 55   10/27/11 3:32p erickson
49 * SW7425-1581: move crcQueueSize to NEXUS_DisplaySettings
50 *
51 * 54   9/29/11 12:37p erickson
52 * SW7425-1320: change comment for NEXUS_DisplayTimingGenerator_eEncoder
53 *
54 * 53   9/8/11 2:18p erickson
55 * SW7425-1267: add NEXUS_GraphicsSettings.horizontalCoeffIndex and
56 *  .verticalCoeffIndex
57 *
58 * 52   7/19/11 11:14a erickson
59 * SW7408-291: move vf filter code to video_output
60 *
61 * 51   6/30/11 2:18p jtna
62 * SW7425-630: change .rightViewOffset from unsigned to int since
63 *  BVDC_Window_SetDstRightRect() prototype changed
64 *
65 * 50   6/28/11 9:47a erickson
66 * SW7405-5366: add NEXUS_Display_GetStatus
67 *
68 * 49   6/23/11 3:36p erickson
69 * SW7408-291: add NEXUS_Display_SetVfFilter
70 *
71 * 48   5/31/11 9:19a erickson
72 * SW7425-652: update comments on NEXUS_DisplayStgSettings
73 *
74 * 47   5/27/11 2:42p erickson
75 * SW7425-652: add NEXUS_DisplayStgSettings
76 *
77 * 46   4/22/11 3:15p vsilyaev
78 * SW7425-416: Updated 3D display API
79 *
80 * 45   4/19/11 1:54p erickson
81 * SW7405-5224: add NEXUS_VideoWindowSettings.preferSyncLock and
82 *  NEXUS_VideoWindowStatus.isSyncLocked
83 *
84 * 44   4/5/11 9:46a erickson
85 * SWDEPRECATED-2425: update comments
86 *
87 * 43   3/11/11 4:13p erickson
88 * SW7346-103: add support for CMP CRC capture
89 *
90 * 42   2/14/11 5:00p erickson
91 * SW7425-64: move NEXUS_Display_SetCustomFormatSettings to
92 *  nexus_display_custom.h
93 *
94 * 41   12/14/10 3:25p erickson
95 * SW7420-1285: add null_allowed attribute
96 *
97 * 40   12/1/10 4:27p erickson
98 * SW7550-577: add NEXUS_DisplayTimingGenerator
99 *
100 * 39   11/9/10 2:49p erickson
101 * SW35230-1899: add NEXUS_GraphicsSettings.visible
102 *
103 * 38   8/26/10 9:32a erickson
104 * SW3548-3069: clarify NEXUS_Display_SetCustomFormatSettings usage
105 *
106 * 37   8/9/10 5:42a erickson
107 * SW35230-896: add NEXUS_GraphicsSettings.verticalFilter
108 *
109 * 36   6/25/10 12:12p erickson
110 * SW7405-4515: add NEXUS_Display_SetGraphicsColorSettings. allow
111 *  NEXUS_Display_SetGraphicsColorMatrix with NULL to unset matrix.
112 *
113 * 35   6/1/10 3:57p erickson
114 * SW3548-2962: add NEXUS_DisplayModule_SetConfigurationId
115 *
116 * 34   5/13/10 10:01a erickson
117 * SW7405-4326: deprecate NEXUS_GraphicsSettings.antiflutterFilter
118 *
119 * 33   1/12/10 5:28p erickson
120 * SWDEPRECATED-2425: improve comments re:
121 *  NEXUS_Display_SetGraphicsFramebuffer and enabling/disabling graphics
122 *
123 * 32   11/17/09 3:54p erickson
124 * SW3556-852: add NEXUS_DisplayModule_SetAutomaticPictureQuality
125 *
126 * 31   11/5/09 3:54p erickson
127 * SWDEPRECATED-2425: update comments on
128 *  NEXUS_Display_SetGraphicsFramebuffer
129 *
130 * 30   8/6/09 2:38p erickson
131 * PR56417: removed NEXUS_GraphicsSettings.gammaCorrection. feature should
132 *  not be used.
133 *
134 * 29   7/16/09 11:50a erickson
135 * PR56417: added NEXUS_GraphicsSettings.gammaCorrection
136 *
137 * 28   6/15/09 12:18p erickson
138 * PR55928: added NEXUS_DisplaySettings.vecIndex
139 *
140 * 27   3/23/09 1:44p erickson
141 * PR53425: add NEXUS_DisplaySettings.vsyncCallback
142 *
143 * 26   3/19/09 2:32p erickson
144 * PR53151: clarify usage of NEXUS_Display_SetCustomFormatSettings
145 *
146 * 25   3/6/09 4:30p erickson
147 * PR52839: added NEXUS_GraphicsFilterCoeffs to NEXUS_GraphicsSettings for
148 *  controlling GFD scaling coefficients
149 *
150 * 24   2/23/09 3:03p erickson
151 * PR52406: fix deep copy in NEXUS_DisplayCustomFormatSettings
152 *
153 * 23   2/23/09 1:36p erickson
154 * PR35457: improve comments
155 *
156 * 22   1/12/09 12:29p erickson
157 * PR50979: rename NEXUS_Display_ConnectVideoInput, clarify comments
158 *
159 * 21   1/6/09 7:39p erickson
160 * PR50749: added NEXUS_Display_DisconnectVideoDecoder for tearing down
161 *  NEXUS_Display_DriveVideoDecoder
162 *
163 * 20   11/3/08 3:40p erickson
164 * PR46063: added NEXUS_DisplayCustomFormatSettings.interlaced
165 *
166 * 19   10/6/08 11:38p erickson
167 * PR44801: merge
168 *
169 * PR44801/1   9/29/08 9:00p bandrews
170 * PR44801: Added support for display VEC alignment
171 *
172 * 18   9/26/08 1:22p erickson
173 * PR35457: added comment about sync-locked displays
174 *
175 * 17   9/19/08 5:19p erickson
176 * PR46063: added NEXUS_Display_SetCustomFormatSettings
177 *
178 * 16   9/17/08 12:29p erickson
179 * PR47014: expose compositor blend equation in NEXUS_VideoWindowSettings
180 *  and NEXUS_GraphicsSettings
181 *
182 * 15   9/8/08 3:03p erickson
183 * PR46527: intial checkin of test code to route from AVD->M2MC->GFD
184 *
185 * 14   6/25/08 11:44a erickson
186 * PR39453: moved xvYccEnabled to NEXUS_DisplaySettings
187 *
188 * 13   5/6/08 2:40p erickson
189 * PR42352: update comments
190 *
191 * 12   5/5/08 4:48p erickson
192 * PR42445: provide API's for better display frame rate control
193 *
194 * 11   4/4/08 4:06p erickson
195 * PR39257: add NEXUS_DisplayType_eBypass for DTV
196 *
197 * 10   3/24/08 5:35p vsilyaev
198 * PR 40755: Added implementation for colorkeying
199 *
200 * 9   3/11/08 4:28p erickson
201 * PR36159: clarified comment
202 *
203 * 8   2/29/08 5:39p erickson
204 * PR40156: implement ColorMatrix function
205 *
206 * 7   2/21/08 1:57p erickson
207 * PR39786: clarify comments
208 *
209 * 6   2/6/08 12:42p vsilyaev
210 * PR 38682: Added attributes for the linux/kernel proxy mode
211 *
212 * 5   2/1/08 3:20p erickson
213 * PR38679: add vbi support
214 *
215 * 4   1/23/08 9:22p vobadm
216 * PR35457: update docs
217 *
218 * 3   1/23/08 2:39p erickson
219 * PR35457: update docs
220 *
221 * 2   1/21/08 3:50p erickson
222 * PR38862: added NEXUS_DisplayType_eLvds which is the default. use
223 * DisplayType to select DVO or LVDS.
224 *
225 * 1   1/18/08 2:16p jgarrett
226 * PR 38808: Merging to main branch
227 *
228 **************************************************************************/
229#ifndef NEXUS_DISPLAY_H__
230#define NEXUS_DISPLAY_H__
231
232#include "nexus_types.h"
233#include "nexus_surface.h"
234#include "nexus_display_types.h"
235#include "nexus_display_custom.h"
236
237#ifdef __cplusplus
238extern "C" {
239#endif
240
241/*=*
242A Display provides control of a video compositor.
243
244Each display has one or more video windows.
245For all displays except NEXUS_DisplayType_eBypass types, there is one graphics framebuffer.
246The compositor combines these video sources into one display.
247
248For NEXUS_DisplayType_eAuto types, there is a VEC associated with the compositor for analog output.
249
250NEXUS_VideoInput tokens are connected to NEXUS_VideoWindowHandle's to route from various video sources.
251See NEXUS_VideoWindow_AddInput.
252
253NEXUS_VideoOutput tokens are added to NEXUS_Display to route to various video outputs.
254See NEXUS_Display_AddOutput.
255**/
256
257/**
258Summary:
259NEXUS_DisplayType is used when opening a Display
260**/
261typedef enum NEXUS_DisplayType
262{
263    NEXUS_DisplayType_eAuto = 0, /* Configure display for VEC output. The VEC output is used to drive analog outputs like
264                                    component, composite, svideo as well as HDMI output.
265                                    This is called eAuto because the index of the VEC (e.g. primary or secondary VEC) is automatically chosen based on internal configuration. */
266    NEXUS_DisplayType_eLvds,     /* Configure display for LVDS output by means of the DVO port. This is used to drive an LCD/PDP panel directly.
267                                    This is only valid for some chips and Display indexes. */
268    NEXUS_DisplayType_eDvo,      /* Configure display for DVO output. This is used to drive an LCD/PDP panel with an external LVDS daughter card.
269                                    This is only valid for some chips and Display indexes. */
270    NEXUS_DisplayType_eBypass,   /* Configure display for bypass output to CCIR656 or composite output. No graphics. */
271    NEXUS_DisplayType_eMax
272} NEXUS_DisplayType;
273
274/**
275Summary:
276Display timing generator selection
277**/
278typedef enum NEXUS_DisplayTimingGenerator
279{
280    NEXUS_DisplayTimingGenerator_ePrimaryInput,
281    NEXUS_DisplayTimingGenerator_eSecondaryInput,
282    NEXUS_DisplayTimingGenerator_eTertiaryInput,
283    NEXUS_DisplayTimingGenerator_eHdmiDvo, /* used for HDMI output master mode */
284    NEXUS_DisplayTimingGenerator_e656Output,
285    NEXUS_DisplayTimingGenerator_eEncoder, /* optional. maps to STG (simple timing generator). also see NEXUS_DisplayStgSettings.
286                                              if you open with eAuto and use a display index dedicated to the encoder (like NEXUS_ENCODER_DISPLAY_IDX),
287                                              it will select the appropriate STG for the encoder. */
288    NEXUS_DisplayTimingGenerator_eAuto, /* default */
289    NEXUS_DisplayTimingGenerator_eMax
290} NEXUS_DisplayTimingGenerator;
291
292/**
293Summary:
294Display settings
295**/
296typedef struct NEXUS_DisplaySettings
297{
298    NEXUS_DisplayType displayType;         /* The type of display to open. Cannot be changed after Open. */
299    NEXUS_DisplayTimingGenerator timingGenerator;
300    int vecIndex;                          /* If displayType is NEXUS_DisplayType_eAuto, this selects the VEC for this display.
301                                              The default value is -1, which allows Nexus to select the mapping.
302                                              Nexus will use the NEXUS_DisplayModuleSettings.vecSwap setting only if vecIndex is -1. */
303
304    NEXUS_VideoFormat format;              /* Output format of video display. If an output is connected which can't support this format the SetSettings call will fail.
305                                              Full-screen windows will be automatically resized.
306                                              Graphics will be disabled. You must re-enable graphics, usually after setting the newly sized framebuffer. */
307    NEXUS_DisplayAspectRatio aspectRatio;  /* Aspect ratio of display, if applicable */
308    NEXUS_Timebase timebase;               /* Timebase that will drive the outputs */
309    NEXUS_VideoInput frameRateMaster;      /* VideoInput that provides the frame rate master to the VEC, which determines if the VEC will
310                                              use a drop-frame or non-drop-frame frame rate (if applicable).
311                                              If NULL, Nexus will look for NEXUS_VideoWindowSettings.autoMaster.
312                                              If no autoMaster is set, Nexus will look at NEXUS_DisplayModuleSettings.dropFrame. */
313    NEXUS_Pixel background;                /* Background color in NEXUS_PixelFormat_eA8_R8_G8_B8 colorspace */
314    bool xvYccEnabled;                     /* If true, Nexus will check the HdmiInput for xvYCC colorspace and, if detected, will output xvYcc to an HdmiOutput or PanelOutput. */
315    NEXUS_DisplayHandle alignmentTarget;   /* If non-NULL, Nexus will ask VDC to align this display's timing to the display
316                                              specified as the target.  This only works when both displays are the same frame
317                                              rate and frameRateMaster is NULL and NEXUS_VideoWindowSettings.autoMaster is false.
318                                              If NULL, disables display alignment for this display. */
319    NEXUS_CallbackDesc vsyncCallback;      /* Callback fires on every output vsync. Nexus does not deliver this callback with any minimum latency or during
320                                              the blanking interval. It should be used for general timing only. */
321    struct {
322       bool  overrideOrientation;           /* used to override orientation of 2D display formats */
323       NEXUS_VideoOrientation  orientation; /* orientation of the 3D display */
324    } display3DSettings;
325   
326    unsigned crcQueueSize;              /* if non-zero, CRC capture is enabled. use NEXUS_Display_GetCrcData to retrieve data. */
327} NEXUS_DisplaySettings;
328
329/**
330Summary:
331This type describes possible update modes for the display module
332
333Description:
334When updating the display, it's often necessary to call multiple functions to get the
335desired setting. Instead of having each function applied immediately to hardware, the user can instruct Nexus
336to accumulate changes, then apply them all at once.
337
338By default Nexus operates in NEXUS_DisplayUpdateMode_eAuto mode. In this mode, all changes
339are applied immediately and do not accumulate.
340
341If you set Nexus into NEXUS_DisplayUpdateMode_eManual mode, changes will accumulate.
342Call NEXUS_DisplayModule_SetUpdateMode(NEXUS_DisplayUpdateMode_eNow) to apply the
343acculumated changes. Nexus will remain in NEXUS_DisplayUpdateMode_eManual mode.
344
345Be aware that some changes cannot be accumulated, even in NEXUS_DisplayUpdateMode_eManual mode.
346These will be applied immediately, as if it was in NEXUS_DisplayUpdateMode_eAuto mode.
347This mainly applies to creation and destruction of resources.
348**/
349typedef enum NEXUS_DisplayUpdateMode
350{
351    NEXUS_DisplayUpdateMode_eAuto,   /* Update the display settings immediately. */
352    NEXUS_DisplayUpdateMode_eManual, /* Accumulate changes until user calls NEXUS_DisplayModule_SetUpdateMode(NEXUS_DisplayUpdateMode_eNow) */
353    NEXUS_DisplayUpdateMode_eNow     /* Apply all changes accumulated in NEXUS_DisplayUpdateMode_eManual mode. */
354} NEXUS_DisplayUpdateMode;
355
356/**
357Summary:
358This function is used to control when changes in display settings take effect.
359
360Description:
361Most display module functions take effect immediately (e.g. resizing of a window).
362NEXUS_DisplayModule_SetUpdateMode allows the user to accumulate changes and commit them as a single transaction.
363This can reduce execution time and can eliminate transition effects.
364
365For example to change size of two windows simultaneously user would need use this code:
366
367     NEXUS_DisplayModule_SetUpdateMode(NEXUS_DisplayUpdateMode_eManual);
368     NEXUS_VideoWindow_GetSettings(window0, &windowSettings);
369     windowSettings.position.height /= 2;
370     windowSettings.position.width /= 2;
371     NEXUS_VideoWindow_SetSettings(window0, &windowSettings);
372     NEXUS_VideoWindow_GetSettings(window1, &windowSettings);
373     windowSettings.position.height *= 2;
374     windowSettings.position.width *= 2;
375     NEXUS_VideoWindow_SetSettings(window1, &windowSettings);
376     NEXUS_DisplayModule_SetUpdateMode(NEXUS_DisplayUpdateMode_eAuto);
377**/
378NEXUS_Error NEXUS_DisplayModule_SetUpdateMode(
379    NEXUS_DisplayUpdateMode updateMode
380    );
381
382/**
383Summary:
384Get default NEXUS_DisplaySettings before calling NEXUS_Display_Open.
385**/
386void NEXUS_Display_GetDefaultSettings(
387    NEXUS_DisplaySettings *pSettings    /* [out] */
388    );
389
390/**
391Summary:
392Open a new Display.
393**/
394NEXUS_DisplayHandle NEXUS_Display_Open( /* attr{destructor=NEXUS_Display_Close}  */
395    unsigned displayIndex,
396    const NEXUS_DisplaySettings *pSettings /* attr{null_allowed=y} */
397    );
398
399/**
400Summary:
401Close a Display
402**/
403void NEXUS_Display_Close(
404    NEXUS_DisplayHandle display
405    );
406
407/**
408Summary:
409Get the current NEXUS_DisplaySettings from the Display.
410**/
411void NEXUS_Display_GetSettings(
412    NEXUS_DisplayHandle display,
413    NEXUS_DisplaySettings *pSettings      /* [out] */
414    );
415
416/**
417Summary:
418Set new NEXUS_DisplaySettings to the Display.
419**/
420NEXUS_Error NEXUS_Display_SetSettings(
421    NEXUS_DisplayHandle display,
422    const NEXUS_DisplaySettings *pSettings
423    );
424
425/**
426Summary:
427Adds unique VideoOutput to the display.
428
429Description:
430This causes the content for this display to be routed to this output.
431The output must support the Display's current NEXUS_VideoFormat, otherwise the function fails.
432**/
433NEXUS_Error NEXUS_Display_AddOutput(
434    NEXUS_DisplayHandle display,
435    NEXUS_VideoOutput output
436    );
437
438/**
439Summary:
440Removes connected VideoOutput from the display
441**/
442NEXUS_Error NEXUS_Display_RemoveOutput(
443    NEXUS_DisplayHandle display,
444    NEXUS_VideoOutput output
445    );
446
447/**
448Summary:
449Removes all VideoOutputs connected to the display
450**/
451void NEXUS_Display_RemoveAllOutputs(
452    NEXUS_DisplayHandle display
453    );
454
455/**
456Summary:
457Status information returned by NEXUS_Display_GetStatus
458**/
459typedef struct NEXUS_DisplayStatus
460{
461    unsigned refreshRate; /* actual frame rate in 1/1000 Hz (e.g. 29.97 = 29970).
462                             This is determined by the framerate of NEXUS_DisplaySettings.format and
463                             the drop-frame/non-drop-frame characteristics of the sync-locked source. */
464} NEXUS_DisplayStatus;
465
466/**
467Summary:
468Get status information about the display
469**/
470NEXUS_Error NEXUS_Display_GetStatus(
471    NEXUS_DisplayHandle display,
472    NEXUS_DisplayStatus *pStatus /* [out] */
473    );
474
475/*********************************
476* Graphics
477********/
478
479/**
480Summary:
481Graphics feeder (GFD) scaler filtering options used in NEXUS_GraphicsSettings
482**/
483typedef enum NEXUS_GraphicsFilterCoeffs
484{
485    NEXUS_GraphicsFilterCoeffs_ePointSample,      /* Point sampled filtering */
486    NEXUS_GraphicsFilterCoeffs_eBilinear,         /* Bilinear filtering */
487    NEXUS_GraphicsFilterCoeffs_eAnisotropic,      /* Anisotropic filtering */
488    NEXUS_GraphicsFilterCoeffs_eSharp,            /* Tabled sin(x)/x filtering. Also, see comments for horizontalCoeffIndex and verticalCoeffIndex */
489    NEXUS_GraphicsFilterCoeffs_eMax
490} NEXUS_GraphicsFilterCoeffs;
491
492/*
493Summary:
494Graphics compositor settings which instruct the Display how to composite a graphics framebuffer with VideoWindows.
495
496Description:
497Graphics scaling is calculated by comparing the source width/height
498with the destination width/height.
499
500Instead of assuming the destination width/height is the width/height of the
501display format, the application must specify it independently. This is because
502the real issue is not the width/height of the display forward, but the x/y/width/height
503of the viewable area of the TV. This can vary depending on the application and
504target platform.
505
506The source width/height are used to define the scale factor used by graphic
507surfaces.
508*/
509typedef struct NEXUS_GraphicsSettings
510{
511    bool enabled; /* Enable graphics on the display.
512                     When disabled, nexus will forget about any surface set with NEXUS_Display_SetGraphicsFramebuffer and
513                     will destroy any internal state related to graphics.
514                     After enabling, you must call NEXUS_Display_SetGraphicsFramebuffer to set the framebuffer. */
515    bool visible; /* If false, nexus will hide graphics but will remember the framebuffer and will do minimal
516                     reconfiguration of the display.
517                     Both 'enabled' and 'visible' must be true to see graphics. 'visible' defaults to true. */
518    bool antiflutterFilter; /* deprecated. use NEXUS_Graphics2DSettings.verticalFilter instead. */
519    uint8_t alpha; /* alpha blending of framebuffer with video where 0xFF is opaque and 0x00 is transparent.  */
520    unsigned zorder; /* Z-order of the graphics plane relative to the video windows' zorder. 0 is on bottom. */
521
522    bool chromakeyEnabled; /* should the chromakey values be applied? */
523    NEXUS_Pixel lowerChromakey; /* lower bound of chromakey range in NEXUS_PixelFormat_eA8_R8_G8_B8 colorspace */
524    NEXUS_Pixel upperChromakey; /* upper bound of chromakey range in NEXUS_PixelFormat_eA8_R8_G8_B8 colorspace */
525
526    NEXUS_Rect position; /* The area within the display that surface should displayed */
527    NEXUS_Rect clip; /* The area within the surface that should be shown, relative to 0,0.
528        If you want to show the entire surface, cliprect should be 0,0,position.width,position.height.
529        If you specify a cliprect which is smaller, only that portition will be shown
530        and it will be scaled to fit the rectangle of size position.width and position.height.
531        At this time only horizontal upscaling is supported. Vertical scaling and horizontal downscaling are not supported.
532        The default value of clip.width is less than position.width for HD resolutions. Typically, HD graphics use horizontal upscaling to converse memory bandwidth. */
533
534    NEXUS_CallbackDesc frameBufferCallback;  /* Callback called when framebuffer has been set. After the callback fires,
535        it's possible to use the previous framebuffer without any visible artifacting. */
536
537    NEXUS_CompositorBlendFactor sourceBlendFactor; /* Source refers to the graphics. */
538    NEXUS_CompositorBlendFactor destBlendFactor;   /* Dest referes to whatever the graphics is being blended with. */
539    uint8_t constantAlpha;                         /* constantAlpha is used if either sourceBlendFactor or destBlendFactor specify it */
540
541    NEXUS_GraphicsFilterCoeffs horizontalFilter;   /* GFD horizontal upscaler coefficients */
542    NEXUS_GraphicsFilterCoeffs verticalFilter;     /* GFD vertical upscaler coefficients */
543    unsigned horizontalCoeffIndex;                 /* if horizontalFilter == eSharp, then this index is used for table-driven coefficients. */
544    unsigned verticalCoeffIndex;                   /* if verticalFilter == eSharp, then this index is used for table-driven coefficients. */
545   
546    struct {
547        int rightViewOffset; /* offset of the right view */
548    } graphics3DSettings;
549} NEXUS_GraphicsSettings;
550
551/**
552Summary:
553Get current graphics compositing settings.
554**/
555void NEXUS_Display_GetGraphicsSettings(
556    NEXUS_DisplayHandle display,
557    NEXUS_GraphicsSettings *pSettings /* [out] */
558    );
559
560/**
561Summary:
562Set graphics compositing settings.
563**/
564NEXUS_Error NEXUS_Display_SetGraphicsSettings(
565    NEXUS_DisplayHandle display,
566    const NEXUS_GraphicsSettings *pSettings
567    );
568
569/*
570Summary:
571Set which surface should be used as the framebuffer.
572
573Description:
574There is no implicit double-buffering. The user is responsible to provide any double or triple buffering logic by cycling the framebuffer between two or three surfaces.
575
576If you are doing asynchronous blits into the new framebuffer, to avoid tearing your app must wait for those blits to be completed before calling
577NEXUS_Display_SetGraphicsFramebuffer. See NEXUS_Graphics2D_Checkpoint.
578
579The framebuffer will be switched on the next vsync. NEXUS_GraphicsSettings.frameBufferCallback will be fired after that switch happens.
580If you are double buffering, to avoid tearing you must not write into the outgoing framebuffer until after frameBufferCallback is fired.
581If you want to start updating the next framebuffer before waiting for frameBufferCallback, use triple buffering. You can achieve a sustained 60 fps
582graphics update (or 50 fps for 50Hz systems), if your application can prepare the next framebuffer in less than the 16 msec vsync time minus a small amount
583of time (e.g. 1-2 msec) to process the frameBufferCallback.
584
585If you call NEXUS_Display_SetGraphicsFramebuffer a second time, before the first call was able to be applied (i.e. before the next vsync), your first call
586will be overwritten. NEXUS_Display_SetGraphicsFramebuffer calls are not queued.
587
588Framebuffers are always placed at coordinate 0,0.
589
590The difference between this surface's width and height and the NEXUS_GraphicsSettings destinationWidth and destinationHeight will
591result in graphics feeder scaling, if the scaling feature exists.
592
593When you set NEXUS_GraphicsSettings.enabled = false, nexus will forget about any framebuffer that was set. The application can then
594safely delete the surface. To re-enable, you must set NEXUS_GraphicsSettings.enabled = true and call NEXUS_Display_SetGraphicsFramebuffer with a new surface.
595*/
596NEXUS_Error NEXUS_Display_SetGraphicsFramebuffer(
597    NEXUS_DisplayHandle display,
598    NEXUS_SurfaceHandle frameBuffer
599    );
600
601/**
602Summary:
603Get current color space convertor matrix for the graphics feeder (GFD)
604**/
605void NEXUS_Display_GetGraphicsColorMatrix(
606    NEXUS_DisplayHandle display,
607    NEXUS_ColorMatrix *pColorMatrix /* [out] */
608    );
609
610/**
611Summary:
612Set new color space convertor matrix for the graphics feeder (GFD)
613
614Description:
615This will override anything set by NEXUS_Display_SetGraphicsColorSettings.
616**/
617NEXUS_Error NEXUS_Display_SetGraphicsColorMatrix(
618    NEXUS_DisplayHandle display,
619    const NEXUS_ColorMatrix *pColorMatrix /* attr{null_allowed=y} */
620    );
621
622/**
623Summary:
624Set color control settings for graphics feeder (GFD).
625
626Description:
627This will override anything set by NEXUS_Display_SetGraphicsColorMatrix.
628
629int16_t values range between -32768 and 32767.
630**/
631typedef struct NEXUS_GraphicsColorSettings
632{
633    int16_t contrast;
634    int16_t saturation;
635    int16_t hue;
636    int16_t brightness;
637} NEXUS_GraphicsColorSettings;
638
639/**
640Summary:
641**/
642void NEXUS_Display_GetGraphicsColorSettings(
643    NEXUS_DisplayHandle display,
644    NEXUS_GraphicsColorSettings *pSettings /* [out] */
645    );
646
647/**
648Summary:
649**/
650NEXUS_Error NEXUS_Display_SetGraphicsColorSettings(
651    NEXUS_DisplayHandle display,
652    const NEXUS_GraphicsColorSettings *pSettings
653    );
654
655/**
656Summary:
657Connect a Display to a VideoInput without a VideoWindow.
658
659Description:
660Some usage modes allow video to be processed with no video window.
661In these cases, a VideoInput might still need interrupts or some other internal connection from the Display.
662
663For example, the VideoDecoder has NEXUS_VideoDecoder_CreateStripedSurface which allows an application
664to capture decoded pictures for graphics processing. The application can then display those decoded
665pictures using a graphics framebuffer. However, the VideoDecoder still needs interrupts from the Display
666to drive its internal heartbeat. This connection makes that possible.
667**/
668NEXUS_Error NEXUS_Display_ConnectVideoInput(
669    NEXUS_DisplayHandle display,
670    NEXUS_VideoInput videoInput
671    );
672
673/**
674Summary:
675Disconnect a VideoInput connected with NEXUS_Display_ConnectVideoInput
676**/
677void NEXUS_Display_DisconnectVideoInput(
678    NEXUS_DisplayHandle display,
679    NEXUS_VideoInput videoInput
680    );
681
682/**
683Summary:
684Enable a default set of picture quality features including MAD, ANR, and DNR.
685
686Description:
687By default, Nexus starts with picture quality features disabled. Users must enable each feature and can control each feature's settings.
688
689NEXUS_DisplayModule_SetAutomaticPictureQuality performs a one-time automatic enabling of picture quality features for all displays and windows in the system.
690After this function finishes, the user can call PQ functions and learn or modify these settings.
691
692This is a one-time setting. No on-going automatic picture quality changes will be made.
693**/
694NEXUS_Error NEXUS_DisplayModule_SetAutomaticPictureQuality(void);
695
696/**
697Summary:
698Update the NEXUS_DisplayModuleSettings.configurationId for dynamic RTS.
699
700Description:
701See NEXUS_DisplayModuleSettings.configurationId for the meaning of this ID.
702**/
703NEXUS_Error NEXUS_DisplayModule_SetConfigurationId(
704    unsigned configurationId
705    );
706
707/**
708Summary:
709Display CRC data
710**/
711typedef struct NEXUS_DisplayCrcData
712{
713    struct {
714        uint32_t luma;
715        uint32_t cb;
716        uint32_t cr;
717    } cmp; /* compositor (CMP) CRC */
718} NEXUS_DisplayCrcData;
719
720/**
721Summary:
722Get compositor CRC data
723
724Description:
725You must set NEXUS_DisplayModuleSettings.crcQueueSize to a non-zero value (for example, 30) to capture data.
726**/
727NEXUS_Error NEXUS_Display_GetCrcData(
728    NEXUS_DisplayHandle display,
729    NEXUS_DisplayCrcData *pData, /* attr{nelem=numEntries;nelem_out=pNumEntriesReturned} [out] array of crc data structures */
730    unsigned numEntries,
731    unsigned *pNumEntriesReturned /* [out] */
732    );
733
734/*
735Summary:
736Description of the stereo (Left/Right) framebuffer
737
738**/
739
740typedef struct NEXUS_GraphicsFramebuffer3D {
741    NEXUS_VideoOrientation  orientation; /* orientation of the graphics framebuffer */
742    NEXUS_SurfaceHandle main; /* mandatory, main surface */
743    NEXUS_SurfaceHandle alpha; /* optional, alpha surface */
744    NEXUS_SurfaceHandle right; /* optional, right surface */
745    NEXUS_SurfaceHandle rightAlpha; /* optional, right alpha surface */
746    uint32_t alphaW0; /* used as pixel alpha when pixel's W is 0 */
747    uint32_t alphaW1; /* used as pixel alpha when pixel's W is 1 */
748} NEXUS_GraphicsFramebuffer3D;
749
750/**
751Summary:
752Get default values for NEXUS_DisplayCustomFormatSettings
753**/
754void NEXUS_Graphics_GetDefaultFramebuffer3D(
755    NEXUS_GraphicsFramebuffer3D *pFrameBuffer3D /* [out] */
756    );
757
758/*
759Summary:
760Sets description of surfaces used as 3d(Left/Right)  framebuffer
761
762Description:
763This function is  the same as NEXUS_Display_SetGraphicsFramebuffer with sole exception
764that it could provides information about composition of 3D framebuffer
765
766See Also:
767    NEXUS_Display_SetGraphicsFramebuffer
768    NEXUS_Graphics_GetDefaultFramebuffer3D
769*/
770NEXUS_Error NEXUS_Display_SetGraphicsFramebuffer3D(
771    NEXUS_DisplayHandle display,
772    const NEXUS_GraphicsFramebuffer3D *pFrameBuffer3D
773    );
774
775/**
776Summary:
777STG (simple timing generator) settings.
778
779Description:
780See BVDC_Display_SetStgConfiguration for more detailed documentation.
781**/
782typedef struct NEXUS_DisplayStgSettings
783{
784    bool enabled; /* If NEXUS_DisplayTimingGenerator_eEncoder is set (the STG master), this must be true; Nexus will reject a false setting.
785                     When master TG of the display is not STG, if enabled = true then the STG output is slaved on that display;
786                     else STG output would be detached from that display. */
787    bool nonRealTime; /* configure STG trigger as real-time or non-real-time */
788} NEXUS_DisplayStgSettings;
789
790/**
791Summary:
792Get STG settings
793**/
794void NEXUS_Display_GetStgSettings(
795    NEXUS_DisplayHandle display,
796    NEXUS_DisplayStgSettings *pSettings  /* [out] */
797    );
798   
799/**
800Summary:
801Set STG settings
802**/
803NEXUS_Error NEXUS_Display_SetStgSettings(
804    NEXUS_DisplayHandle display,
805    const NEXUS_DisplayStgSettings *pSettings
806    );
807
808#ifdef __cplusplus
809}
810#endif
811
812#endif /* NEXUS_DISPLAY_H__ */
Note: See TracBrowser for help on using the repository browser.