From f42f540b9d0c16ffc0dd15a2d5c5f837bb7441c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Yannick=20Fertr=C3=A9?= Date: Wed, 3 Apr 2019 11:24:13 +0200 Subject: [PATCH] drm/stm: ltdc: reset controller to avoid partial refresh MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Display controller reset must be done as soon as possible after enable the clock to avoid partial refresh on screen. Signed-off-by: Yannick Fertré Acked-by: Philippe Cornu Signed-off-by: Benjamin Gaignard Link: https://patchwork.freedesktop.org/patch/msgid/1554283453-2879-1-git-send-email-yannick.fertre@st.com --- drivers/gpu/drm/stm/ltdc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 17438c28d9fc..21a821ee065a 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -1137,6 +1137,12 @@ int ltdc_load(struct drm_device *ddev) return -ENODEV; } + if (!IS_ERR(rstc)) { + reset_control_assert(rstc); + usleep_range(10, 20); + reset_control_deassert(rstc); + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ldev->regs = devm_ioremap_resource(dev, res); if (IS_ERR(ldev->regs)) { @@ -1163,11 +1169,6 @@ int ltdc_load(struct drm_device *ddev) } } - if (!IS_ERR(rstc)) { - reset_control_assert(rstc); - usleep_range(10, 20); - reset_control_deassert(rstc); - } ret = ltdc_get_caps(ddev); if (ret) { -- 2.30.2