1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef __IA_CSS_SC_PARAM_H
17 #define __IA_CSS_SC_PARAM_H
18 
19 #include "type_support.h"
20 
21 /* SC (Shading Corrction) */
22 struct sh_css_isp_sc_params {
23 	s32 gain_shift;
24 };
25 
26 /* Number of horizontal slice times for interpolated gain:
27  *
28  * The start position of the internal frame does not match the start position of the shading table.
29  * To get a vector of shading gains (interpolated horizontally and vertically)
30  * which matches a vector on the internal frame,
31  * vec_slice is used for 2 adjacent vectors of shading gains.
32  * The number of shift times by vec_slice is 8.
33  *     Max grid cell bqs to support the shading table centerting: N = 32
34  *     CEIL_DIV(N-1, ISP_SLICE_NELEMS) = CEIL_DIV(31, 4) = 8
35  */
36 #define SH_CSS_SC_INTERPED_GAIN_HOR_SLICE_TIMES   8
37 
38 struct sh_css_isp_sc_isp_config {
39 	u32 interped_gain_hor_slice_bqs[SH_CSS_SC_INTERPED_GAIN_HOR_SLICE_TIMES];
40 	u32 internal_frame_origin_y_bqs_on_sctbl;
41 };
42 
43 #endif /* __IA_CSS_SC_PARAM_H */
44