xref: /linux/drivers/staging/media/atomisp/pci/isp/kernels/gc/gc_2/ia_css_gc2_types.h (revision c771600c6af14749609b49565ffb4cac2959710d)
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_GC2_TYPES_H
8 #define __IA_CSS_GC2_TYPES_H
9 
10 #include "isp/kernels/ctc/ctc_1.0/ia_css_ctc_types.h"  /* FIXME: needed for ia_css_vamem_type */
11 
12 /* @file
13 * CSS-API header file for Gamma Correction parameters.
14 */
15 
16 /* sRGB Gamma table, used for sRGB Gamma Correction.
17  *
18  *  ISP block: GC2 (sRGB Gamma Correction)
19  * (ISP1: GC1(YUV Gamma Correction) is used.)
20  *  ISP2: GC2 is used.
21  */
22 
23 /* Number of elements in the sRGB gamma table. */
24 #define IA_CSS_VAMEM_1_RGB_GAMMA_TABLE_SIZE_LOG2 8
25 #define IA_CSS_VAMEM_1_RGB_GAMMA_TABLE_SIZE      BIT(IA_CSS_VAMEM_1_RGB_GAMMA_TABLE_SIZE_LOG2)
26 
27 /* Number of elements in the sRGB gamma table. */
28 #define IA_CSS_VAMEM_2_RGB_GAMMA_TABLE_SIZE_LOG2    8
29 #define IA_CSS_VAMEM_2_RGB_GAMMA_TABLE_SIZE     ((1U << IA_CSS_VAMEM_2_RGB_GAMMA_TABLE_SIZE_LOG2) + 1)
30 
31 /** IA_CSS_VAMEM_TYPE_1(ISP2300) or
32      IA_CSS_VAMEM_TYPE_2(ISP2400) */
33 union ia_css_rgb_gamma_data {
34 	u16 vamem_1[IA_CSS_VAMEM_1_RGB_GAMMA_TABLE_SIZE];
35 	/** RGB Gamma table on vamem type1. This table is not used,
36 		because sRGB Gamma Correction is not implemented for ISP2300. */
37 	u16 vamem_2[IA_CSS_VAMEM_2_RGB_GAMMA_TABLE_SIZE];
38 	/** RGB Gamma table on vamem type2. u0.12, [0,4095] */
39 };
40 
41 struct ia_css_rgb_gamma_table {
42 	enum ia_css_vamem_type vamem_type;
43 	union ia_css_rgb_gamma_data data;
44 };
45 
46 #endif /* __IA_CSS_GC2_TYPES_H */
47