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 #ifndef IA_CSS_NO_DEBUG
18 /* FIXME: See BZ 4427 */
19 #include "ia_css_debug.h"
21 #include "sh_css_frac.h"
24 #include "ia_css_gc.host.h"
26 const struct ia_css_gc_config default_gc_config = {
31 const struct ia_css_ce_config default_ce_config = {
38 struct sh_css_isp_gc_params *to,
39 const struct ia_css_gc_config *from,
44 uDIGIT_FITTING((int)from->gain_k1, 16,
45 IA_CSS_GAMMA_GAIN_K_SHIFT);
47 uDIGIT_FITTING((int)from->gain_k2, 16,
48 IA_CSS_GAMMA_GAIN_K_SHIFT);
53 struct sh_css_isp_ce_params *to,
54 const struct ia_css_ce_config *from,
58 to->uv_level_min = from->uv_level_min;
59 to->uv_level_max = from->uv_level_max;
63 ia_css_gc_vamem_encode(
64 struct sh_css_isp_gc_vamem_params *to,
65 const struct ia_css_gamma_table *from,
69 memcpy (&to->gc, &from->data, sizeof(to->gc));
72 #ifndef IA_CSS_NO_DEBUG
75 const struct sh_css_isp_gc_params *gc,
79 ia_css_debug_dtrace(level, "Gamma Correction:\n");
80 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
81 "gamma_gain_k1", gc->gain_k1);
82 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
83 "gamma_gain_k2", gc->gain_k2);
88 const struct sh_css_isp_ce_params *ce,
91 ia_css_debug_dtrace(level, "Chroma Enhancement:\n");
92 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
93 "ce_uv_level_min", ce->uv_level_min);
94 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
95 "ce_uv_level_max", ce->uv_level_max);
99 ia_css_gc_debug_dtrace(
100 const struct ia_css_gc_config *config,
103 ia_css_debug_dtrace(level,
104 "config.gain_k1=%d, config.gain_k2=%d\n",
105 config->gain_k1, config->gain_k2);
109 ia_css_ce_debug_dtrace(
110 const struct ia_css_ce_config *config,
113 ia_css_debug_dtrace(level,
114 "config.uv_level_min=%d, config.uv_level_max=%d\n",
115 config->uv_level_min, config->uv_level_max);