mt8183 gamma module usage is different with before soc, gamma odd(index start from 0) lut value set to hardware register should be the difference of current lut value with last lut value. for example, chrome os user space set lut like this(only r chanel for example): 2 4 6 8 10 12. 1) mt8183 gamma driver should set the gamma lut to hardware register like this: 2 [2] 6 [2] 10 [2] the value with [] is the difference value 2)gamma hardware process display data with original lut Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220428085829.15855-2-yongqiang.niu@mediatek.com/ Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com> Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.corp-partner.google.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
105 lines
4.2 KiB
C
105 lines
4.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2020 MediaTek Inc.
|
|
*/
|
|
|
|
#ifndef _MTK_DISP_DRV_H_
|
|
#define _MTK_DISP_DRV_H_
|
|
|
|
#include <linux/soc/mediatek/mtk-cmdq.h>
|
|
#include "mtk_drm_plane.h"
|
|
|
|
int mtk_aal_clk_enable(struct device *dev);
|
|
void mtk_aal_clk_disable(struct device *dev);
|
|
void mtk_aal_config(struct device *dev, unsigned int w,
|
|
unsigned int h, unsigned int vrefresh,
|
|
unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
|
|
void mtk_aal_gamma_set(struct device *dev, struct drm_crtc_state *state);
|
|
void mtk_aal_start(struct device *dev);
|
|
void mtk_aal_stop(struct device *dev);
|
|
|
|
void mtk_ccorr_ctm_set(struct device *dev, struct drm_crtc_state *state);
|
|
int mtk_ccorr_clk_enable(struct device *dev);
|
|
void mtk_ccorr_clk_disable(struct device *dev);
|
|
void mtk_ccorr_config(struct device *dev, unsigned int w,
|
|
unsigned int h, unsigned int vrefresh,
|
|
unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
|
|
void mtk_ccorr_start(struct device *dev);
|
|
void mtk_ccorr_stop(struct device *dev);
|
|
|
|
void mtk_color_bypass_shadow(struct device *dev);
|
|
int mtk_color_clk_enable(struct device *dev);
|
|
void mtk_color_clk_disable(struct device *dev);
|
|
void mtk_color_config(struct device *dev, unsigned int w,
|
|
unsigned int h, unsigned int vrefresh,
|
|
unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
|
|
void mtk_color_start(struct device *dev);
|
|
|
|
void mtk_dither_set_common(void __iomem *regs, struct cmdq_client_reg *cmdq_reg,
|
|
unsigned int bpc, unsigned int cfg,
|
|
unsigned int dither_en, struct cmdq_pkt *cmdq_pkt);
|
|
|
|
void mtk_dpi_start(struct device *dev);
|
|
void mtk_dpi_stop(struct device *dev);
|
|
|
|
void mtk_dsi_ddp_start(struct device *dev);
|
|
void mtk_dsi_ddp_stop(struct device *dev);
|
|
|
|
int mtk_gamma_clk_enable(struct device *dev);
|
|
void mtk_gamma_clk_disable(struct device *dev);
|
|
void mtk_gamma_config(struct device *dev, unsigned int w,
|
|
unsigned int h, unsigned int vrefresh,
|
|
unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
|
|
void mtk_gamma_set(struct device *dev, struct drm_crtc_state *state);
|
|
void mtk_gamma_set_common(void __iomem *regs, struct drm_crtc_state *state, bool lut_diff);
|
|
void mtk_gamma_start(struct device *dev);
|
|
void mtk_gamma_stop(struct device *dev);
|
|
|
|
void mtk_ovl_bgclr_in_on(struct device *dev);
|
|
void mtk_ovl_bgclr_in_off(struct device *dev);
|
|
void mtk_ovl_bypass_shadow(struct device *dev);
|
|
int mtk_ovl_clk_enable(struct device *dev);
|
|
void mtk_ovl_clk_disable(struct device *dev);
|
|
void mtk_ovl_config(struct device *dev, unsigned int w,
|
|
unsigned int h, unsigned int vrefresh,
|
|
unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
|
|
int mtk_ovl_layer_check(struct device *dev, unsigned int idx,
|
|
struct mtk_plane_state *mtk_state);
|
|
void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
|
|
struct mtk_plane_state *state,
|
|
struct cmdq_pkt *cmdq_pkt);
|
|
unsigned int mtk_ovl_layer_nr(struct device *dev);
|
|
void mtk_ovl_layer_on(struct device *dev, unsigned int idx,
|
|
struct cmdq_pkt *cmdq_pkt);
|
|
void mtk_ovl_layer_off(struct device *dev, unsigned int idx,
|
|
struct cmdq_pkt *cmdq_pkt);
|
|
void mtk_ovl_start(struct device *dev);
|
|
void mtk_ovl_stop(struct device *dev);
|
|
unsigned int mtk_ovl_supported_rotations(struct device *dev);
|
|
void mtk_ovl_register_vblank_cb(struct device *dev,
|
|
void (*vblank_cb)(void *),
|
|
void *vblank_cb_data);
|
|
void mtk_ovl_unregister_vblank_cb(struct device *dev);
|
|
void mtk_ovl_enable_vblank(struct device *dev);
|
|
void mtk_ovl_disable_vblank(struct device *dev);
|
|
|
|
void mtk_rdma_bypass_shadow(struct device *dev);
|
|
int mtk_rdma_clk_enable(struct device *dev);
|
|
void mtk_rdma_clk_disable(struct device *dev);
|
|
void mtk_rdma_config(struct device *dev, unsigned int width,
|
|
unsigned int height, unsigned int vrefresh,
|
|
unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
|
|
unsigned int mtk_rdma_layer_nr(struct device *dev);
|
|
void mtk_rdma_layer_config(struct device *dev, unsigned int idx,
|
|
struct mtk_plane_state *state,
|
|
struct cmdq_pkt *cmdq_pkt);
|
|
void mtk_rdma_start(struct device *dev);
|
|
void mtk_rdma_stop(struct device *dev);
|
|
void mtk_rdma_register_vblank_cb(struct device *dev,
|
|
void (*vblank_cb)(void *),
|
|
void *vblank_cb_data);
|
|
void mtk_rdma_unregister_vblank_cb(struct device *dev);
|
|
void mtk_rdma_enable_vblank(struct device *dev);
|
|
void mtk_rdma_disable_vblank(struct device *dev);
|
|
|
|
#endif
|