video:tegra:dc L4T unblank display corruption
Jong Kim [Fri, 22 Nov 2013 23:29:53 +0000 (15:29 -0800)]
Fix L4T unblank display corruption problem by save/restore last
window context.

bug 1408678

Change-Id: Ia6f426d02e5c14b19cf883fea6fdfd505984cee5
Signed-off-by: Jong Kim <jongk@nvidia.com>
Reviewed-on: http://git-master/r/334737
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>

drivers/video/tegra/dc/dc_priv_defs.h
drivers/video/tegra/fb.c

index 973f6c2..1cbd68d 100644 (file)
@@ -222,6 +222,9 @@ struct tegra_dc {
        u32                             reserved_bw;
        u32                             available_bw;
        struct tegra_dc_win             tmp_wins[DC_N_WINDOWS];
+
+       int                             win_blank_saved_flag;
+       struct tegra_dc_win             win_blank_saved;
 };
 
 #endif
index 1b1d61e..7244af1 100644 (file)
@@ -301,8 +301,10 @@ static int tegra_fb_blank(int blank, struct fb_info *info)
                        (tegra_fb->win->flags & TEGRA_WIN_FLAG_ENABLED))
                        return 0;
                tegra_fb->win->flags |= TEGRA_WIN_FLAG_ENABLED;
-               tegra_fb->win->phys_addr = tegra_fb->phys_start;
-               tegra_fb->win->virt_addr = tegra_fb->info->screen_base;
+               if (tegra_fb->win->dc->win_blank_saved_flag > 0) {
+                       *(tegra_fb->win) = tegra_fb->win->dc->win_blank_saved;
+                       tegra_fb->win->dc->win_blank_saved_flag = 0;
+               }
                tegra_dc_enable(tegra_fb->win->dc);
                tegra_dc_update_windows(&tegra_fb->win, 1);
                tegra_dc_sync_windows(&tegra_fb->win, 1);
@@ -323,6 +325,8 @@ static int tegra_fb_blank(int blank, struct fb_info *info)
                /* To pan fb while switching from X */
                if (!tegra_fb->win->dc->suspended && tegra_fb->win->dc->enabled)
                        tegra_fb->curr_xoffset = -1;
+               tegra_fb->win->dc->win_blank_saved = *(tegra_fb->win);
+               tegra_fb->win->dc->win_blank_saved_flag = 1;
                tegra_dc_disable(tegra_fb->win->dc);
                return 0;