Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / rcar-du / rcar_cmm.h
blobb5f7ec6db04a1e9d5193b64b9b38dbe67777f31e
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * rcar_cmm.h -- R-Car Display Unit Color Management Module
5 * Copyright (C) 2019 Jacopo Mondi <jacopo+renesas@jmondi.org>
6 */
8 #ifndef __RCAR_CMM_H__
9 #define __RCAR_CMM_H__
11 #define CM2_LUT_SIZE 256
13 struct drm_color_lut;
14 struct platform_device;
16 /**
17 * struct rcar_cmm_config - CMM configuration
19 * @lut: 1D-LUT configuration
20 * @lut.table: 1D-LUT table entries. Disable LUT operations when NULL
22 struct rcar_cmm_config {
23 struct {
24 struct drm_color_lut *table;
25 } lut;
28 #if IS_ENABLED(CONFIG_DRM_RCAR_CMM)
29 int rcar_cmm_init(struct platform_device *pdev);
31 int rcar_cmm_enable(struct platform_device *pdev);
32 void rcar_cmm_disable(struct platform_device *pdev);
34 int rcar_cmm_setup(struct platform_device *pdev,
35 const struct rcar_cmm_config *config);
36 #else
37 static inline int rcar_cmm_init(struct platform_device *pdev)
39 return -ENODEV;
42 static inline int rcar_cmm_enable(struct platform_device *pdev)
44 return 0;
47 static inline void rcar_cmm_disable(struct platform_device *pdev)
51 static inline int rcar_cmm_setup(struct platform_device *pdev,
52 const struct rcar_cmm_config *config)
54 return 0;
56 #endif /* IS_ENABLED(CONFIG_DRM_RCAR_CMM) */
58 #endif /* __RCAR_CMM_H__ */