diff options
author | Erik Gilling <konkers@android.com> | 2010-10-26 15:21:23 -0700 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2010-10-26 18:20:13 -0700 |
commit | 06d191b17b944de22e1fd36fad24d32107e283b2 (patch) | |
tree | 109811a4a894ef82008592be69f18b6a60d0c426 /drivers | |
parent | 185ddab215a2d9cb06d49e7a42ce8abd5925d2fd (diff) |
video: tegra: allow setting output mode without changing fb geometry
Change-Id: I0a723b4e68c99d2727e12d2c26f1506b1f634f8a
Signed-off-by: Erik Gilling <konkers@android.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/fb.c | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index a1045957bdae..1d518a561242 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -120,36 +120,35 @@ 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; - /* we only support RGB ordering for now */ - switch (var->bits_per_pixel) { - case 32: - case 24: - var->red.offset = 0; - var->red.length = 8; - var->green.offset = 8; - var->green.length = 8; - var->blue.offset = 16; - var->blue.length = 8; - tegra_fb->win->fmt = TEGRA_WIN_FMT_R8G8B8A8; - break; - case 16: - var->red.offset = 11; - var->red.length = 5; - var->green.offset = 5; - var->green.length = 6; - var->blue.offset = 0; - var->blue.length = 5; - tegra_fb->win->fmt = TEGRA_WIN_FMT_B5G6R5; - break; - - case 0: - break; - - default: - return -EINVAL; + if (var->bits_per_pixel) { + /* we only support RGB ordering for now */ + switch (var->bits_per_pixel) { + case 32: + case 24: + var->red.offset = 0; + var->red.length = 8; + var->green.offset = 8; + var->green.length = 8; + var->blue.offset = 16; + var->blue.length = 8; + tegra_fb->win->fmt = TEGRA_WIN_FMT_R8G8B8A8; + break; + case 16: + var->red.offset = 11; + var->red.length = 5; + var->green.offset = 5; + var->green.length = 6; + var->blue.offset = 0; + var->blue.length = 5; + tegra_fb->win->fmt = TEGRA_WIN_FMT_B5G6R5; + break; + + default: + return -EINVAL; + } + info->fix.line_length = var->xres * var->bits_per_pixel / 8; + tegra_fb->win->stride = info->fix.line_length; } - info->fix.line_length = var->xres * var->bits_per_pixel / 8; - tegra_fb->win->stride = info->fix.line_length; if (var->pixclock) { struct tegra_dc_mode mode; |