diff options
author | Xinwei Kong <xinwei.kong@hisilicon.com> | 2015-06-17 20:30:04 +0800 |
---|---|---|
committer | Guodong Xu <guodong.xu@linaro.org> | 2015-08-19 14:09:24 +0800 |
commit | 47713ea039939cdbbb7932aa4889b3edac6343eb (patch) | |
tree | 14cc54f802730f939e1d7a1eb4f30d30254c6b9f | |
parent | 3286b561c778c88e183c4f6f640f19023694db93 (diff) |
drm hisi ade avoid setting powered-down DPI
-rw-r--r-- | drivers/gpu/drm/hisilicon/hisi_drm_ade.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/drm/hisilicon/hisi_drm_ade.c b/drivers/gpu/drm/hisilicon/hisi_drm_ade.c index 404d20ff0f57..b339f13f10ec 100644 --- a/drivers/gpu/drm/hisilicon/hisi_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/hisi_drm_ade.c @@ -109,6 +109,7 @@ struct hisi_drm_ade_crtc { struct clk *ade_core_clk; struct clk *media_noc_clk; struct clk *ade_pix_clk; + bool power_on; }; @@ -176,6 +177,7 @@ static int ade_power_up(struct hisi_drm_ade_crtc *crtc_ade) DRM_ERROR("fail to clk_prepare_enable ade_core_clk\n"); return ret; } + crtc_ade->power_on = true; return 0; } @@ -186,6 +188,7 @@ static int ade_power_down(struct hisi_drm_ade_crtc *crtc_ade) clk_disable_unprepare(crtc_ade->ade_core_clk); writel(0x20, media_base + SC_MEDIA_RSTEN); clk_disable_unprepare(crtc_ade->media_noc_clk); + crtc_ade->power_on = false; return 0; } @@ -193,10 +196,12 @@ static int hisi_drm_crtc_ade_enable(struct hisi_drm_ade_crtc *crtc_ade) { int ret; - ret = ade_power_up(crtc_ade); - if (ret) { + if (!crtc_ade->power_on) { + ret = ade_power_up(crtc_ade); + if (ret) { DRM_ERROR("failed to initialize ade clk\n"); return ret; + } } ade_init(crtc_ade); @@ -313,6 +318,10 @@ static bool hisi_drm_crtc_mode_fixup(struct drm_crtc *crtc, DRM_DEBUG_DRIVER("mode_fixup enter successfully.\n"); + if (!crtc_ade->power_on) + if (ade_power_up(crtc_ade)) + DRM_ERROR("%s: failed to power up ade\n", __func__); + do { ret = clk_set_rate(crtc_ade->ade_pix_clk, clock_kHz * 1000); if (ret) { @@ -492,6 +501,7 @@ static int hisi_drm_crtc_create(struct hisi_drm_ade_crtc *crtc_ade) int ret; crtc_ade->enable = false; + crtc_ade->power_on = false; ret = drm_crtc_init(crtc_ade->drm_dev, crtc, &crtc_funcs); if (ret < 0) return ret; |