summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchanghuang.liang <changhuang.liang@starfivetech.com>2022-06-08 09:45:28 +0300
committerJianlong Huang <jianlong.huang@starfivetech.com>2022-06-13 06:39:18 +0300
commit7d774dca86a0f33af46788b692fded46219c365b (patch)
tree45a6c75faf8f4e0e7bdb050e18105336cfdbf5b9
parenta04f67afa7f92f77e0f623a32d05d62cf5cc9471 (diff)
downloadlinux-7d774dca86a0f33af46788b692fded46219c365b.tar.xz
DRM: fixed mipi screen color error
Signed-off-by: changhuang.liang <changhuang.liang@starfivetech.com>
-rwxr-xr-xdrivers/gpu/drm/starfive/starfive_drm_dsi.c10
-rwxr-xr-xdrivers/gpu/drm/starfive/starfive_drm_lcdc.c9
2 files changed, 17 insertions, 2 deletions
diff --git a/drivers/gpu/drm/starfive/starfive_drm_dsi.c b/drivers/gpu/drm/starfive/starfive_drm_dsi.c
index c528e9d2092f..7231c468110e 100755
--- a/drivers/gpu/drm/starfive/starfive_drm_dsi.c
+++ b/drivers/gpu/drm/starfive/starfive_drm_dsi.c
@@ -971,6 +971,16 @@ static void cdns_dsi_bridge_enable(struct drm_bridge *bridge)
tmp = readl(dsi->regs + MCTL_MAIN_EN) | IF_EN(input->id);
writel(tmp, dsi->regs + MCTL_MAIN_EN);
+/*here is a special setting for mipi dsi,dsi enable should ahead lcdc enable*/
+/////////////////////////////////////////////////////////////////////////////
+ void __iomem *base_lcdc = ioremap(0x12000000, 0x10000);
+ u32 runcfg = (2 << 2) | 1;
+ u32 cfg = ~(1 << 5);
+
+ writel(runcfg, base_lcdc + 0x0000);
+ writel(cfg, base_lcdc + 0x000C);
+
+/////////////////////////////////////////////////////////////////////////////
}
static const struct drm_bridge_funcs cdns_dsi_bridge_funcs = {
diff --git a/drivers/gpu/drm/starfive/starfive_drm_lcdc.c b/drivers/gpu/drm/starfive/starfive_drm_lcdc.c
index faf760638b40..20bef9cb6c2e 100755
--- a/drivers/gpu/drm/starfive/starfive_drm_lcdc.c
+++ b/drivers/gpu/drm/starfive/starfive_drm_lcdc.c
@@ -463,6 +463,9 @@ static int sf_fb_lcdc_init(struct starfive_crtc *sf_crtc, struct drm_crtc_state
int starfive_lcdc_enable(struct starfive_crtc *sf_crtc)
{
struct drm_crtc_state *state = sf_crtc->crtc.state;
+ struct drm_encoder *encoder = NULL;
+
+ encoder = starfive_head_atom_get_encoder(sf_crtc);
lcdc_disable_intr(sf_crtc);
@@ -476,8 +479,10 @@ int starfive_lcdc_enable(struct starfive_crtc *sf_crtc)
return -EINVAL;
}
- lcdc_run(sf_crtc, sf_crtc->winNum, LCDC_RUN);
- lcdc_enable_intr(sf_crtc);
+ if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
+ lcdc_run(sf_crtc, sf_crtc->winNum, LCDC_RUN);
+ lcdc_enable_intr(sf_crtc);
+ }
return 0;
}