summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/fb.c
diff options
context:
space:
mode:
authorJon Mayo <jmayo@nvidia.com>2012-03-16 12:50:59 -0700
committerSimone Willett <swillett@nvidia.com>2012-04-11 15:00:58 -0700
commit44c7bd82653b68c04fef5db9650dc739f7b76eee (patch)
tree6f02e55a9086f6a50c77063c6c97f79c32afaab6 /drivers/video/tegra/fb.c
parentca4fdaf787a68ff8eb1a31999725a80c2b4f084f (diff)
video: tegra: dc: load video mode during vblank
Handle mode set for FBIOPUT_VSCREENINFO at the end of a frame (during vblank). This elimiates the work around that requires disabling then enabling display to change modes. Adds a spinlock to protect irq code from updates to tegra_dc_mode structure. Bug 560152 Change-Id: I5d2175f01a177a32d685b46e5af4f78efeec0786 Signed-off-by: Jon Mayo <jmayo@nvidia.com> Reviewed-on: http://git-master/r/90688 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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c
index 7bc3ab06c47f..ac4c84ba9a1c 100644
--- a/drivers/video/tegra/fb.c
+++ b/drivers/video/tegra/fb.c
@@ -6,7 +6,7 @@
* Colin Cross <ccross@android.com>
* Travis Geiselbrecht <travis@palm.com>
*
- * Copyright (C) 2010-2011 NVIDIA Corporation
+ * Copyright (C) 2010-2012 NVIDIA Corporation
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -79,6 +79,10 @@ static int tegra_fb_set_par(struct fb_info *info)
struct tegra_fb_info *tegra_fb = info->par;
struct fb_var_screeninfo *var = &info->var;
+ BUG_ON(info == NULL);
+ if (!info)
+ return -EINVAL;
+
if (var->bits_per_pixel) {
/* we only support RGB ordering for now */
switch (var->bits_per_pixel) {
@@ -484,6 +488,7 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev,
unsigned long fb_size = 0;
unsigned long fb_phys = 0;
int ret = 0;
+ struct fb_videomode m;
win = tegra_dc_get_window(dc, fb_data->win);
if (!win) {
@@ -535,22 +540,15 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev,
info->fix.line_length = round_up(info->fix.line_length,
TEGRA_LINEAR_PITCH_ALIGNMENT);
- info->var.xres = fb_data->xres;
- info->var.yres = fb_data->yres;
+ INIT_LIST_HEAD(&info->modelist);
+ tegra_dc_to_fb_videomode(&m, &dc->mode);
+ fb_videomode_to_var(&info->var, &m);
info->var.xres_virtual = fb_data->xres;
info->var.yres_virtual = fb_data->yres * 2;
info->var.bits_per_pixel = fb_data->bits_per_pixel;
info->var.activate = FB_ACTIVATE_VBL;
info->var.height = tegra_dc_get_out_height(dc);
info->var.width = tegra_dc_get_out_width(dc);
- info->var.pixclock = 0;
- info->var.left_margin = 0;
- info->var.right_margin = 0;
- info->var.upper_margin = 0;
- info->var.lower_margin = 0;
- info->var.hsync_len = 0;
- info->var.vsync_len = 0;
- info->var.vmode = FB_VMODE_NONINTERLACED;
win->x.full = dfixed_const(0);
win->y.full = dfixed_const(0);