diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-04 18:53:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-04 18:53:53 -0400 |
commit | aababb9766f0e874da26a17acbbec867bf9501f0 (patch) | |
tree | 4dea1f04d8c6d66ce00bb0ab49b939c165c3f33b | |
parent | b2bc4782191cb574924a1d09f48083ea8b33a93b (diff) | |
parent | 3e86f1d8e397b1ef59a97910089e16a99e8f31f7 (diff) |
Merge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-3.x
* 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-3.x:
vesafb: fix memory leak
fbdev: amba: Link fb device to its parent
fsl-diu-fb: remove check for pixel clock ranges
udlfb: Correct sub-optimal resolution selection.
hecubafb: add module_put on error path in hecubafb_probe()
sm501fb: fix section mismatch warning
gx1fb: Fix section mismatch warnings
fbdev: sh_mobile_meram: Correct pointer check for YCbCr chroma plane
-rw-r--r-- | drivers/video/amba-clcd.c | 2 | ||||
-rw-r--r-- | drivers/video/fsl-diu-fb.c | 16 | ||||
-rw-r--r-- | drivers/video/geode/gx1fb_core.c | 14 | ||||
-rw-r--r-- | drivers/video/hecubafb.c | 3 | ||||
-rw-r--r-- | drivers/video/sh_mobile_meram.c | 2 | ||||
-rw-r--r-- | drivers/video/sm501fb.c | 2 | ||||
-rw-r--r-- | drivers/video/udlfb.c | 8 | ||||
-rw-r--r-- | drivers/video/vesafb.c | 1 | ||||
-rw-r--r-- | include/linux/fsl-diu-fb.h | 6 |
9 files changed, 20 insertions, 34 deletions
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 5fc983c5b92c..cf03ad067147 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c | |||
@@ -447,6 +447,8 @@ static int clcdfb_register(struct clcd_fb *fb) | |||
447 | goto out; | 447 | goto out; |
448 | } | 448 | } |
449 | 449 | ||
450 | fb->fb.device = &fb->dev->dev; | ||
451 | |||
450 | fb->fb.fix.mmio_start = fb->dev->res.start; | 452 | fb->fb.fix.mmio_start = fb->dev->res.start; |
451 | fb->fb.fix.mmio_len = resource_size(&fb->dev->res); | 453 | fb->fb.fix.mmio_len = resource_size(&fb->dev->res); |
452 | 454 | ||
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index bedf5be27f05..0acc7d65aeaa 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -555,8 +555,6 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var, | |||
555 | static int fsl_diu_check_var(struct fb_var_screeninfo *var, | 555 | static int fsl_diu_check_var(struct fb_var_screeninfo *var, |
556 | struct fb_info *info) | 556 | struct fb_info *info) |
557 | { | 557 | { |
558 | unsigned long htotal, vtotal; | ||
559 | |||
560 | pr_debug("check_var xres: %d\n", var->xres); | 558 | pr_debug("check_var xres: %d\n", var->xres); |
561 | pr_debug("check_var yres: %d\n", var->yres); | 559 | pr_debug("check_var yres: %d\n", var->yres); |
562 | 560 | ||
@@ -635,20 +633,6 @@ static int fsl_diu_check_var(struct fb_var_screeninfo *var, | |||
635 | 633 | ||
636 | break; | 634 | break; |
637 | } | 635 | } |
638 | /* If the pixclock is below the minimum spec'd value then set to | ||
639 | * refresh rate for 60Hz since this is supported by most monitors. | ||
640 | * Refer to Documentation/fb/ for calculations. | ||
641 | */ | ||
642 | if ((var->pixclock < MIN_PIX_CLK) || (var->pixclock > MAX_PIX_CLK)) { | ||
643 | htotal = var->xres + var->right_margin + var->hsync_len + | ||
644 | var->left_margin; | ||
645 | vtotal = var->yres + var->lower_margin + var->vsync_len + | ||
646 | var->upper_margin; | ||
647 | var->pixclock = (vtotal * htotal * 6UL) / 100UL; | ||
648 | var->pixclock = KHZ2PICOS(var->pixclock); | ||
649 | pr_debug("pixclock set for 60Hz refresh = %u ps\n", | ||
650 | var->pixclock); | ||
651 | } | ||
652 | 636 | ||
653 | var->height = -1; | 637 | var->height = -1; |
654 | var->width = -1; | 638 | var->width = -1; |
diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c index c6b554f72c6d..5a5d0928df33 100644 --- a/drivers/video/geode/gx1fb_core.c +++ b/drivers/video/geode/gx1fb_core.c | |||
@@ -29,7 +29,7 @@ static int crt_option = 1; | |||
29 | static char panel_option[32] = ""; | 29 | static char panel_option[32] = ""; |
30 | 30 | ||
31 | /* Modes relevant to the GX1 (taken from modedb.c) */ | 31 | /* Modes relevant to the GX1 (taken from modedb.c) */ |
32 | static const struct fb_videomode __initdata gx1_modedb[] = { | 32 | static const struct fb_videomode __devinitdata gx1_modedb[] = { |
33 | /* 640x480-60 VESA */ | 33 | /* 640x480-60 VESA */ |
34 | { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, | 34 | { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, |
35 | 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, | 35 | 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, |
@@ -195,7 +195,7 @@ static int gx1fb_blank(int blank_mode, struct fb_info *info) | |||
195 | return par->vid_ops->blank_display(info, blank_mode); | 195 | return par->vid_ops->blank_display(info, blank_mode); |
196 | } | 196 | } |
197 | 197 | ||
198 | static int __init gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *dev) | 198 | static int __devinit gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *dev) |
199 | { | 199 | { |
200 | struct geodefb_par *par = info->par; | 200 | struct geodefb_par *par = info->par; |
201 | unsigned gx_base; | 201 | unsigned gx_base; |
@@ -268,7 +268,7 @@ static struct fb_ops gx1fb_ops = { | |||
268 | .fb_imageblit = cfb_imageblit, | 268 | .fb_imageblit = cfb_imageblit, |
269 | }; | 269 | }; |
270 | 270 | ||
271 | static struct fb_info * __init gx1fb_init_fbinfo(struct device *dev) | 271 | static struct fb_info * __devinit gx1fb_init_fbinfo(struct device *dev) |
272 | { | 272 | { |
273 | struct geodefb_par *par; | 273 | struct geodefb_par *par; |
274 | struct fb_info *info; | 274 | struct fb_info *info; |
@@ -318,7 +318,7 @@ static struct fb_info * __init gx1fb_init_fbinfo(struct device *dev) | |||
318 | return info; | 318 | return info; |
319 | } | 319 | } |
320 | 320 | ||
321 | static int __init gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 321 | static int __devinit gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
322 | { | 322 | { |
323 | struct geodefb_par *par; | 323 | struct geodefb_par *par; |
324 | struct fb_info *info; | 324 | struct fb_info *info; |
@@ -382,7 +382,7 @@ static int __init gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id * | |||
382 | return ret; | 382 | return ret; |
383 | } | 383 | } |
384 | 384 | ||
385 | static void gx1fb_remove(struct pci_dev *pdev) | 385 | static void __devexit gx1fb_remove(struct pci_dev *pdev) |
386 | { | 386 | { |
387 | struct fb_info *info = pci_get_drvdata(pdev); | 387 | struct fb_info *info = pci_get_drvdata(pdev); |
388 | struct geodefb_par *par = info->par; | 388 | struct geodefb_par *par = info->par; |
@@ -441,7 +441,7 @@ static struct pci_driver gx1fb_driver = { | |||
441 | .name = "gx1fb", | 441 | .name = "gx1fb", |
442 | .id_table = gx1fb_id_table, | 442 | .id_table = gx1fb_id_table, |
443 | .probe = gx1fb_probe, | 443 | .probe = gx1fb_probe, |
444 | .remove = gx1fb_remove, | 444 | .remove = __devexit_p(gx1fb_remove), |
445 | }; | 445 | }; |
446 | 446 | ||
447 | static int __init gx1fb_init(void) | 447 | static int __init gx1fb_init(void) |
@@ -456,7 +456,7 @@ static int __init gx1fb_init(void) | |||
456 | return pci_register_driver(&gx1fb_driver); | 456 | return pci_register_driver(&gx1fb_driver); |
457 | } | 457 | } |
458 | 458 | ||
459 | static void __exit gx1fb_cleanup(void) | 459 | static void __devexit gx1fb_cleanup(void) |
460 | { | 460 | { |
461 | pci_unregister_driver(&gx1fb_driver); | 461 | pci_unregister_driver(&gx1fb_driver); |
462 | } | 462 | } |
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c index fbef15f7a218..614251a9af91 100644 --- a/drivers/video/hecubafb.c +++ b/drivers/video/hecubafb.c | |||
@@ -233,7 +233,7 @@ static int __devinit hecubafb_probe(struct platform_device *dev) | |||
233 | 233 | ||
234 | videomemory = vzalloc(videomemorysize); | 234 | videomemory = vzalloc(videomemorysize); |
235 | if (!videomemory) | 235 | if (!videomemory) |
236 | return retval; | 236 | goto err_videomem_alloc; |
237 | 237 | ||
238 | info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev); | 238 | info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev); |
239 | if (!info) | 239 | if (!info) |
@@ -275,6 +275,7 @@ err_fbreg: | |||
275 | framebuffer_release(info); | 275 | framebuffer_release(info); |
276 | err_fballoc: | 276 | err_fballoc: |
277 | vfree(videomemory); | 277 | vfree(videomemory); |
278 | err_videomem_alloc: | ||
278 | module_put(board->owner); | 279 | module_put(board->owner); |
279 | return retval; | 280 | return retval; |
280 | } | 281 | } |
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c index 9170c82b495c..cc7d7329dc15 100644 --- a/drivers/video/sh_mobile_meram.c +++ b/drivers/video/sh_mobile_meram.c | |||
@@ -218,7 +218,7 @@ static inline void meram_get_next_icb_addr(struct sh_mobile_meram_info *pdata, | |||
218 | icb_offset = 0xc0000000 | (cfg->current_reg << 23); | 218 | icb_offset = 0xc0000000 | (cfg->current_reg << 23); |
219 | 219 | ||
220 | *icb_addr_y = icb_offset | (cfg->icb[0].marker_icb << 24); | 220 | *icb_addr_y = icb_offset | (cfg->icb[0].marker_icb << 24); |
221 | if ((*icb_addr_c) && is_nvcolor(cfg->pixelformat)) | 221 | if (is_nvcolor(cfg->pixelformat)) |
222 | *icb_addr_c = icb_offset | (cfg->icb[1].marker_icb << 24); | 222 | *icb_addr_c = icb_offset | (cfg->icb[1].marker_icb << 24); |
223 | } | 223 | } |
224 | 224 | ||
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index 87f0be1e78b5..6294dca95500 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c | |||
@@ -1664,7 +1664,7 @@ static void sm501fb_stop(struct sm501fb_info *info) | |||
1664 | resource_size(info->regs_res)); | 1664 | resource_size(info->regs_res)); |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | static int sm501fb_init_fb(struct fb_info *fb, | 1667 | static int __devinit sm501fb_init_fb(struct fb_info *fb, |
1668 | enum sm501_controller head, | 1668 | enum sm501_controller head, |
1669 | const char *fbname) | 1669 | const char *fbname) |
1670 | { | 1670 | { |
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 52b0f3e8ccac..816a4fda04f5 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c | |||
@@ -1233,8 +1233,12 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
1233 | if (dlfb_is_valid_mode(&info->monspecs.modedb[i], info)) | 1233 | if (dlfb_is_valid_mode(&info->monspecs.modedb[i], info)) |
1234 | fb_add_videomode(&info->monspecs.modedb[i], | 1234 | fb_add_videomode(&info->monspecs.modedb[i], |
1235 | &info->modelist); | 1235 | &info->modelist); |
1236 | else /* if we've removed top/best mode */ | 1236 | else { |
1237 | info->monspecs.misc &= ~FB_MISC_1ST_DETAIL; | 1237 | if (i == 0) |
1238 | /* if we've removed top/best mode */ | ||
1239 | info->monspecs.misc | ||
1240 | &= ~FB_MISC_1ST_DETAIL; | ||
1241 | } | ||
1238 | } | 1242 | } |
1239 | 1243 | ||
1240 | default_vmode = fb_find_best_display(&info->monspecs, | 1244 | default_vmode = fb_find_best_display(&info->monspecs, |
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index a99bbe86db13..501b3406c6d5 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c | |||
@@ -175,6 +175,7 @@ static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
175 | 175 | ||
176 | static void vesafb_destroy(struct fb_info *info) | 176 | static void vesafb_destroy(struct fb_info *info) |
177 | { | 177 | { |
178 | fb_dealloc_cmap(&info->cmap); | ||
178 | if (info->screen_base) | 179 | if (info->screen_base) |
179 | iounmap(info->screen_base); | 180 | iounmap(info->screen_base); |
180 | release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size); | 181 | release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size); |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index 781d4671415f..daa9952d2174 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
@@ -24,12 +24,6 @@ | |||
24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() | 24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() |
25 | */ | 25 | */ |
26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) | 26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) |
27 | /* Minimum value that the pixel clock can be set to in pico seconds | ||
28 | * This is determined by platform clock/3 where the minimum platform | ||
29 | * clock is 533MHz. This gives 5629 pico seconds. | ||
30 | */ | ||
31 | #define MIN_PIX_CLK 5629 | ||
32 | #define MAX_PIX_CLK 96096 | ||
33 | 27 | ||
34 | #include <linux/types.h> | 28 | #include <linux/types.h> |
35 | 29 | ||