1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * (C) COPYRIGHT 2019 ARM Limited. All rights reserved.
4  * Author: James.Qian.Wang <james.qian.wang@arm.com>
5  *
6  */
7 
8 #ifndef _KOMEDA_COLOR_MGMT_H_
9 #define _KOMEDA_COLOR_MGMT_H_
10 
11 #include <drm/drm_color_mgmt.h>
12 
13 #define KOMEDA_N_YUV2RGB_COEFFS		12
14 #define KOMEDA_N_RGB2YUV_COEFFS		12
15 #define KOMEDA_COLOR_PRECISION		12
16 #define KOMEDA_N_GAMMA_COEFFS		65
17 #define KOMEDA_COLOR_LUT_SIZE		BIT(KOMEDA_COLOR_PRECISION)
18 #define KOMEDA_N_CTM_COEFFS		9
19 
20 void drm_lut_to_fgamma_coeffs(struct drm_property_blob *lut_blob, u32 *coeffs);
21 void drm_ctm_to_coeffs(struct drm_property_blob *ctm_blob, u32 *coeffs);
22 
23 const s32 *komeda_select_yuv2rgb_coeffs(u32 color_encoding, u32 color_range);
24 
25 #endif /*_KOMEDA_COLOR_MGMT_H_*/
26