diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-12-27 13:33:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-12-27 13:33:30 -0500 |
commit | b094a870ae33426442b0cbcf8025f1ef919d1def (patch) | |
tree | 2003e7329a5fb416990ff841fe5797695bd1f19a /drivers | |
parent | 4e838c7e6ebaf7b2febaafe2cd598a44fdceb094 (diff) | |
parent | cb59bfc59024115279de0d7612558caa72ec95f1 (diff) |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fbmem.c | 2 | ||||
-rw-r--r-- | drivers/video/imxfb.c | 9 | ||||
-rw-r--r-- | drivers/video/sh_mobile_hdmi.c | 16 | ||||
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 30 |
4 files changed, 28 insertions, 29 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 0e6aa3d96a42..4ac1201ad6c2 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1458,7 +1458,7 @@ static bool apertures_overlap(struct aperture *gen, struct aperture *hw) | |||
1458 | if (gen->base == hw->base) | 1458 | if (gen->base == hw->base) |
1459 | return true; | 1459 | return true; |
1460 | /* is the generic aperture base inside the hw base->hw base+size */ | 1460 | /* is the generic aperture base inside the hw base->hw base+size */ |
1461 | if (gen->base > hw->base && gen->base <= hw->base + hw->size) | 1461 | if (gen->base > hw->base && gen->base < hw->base + hw->size) |
1462 | return true; | 1462 | return true; |
1463 | return false; | 1463 | return false; |
1464 | } | 1464 | } |
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 5c363d026f64..1ab2c2588675 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -53,11 +53,8 @@ | |||
53 | #define LCDC_SIZE 0x04 | 53 | #define LCDC_SIZE 0x04 |
54 | #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) | 54 | #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) |
55 | 55 | ||
56 | #ifdef CONFIG_ARCH_MX1 | 56 | #define YMAX_MASK (cpu_is_mx1() ? 0x1ff : 0x3ff) |
57 | #define SIZE_YMAX(y) ((y) & 0x1ff) | 57 | #define SIZE_YMAX(y) ((y) & YMAX_MASK) |
58 | #else | ||
59 | #define SIZE_YMAX(y) ((y) & 0x3ff) | ||
60 | #endif | ||
61 | 58 | ||
62 | #define LCDC_VPW 0x08 | 59 | #define LCDC_VPW 0x08 |
63 | #define VPW_VPW(x) ((x) & 0x3ff) | 60 | #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 | if (var->right_margin > 255) | 620 | if (var->right_margin > 255) |
624 | printk(KERN_ERR "%s: invalid right_margin %d\n", | 621 | printk(KERN_ERR "%s: invalid right_margin %d\n", |
625 | info->fix.id, var->right_margin); | 622 | info->fix.id, var->right_margin); |
626 | if (var->yres < 1 || var->yres > 511) | 623 | if (var->yres < 1 || var->yres > YMAX_MASK) |
627 | printk(KERN_ERR "%s: invalid yres %d\n", | 624 | printk(KERN_ERR "%s: invalid yres %d\n", |
628 | info->fix.id, var->yres); | 625 | info->fix.id, var->yres); |
629 | if (var->vsync_len > 100) | 626 | if (var->vsync_len > 100) |
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index d7df10315d8d..fcda0e970113 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
@@ -787,6 +787,9 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi) | |||
787 | found_rate_error = rate_error; | 787 | found_rate_error = rate_error; |
788 | } | 788 | } |
789 | 789 | ||
790 | hdmi->var.width = hdmi->monspec.max_x * 10; | ||
791 | hdmi->var.height = hdmi->monspec.max_y * 10; | ||
792 | |||
790 | /* | 793 | /* |
791 | * TODO 1: if no ->info is present, postpone running the config until | 794 | * TODO 1: if no ->info is present, postpone running the config until |
792 | * after ->info first gets registered. | 795 | * after ->info first gets registered. |
@@ -960,8 +963,12 @@ static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi) | |||
960 | dev_dbg(info->dev, "Old %ux%u, new %ux%u\n", | 963 | dev_dbg(info->dev, "Old %ux%u, new %ux%u\n", |
961 | mode1.xres, mode1.yres, mode2.xres, mode2.yres); | 964 | mode1.xres, mode1.yres, mode2.xres, mode2.yres); |
962 | 965 | ||
963 | if (fb_mode_is_equal(&mode1, &mode2)) | 966 | if (fb_mode_is_equal(&mode1, &mode2)) { |
967 | /* It can be a different monitor with an equal video-mode */ | ||
968 | old_var->width = new_var->width; | ||
969 | old_var->height = new_var->height; | ||
964 | return false; | 970 | return false; |
971 | } | ||
965 | 972 | ||
966 | dev_dbg(info->dev, "Switching %u -> %u lines\n", | 973 | dev_dbg(info->dev, "Switching %u -> %u lines\n", |
967 | mode1.yres, mode2.yres); | 974 | mode1.yres, mode2.yres); |
@@ -1057,8 +1064,11 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
1057 | * on, if we run a resume here, the logo disappears | 1064 | * on, if we run a resume here, the logo disappears |
1058 | */ | 1065 | */ |
1059 | if (lock_fb_info(hdmi->info)) { | 1066 | if (lock_fb_info(hdmi->info)) { |
1060 | sh_hdmi_display_on(hdmi, hdmi->info); | 1067 | struct fb_info *info = hdmi->info; |
1061 | unlock_fb_info(hdmi->info); | 1068 | info->var.width = hdmi->var.width; |
1069 | info->var.height = hdmi->var.height; | ||
1070 | sh_hdmi_display_on(hdmi, info); | ||
1071 | unlock_fb_info(info); | ||
1062 | } | 1072 | } |
1063 | } else { | 1073 | } else { |
1064 | /* New monitor or have to wake up */ | 1074 | /* New monitor or have to wake up */ |
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index b02d97a879d6..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 | ||
60 | static unsigned long lcdc_offs_mainlcd[NR_CH_REGS] = { | 60 | static 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); |
@@ -1238,12 +1228,14 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
1238 | mode = &default_720p; | 1228 | mode = &default_720p; |
1239 | num_cfg = 1; | 1229 | num_cfg = 1; |
1240 | } else { | 1230 | } else { |
1241 | num_cfg = ch->cfg.num_cfg; | 1231 | num_cfg = cfg->num_cfg; |
1242 | } | 1232 | } |
1243 | 1233 | ||
1244 | fb_videomode_to_modelist(mode, num_cfg, &info->modelist); | 1234 | fb_videomode_to_modelist(mode, num_cfg, &info->modelist); |
1245 | 1235 | ||
1246 | fb_videomode_to_var(var, mode); | 1236 | fb_videomode_to_var(var, mode); |
1237 | var->width = cfg->lcd_size_cfg.width; | ||
1238 | var->height = cfg->lcd_size_cfg.height; | ||
1247 | /* Default Y virtual resolution is 2x panel size */ | 1239 | /* Default Y virtual resolution is 2x panel size */ |
1248 | var->yres_virtual = var->yres * 2; | 1240 | var->yres_virtual = var->yres * 2; |
1249 | var->activate = FB_ACTIVATE_NOW; | 1241 | var->activate = FB_ACTIVATE_NOW; |