From 961428a649899d0e83f76f27526b26a196d8dc2e Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Mon, 8 Nov 2010 15:08:40 -0800 Subject: video: tegra: flush fb_flip workqueue on blank and suspend Change-Id: I58e9ba73b2fd232e6c1f40946e2e353b90ce5dd7 Signed-off-by: Erik Gilling --- arch/arm/mach-tegra/include/mach/fb.h | 5 +++++ drivers/video/tegra/dc/dc.c | 4 +++- drivers/video/tegra/fb.c | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-tegra/include/mach/fb.h b/arch/arm/mach-tegra/include/mach/fb.h index 0c9577208a2c..deac25a27ea9 100644 --- a/arch/arm/mach-tegra/include/mach/fb.h +++ b/arch/arm/mach-tegra/include/mach/fb.h @@ -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 diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index db90860b731d..d802535b913b 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -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; diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 6992e1c06ddf..2a42ae56d71b 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -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) { -- cgit v1.2.3