From 341e973c967304976a762211b6465b0074de62ef Mon Sep 17 00:00:00 2001 From: Sean Paul Date: Fri, 7 Sep 2012 11:14:51 -0700 Subject: [PATCH] drm/exynos: fimd: Disable all windows on power off Make sure we disable all windows when we power off. We were seeing crashes on HDMI hotplug, this occurred because we DPMS off on hotplug, then resize the scanout buffer. This resize deletes the old buffer, which calls fimd_win_disable. This function returns early and the window is never disabled. Then when we try to delete the buffer, we get a crash in iommu, presumably because the buffer is still being used by the enabled window. BUG=chrome-os-partner:13349 TEST=Tested boot with hdmi and hotplug Change-Id: I134d510ae4abc5604606f565ce7d631d96918477 Signed-off-by: Sean Paul Reviewed-on: https://gerrit.chromium.org/gerrit/32568 Tested-by: Shirish S --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index dda22018b1fa..167d5f0260c7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -781,6 +781,7 @@ static int fimd_power_on(struct fimd_context *ctx, bool enable) struct exynos_drm_subdrv *subdrv = &ctx->subdrv; struct device *dev = subdrv->dev; struct exynos_drm_fimd_pdata *pdata = dev->platform_data; + int i; DRM_DEBUG_KMS("%s\n", __FILE__); @@ -808,6 +809,14 @@ static int fimd_power_on(struct fimd_context *ctx, bool enable) if (pdata->panel_type == DP_LCD) writel(MIE_CLK_ENABLE, ctx->regs + DPCLKCON); } else { + /* + * We need to make sure that all windows are disabled before we + * suspend that connector. Otherwise we might try to scan from + * a destroyed buffer later. + */ + for (i = 0; i < WINDOWS_NR; i++) + fimd_win_disable(dev, i); + clk_disable(ctx->lcd_clk); clk_disable(ctx->bus_clk); -- 2.20.1