1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  */
6 
7 #include "ia_css_types.h"
8 #include "sh_css_defs.h"
9 #include "ia_css_debug.h"
10 
11 #include "ia_css_de2.host.h"
12 
13 const struct ia_css_ecd_config default_ecd_config = {
14 	(1 << (ISP_VEC_ELEMBITS - 1)) * 2 / 3,	/* 2/3 */
15 	(1 << (ISP_VEC_ELEMBITS - 1)) - 1,	/* 1.0 */
16 	0,					/* 0.0 */
17 };
18 
19 void
ia_css_ecd_encode(struct sh_css_isp_ecd_params * to,const struct ia_css_ecd_config * from,unsigned int size)20 ia_css_ecd_encode(
21     struct sh_css_isp_ecd_params *to,
22     const struct ia_css_ecd_config *from,
23     unsigned int size)
24 {
25 	(void)size;
26 	to->zip_strength = from->zip_strength;
27 	to->fc_strength  = from->fc_strength;
28 	to->fc_debias    = from->fc_debias;
29 }
30 
31 void
32 ia_css_ecd_dump(
33     const struct sh_css_isp_ecd_params *ecd,
34     unsigned int level);
35 
36 void
ia_css_ecd_debug_dtrace(const struct ia_css_ecd_config * config,unsigned int level)37 ia_css_ecd_debug_dtrace(
38     const struct ia_css_ecd_config *config,
39     unsigned int level)
40 {
41 	ia_css_debug_dtrace(level,
42 			    "config.zip_strength=%d, config.fc_strength=%d, config.fc_debias=%d\n",
43 			    config->zip_strength,
44 			    config->fc_strength, config->fc_debias);
45 }
46