2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
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.
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
15 #include "ia_css_types.h"
16 #include "sh_css_defs.h"
17 #include "ia_css_debug.h"
18 #include "assert_support.h"
20 #include "ia_css_ynr2.host.h"
22 const struct ia_css_ynr_config default_ynr_config = {
29 const struct ia_css_fc_config default_fc_config = {
31 0, /* 0 -> ineffective */
32 0, /* 0 -> ineffective */
33 0, /* 0 -> ineffective */
34 0, /* 0 -> ineffective */
35 (1 << (ISP_VEC_ELEMBITS - 2)), /* 0.5 */
36 (1 << (ISP_VEC_ELEMBITS - 2)), /* 0.5 */
37 (1 << (ISP_VEC_ELEMBITS - 2)), /* 0.5 */
38 (1 << (ISP_VEC_ELEMBITS - 2)), /* 0.5 */
39 (1 << (ISP_VEC_ELEMBITS - 1)) - 1, /* 1 */
40 (1 << (ISP_VEC_ELEMBITS - 1)) - 1, /* 1 */
41 (int16_t)- (1 << (ISP_VEC_ELEMBITS - 1)), /* -1 */
42 (int16_t)- (1 << (ISP_VEC_ELEMBITS - 1)), /* -1 */
47 struct sh_css_isp_yee2_params *to,
48 const struct ia_css_ynr_config *from,
52 to->edge_sense_gain_0 = from->edge_sense_gain_0;
53 to->edge_sense_gain_1 = from->edge_sense_gain_1;
54 to->corner_sense_gain_0 = from->corner_sense_gain_0;
55 to->corner_sense_gain_1 = from->corner_sense_gain_1;
60 struct sh_css_isp_fc_params *to,
61 const struct ia_css_fc_config *from,
65 to->gain_exp = from->gain_exp;
67 to->coring_pos_0 = from->coring_pos_0;
68 to->coring_pos_1 = from->coring_pos_1;
69 to->coring_neg_0 = from->coring_neg_0;
70 to->coring_neg_1 = from->coring_neg_1;
72 to->gain_pos_0 = from->gain_pos_0;
73 to->gain_pos_1 = from->gain_pos_1;
74 to->gain_neg_0 = from->gain_neg_0;
75 to->gain_neg_1 = from->gain_neg_1;
77 to->crop_pos_0 = from->crop_pos_0;
78 to->crop_pos_1 = from->crop_pos_1;
79 to->crop_neg_0 = from->crop_neg_0;
80 to->crop_neg_1 = from->crop_neg_1;
85 const struct sh_css_isp_yee2_params *yee2,
90 const struct sh_css_isp_fc_params *fc,
94 ia_css_fc_debug_dtrace(
95 const struct ia_css_fc_config *config,
98 ia_css_debug_dtrace(level,
99 "config.gain_exp=%d, "
100 "config.coring_pos_0=%d, config.coring_pos_1=%d, "
101 "config.coring_neg_0=%d, config.coring_neg_1=%d, "
102 "config.gain_pos_0=%d, config.gain_pos_1=%d, "
103 "config.gain_neg_0=%d, config.gain_neg_1=%d, "
104 "config.crop_pos_0=%d, config.crop_pos_1=%d, "
105 "config.crop_neg_0=%d, config.crop_neg_1=%d\n",
107 config->coring_pos_0, config->coring_pos_1,
108 config->coring_neg_0, config->coring_neg_1,
109 config->gain_pos_0, config->gain_pos_1,
110 config->gain_neg_0, config->gain_neg_1,
111 config->crop_pos_0, config->crop_pos_1,
112 config->crop_neg_0, config->crop_neg_1);
116 ia_css_ynr_debug_dtrace(
117 const struct ia_css_ynr_config *config,
120 ia_css_debug_dtrace(level,
121 "config.edge_sense_gain_0=%d, config.edge_sense_gain_1=%d, "
122 "config.corner_sense_gain_0=%d, config.corner_sense_gain_1=%d\n",
123 config->edge_sense_gain_0, config->edge_sense_gain_1,
124 config->corner_sense_gain_0, config->corner_sense_gain_1);