1#ifndef ISP2401
2
3
4
5
6
7
8
9
10
11
12
13
14
15#else
16
17
18
19
20
21
22
23
24
25
26
27
28
29#endif
30
31#ifndef _IA_CSS_BINARY_H_
32#define _IA_CSS_BINARY_H_
33
34#include <type_support.h>
35#include "ia_css_types.h"
36#include "ia_css_err.h"
37#include "ia_css_stream_format.h"
38#include "ia_css_stream_public.h"
39#include "ia_css_frame_public.h"
40#include "sh_css_metrics.h"
41#include "isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds_types.h"
42
43
44
45#define IA_CSS_BINARY_MODE_COPY 0
46#define IA_CSS_BINARY_MODE_PREVIEW 1
47#define IA_CSS_BINARY_MODE_PRIMARY 2
48#define IA_CSS_BINARY_MODE_VIDEO 3
49#define IA_CSS_BINARY_MODE_PRE_ISP 4
50#define IA_CSS_BINARY_MODE_GDC 5
51#define IA_CSS_BINARY_MODE_POST_ISP 6
52#define IA_CSS_BINARY_MODE_ANR 7
53#define IA_CSS_BINARY_MODE_CAPTURE_PP 8
54#define IA_CSS_BINARY_MODE_VF_PP 9
55#define IA_CSS_BINARY_MODE_PRE_DE 10
56#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE0 11
57#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE1 12
58#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE2 13
59#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE3 14
60#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE4 15
61#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE5 16
62#define IA_CSS_BINARY_NUM_MODES 17
63
64#define MAX_NUM_PRIMARY_STAGES 6
65#define NUM_PRIMARY_HQ_STAGES 6
66#define NUM_PRIMARY_STAGES 1
67
68
69#define IA_CSS_BINARY_INPUT_SENSOR 0
70#define IA_CSS_BINARY_INPUT_MEMORY 1
71#define IA_CSS_BINARY_INPUT_VARIABLE 2
72
73
74
75
76
77#include "runtime/isp_param/interface/ia_css_isp_param_types.h"
78
79
80enum {
81 IA_CSS_BINARY_OUTPUT_PORT_0 = 0,
82 IA_CSS_BINARY_OUTPUT_PORT_1 = 1,
83 IA_CSS_BINARY_MAX_OUTPUT_PORTS = 2
84};
85
86struct ia_css_cas_binary_descr {
87 unsigned int num_stage;
88 unsigned int num_output_stage;
89 struct ia_css_frame_info *in_info;
90 struct ia_css_frame_info *internal_out_info;
91 struct ia_css_frame_info *out_info;
92 struct ia_css_frame_info *vf_info;
93 bool *is_output_stage;
94};
95
96struct ia_css_binary_descr {
97 int mode;
98 bool online;
99 bool continuous;
100 bool striped;
101 bool two_ppc;
102 bool enable_yuv_ds;
103 bool enable_high_speed;
104 bool enable_dvs_6axis;
105 bool enable_reduced_pipe;
106 bool enable_dz;
107 bool enable_xnr;
108 bool enable_fractional_ds;
109 bool enable_dpc;
110#ifdef ISP2401
111 bool enable_luma_only;
112 bool enable_tnr;
113#endif
114 bool enable_capture_pp_bli;
115 struct ia_css_resolution dvs_env;
116 enum atomisp_input_format stream_format;
117 struct ia_css_frame_info *in_info;
118
119 struct ia_css_frame_info *bds_out_info;
120 struct ia_css_frame_info *out_info[IA_CSS_BINARY_MAX_OUTPUT_PORTS];
121 struct ia_css_frame_info *vf_info;
122 unsigned int isp_pipe_version;
123 unsigned int required_bds_factor;
124 int stream_config_left_padding;
125};
126
127struct ia_css_binary {
128 const struct ia_css_binary_xinfo *info;
129 enum atomisp_input_format input_format;
130 struct ia_css_frame_info in_frame_info;
131 struct ia_css_frame_info internal_frame_info;
132 struct ia_css_frame_info out_frame_info[IA_CSS_BINARY_MAX_OUTPUT_PORTS];
133 struct ia_css_resolution effective_in_frame_res;
134 struct ia_css_frame_info vf_frame_info;
135 int input_buf_vectors;
136 int deci_factor_log2;
137 int vf_downscale_log2;
138 int s3atbl_width;
139 int s3atbl_height;
140 int s3atbl_isp_width;
141 int s3atbl_isp_height;
142 unsigned int morph_tbl_width;
143 unsigned int morph_tbl_aligned_width;
144 unsigned int morph_tbl_height;
145 int sctbl_width_per_color;
146 int sctbl_aligned_width_per_color;
147 int sctbl_height;
148#ifdef ISP2401
149 int sctbl_legacy_width_per_color;
150 int sctbl_legacy_height;
151#endif
152 struct ia_css_sdis_info dis;
153 struct ia_css_resolution dvs_envelope;
154 bool online;
155 unsigned int uds_xc;
156 unsigned int uds_yc;
157 unsigned int left_padding;
158 struct sh_css_binary_metrics metrics;
159 struct ia_css_isp_param_host_segments mem_params;
160 struct ia_css_isp_param_css_segments css_params;
161};
162
163#define IA_CSS_BINARY_DEFAULT_SETTINGS \
164(struct ia_css_binary) { \
165 .input_format = ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY, \
166 .in_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
167 .internal_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
168 .out_frame_info = {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
169 .vf_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
170}
171
172enum ia_css_err
173ia_css_binary_init_infos(void);
174
175enum ia_css_err
176ia_css_binary_uninit(void);
177
178enum ia_css_err
179ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo,
180 bool online,
181 bool two_ppc,
182 enum atomisp_input_format stream_format,
183 const struct ia_css_frame_info *in_info,
184 const struct ia_css_frame_info *bds_out_info,
185 const struct ia_css_frame_info *out_info[],
186 const struct ia_css_frame_info *vf_info,
187 struct ia_css_binary *binary,
188 struct ia_css_resolution *dvs_env,
189 int stream_config_left_padding,
190 bool accelerator);
191
192enum ia_css_err
193ia_css_binary_find(struct ia_css_binary_descr *descr,
194 struct ia_css_binary *binary);
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219enum ia_css_err
220ia_css_binary_get_shading_info(const struct ia_css_binary *binary,
221 enum ia_css_shading_correction_type type,
222 unsigned int required_bds_factor,
223 const struct ia_css_stream_config *stream_config,
224#ifndef ISP2401
225 struct ia_css_shading_info *info);
226#else
227 struct ia_css_shading_info *shading_info,
228 struct ia_css_pipe_config *pipe_config);
229#endif
230
231enum ia_css_err
232ia_css_binary_3a_grid_info(const struct ia_css_binary *binary,
233 struct ia_css_grid_info *info,
234 struct ia_css_pipe *pipe);
235
236void
237ia_css_binary_dvs_grid_info(const struct ia_css_binary *binary,
238 struct ia_css_grid_info *info,
239 struct ia_css_pipe *pipe);
240
241void
242ia_css_binary_dvs_stat_grid_info(
243 const struct ia_css_binary *binary,
244 struct ia_css_grid_info *info,
245 struct ia_css_pipe *pipe);
246
247unsigned
248ia_css_binary_max_vf_width(void);
249
250void
251ia_css_binary_destroy_isp_parameters(struct ia_css_binary *binary);
252
253void
254ia_css_binary_get_isp_binaries(struct ia_css_binary_xinfo **binaries,
255 uint32_t *num_isp_binaries);
256
257#endif
258