video: tegra: dc: check DC suspend state
Pankaj Dabade [Fri, 14 Feb 2014 06:04:23 +0000 (11:04 +0530)]
Check DC suspended state before updating window.
DC suspend function will disable dc but will only change
suspend status to true, while the enable status will
remain true. DC will be enabled by dc resume function.

bug 1452204

Change-Id: I55d44c8e84fd7025459dca1f9cec5a462aa1c842
Signed-off-by: Pankaj Dabade <pdabade@nvidia.com>
Reviewed-on: http://git-master/r/363764
(cherry picked from commit 9bb217d8c2c7c55cc54c6a2281429ba169f7ddb6)
Reviewed-on: http://git-master/r/372681
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

drivers/video/tegra/fb.c

index 7244af1..36e79dd 100644 (file)
@@ -6,7 +6,7 @@
  *         Colin Cross <ccross@android.com>
  *         Travis Geiselbrecht <travis@palm.com>
  *
- * Copyright (c) 2010-2013, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2010-2014, NVIDIA CORPORATION, All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -306,8 +306,10 @@ static int tegra_fb_blank(int blank, struct fb_info *info)
                        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);
+               if (!tegra_fb->win->dc->suspended) {
+                       tegra_dc_update_windows(&tegra_fb->win, 1);
+                       tegra_dc_sync_windows(&tegra_fb->win, 1);
+               }
                return 0;
 
        case FB_BLANK_NORMAL:
@@ -375,8 +377,10 @@ static int tegra_fb_pan_display(struct fb_var_screeninfo *var,
                tegra_fb->win->flags |= TEGRA_WIN_FLAG_FB;
                tegra_fb->win->virt_addr = info->screen_base;
 
-               tegra_dc_update_windows(&tegra_fb->win, 1);
-               tegra_dc_sync_windows(&tegra_fb->win, 1);
+               if (!tegra_fb->win->dc->suspended) {
+                       tegra_dc_update_windows(&tegra_fb->win, 1);
+                       tegra_dc_sync_windows(&tegra_fb->win, 1);
+               }
        }
 
        return 0;