![Jacopo Mondi](/assets/img/avatar_default.png)
Add a driver for the R-Car Display Unit Color Correction Module. In most of Gen3 SoCs, each DU output channel is provided with a CMM unit to perform image enhancement and color correction. Add support for CMM through a driver that supports configuration of the 1-dimensional LUT table. More advanced CMM features will be implemented on top of this initial one. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
59 lines
1.2 KiB
C
59 lines
1.2 KiB
C
/* 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__ */
|