blob: f540771c45aa06594af6bd1794a75d499344c6eb
1 | /* |
2 | * drivers/amlogic/media/video_sink/video_priv.h |
3 | * |
4 | * Copyright (C) 2017 Amlogic, Inc. All rights reserved. |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, but WITHOUT |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
14 | * more details. |
15 | * |
16 | */ |
17 | |
18 | #ifndef VIDEO_PRIV_HEADER_HH |
19 | #define VIDEO_PRIV_HEADER_HH |
20 | |
21 | #include <linux/amlogic/media/video_sink/vpp.h> |
22 | |
23 | #define DEBUG_FLAG_BLACKOUT 0x1 |
24 | #define DEBUG_FLAG_PRINT_TOGGLE_FRAME 0x2 |
25 | #define DEBUG_FLAG_PRINT_RDMA 0x4 |
26 | #define DEBUG_FLAG_LOG_RDMA_LINE_MAX 0x100 |
27 | #define DEBUG_FLAG_TOGGLE_SKIP_KEEP_CURRENT 0x10000 |
28 | #define DEBUG_FLAG_TOGGLE_FRAME_PER_VSYNC 0x20000 |
29 | #define DEBUG_FLAG_RDMA_WAIT_1 0x40000 |
30 | #define DEBUG_FLAG_VSYNC_DONONE 0x80000 |
31 | #define DEBUG_FLAG_GOFIELD_MANUL 0x100000 |
32 | #define DEBUG_FLAG_LATENCY 0x200000 |
33 | #define DEBUG_FLAG_PTS_TRACE 0x400000 |
34 | #define DEBUG_FLAG_FRAME_DETECT 0x800000 |
35 | |
36 | /*for video.c's static int debug_flag;*/ |
37 | |
38 | #define VOUT_TYPE_TOP_FIELD 0 |
39 | #define VOUT_TYPE_BOT_FIELD 1 |
40 | #define VOUT_TYPE_PROG 2 |
41 | |
42 | #define VIDEO_DISABLE_NONE 0 |
43 | #define VIDEO_DISABLE_NORMAL 1 |
44 | #define VIDEO_DISABLE_FORNEXT 2 |
45 | |
46 | #define VIDEO_NOTIFY_TRICK_WAIT 0x01 |
47 | #define VIDEO_NOTIFY_PROVIDER_GET 0x02 |
48 | #define VIDEO_NOTIFY_PROVIDER_PUT 0x04 |
49 | #define VIDEO_NOTIFY_FRAME_WAIT 0x08 |
50 | #define VIDEO_NOTIFY_POS_CHANGED 0x10 |
51 | |
52 | struct video_dev_s { |
53 | int vpp_off; |
54 | int viu_off; |
55 | }; |
56 | |
57 | struct mif_pos_s { |
58 | u32 id; |
59 | u32 vd_reg_offt; |
60 | u32 afbc_reg_offt; |
61 | |
62 | /* frame original size */ |
63 | u32 src_w; |
64 | u32 src_h; |
65 | |
66 | /* mif start - end lines */ |
67 | u32 start_x_lines; |
68 | u32 end_x_lines; |
69 | u32 start_y_lines; |
70 | u32 end_y_lines; |
71 | |
72 | /* left and right eye position, skip flag. */ |
73 | /* And if non 3d case, left eye = right eye */ |
74 | u32 l_hs_luma; |
75 | u32 l_he_luma; |
76 | u32 l_hs_chrm; |
77 | u32 l_he_chrm; |
78 | u32 r_hs_luma; |
79 | u32 r_he_luma; |
80 | u32 r_hs_chrm; |
81 | u32 r_he_chrm; |
82 | u32 h_skip; |
83 | u32 l_vs_luma; |
84 | u32 l_ve_luma; |
85 | u32 l_vs_chrm; |
86 | u32 l_ve_chrm; |
87 | u32 r_vs_luma; |
88 | u32 r_ve_luma; |
89 | u32 r_vs_chrm; |
90 | u32 r_ve_chrm; |
91 | u32 v_skip; |
92 | |
93 | bool reverse; |
94 | |
95 | bool skip_afbc; |
96 | }; |
97 | |
98 | struct scaler_setting_s { |
99 | u32 id; |
100 | u32 misc_reg_offt; |
101 | |
102 | bool sc_h_enable; |
103 | bool sc_v_enable; |
104 | bool sc_top_enable; |
105 | |
106 | u32 vinfo_width; |
107 | u32 vinfo_height; |
108 | /* u32 VPP_pic_in_height_; */ |
109 | /* u32 VPP_line_in_length_; */ |
110 | |
111 | struct vpp_frame_par_s *frame_par; |
112 | }; |
113 | |
114 | struct blend_setting_s { |
115 | u32 id; |
116 | u32 misc_reg_offt; |
117 | |
118 | u32 layer_alpha; |
119 | |
120 | u32 preblend_h_start; |
121 | u32 preblend_h_end; |
122 | u32 preblend_v_start; |
123 | u32 preblend_v_end; |
124 | |
125 | u32 preblend_h_size; |
126 | |
127 | u32 postblend_h_start; |
128 | u32 postblend_h_end; |
129 | u32 postblend_v_start; |
130 | u32 postblend_v_end; |
131 | |
132 | u32 postblend_h_size; |
133 | |
134 | struct vpp_frame_par_s *frame_par; |
135 | }; |
136 | |
137 | void safe_disble_videolayer(void); |
138 | void update_cur_dispbuf(void *buf); |
139 | |
140 | /*for video related files only.*/ |
141 | void video_module_lock(void); |
142 | void video_module_unlock(void); |
143 | struct video_dev_s *get_video_cur_dev(void); |
144 | struct vframe_s *get_cur_dispbuf(void); |
145 | |
146 | int get_video_debug_flags(void); |
147 | int _video_set_disable(u32 val); |
148 | u32 get_video_enabled(void); |
149 | struct device *get_video_device(void); |
150 | |
151 | #ifdef CONFIG_AMLOGIC_MEDIA_VIDEOCAPTURE |
152 | int ext_frame_capture_poll(int endflags); |
153 | #endif |
154 | |
155 | extern u32 disp_canvas_index[2][6]; |
156 | #endif |
157 | /*VIDEO_PRIV_HEADER_HH*/ |
158 |