summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/fb.c
diff options
context:
space:
mode:
authorShashank Sharma <shashanks@nvidia.com>2012-02-09 13:33:24 +0530
committerSimone Willett <swillett@nvidia.com>2012-02-10 18:03:36 -0800
commitc0c483a12a5c818a7638b6cce30d5f07a7c7a3de (patch)
tree625707fa0b86aea4fd33610c169d55145749466a /drivers/video/tegra/fb.c
parent53762ebadc988d4d4fef1387ffb073b8dab234c2 (diff)
ARM: tegra: video: Flip window for unblanking
This patch contains: 1. Addition of function tegra_fb_flip_win 2. Call to function tegra_fb_flip_win for an unblank event tegra_dc needs a flip event after blank, to unblank sceen Bug: 932784 Change-Id: Iec7e3f5ee898228e4efc90ca0efc2ca2b02021ae Reviewed-on: http://git-master/r/79740 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/fb.c')
-rw-r--r--drivers/video/tegra/fb.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c
index e9bc1f78ccca..f7b3fd178897 100644
--- a/drivers/video/tegra/fb.c
+++ b/drivers/video/tegra/fb.c
@@ -225,6 +225,49 @@ static int tegra_fb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
return 0;
}
+static void tegra_fb_flip_win(struct tegra_fb_info *tegra_fb)
+{
+ struct tegra_dc_win *win = tegra_fb->win;
+ struct fb_info *info = tegra_fb->info;
+
+ win->x.full = dfixed_const(0);
+ win->y.full = dfixed_const(0);
+ win->w.full = dfixed_const(tegra_fb->xres);
+ win->h.full = dfixed_const(tegra_fb->yres);
+
+ /* TODO: set to output res dc */
+ win->out_x = 0;
+ win->out_y = 0;
+ win->out_w = tegra_fb->xres;
+ win->out_h = tegra_fb->yres;
+ win->z = 0;
+ win->phys_addr = info->fix.smem_start +
+ (info->var.yoffset * info->fix.line_length) +
+ (info->var.xoffset * (info->var.bits_per_pixel / 8));
+ win->virt_addr = info->screen_base;
+
+ win->phys_addr_u = 0;
+ win->phys_addr_v = 0;
+ win->stride = info->fix.line_length;
+ win->stride_uv = 0;
+
+ switch (info->var.bits_per_pixel) {
+ default:
+ WARN_ON(1);
+ /* fall through */
+ case 32:
+ tegra_fb->win->fmt = TEGRA_WIN_FMT_R8G8B8A8;
+ break;
+ case 16:
+ tegra_fb->win->fmt = TEGRA_WIN_FMT_B5G6R5;
+ break;
+ }
+ win->flags = TEGRA_WIN_FLAG_ENABLED;
+
+ tegra_dc_update_windows(&tegra_fb->win, 1);
+ tegra_dc_sync_windows(&tegra_fb->win, 1);
+}
+
static int tegra_fb_blank(int blank, struct fb_info *info)
{
struct tegra_fb_info *tegra_fb = info->par;
@@ -234,6 +277,16 @@ static int tegra_fb_blank(int blank, struct fb_info *info)
dev_dbg(&tegra_fb->ndev->dev, "unblank\n");
tegra_fb->win->flags = TEGRA_WIN_FLAG_ENABLED;
tegra_dc_enable(tegra_fb->win->dc);
+#if defined(CONFIG_FRAMEBUFFER_CONSOLE)
+ /*
+ * TODO:
+ * This is a work around to provide an unblanking flip
+ * to dc driver, required to display fb-console after
+ * a blank event,and needs to be replaced by a proper
+ * unblanking mechanism
+ */
+ tegra_fb_flip_win(tegra_fb);
+#endif
return 0;
case FB_BLANK_NORMAL: