video: tegra: dc: Set WIN_OPTIONS with valid phys addr
Min-wuk Lee [Thu, 30 May 2013 10:12:56 +0000 (19:12 +0900)]
Do not set WIN_OPTIONS until window physical address is valid.
After suspend, window handle becomes not valid, but UNBLANK
in resume tries to set window enabled and update for Window A,
before its new physical address is set. This makes DECERR_EMEM
error and glitches in resume.

Bug 1294791

Change-Id: I22aedd5e33056d4c0ec9fcd84f28597ec6164889
Signed-off-by: Min-wuk Lee <mlee@nvidia.com>
Reviewed-on: http://git-master/r/234087
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>

drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/window.c

index 4590a34..17263a3 100644 (file)
@@ -2037,6 +2037,9 @@ static void _tegra_dc_controller_disable(struct tegra_dc *dc)
                /* disable windows */
                w->flags &= ~TEGRA_WIN_FLAG_ENABLED;
 
+               /* set window physical address to invalid*/
+               w->phys_addr = 0;
+
                /* flush any pending syncpt waits */
                while (dc->syncpt[i].min < dc->syncpt[i].max) {
                        trace_display_syncpt_flush(dc, dc->syncpt[i].id,
index 0f9a5fc..e9b72cb 100644 (file)
@@ -389,7 +389,7 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n)
                if (!no_vsync)
                        update_mask |= WIN_A_ACT_REQ << win->idx;
 
-               if (!WIN_IS_ENABLED(win)) {
+               if (!WIN_IS_ENABLED(win) || !win->phys_addr) {
                        dc_win->dirty = no_vsync ? 0 : 1;
                        tegra_dc_writel(dc, 0, DC_WIN_WIN_OPTIONS);
                        continue;