Initial version of libomxil-vc4 for RPI3
[platform/adaptation/broadcom/libomxil-vc4.git] / interface / vctypes / vc_display_types.h
1 /*
2 Copyright (c) 2012, Broadcom Europe Ltd
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7     * Redistributions of source code must retain the above copyright
8       notice, this list of conditions and the following disclaimer.
9     * Redistributions in binary form must reproduce the above copyright
10       notice, this list of conditions and the following disclaimer in the
11       documentation and/or other materials provided with the distribution.
12     * Neither the name of the copyright holder nor the
13       names of its contributors may be used to endorse or promote products
14       derived from this software without specific prior written permission.
15
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 /*=============================================================================
29 Common image types used by the vc_image library.
30 =============================================================================*/
31
32 #ifndef INTERFACE_VC_DISPLAY_TYPES_H
33 #define INTERFACE_VC_DISPLAY_TYPES_H
34
35 //enums of display input format
36 typedef enum
37 {
38    VCOS_DISPLAY_INPUT_FORMAT_INVALID = 0,
39    VCOS_DISPLAY_INPUT_FORMAT_RGB888,
40    VCOS_DISPLAY_INPUT_FORMAT_RGB565
41 }
42 VCOS_DISPLAY_INPUT_FORMAT_T;
43
44 /** For backward compatibility */
45 #define DISPLAY_INPUT_FORMAT_INVALID VCOS_DISPLAY_INPUT_FORMAT_INVALID
46 #define DISPLAY_INPUT_FORMAT_RGB888  VCOS_DISPLAY_INPUT_FORMAT_RGB888
47 #define DISPLAY_INPUT_FORMAT_RGB565  VCOS_DISPLAY_INPUT_FORMAT_RGB565
48 typedef VCOS_DISPLAY_INPUT_FORMAT_T DISPLAY_INPUT_FORMAT_T;
49
50 // Enum determining how image data for 3D displays has to be supplied
51 typedef enum
52 {
53    DISPLAY_3D_UNSUPPORTED = 0,   // default
54    DISPLAY_3D_INTERLEAVED,       // For autosteroscopic displays
55    DISPLAY_3D_SBS_FULL_AUTO,     // Side-By-Side, Full Width (also used by some autostereoscopic displays)
56    DISPLAY_3D_SBS_HALF_HORIZ,    // Side-By-Side, Half Width, Horizontal Subsampling (see HDMI spec)
57    DISPLAY_3D_TB_HALF,           // Top-bottom 3D
58    DISPLAY_3D_FRAME_PACKING,     // Frame Packed 3D
59    DISPLAY_3D_FRAME_SEQUENTIAL,  // Output left on even frames and right on odd frames (typically 120Hz)
60    DISPLAY_3D_FORMAT_MAX
61 } DISPLAY_3D_FORMAT_T;
62
63 //enums of display types
64 typedef enum
65 {
66    DISPLAY_INTERFACE_MIN,
67    DISPLAY_INTERFACE_SMI,
68    DISPLAY_INTERFACE_DPI,
69    DISPLAY_INTERFACE_DSI,
70    DISPLAY_INTERFACE_LVDS,
71    DISPLAY_INTERFACE_MAX
72
73 } DISPLAY_INTERFACE_T;
74
75 /* display dither setting, used on B0 */
76 typedef enum {
77    DISPLAY_DITHER_NONE   = 0,   /* default if not set */
78    DISPLAY_DITHER_RGB666 = 1,
79    DISPLAY_DITHER_RGB565 = 2,
80    DISPLAY_DITHER_RGB555 = 3,
81    DISPLAY_DITHER_MAX
82 } DISPLAY_DITHER_T;
83
84 //info struct
85 typedef struct
86 {
87    //type
88    DISPLAY_INTERFACE_T type;
89    //width / height
90    uint32_t width;
91    uint32_t height;
92    //output format
93    DISPLAY_INPUT_FORMAT_T input_format;
94    //interlaced?
95    uint32_t interlaced;
96    /* output dither setting (if required) */
97    DISPLAY_DITHER_T output_dither;
98    /* Pixel frequency */
99    uint32_t pixel_freq;
100    /* Line rate in lines per second */
101    uint32_t line_rate;
102    // Format required for image data for 3D displays
103    DISPLAY_3D_FORMAT_T format_3d;
104    // If display requires PV1 (e.g. DSI1), special config is required in HVS
105    uint32_t use_pixelvalve_1;
106    // Set for DSI displays which use video mode.
107    uint32_t dsi_video_mode;
108    // Select HVS channel (usually 0).
109    uint32_t hvs_channel;
110 } DISPLAY_INFO_T;
111
112 #endif /* __VC_INCLUDE_IMAGE_TYPES_H__ */
113
114