GNU Linux-libre 4.14.259-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / kernels / gc / gc_1.0 / ia_css_gc_param.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
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.
8  *
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
12  * more details.
13  */
14
15 #ifndef __IA_CSS_GC_PARAM_H
16 #define __IA_CSS_GC_PARAM_H
17
18 #include "type_support.h"
19 #ifndef PIPE_GENERATION
20 #ifdef __ISP
21 #define __INLINE_VAMEM__
22 #endif
23 #include "vamem.h"
24 #include "ia_css_gc_types.h"
25
26 #if defined(IS_VAMEM_VERSION_1)
27 #define SH_CSS_ISP_GAMMA_TABLE_SIZE_LOG2 IA_CSS_VAMEM_1_GAMMA_TABLE_SIZE_LOG2
28 #define SH_CSS_ISP_GC_TABLE_SIZE         IA_CSS_VAMEM_1_GAMMA_TABLE_SIZE
29 #elif defined(IS_VAMEM_VERSION_2)
30 #define SH_CSS_ISP_GAMMA_TABLE_SIZE_LOG2 IA_CSS_VAMEM_2_GAMMA_TABLE_SIZE_LOG2
31 #define SH_CSS_ISP_GC_TABLE_SIZE         IA_CSS_VAMEM_2_GAMMA_TABLE_SIZE
32 #else
33 #error "Undefined vamem version"
34 #endif
35
36 #else
37 /* For pipe generation, the size is not relevant */
38 #define SH_CSS_ISP_GC_TABLE_SIZE 0
39 #endif
40
41 #define GAMMA_OUTPUT_BITS               8
42 #define GAMMA_OUTPUT_MAX_VAL            ((1<<GAMMA_OUTPUT_BITS)-1)
43
44 /* GC (Gamma Correction) */
45 struct sh_css_isp_gc_params {
46         int32_t gain_k1;
47         int32_t gain_k2;
48 };
49
50 /* CE (Chroma Enhancement) */
51 struct sh_css_isp_ce_params {
52         int32_t uv_level_min;
53         int32_t uv_level_max;
54 };
55
56 /* This should be vamem_data_t, but that breaks the pipe generator */
57 struct sh_css_isp_gc_vamem_params {
58         uint16_t gc[SH_CSS_ISP_GC_TABLE_SIZE];
59 };
60
61 #endif /* __IA_CSS_GC_PARAM_H */