1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 /* Generated code: do not edit or commmit. */
17 
18 #define IA_CSS_INCLUDE_CONFIGURATIONS
19 #include "ia_css_pipeline.h"
20 #include "ia_css_isp_configs.h"
21 #include "ia_css_debug.h"
22 #include "assert_support.h"
23 
ia_css_configure_iterator(const struct ia_css_binary * binary,const struct ia_css_iterator_configuration * config_dmem)24 int ia_css_configure_iterator(const struct ia_css_binary *binary,
25 			      const struct ia_css_iterator_configuration *config_dmem)
26 {
27 	unsigned int offset = 0;
28 	unsigned int size   = 0;
29 
30 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
31 
32 	if (!binary->info->mem_offsets.offsets.config)
33 		return 0;
34 
35 	size = binary->info->mem_offsets.offsets.config->dmem.iterator.size;
36 	if (!size)
37 		return 0;
38 
39 	offset = binary->info->mem_offsets.offsets.config->dmem.iterator.offset;
40 
41 	ia_css_iterator_config((struct sh_css_isp_iterator_isp_config *)
42 			       &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
43 			       config_dmem, size);
44 	return 0;
45 }
46 
ia_css_configure_copy_output(const struct ia_css_binary * binary,const struct ia_css_copy_output_configuration * config_dmem)47 int ia_css_configure_copy_output(const struct ia_css_binary *binary,
48 				 const struct ia_css_copy_output_configuration *config_dmem)
49 {
50 	unsigned int offset = 0;
51 	unsigned int size   = 0;
52 
53 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
54 
55 	if (!binary->info->mem_offsets.offsets.config)
56 		return 0;
57 
58 	size = binary->info->mem_offsets.offsets.config->dmem.copy_output.size;
59 	if (!size)
60 		return 0;
61 
62 	offset = binary->info->mem_offsets.offsets.config->dmem.copy_output.offset;
63 
64 	ia_css_copy_output_config((struct sh_css_isp_copy_output_isp_config *)
65 				  &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
66 				  config_dmem, size);
67 	return 0;
68 }
69 
70 /* Code generated by genparam/genconfig.c:gen_configure_function() */
71 
ia_css_configure_crop(const struct ia_css_binary * binary,const struct ia_css_crop_configuration * config_dmem)72 int ia_css_configure_crop(const struct ia_css_binary *binary,
73 			  const struct ia_css_crop_configuration *config_dmem)
74 {
75 	unsigned int offset = 0;
76 	unsigned int size   = 0;
77 
78 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
79 
80 	if (!binary->info->mem_offsets.offsets.config)
81 		return 0;
82 
83 	size = binary->info->mem_offsets.offsets.config->dmem.crop.size;
84 	if (!size)
85 		return 0;
86 
87 	offset = binary->info->mem_offsets.offsets.config->dmem.crop.offset;
88 
89 	ia_css_crop_config((struct sh_css_isp_crop_isp_config *)
90 			   &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
91 			   config_dmem, size);
92 	return 0;
93 }
94 
ia_css_configure_fpn(const struct ia_css_binary * binary,const struct ia_css_fpn_configuration * config_dmem)95 int ia_css_configure_fpn(const struct ia_css_binary *binary,
96 			 const struct ia_css_fpn_configuration *config_dmem)
97 {
98 	unsigned int offset = 0;
99 	unsigned int size   = 0;
100 
101 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
102 
103 	if (!binary->info->mem_offsets.offsets.config)
104 		return 0;
105 
106 	size   = binary->info->mem_offsets.offsets.config->dmem.fpn.size;
107 	if (!size)
108 		return 0;
109 
110 	offset = binary->info->mem_offsets.offsets.config->dmem.fpn.offset;
111 	ia_css_fpn_config((struct sh_css_isp_fpn_isp_config *)
112 			  &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
113 			  config_dmem, size);
114 	return 0;
115 }
116 
ia_css_configure_dvs(const struct ia_css_binary * binary,const struct ia_css_dvs_configuration * config_dmem)117 int ia_css_configure_dvs(const struct ia_css_binary *binary,
118 			 const struct ia_css_dvs_configuration *config_dmem)
119 {
120 	unsigned int offset = 0;
121 	unsigned int size   = 0;
122 
123 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
124 
125 	if (!binary->info->mem_offsets.offsets.config)
126 		return 0;
127 
128 	size = binary->info->mem_offsets.offsets.config->dmem.dvs.size;
129 	if (!size)
130 		return 0;
131 
132 	offset = binary->info->mem_offsets.offsets.config->dmem.dvs.offset;
133 	ia_css_dvs_config((struct sh_css_isp_dvs_isp_config *)
134 			  &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
135 			  config_dmem, size);
136 	return 0;
137 }
138 
ia_css_configure_qplane(const struct ia_css_binary * binary,const struct ia_css_qplane_configuration * config_dmem)139 int ia_css_configure_qplane(const struct ia_css_binary *binary,
140 			    const struct ia_css_qplane_configuration *config_dmem)
141 {
142 	unsigned int offset = 0;
143 	unsigned int size   = 0;
144 
145 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
146 
147 	if (!binary->info->mem_offsets.offsets.config)
148 		return 0;
149 
150 	size = binary->info->mem_offsets.offsets.config->dmem.qplane.size;
151 	if (!size)
152 		return 0;
153 
154 	offset = binary->info->mem_offsets.offsets.config->dmem.qplane.offset;
155 	ia_css_qplane_config((struct sh_css_isp_qplane_isp_config *)
156 			     &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
157 			     config_dmem, size);
158 
159 	return 0;
160 }
161 
ia_css_configure_output0(const struct ia_css_binary * binary,const struct ia_css_output0_configuration * config_dmem)162 int ia_css_configure_output0(const struct ia_css_binary *binary,
163 			     const struct ia_css_output0_configuration *config_dmem)
164 {
165 	unsigned int offset = 0;
166 	unsigned int size   = 0;
167 
168 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
169 
170 	if (!binary->info->mem_offsets.offsets.config)
171 		return 0;
172 
173 	size = binary->info->mem_offsets.offsets.config->dmem.output0.size;
174 	if (!size)
175 		return 0;
176 
177 	offset = binary->info->mem_offsets.offsets.config->dmem.output0.offset;
178 
179 	ia_css_output0_config((struct sh_css_isp_output_isp_config *)
180 			      &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
181 			      config_dmem, size);
182 	return 0;
183 }
184 
ia_css_configure_output1(const struct ia_css_binary * binary,const struct ia_css_output1_configuration * config_dmem)185 int ia_css_configure_output1(const struct ia_css_binary *binary,
186 			     const struct ia_css_output1_configuration *config_dmem)
187 {
188 	unsigned int offset = 0;
189 	unsigned int size   = 0;
190 
191 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
192 
193 	if (!binary->info->mem_offsets.offsets.config)
194 		return 0;
195 
196 	size = binary->info->mem_offsets.offsets.config->dmem.output1.size;
197 	if (!size)
198 		return 0;
199 
200 	offset = binary->info->mem_offsets.offsets.config->dmem.output1.offset;
201 
202 	ia_css_output1_config((struct sh_css_isp_output_isp_config *)
203 			      &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
204 			      config_dmem, size);
205 	return 0;
206 }
207 
ia_css_configure_output(const struct ia_css_binary * binary,const struct ia_css_output_configuration * config_dmem)208 int ia_css_configure_output(const struct ia_css_binary *binary,
209 			    const struct ia_css_output_configuration *config_dmem)
210 {
211 	unsigned int offset = 0;
212 	unsigned int size   = 0;
213 
214 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
215 
216 	if (!binary->info->mem_offsets.offsets.config)
217 		return 0;
218 
219 	size = binary->info->mem_offsets.offsets.config->dmem.output.size;
220 	if (!size)
221 		return 0;
222 
223 	offset = binary->info->mem_offsets.offsets.config->dmem.output.offset;
224 
225 	ia_css_output_config((struct sh_css_isp_output_isp_config *)
226 			     &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
227 					     config_dmem, size);
228 	return 0;
229 }
230 
ia_css_configure_raw(const struct ia_css_binary * binary,const struct ia_css_raw_configuration * config_dmem)231 int ia_css_configure_raw(const struct ia_css_binary *binary,
232 			 const struct ia_css_raw_configuration *config_dmem)
233 {
234 	unsigned int offset = 0;
235 	unsigned int size   = 0;
236 
237 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
238 
239 	if (!binary->info->mem_offsets.offsets.config)
240 		return 0;
241 
242 	size = binary->info->mem_offsets.offsets.config->dmem.raw.size;
243 	if (!size)
244 		return 0;
245 
246 	offset = binary->info->mem_offsets.offsets.config->dmem.raw.offset;
247 
248 	ia_css_raw_config((struct sh_css_isp_raw_isp_config *)
249 			  &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
250 			  config_dmem, size);
251 	return 0;
252 }
253 
ia_css_configure_tnr(const struct ia_css_binary * binary,const struct ia_css_tnr_configuration * config_dmem)254 int ia_css_configure_tnr(const struct ia_css_binary *binary,
255 			 const struct ia_css_tnr_configuration *config_dmem)
256 {
257 	unsigned int offset = 0;
258 	unsigned int size   = 0;
259 
260 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
261 
262 	if (!binary->info->mem_offsets.offsets.config)
263 		return 0;
264 
265 	size = binary->info->mem_offsets.offsets.config->dmem.tnr.size;
266 	if (!size)
267 		return 0;
268 
269 	offset = binary->info->mem_offsets.offsets.config->dmem.tnr.offset;
270 
271 	ia_css_tnr_config((struct sh_css_isp_tnr_isp_config *)
272 			  &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
273 			  config_dmem, size);
274 	return 0;
275 }
276 
ia_css_configure_ref(const struct ia_css_binary * binary,const struct ia_css_ref_configuration * config_dmem)277 int ia_css_configure_ref(const struct ia_css_binary *binary,
278 			 const struct ia_css_ref_configuration *config_dmem)
279 {
280 	unsigned int offset = 0;
281 	unsigned int size   = 0;
282 
283 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
284 
285 	if (!binary->info->mem_offsets.offsets.config)
286 		return 0;
287 
288 	size = binary->info->mem_offsets.offsets.config->dmem.ref.size;
289 	if (!size)
290 		return 0;
291 
292 	offset = binary->info->mem_offsets.offsets.config->dmem.ref.offset;
293 
294 	ia_css_ref_config((struct sh_css_isp_ref_isp_config *)
295 			  &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
296 			  config_dmem, size);
297 	return 0;
298 }
299 
ia_css_configure_vf(const struct ia_css_binary * binary,const struct ia_css_vf_configuration * config_dmem)300 int ia_css_configure_vf(const struct ia_css_binary *binary,
301 			const struct ia_css_vf_configuration *config_dmem)
302 {
303 	unsigned int offset = 0;
304 	unsigned int size   = 0;
305 
306 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "%s:\n", __func__);
307 
308 	if (!binary->info->mem_offsets.offsets.config)
309 		return 0;
310 
311 	size = binary->info->mem_offsets.offsets.config->dmem.vf.size;
312 	if (!size)
313 		return 0;
314 
315 	offset = binary->info->mem_offsets.offsets.config->dmem.vf.offset;
316 
317 	ia_css_vf_config((struct sh_css_isp_vf_isp_config *)
318 			 &binary->mem_params.params[IA_CSS_PARAM_CLASS_CONFIG][IA_CSS_ISP_DMEM].address[offset],
319 			 config_dmem, size);
320 	return 0;
321 }
322