[PATCH v1 15/21] drm/mediatek: add color bypass shadow register function
From: Yongqiang Niu
Date: Thu Aug 20 2020 - 02:06:44 EST
add color bypass shadow register function
Signed-off-by: Yongqiang Niu <yongqiang.niu@xxxxxxxxxxxx>
---
drivers/gpu/drm/mediatek/mtk_disp_color.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c b/drivers/gpu/drm/mediatek/mtk_disp_color.c
index 31918fa..83b075a 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_color.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_color.c
@@ -17,6 +17,8 @@
#define DISP_COLOR_CFG_MAIN 0x0400
#define DISP_COLOR_START_MT2701 0x0f00
#define DISP_COLOR_START_MT8173 0x0c00
+#define DISP_COLOR_SHADOW_CTRL 0x0cb0
+#define COLOR_BYPASS_SHADOW BIT(0)
#define DISP_COLOR_START(comp) ((comp)->data->color_offset)
#define DISP_COLOR_WIDTH(comp) (DISP_COLOR_START(comp) + 0x50)
#define DISP_COLOR_HEIGHT(comp) (DISP_COLOR_START(comp) + 0x54)
@@ -26,6 +28,7 @@
struct mtk_disp_color_data {
unsigned int color_offset;
+ bool has_shadow;
};
/**
@@ -63,9 +66,21 @@ static void mtk_color_start(struct mtk_ddp_comp *comp)
writel(0x1, comp->regs + DISP_COLOR_START(color));
}
+static void mtk_color_bypass_shadow(struct mtk_ddp_comp *comp)
+{
+ struct mtk_disp_color *color = comp_to_color(comp);
+
+ if (color->data->has_shadow) {
+ mtk_ddp_write_mask(NULL, COLOR_BYPASS_SHADOW, comp,
+ DISP_COLOR_SHADOW_CTRL,
+ COLOR_BYPASS_SHADOW);
+ }
+}
+
static const struct mtk_ddp_comp_funcs mtk_disp_color_funcs = {
.config = mtk_color_config,
.start = mtk_color_start,
+ .bypass_shadow = mtk_color_bypass_shadow,
};
static int mtk_disp_color_bind(struct device *dev, struct device *master,
--
1.8.1.1.dirty