summaryrefslogtreecommitdiff
path: root/drivers/amlogic/media/video_sink/video_priv.h (plain)
blob: 446a8a9e2399e3a2dd298b0eb86982bc59b460b0
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/*for video.c's static int debug_flag;*/
35
36#define VOUT_TYPE_TOP_FIELD 0
37#define VOUT_TYPE_BOT_FIELD 1
38#define VOUT_TYPE_PROG 2
39
40#define VIDEO_DISABLE_NONE 0
41#define VIDEO_DISABLE_NORMAL 1
42#define VIDEO_DISABLE_FORNEXT 2
43
44#define VIDEO_NOTIFY_TRICK_WAIT 0x01
45#define VIDEO_NOTIFY_PROVIDER_GET 0x02
46#define VIDEO_NOTIFY_PROVIDER_PUT 0x04
47#define VIDEO_NOTIFY_FRAME_WAIT 0x08
48#define VIDEO_NOTIFY_POS_CHANGED 0x10
49
50struct video_dev_s {
51 int vpp_off;
52 int viu_off;
53};
54
55struct mif_pos_s {
56 u32 id;
57 u32 vd_reg_offt;
58 u32 afbc_reg_offt;
59
60 /* frame original size */
61 u32 src_w;
62 u32 src_h;
63
64 /* mif start - end lines */
65 u32 start_x_lines;
66 u32 end_x_lines;
67 u32 start_y_lines;
68 u32 end_y_lines;
69
70 /* left and right eye position, skip flag. */
71 /* And if non 3d case, left eye = right eye */
72 u32 l_hs_luma;
73 u32 l_he_luma;
74 u32 l_hs_chrm;
75 u32 l_he_chrm;
76 u32 r_hs_luma;
77 u32 r_he_luma;
78 u32 r_hs_chrm;
79 u32 r_he_chrm;
80 u32 h_skip;
81 u32 l_vs_luma;
82 u32 l_ve_luma;
83 u32 l_vs_chrm;
84 u32 l_ve_chrm;
85 u32 r_vs_luma;
86 u32 r_ve_luma;
87 u32 r_vs_chrm;
88 u32 r_ve_chrm;
89 u32 v_skip;
90
91 bool reverse;
92
93 bool skip_afbc;
94};
95
96struct scaler_setting_s {
97 u32 id;
98 u32 misc_reg_offt;
99
100 bool sc_h_enable;
101 bool sc_v_enable;
102 bool sc_top_enable;
103
104 u32 vinfo_width;
105 u32 vinfo_height;
106 /* u32 VPP_pic_in_height_; */
107 /* u32 VPP_line_in_length_; */
108
109 struct vpp_frame_par_s *frame_par;
110};
111
112struct blend_setting_s {
113 u32 id;
114 u32 misc_reg_offt;
115
116 u32 layer_alpha;
117
118 u32 preblend_h_start;
119 u32 preblend_h_end;
120 u32 preblend_v_start;
121 u32 preblend_v_end;
122
123 u32 preblend_h_size;
124
125 u32 postblend_h_start;
126 u32 postblend_h_end;
127 u32 postblend_v_start;
128 u32 postblend_v_end;
129
130 u32 postblend_h_size;
131
132 struct vpp_frame_par_s *frame_par;
133};
134
135void safe_disble_videolayer(void);
136void update_cur_dispbuf(void *buf);
137
138/*for video related files only.*/
139void video_module_lock(void);
140void video_module_unlock(void);
141struct video_dev_s *get_video_cur_dev(void);
142struct vframe_s *get_cur_dispbuf(void);
143
144int get_video_debug_flags(void);
145int _video_set_disable(u32 val);
146u32 get_video_enabled(void);
147struct device *get_video_device(void);
148
149#ifdef CONFIG_AMLOGIC_MEDIA_VIDEOCAPTURE
150int ext_frame_capture_poll(int endflags);
151#endif
152
153extern u32 disp_canvas_index[2][6];
154#endif
155/*VIDEO_PRIV_HEADER_HH*/
156