summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/rcar-du/rcar_cmm.h
blob: b5f7ec6db04a1e9d5193b64b9b38dbe67777f31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * rcar_cmm.h -- R-Car Display Unit Color Management Module
 *
 * Copyright (C) 2019 Jacopo Mondi <jacopo+renesas@jmondi.org>
 */

#ifndef __RCAR_CMM_H__
#define __RCAR_CMM_H__

#define CM2_LUT_SIZE		256

struct drm_color_lut;
struct platform_device;

/**
 * struct rcar_cmm_config - CMM configuration
 *
 * @lut:	1D-LUT configuration
 * @lut.table:	1D-LUT table entries. Disable LUT operations when NULL
 */
struct rcar_cmm_config {
	struct {
		struct drm_color_lut *table;
	} lut;
};

#if IS_ENABLED(CONFIG_DRM_RCAR_CMM)
int rcar_cmm_init(struct platform_device *pdev);

int rcar_cmm_enable(struct platform_device *pdev);
void rcar_cmm_disable(struct platform_device *pdev);

int rcar_cmm_setup(struct platform_device *pdev,
		   const struct rcar_cmm_config *config);
#else
static inline int rcar_cmm_init(struct platform_device *pdev)
{
	return -ENODEV;
}

static inline int rcar_cmm_enable(struct platform_device *pdev)
{
	return 0;
}

static inline void rcar_cmm_disable(struct platform_device *pdev)
{
}

static inline int rcar_cmm_setup(struct platform_device *pdev,
				 const struct rcar_cmm_config *config)
{
	return 0;
}
#endif /* IS_ENABLED(CONFIG_DRM_RCAR_CMM) */

#endif /* __RCAR_CMM_H__ */