• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 
19 #ifndef __HI_COMM_VO_DEV_ADAPT_H__
20 #define __HI_COMM_VO_DEV_ADAPT_H__
21 
22 #include "hi_type.h"
23 #include "hi_comm_video_adapt.h"
24 #include "hi_comm_vo_dev.h"
25 
26 #ifdef __cplusplus
27 #if __cplusplus
28 extern "C" {
29 #endif
30 #endif /* end of #ifdef __cplusplus */
31 
32 typedef EN_VOU_ERR_CODE_E hi_vou_err_code;
33 
34 typedef hi_u32 hi_vo_intf_type;
35 
36 typedef VO_INTF_SYNC_E hi_vo_intf_sync;
37 
38 typedef VO_CSC_MATRIX_E hi_vo_csc_matrix;
39 
40 typedef struct {
41     hi_bool synm; /* RW; sync mode(0:timing,as BT.656; 1:signal,as LCD) */
42     hi_bool iop; /* RW; interlaced or progressive display(0:i; 1:p) */
43     hi_u8 intfb; /* RW; interlace bit width while output */
44 
45     hi_u16 vact; /* RW; vertical active area */
46     hi_u16 vbb; /* RW; vertical back blank porch */
47     hi_u16 vfb; /* RW; vertical front blank porch */
48 
49     hi_u16 hact; /* RW; horizontal active area */
50     hi_u16 hbb; /* RW; horizontal back blank porch */
51     hi_u16 hfb; /* RW; horizontal front blank porch */
52     hi_u16 hmid; /* RW; bottom horizontal active area */
53 
54     hi_u16 bvact; /* RW; bottom vertical active area */
55     hi_u16 bvbb; /* RW; bottom vertical back blank porch */
56     hi_u16 bvfb; /* RW; bottom vertical front blank porch */
57 
58     hi_u16 hpw; /* RW; horizontal pulse width */
59     hi_u16 vpw; /* RW; vertical pulse width */
60 
61     hi_bool idv; /* RW; inverse data valid of output */
62     hi_bool ihs; /* RW; inverse horizontal synch signal */
63     hi_bool ivs; /* RW; inverse vertical synch signal */
64 } hi_vo_sync_info;
65 
66 typedef struct {
67     hi_u32 bg_color; /* RW; background color of a device, in RGB format. */
68     hi_vo_intf_type intf_type; /* RW; type of a VO interface */
69     hi_vo_intf_sync intf_sync; /* RW; type of a VO interface timing */
70     hi_vo_sync_info sync_info; /* RW; information about VO interface timings */
71 } hi_vo_pub_attr;
72 
73 typedef struct {
74     hi_vo_csc_matrix csc_matrix; /* CSC matrix */
75     hi_u32 luma; /* RW; range:    [0, 100]; luminance, default: 50 */
76     hi_u32 contrast; /* RW; range:    [0, 100]; contrast, default: 50 */
77     hi_u32 hue; /* RW; range:    [0, 100]; hue, default: 50 */
78     hi_u32 satuature; /* RW; range:    [0, 100]; satuature, default: 50 */
79 } hi_vo_csc;
80 
81 typedef struct {
82     hi_bool transparent_transmit; /* RW, range: [0, 1];  YC(luminance and chrominance) changes or not
83                                             when passing through VO */
84     hi_bool exit_dev;
85     hi_bool wbc_bg_black_en;
86     hi_bool dev_clk_ext_en;
87     hi_bool save_buf_mode[VO_MAX_PHY_DEV_NUM]; /* save buff mode */
88 } hi_vo_mod_param;
89 
90 typedef VO_CLK_SOURCE_E hi_vo_clk_source;
91 
92 typedef struct {
93     hi_u32 fbdiv;
94     hi_u32 frac;
95     hi_u32 refdiv;
96     hi_u32 postdiv1;
97     hi_u32 postdiv2;
98 } hi_vo_user_intfsync_pll;
99 
100 typedef struct {
101     hi_vo_clk_source clk_source;
102 
103     union {
104         hi_vo_user_intfsync_pll user_sync_pll;
105         hi_u32 lcd_m_clk_div;
106     };
107 } hi_vo_user_intfsync_attr;
108 
109 typedef struct {
110     hi_vo_user_intfsync_attr user_intf_sync_attr;
111     hi_u32 pre_div;
112     hi_u32 dev_div;
113     hi_bool clk_reverse;
114 } hi_vo_user_intfsync_info;
115 
116 #ifdef __cplusplus
117 #if __cplusplus
118 }
119 #endif
120 #endif /* end of #ifdef __cplusplus */
121 
122 #endif /* end of #ifndef __HI_COMM_VO_DEV_ADAPT_H__ */
123