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 <assert_support.h>
16 #include <ia_css_frame_public.h>
17 #include <ia_css_frame.h>
18 #include <ia_css_binary.h>
19 #include <ia_css_types.h>
20 #include <sh_css_defs.h>
21 #include <ia_css_debug.h>
23 #define IA_CSS_INCLUDE_CONFIGURATIONS
24 #include "ia_css_isp_configs.h"
27 #include "ia_css_fpn.host.h"
31 struct sh_css_isp_fpn_params
*to
,
32 const struct ia_css_fpn_table
*from
,
36 to
->shift
= from
->shift
;
37 to
->enabled
= from
->data
!= NULL
;
42 const struct sh_css_isp_fpn_params
*fpn
,
46 ia_css_debug_dtrace(level
, "Fixed Pattern Noise Reduction:\n");
47 ia_css_debug_dtrace(level
, "\t%-32s = %d\n",
48 "fpn_shift", fpn
->shift
);
49 ia_css_debug_dtrace(level
, "\t%-32s = %d\n",
50 "fpn_enabled", fpn
->enabled
);
55 struct sh_css_isp_fpn_isp_config
*to
,
56 const struct ia_css_fpn_configuration
*from
,
59 unsigned elems_a
= ISP_VEC_NELEMS
;
62 ia_css_dma_configure_from_info(&to
->port_b
, from
->info
);
63 to
->width_a_over_b
= elems_a
/ to
->port_b
.elems
;
65 /* Assume divisiblity here, may need to generalize to fixed point. */
66 assert (elems_a
% to
->port_b
.elems
== 0);
71 const struct ia_css_binary
*binary
,
72 const struct ia_css_frame_info
*info
)
74 struct ia_css_frame_info my_info
= IA_CSS_BINARY_DEFAULT_FRAME_INFO
;
75 const struct ia_css_fpn_configuration config
= {
79 my_info
.res
.width
= CEIL_DIV(info
->res
.width
, 2); /* Packed by 2x */
80 my_info
.res
.height
= info
->res
.height
;
81 my_info
.padded_width
= CEIL_DIV(info
->padded_width
, 2); /* Packed by 2x */
82 my_info
.format
= info
->format
;
83 my_info
.raw_bit_depth
= FPN_BITS_PER_PIXEL
;
84 my_info
.raw_bayer_order
= info
->raw_bayer_order
;
85 my_info
.crop_info
= info
->crop_info
;
87 ia_css_configure_fpn(binary
, &config
);