diff options
author | Shashank Sharma <shashanks@nvidia.com> | 2012-04-30 19:23:57 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-05-08 06:07:22 -0700 |
commit | 86c9754e625b6b9ac86db944c08158c895ca7919 (patch) | |
tree | 50f240a6b24fcce620b09c684688130d51584f66 /drivers/video/tegra/fb.c | |
parent | 4ab7c111fa8570e58ad70a6b0f7c6539b2c4ae3d (diff) |
video: tegra: fb: Call mode filter from check var
Call dc_hdmi_mode_filter to validate a videomode. X prepares its
own modedb of supported HDMI modes, but all of them may not be
supported from the HDMI driver. This call makes sure a X-mode is
listed only if supported in DC driver.
Bug: 959676
Change-Id: I8aff65f4e08fcc4471af096150e3972b5913a95a
Signed-off-by: Shashank Sharma <shashanks@nvidia.com>
Reviewed-on: http://git-master/r/99650
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/fb.c')
-rw-r--r-- | drivers/video/tegra/fb.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 32ae6527c640..fc9befdf72c8 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -64,11 +64,27 @@ static u32 pseudo_palette[16]; static int tegra_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { + struct tegra_fb_info *tegra_fb = info->par; + struct tegra_dc *dc = tegra_fb->win->dc; + struct tegra_dc_out_ops *ops = dc->out_ops; + struct fb_videomode mode; + if ((var->yres * var->xres * var->bits_per_pixel / 8 * 2) > info->screen_size) return -EINVAL; - /* double yres_virtual to allow double buffering through pan_display */ + /* Apply mode filter for HDMI only -LVDS supports only fix mode */ + if (ops && ops->mode_filter) { + + fb_var_to_videomode(&mode, var); + if (!ops->mode_filter(dc, &mode)) + return -EINVAL; + + /* Mode filter may have modified the mode */ + fb_videomode_to_var(var, &mode); + } + + /* Double yres_virtual to allow double buffering through pan_display */ var->yres_virtual = var->yres * 2; return 0; |