xref: /rk3399_rockchip-uboot/drivers/video/drm/rockchip_post_csc.h (revision 8b59e34d0877595928f7ba92d4e1e93c88ae3451)
1*6027c871SZhang Yubing /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
2*6027c871SZhang Yubing /*
3*6027c871SZhang Yubing  * Copyright (C) Rockchip Electronics Co.Ltd
4*6027c871SZhang Yubing  * Author:
5*6027c871SZhang Yubing  *      Zhang Yubing <yubing.zhang@rock-chips.com>
6*6027c871SZhang Yubing  */
7*6027c871SZhang Yubing 
8*6027c871SZhang Yubing #ifndef _ROCKCHIP_POST_CSC_H
9*6027c871SZhang Yubing #define _ROCKCHIP_POST_CSC_H
10*6027c871SZhang Yubing 
11*6027c871SZhang Yubing #include <linux/kernel.h>
12*6027c871SZhang Yubing #include <edid.h>
13*6027c871SZhang Yubing 
14*6027c871SZhang Yubing struct post_csc_coef {
15*6027c871SZhang Yubing 	s32 csc_coef00;
16*6027c871SZhang Yubing 	s32 csc_coef01;
17*6027c871SZhang Yubing 	s32 csc_coef02;
18*6027c871SZhang Yubing 	s32 csc_coef10;
19*6027c871SZhang Yubing 	s32 csc_coef11;
20*6027c871SZhang Yubing 	s32 csc_coef12;
21*6027c871SZhang Yubing 	s32 csc_coef20;
22*6027c871SZhang Yubing 	s32 csc_coef21;
23*6027c871SZhang Yubing 	s32 csc_coef22;
24*6027c871SZhang Yubing 
25*6027c871SZhang Yubing 	s32 csc_dc0;
26*6027c871SZhang Yubing 	s32 csc_dc1;
27*6027c871SZhang Yubing 	s32 csc_dc2;
28*6027c871SZhang Yubing 
29*6027c871SZhang Yubing 	u32 range_type;
30*6027c871SZhang Yubing };
31*6027c871SZhang Yubing 
32*6027c871SZhang Yubing int rockchip_calc_post_csc(struct csc_info *csc, struct post_csc_coef *csc_coef,
33*6027c871SZhang Yubing 			   int csc_mode, bool is_input_yuv, bool is_output_yuv);
34*6027c871SZhang Yubing 
35*6027c871SZhang Yubing #endif
36