1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Support for Intel Camera Imaging ISP subsystem. 4 * Copyright (c) 2015, Intel Corporation. 5 */ 6 7 #ifndef __IA_CSS_GC_PARAM_H 8 #define __IA_CSS_GC_PARAM_H 9 10 #include "type_support.h" 11 #ifndef PIPE_GENERATION 12 #ifdef __ISP 13 #define __INLINE_VAMEM__ 14 #endif 15 #include "vamem.h" 16 #include "ia_css_gc_types.h" 17 18 #if defined(IS_VAMEM_VERSION_1) 19 #define SH_CSS_ISP_GAMMA_TABLE_SIZE_LOG2 IA_CSS_VAMEM_1_GAMMA_TABLE_SIZE_LOG2 20 #define SH_CSS_ISP_GC_TABLE_SIZE IA_CSS_VAMEM_1_GAMMA_TABLE_SIZE 21 #elif defined(IS_VAMEM_VERSION_2) 22 #define SH_CSS_ISP_GAMMA_TABLE_SIZE_LOG2 IA_CSS_VAMEM_2_GAMMA_TABLE_SIZE_LOG2 23 #define SH_CSS_ISP_GC_TABLE_SIZE IA_CSS_VAMEM_2_GAMMA_TABLE_SIZE 24 #else 25 #error "Undefined vamem version" 26 #endif 27 28 #else 29 /* For pipe generation, the size is not relevant */ 30 #define SH_CSS_ISP_GC_TABLE_SIZE 0 31 #endif 32 33 #define GAMMA_OUTPUT_BITS 8 34 #define GAMMA_OUTPUT_MAX_VAL ((1 << GAMMA_OUTPUT_BITS) - 1) 35 36 /* GC (Gamma Correction) */ 37 struct sh_css_isp_gc_params { 38 s32 gain_k1; 39 s32 gain_k2; 40 }; 41 42 /* CE (Chroma Enhancement) */ 43 struct sh_css_isp_ce_params { 44 s32 uv_level_min; 45 s32 uv_level_max; 46 }; 47 48 /* This should be vamem_data_t, but that breaks the pipe generator */ 49 struct sh_css_isp_gc_vamem_params { 50 u16 gc[SH_CSS_ISP_GC_TABLE_SIZE]; 51 }; 52 53 #endif /* __IA_CSS_GC_PARAM_H */ 54