aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-11-04 07:06:06 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-12-27 09:06:29 -0500
commitcb59bfc59024115279de0d7612558caa72ec95f1 (patch)
treef5e8c61dd8ef0bda123485ad91835c47fecf5724
parent60328917e6019c7f8a2e70c08d433a05ba9fcfb7 (diff)
fbdev: sh_mobile_lcdc: increase maximum framebuffer size to support 1080p
LCDC hardware can support 1920x1080 formats, adjust the driver to cover them. Besides, instead of guessing some "reasonable" validity checks, only verify values in .fb_check_var(), that we are sure, we cannot support. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 257ed0c4b203..c05326b61235 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -54,8 +54,8 @@ static int lcdc_shared_regs[] = {
54}; 54};
55#define NR_SHARED_REGS ARRAY_SIZE(lcdc_shared_regs) 55#define NR_SHARED_REGS ARRAY_SIZE(lcdc_shared_regs)
56 56
57#define DEFAULT_XRES 1280 57#define MAX_XRES 1920
58#define DEFAULT_YRES 1024 58#define MAX_YRES 1080
59 59
60static unsigned long lcdc_offs_mainlcd[NR_CH_REGS] = { 60static unsigned long lcdc_offs_mainlcd[NR_CH_REGS] = {
61 [LDDCKPAT1R] = 0x400, 61 [LDDCKPAT1R] = 0x400,
@@ -914,22 +914,12 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
914{ 914{
915 struct sh_mobile_lcdc_chan *ch = info->par; 915 struct sh_mobile_lcdc_chan *ch = info->par;
916 916
917 if (var->xres < 160 || var->xres > 1920 || 917 if (var->xres > MAX_XRES || var->yres > MAX_YRES ||
918 var->yres < 120 || var->yres > 1080 ||
919 var->left_margin < 32 || var->left_margin > 320 ||
920 var->right_margin < 12 || var->right_margin > 240 ||
921 var->upper_margin < 12 || var->upper_margin > 120 ||
922 var->lower_margin < 1 || var->lower_margin > 64 ||
923 var->hsync_len < 32 || var->hsync_len > 240 ||
924 var->vsync_len < 2 || var->vsync_len > 64 ||
925 var->pixclock < 6000 || var->pixclock > 40000 ||
926 var->xres * var->yres * (ch->cfg.bpp / 8) * 2 > info->fix.smem_len) { 918 var->xres * var->yres * (ch->cfg.bpp / 8) * 2 > info->fix.smem_len) {
927 dev_warn(info->dev, "Invalid info: %u %u %u %u %u %u %u %u %u!\n", 919 dev_warn(info->dev, "Invalid info: %u-%u-%u-%u x %u-%u-%u-%u @ %ukHz!\n",
928 var->xres, var->yres, 920 var->left_margin, var->xres, var->right_margin, var->hsync_len,
929 var->left_margin, var->right_margin, 921 var->upper_margin, var->yres, var->lower_margin, var->vsync_len,
930 var->upper_margin, var->lower_margin, 922 PICOS2KHZ(var->pixclock));
931 var->hsync_len, var->vsync_len,
932 var->pixclock);
933 return -EINVAL; 923 return -EINVAL;
934 } 924 }
935 return 0; 925 return 0;
@@ -1226,7 +1216,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
1226 } 1216 }
1227 1217
1228 if (!mode) 1218 if (!mode)
1229 max_size = DEFAULT_XRES * DEFAULT_YRES; 1219 max_size = MAX_XRES * MAX_YRES;
1230 else if (max_cfg) 1220 else if (max_cfg)
1231 dev_dbg(&pdev->dev, "Found largest videomode %ux%u\n", 1221 dev_dbg(&pdev->dev, "Found largest videomode %ux%u\n",
1232 max_cfg->xres, max_cfg->yres); 1222 max_cfg->xres, max_cfg->yres);