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_frame.h"
16 #include "ia_css_debug.h"
17 #define IA_CSS_INCLUDE_CONFIGURATIONS
18 #include "ia_css_isp_configs.h"
19 #include "ia_css_output.host.h"
22 #include "assert_support.h"
24 const struct ia_css_output_config default_output_config = {
29 static const struct ia_css_output_configuration default_output_configuration = {
30 .info = (struct ia_css_frame_info *)NULL,
33 static const struct ia_css_output0_configuration default_output0_configuration = {
34 .info = (struct ia_css_frame_info *)NULL,
37 static const struct ia_css_output1_configuration default_output1_configuration = {
38 .info = (struct ia_css_frame_info *)NULL,
43 struct sh_css_isp_output_params *to,
44 const struct ia_css_output_config *from,
48 to->enable_hflip = from->enable_hflip;
49 to->enable_vflip = from->enable_vflip;
54 struct sh_css_isp_output_isp_config *to,
55 const struct ia_css_output_configuration *from,
58 unsigned elems_a = ISP_VEC_NELEMS;
61 ia_css_dma_configure_from_info(&to->port_b, from->info);
62 to->width_a_over_b = elems_a / to->port_b.elems;
63 to->height = from->info->res.height;
64 to->enable = from->info != NULL;
65 ia_css_frame_info_to_frame_sp_info(&to->info, from->info);
67 /* Assume divisiblity here, may need to generalize to fixed point. */
68 assert (elems_a % to->port_b.elems == 0);
72 ia_css_output0_config(
73 struct sh_css_isp_output_isp_config *to,
74 const struct ia_css_output0_configuration *from,
77 ia_css_output_config (
78 to, (const struct ia_css_output_configuration *)from, size);
82 ia_css_output1_config(
83 struct sh_css_isp_output_isp_config *to,
84 const struct ia_css_output1_configuration *from,
87 ia_css_output_config (
88 to, (const struct ia_css_output_configuration *)from, size);
92 ia_css_output_configure(
93 const struct ia_css_binary *binary,
94 const struct ia_css_frame_info *info)
97 struct ia_css_output_configuration config =
98 default_output_configuration;
102 ia_css_configure_output(binary, &config);
107 ia_css_output0_configure(
108 const struct ia_css_binary *binary,
109 const struct ia_css_frame_info *info)
112 struct ia_css_output0_configuration config =
113 default_output0_configuration;
117 ia_css_configure_output0(binary, &config);
122 ia_css_output1_configure(
123 const struct ia_css_binary *binary,
124 const struct ia_css_frame_info *info)
128 struct ia_css_output1_configuration config =
129 default_output1_configuration;
133 ia_css_configure_output1(binary, &config);
139 const struct sh_css_isp_output_params *output,
143 ia_css_debug_dtrace(level, "Horizontal Output Flip:\n");
144 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
145 "enable", output->enable_hflip);
146 ia_css_debug_dtrace(level, "Vertical Output Flip:\n");
147 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
148 "enable", output->enable_vflip);
152 ia_css_output_debug_dtrace(
153 const struct ia_css_output_config *config,
156 ia_css_debug_dtrace(level,
157 "config.enable_hflip=%d",
158 config->enable_hflip);
159 ia_css_debug_dtrace(level,
160 "config.enable_vflip=%d",
161 config->enable_vflip);