GNU Linux-libre 4.14.251-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / kernels / de / de_2 / ia_css_de2.host.c
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #include "ia_css_types.h"
16 #include "sh_css_defs.h"
17 #include "ia_css_debug.h"
18
19 #include "ia_css_de2.host.h"
20
21 const struct ia_css_ecd_config default_ecd_config = {
22         (1 << (ISP_VEC_ELEMBITS - 1)) * 2 / 3,  /* 2/3 */
23         (1 << (ISP_VEC_ELEMBITS - 1)) - 1,      /* 1.0 */
24         0,                                      /* 0.0 */
25 };
26
27 void
28 ia_css_ecd_encode(
29         struct sh_css_isp_ecd_params *to,
30         const struct ia_css_ecd_config *from,
31         unsigned size)
32 {
33         (void)size;
34         to->zip_strength = from->zip_strength;
35         to->fc_strength  = from->fc_strength;
36         to->fc_debias    = from->fc_debias;
37 }
38
39 void
40 ia_css_ecd_dump(
41         const struct sh_css_isp_ecd_params *ecd,
42         unsigned level);
43
44 void
45 ia_css_ecd_debug_dtrace(
46         const struct ia_css_ecd_config *config,
47         unsigned level)
48 {
49         ia_css_debug_dtrace(level,
50                 "config.zip_strength=%d, "
51                 "config.fc_strength=%d, config.fc_debias=%d\n",
52                 config->zip_strength,
53                 config->fc_strength, config->fc_debias);
54 }