GNU Linux-libre 4.14.332-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / kernels / cnr / cnr_2 / ia_css_cnr2.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_cnr2.host.h"
20
21 const struct ia_css_cnr_config default_cnr_config = {
22         0,
23         0,
24         100,
25         100,
26         100,
27         50,
28         50,
29         50
30 };
31
32 void
33 ia_css_cnr_encode(
34         struct sh_css_isp_cnr_params *to,
35         const struct ia_css_cnr_config *from,
36         unsigned size)
37 {
38         (void)size;
39         to->coring_u = from->coring_u;
40         to->coring_v = from->coring_v;
41         to->sense_gain_vy = from->sense_gain_vy;
42         to->sense_gain_vu = from->sense_gain_vu;
43         to->sense_gain_vv = from->sense_gain_vv;
44         to->sense_gain_hy = from->sense_gain_hy;
45         to->sense_gain_hu = from->sense_gain_hu;
46         to->sense_gain_hv = from->sense_gain_hv;
47 }
48
49 void
50 ia_css_cnr_dump(
51         const struct sh_css_isp_cnr_params *cnr,
52         unsigned level);
53
54 void
55 ia_css_cnr_debug_dtrace(
56         const struct ia_css_cnr_config *config,
57         unsigned level)
58 {
59         ia_css_debug_dtrace(level,
60                 "config.coring_u=%d, config.coring_v=%d, "
61                 "config.sense_gain_vy=%d, config.sense_gain_hy=%d, "
62                 "config.sense_gain_vu=%d, config.sense_gain_hu=%d, "
63                 "config.sense_gain_vv=%d, config.sense_gain_hv=%d\n",
64                 config->coring_u, config->coring_v,
65                 config->sense_gain_vy, config->sense_gain_hy,
66                 config->sense_gain_vu, config->sense_gain_hu,
67                 config->sense_gain_vv, config->sense_gain_hv);
68 }
69
70 void
71 ia_css_init_cnr2_state(
72         void/*struct sh_css_isp_cnr_vmem_state*/ *state,
73         size_t size)
74 {
75         memset(state, 0, size);
76 }