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 <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32568
Tested-by: Shirish S <shirish@chromium.org>
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__);
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);