Commit b094a870 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'fbdev-fixes-for-linus' of...

Merge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6

* 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6:
  fbdev: sh_mobile_lcdc: increase maximum framebuffer size to support 1080p
  video: imxfb: Fix the maximum value for yres
  fb: fix overlapping test off-by-one.
  fbdev: sh-mobile: retrieve and propagate display sizes from EDID
  fbdev: sh-mobile: restore display size configuration
parents 4e838c7e cb59bfc5
...@@ -1458,7 +1458,7 @@ static bool apertures_overlap(struct aperture *gen, struct aperture *hw) ...@@ -1458,7 +1458,7 @@ static bool apertures_overlap(struct aperture *gen, struct aperture *hw)
if (gen->base == hw->base) if (gen->base == hw->base)
return true; return true;
/* is the generic aperture base inside the hw base->hw base+size */ /* is the generic aperture base inside the hw base->hw base+size */
if (gen->base > hw->base && gen->base <= hw->base + hw->size) if (gen->base > hw->base && gen->base < hw->base + hw->size)
return true; return true;
return false; return false;
} }
......
...@@ -53,11 +53,8 @@ ...@@ -53,11 +53,8 @@
#define LCDC_SIZE 0x04 #define LCDC_SIZE 0x04
#define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20)
#ifdef CONFIG_ARCH_MX1 #define YMAX_MASK (cpu_is_mx1() ? 0x1ff : 0x3ff)
#define SIZE_YMAX(y) ((y) & 0x1ff) #define SIZE_YMAX(y) ((y) & YMAX_MASK)
#else
#define SIZE_YMAX(y) ((y) & 0x3ff)
#endif
#define LCDC_VPW 0x08 #define LCDC_VPW 0x08
#define VPW_VPW(x) ((x) & 0x3ff) #define VPW_VPW(x) ((x) & 0x3ff)
...@@ -623,7 +620,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf ...@@ -623,7 +620,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
if (var->right_margin > 255) if (var->right_margin > 255)
printk(KERN_ERR "%s: invalid right_margin %d\n", printk(KERN_ERR "%s: invalid right_margin %d\n",
info->fix.id, var->right_margin); info->fix.id, var->right_margin);
if (var->yres < 1 || var->yres > 511) if (var->yres < 1 || var->yres > YMAX_MASK)
printk(KERN_ERR "%s: invalid yres %d\n", printk(KERN_ERR "%s: invalid yres %d\n",
info->fix.id, var->yres); info->fix.id, var->yres);
if (var->vsync_len > 100) if (var->vsync_len > 100)
......
...@@ -787,6 +787,9 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi) ...@@ -787,6 +787,9 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi)
found_rate_error = rate_error; found_rate_error = rate_error;
} }
hdmi->var.width = hdmi->monspec.max_x * 10;
hdmi->var.height = hdmi->monspec.max_y * 10;
/* /*
* TODO 1: if no ->info is present, postpone running the config until * TODO 1: if no ->info is present, postpone running the config until
* after ->info first gets registered. * after ->info first gets registered.
...@@ -960,8 +963,12 @@ static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi) ...@@ -960,8 +963,12 @@ static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi)
dev_dbg(info->dev, "Old %ux%u, new %ux%u\n", dev_dbg(info->dev, "Old %ux%u, new %ux%u\n",
mode1.xres, mode1.yres, mode2.xres, mode2.yres); mode1.xres, mode1.yres, mode2.xres, mode2.yres);
if (fb_mode_is_equal(&mode1, &mode2)) if (fb_mode_is_equal(&mode1, &mode2)) {
/* It can be a different monitor with an equal video-mode */
old_var->width = new_var->width;
old_var->height = new_var->height;
return false; return false;
}
dev_dbg(info->dev, "Switching %u -> %u lines\n", dev_dbg(info->dev, "Switching %u -> %u lines\n",
mode1.yres, mode2.yres); mode1.yres, mode2.yres);
...@@ -1057,8 +1064,11 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) ...@@ -1057,8 +1064,11 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
* on, if we run a resume here, the logo disappears * on, if we run a resume here, the logo disappears
*/ */
if (lock_fb_info(hdmi->info)) { if (lock_fb_info(hdmi->info)) {
sh_hdmi_display_on(hdmi, hdmi->info); struct fb_info *info = hdmi->info;
unlock_fb_info(hdmi->info); info->var.width = hdmi->var.width;
info->var.height = hdmi->var.height;
sh_hdmi_display_on(hdmi, info);
unlock_fb_info(info);
} }
} else { } else {
/* New monitor or have to wake up */ /* New monitor or have to wake up */
......
...@@ -54,8 +54,8 @@ static int lcdc_shared_regs[] = { ...@@ -54,8 +54,8 @@ static int lcdc_shared_regs[] = {
}; };
#define NR_SHARED_REGS ARRAY_SIZE(lcdc_shared_regs) #define NR_SHARED_REGS ARRAY_SIZE(lcdc_shared_regs)
#define DEFAULT_XRES 1280 #define MAX_XRES 1920
#define DEFAULT_YRES 1024 #define MAX_YRES 1080
static unsigned long lcdc_offs_mainlcd[NR_CH_REGS] = { static unsigned long lcdc_offs_mainlcd[NR_CH_REGS] = {
[LDDCKPAT1R] = 0x400, [LDDCKPAT1R] = 0x400,
...@@ -914,22 +914,12 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in ...@@ -914,22 +914,12 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
{ {
struct sh_mobile_lcdc_chan *ch = info->par; struct sh_mobile_lcdc_chan *ch = info->par;
if (var->xres < 160 || var->xres > 1920 || if (var->xres > MAX_XRES || var->yres > MAX_YRES ||
var->yres < 120 || var->yres > 1080 ||
var->left_margin < 32 || var->left_margin > 320 ||
var->right_margin < 12 || var->right_margin > 240 ||
var->upper_margin < 12 || var->upper_margin > 120 ||
var->lower_margin < 1 || var->lower_margin > 64 ||
var->hsync_len < 32 || var->hsync_len > 240 ||
var->vsync_len < 2 || var->vsync_len > 64 ||
var->pixclock < 6000 || var->pixclock > 40000 ||
var->xres * var->yres * (ch->cfg.bpp / 8) * 2 > info->fix.smem_len) { var->xres * var->yres * (ch->cfg.bpp / 8) * 2 > info->fix.smem_len) {
dev_warn(info->dev, "Invalid info: %u %u %u %u %u %u %u %u %u!\n", dev_warn(info->dev, "Invalid info: %u-%u-%u-%u x %u-%u-%u-%u @ %ukHz!\n",
var->xres, var->yres, var->left_margin, var->xres, var->right_margin, var->hsync_len,
var->left_margin, var->right_margin, var->upper_margin, var->yres, var->lower_margin, var->vsync_len,
var->upper_margin, var->lower_margin, PICOS2KHZ(var->pixclock));
var->hsync_len, var->vsync_len,
var->pixclock);
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
...@@ -1226,7 +1216,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) ...@@ -1226,7 +1216,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
} }
if (!mode) if (!mode)
max_size = DEFAULT_XRES * DEFAULT_YRES; max_size = MAX_XRES * MAX_YRES;
else if (max_cfg) else if (max_cfg)
dev_dbg(&pdev->dev, "Found largest videomode %ux%u\n", dev_dbg(&pdev->dev, "Found largest videomode %ux%u\n",
max_cfg->xres, max_cfg->yres); max_cfg->xres, max_cfg->yres);
...@@ -1238,12 +1228,14 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) ...@@ -1238,12 +1228,14 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
mode = &default_720p; mode = &default_720p;
num_cfg = 1; num_cfg = 1;
} else { } else {
num_cfg = ch->cfg.num_cfg; num_cfg = cfg->num_cfg;
} }
fb_videomode_to_modelist(mode, num_cfg, &info->modelist); fb_videomode_to_modelist(mode, num_cfg, &info->modelist);
fb_videomode_to_var(var, mode); fb_videomode_to_var(var, mode);
var->width = cfg->lcd_size_cfg.width;
var->height = cfg->lcd_size_cfg.height;
/* Default Y virtual resolution is 2x panel size */ /* Default Y virtual resolution is 2x panel size */
var->yres_virtual = var->yres * 2; var->yres_virtual = var->yres * 2;
var->activate = FB_ACTIVATE_NOW; var->activate = FB_ACTIVATE_NOW;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment