video: tegra: flush fb_flip workqueue on blank and suspend
authorErik Gilling <konkers@android.com>
Mon, 8 Nov 2010 23:08:40 +0000 (15:08 -0800)
committerErik Gilling <konkers@android.com>
Tue, 9 Nov 2010 21:54:41 +0000 (13:54 -0800)
Change-Id: I58e9ba73b2fd232e6c1f40946e2e353b90ce5dd7
Signed-off-by: Erik Gilling <konkers@android.com>
arch/arm/mach-tegra/include/mach/fb.h
drivers/video/tegra/dc/dc.c
drivers/video/tegra/fb.c

index 0c9577208a2c431633429e8fc416b84e8f471781..deac25a27ea99fca8191b23b28da34c5b27d2dd8 100644 (file)
@@ -37,6 +37,8 @@ void tegra_fb_unregister(struct tegra_fb_info *fb_info);
 void tegra_fb_update_monspecs(struct tegra_fb_info *fb_info,
                              struct fb_monspecs *specs,
                              bool (*mode_filter)(struct fb_videomode *mode));
+/* called by display controller on suspend */
+void tegra_fb_suspend(struct tegra_fb_info *tegra_fb);
 #else
 static inline struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev,
                                                      struct tegra_dc *dc,
@@ -55,6 +57,9 @@ void tegra_fb_update_monspecs(struct tegra_fb_info *fb_info,
                              bool (*mode_filter)(struct fb_videomode *mode))
 {
 }
+void tegra_fb_suspend(struct tegra_fb_info *tegra_fb)
+{
+}
 #endif
 
 #endif
index db90860b731d90d5a2a693b161e42ba994c27651..d802535b913bb1f8a90f5eae08cee1779d9c09ef 100644 (file)
@@ -1102,8 +1102,10 @@ static int tegra_dc_suspend(struct nvhost_device *ndev, pm_message_t state)
        dev_info(&ndev->dev, "suspend\n");
 
        mutex_lock(&dc->lock);
-       if (dc->enabled)
+       if (dc->enabled) {
+               tegra_fb_suspend(dc->fb);
                _tegra_dc_disable(dc);
+       }
        mutex_unlock(&dc->lock);
 
        return 0;
index 6992e1c06ddfff6b398a923893f5751075ea1078..2a42ae56d71b371b187ad3bce2d4c8a399426654 100644 (file)
@@ -216,6 +216,7 @@ static int tegra_fb_blank(int blank, struct fb_info *info)
 
        case FB_BLANK_POWERDOWN:
                dev_dbg(&tegra_fb->ndev->dev, "blank\n");
+               flush_workqueue(tegra_fb->flip_wq);
                tegra_dc_disable(tegra_fb->win->dc);
                return 0;
 
@@ -224,6 +225,12 @@ static int tegra_fb_blank(int blank, struct fb_info *info)
        }
 }
 
+void tegra_fb_suspend(struct tegra_fb_info *tegra_fb)
+{
+       flush_workqueue(tegra_fb->flip_wq);
+}
+
+
 static int tegra_fb_pan_display(struct fb_var_screeninfo *var,
                                struct fb_info *info)
 {