Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-5.20/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev updates from Helge Deller:
"The two major changes in this patchset corrects VGA modes, color
handling and various other smaller fixes in the Atari framebuffer (by
Geert Uytterhoeven), and devm_* conversion, platform data fixes and
header cleanups in the imxfb driver (by Uwe Kleine-König).

Other small patches clean up code in sa1100fb, cirrusfb and omapfb,
fix a refcount leak in amba-clcd (by Liang He), and adds parameter
checks to arkfb, i740fb, vt8623fb and s3fb (by Zheyu Ma)"

* tag 'for-5.20/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (27 commits)
video: fbdev: s3fb: Check the size of screen before memset_io()
video: fbdev: arkfb: Check the size of screen before memset_io()
video: fbdev: vt8623fb: Check the size of screen before memset_io()
video: fbdev: i740fb: Check the argument of i740_calc_vclk()
video: fbdev: arkfb: Fix a divide-by-zero bug in ark_set_pixclock()
video: fbdev: imxfb: fix return value check in imxfb_probe()
video: fbdev: sis: fix typos in SiS_GetModeID()
video: fbdev: imxfb: Convert request_mem_region + ioremap to devm_ioremap_resource
video: fbdev: imxfb: Fold <linux/platform_data/video-imxfb.h> into only user
video: fbdev: imxfb: Drop unused symbols from header
video: fbdev: imxfb: Drop platform data support
video: fbdev: amba-clcd: Fix refcount leak bugs
video: fbdev: omapfb: Unexport omap*_update_window_async()
video: fbdev: atari: Remove backward bug-compatibility
video: fbdev: atari: Remove unused definitions and variables
video: fbdev: atari: Fix VGA modes
video: fbdev: atari: Fix TT High video mode vertical refresh
video: fbdev: atari: Remove unneeded casts to void *
video: fbdev: atari: Remove unneeded casts from void *
video: fbdev: atari: Fix ext_setcolreg()
...

+138 -336
+2 -2
Documentation/m68k/kernel-options.rst
··· 367 367 4.1.2) inverse 368 368 -------------- 369 369 370 - Invert the display. This affects both, text (consoles) and graphics 371 - (X) display. Usually, the background is chosen to be black. With this 370 + Invert the display. This affects only text consoles. 371 + Usually, the background is chosen to be black. With this 372 372 option, you can make the background white. 373 373 374 374 4.1.3) font
-1
MAINTAINERS
··· 8139 8139 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 8140 8140 S: Maintained 8141 8141 F: drivers/video/fbdev/imxfb.c 8142 - F: include/linux/platform_data/video-imxfb.h 8143 8142 8144 8143 FREESCALE IMX DDR PMU DRIVER 8145 8144 M: Frank Li <Frank.li@nxp.com>
+2 -5
drivers/video/fbdev/68328fb.c
··· 84 84 /* 85 85 * Interface used by the world 86 86 */ 87 - int mc68x328fb_init(void); 88 - int mc68x328fb_setup(char *); 89 - 90 87 static int mc68x328fb_check_var(struct fb_var_screeninfo *var, 91 88 struct fb_info *info); 92 89 static int mc68x328fb_set_par(struct fb_info *info); ··· 400 403 #endif 401 404 } 402 405 403 - int __init mc68x328fb_setup(char *options) 406 + static int __init mc68x328fb_setup(char *options) 404 407 { 405 408 if (!options || !*options) 406 409 return 1; ··· 411 414 * Initialisation 412 415 */ 413 416 414 - int __init mc68x328fb_init(void) 417 + static int __init mc68x328fb_init(void) 415 418 { 416 419 #ifndef MODULE 417 420 char *option = NULL;
+18 -6
drivers/video/fbdev/amba-clcd.c
··· 698 698 return -ENODEV; 699 699 700 700 panel = of_graph_get_remote_port_parent(endpoint); 701 - if (!panel) 702 - return -ENODEV; 701 + if (!panel) { 702 + err = -ENODEV; 703 + goto out_endpoint_put; 704 + } 703 705 704 706 err = clcdfb_of_get_backlight(&fb->dev->dev, fb->panel); 705 707 if (err) 706 - return err; 708 + goto out_panel_put; 707 709 708 710 err = clcdfb_of_get_mode(&fb->dev->dev, panel, fb->panel); 709 711 if (err) 710 - return err; 712 + goto out_panel_put; 711 713 712 714 err = of_property_read_u32(fb->dev->dev.of_node, "max-memory-bandwidth", 713 715 &max_bandwidth); ··· 738 736 739 737 if (of_property_read_u32_array(endpoint, 740 738 "arm,pl11x,tft-r0g0b0-pads", 741 - tft_r0b0g0, ARRAY_SIZE(tft_r0b0g0)) != 0) 742 - return -ENOENT; 739 + tft_r0b0g0, ARRAY_SIZE(tft_r0b0g0)) != 0) { 740 + err = -ENOENT; 741 + goto out_panel_put; 742 + } 743 + 744 + of_node_put(panel); 745 + of_node_put(endpoint); 743 746 744 747 return clcdfb_of_init_tft_panel(fb, tft_r0b0g0[0], 745 748 tft_r0b0g0[1], tft_r0b0g0[2]); 749 + out_panel_put: 750 + of_node_put(panel); 751 + out_endpoint_put: 752 + of_node_put(endpoint); 753 + return err; 746 754 } 747 755 748 756 static int clcdfb_of_vram_setup(struct clcd_fb *fb)
+2 -13
drivers/video/fbdev/amifb.c
··· 2540 2540 static int amifb_pan_display(struct fb_var_screeninfo *var, 2541 2541 struct fb_info *info) 2542 2542 { 2543 - if (var->vmode & FB_VMODE_YWRAP) { 2544 - if (var->yoffset < 0 || 2545 - var->yoffset >= info->var.yres_virtual || var->xoffset) 2546 - return -EINVAL; 2547 - } else { 2543 + if (!(var->vmode & FB_VMODE_YWRAP)) { 2548 2544 /* 2549 2545 * TODO: There will be problems when xpan!=1, so some columns 2550 2546 * on the right side will never be seen 2551 2547 */ 2552 2548 if (var->xoffset + info->var.xres > 2553 - upx(16 << maxfmode, info->var.xres_virtual) || 2554 - var->yoffset + info->var.yres > info->var.yres_virtual) 2549 + upx(16 << maxfmode, info->var.xres_virtual)) 2555 2550 return -EINVAL; 2556 2551 } 2557 2552 ami_pan_var(var, info); 2558 - info->var.xoffset = var->xoffset; 2559 - info->var.yoffset = var->yoffset; 2560 - if (var->vmode & FB_VMODE_YWRAP) 2561 - info->var.vmode |= FB_VMODE_YWRAP; 2562 - else 2563 - info->var.vmode &= ~FB_VMODE_YWRAP; 2564 2553 return 0; 2565 2554 } 2566 2555
+8 -1
drivers/video/fbdev/arkfb.c
··· 781 781 return -EINVAL; 782 782 } 783 783 784 - ark_set_pixclock(info, (hdiv * info->var.pixclock) / hmul); 784 + value = (hdiv * info->var.pixclock) / hmul; 785 + if (!value) { 786 + fb_dbg(info, "invalid pixclock\n"); 787 + value = 1; 788 + } 789 + ark_set_pixclock(info, value); 785 790 svga_set_timings(par->state.vgabase, &ark_timing_regs, &(info->var), hmul, hdiv, 786 791 (info->var.vmode & FB_VMODE_DOUBLE) ? 2 : 1, 787 792 (info->var.vmode & FB_VMODE_INTERLACED) ? 2 : 1, ··· 797 792 value = ((value * hmul / hdiv) / 8) - 5; 798 793 vga_wcrt(par->state.vgabase, 0x42, (value + 1) / 2); 799 794 795 + if (screen_size > info->screen_size) 796 + screen_size = info->screen_size; 800 797 memset_io(info->screen_base, 0x00, screen_size); 801 798 /* Device and screen back on */ 802 799 svga_wcrt_mask(par->state.vgabase, 0x17, 0x80, 0x80);
+28 -75
drivers/video/fbdev/atafb.c
··· 236 236 #endif /* ATAFB_EXT */ 237 237 238 238 239 - static int inverse; 240 - 241 239 /* 242 240 * struct fb_ops { 243 241 * * open/release and usage marking ··· 465 467 { 466 468 /* 320x200, 15 kHz, 60 Hz (ST low) */ 467 469 "st-low", 60, 320, 200, 32000, 32, 16, 31, 14, 96, 4, 468 - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 470 + 0, FB_VMODE_NONINTERLACED 469 471 }, { 470 472 /* 640x200, 15 kHz, 60 Hz (ST medium) */ 471 473 "st-mid", 60, 640, 200, 32000, 32, 16, 31, 14, 96, 4, 472 - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 474 + 0, FB_VMODE_NONINTERLACED 473 475 }, { 474 476 /* 640x400, 30.25 kHz, 63.5 Hz (ST high) */ 475 477 "st-high", 63, 640, 400, 32000, 128, 0, 40, 14, 128, 4, 476 - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 478 + 0, FB_VMODE_NONINTERLACED 477 479 }, { 478 480 /* 320x480, 15 kHz, 60 Hz (TT low) */ 479 481 "tt-low", 60, 320, 480, 31041, 120, 100, 8, 16, 140, 30, 480 - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 482 + 0, FB_VMODE_NONINTERLACED 481 483 }, { 482 484 /* 640x480, 29 kHz, 57 Hz (TT medium) */ 483 485 "tt-mid", 60, 640, 480, 31041, 120, 100, 8, 16, 140, 30, 484 - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 486 + 0, FB_VMODE_NONINTERLACED 485 487 }, { 486 488 /* 1280x960, 72 kHz, 72 Hz (TT high) */ 487 - "tt-high", 57, 1280, 960, 7760, 260, 60, 36, 4, 192, 4, 488 - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 489 + "tt-high", 72, 1280, 960, 7760, 260, 60, 36, 4, 192, 4, 490 + 0, FB_VMODE_NONINTERLACED 489 491 }, 490 492 491 493 /* ··· 494 496 495 497 { 496 498 /* 640x480, 31 kHz, 60 Hz (VGA) */ 497 - "vga", 63.5, 640, 480, 32000, 18, 42, 31, 11, 96, 3, 498 - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 499 + "vga", 60, 640, 480, 39721, 42, 18, 31, 11, 100, 3, 500 + 0, FB_VMODE_NONINTERLACED 499 501 }, { 500 502 /* 640x400, 31 kHz, 70 Hz (VGA) */ 501 - "vga70", 70, 640, 400, 32000, 18, 42, 31, 11, 96, 3, 502 - FB_SYNC_VERT_HIGH_ACT | FB_SYNC_COMP_HIGH_ACT, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 503 + "vga70", 70, 640, 400, 39721, 42, 18, 31, 11, 100, 3, 504 + FB_SYNC_VERT_HIGH_ACT | FB_SYNC_COMP_HIGH_ACT, FB_VMODE_NONINTERLACED 503 505 }, 504 506 505 507 /* ··· 509 511 { 510 512 /* 896x608, 31 kHz, 60 Hz (Falcon High) */ 511 513 "falh", 60, 896, 608, 32000, 18, 42, 31, 1, 96,3, 512 - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP 514 + 0, FB_VMODE_NONINTERLACED 513 515 }, 514 516 }; 515 517 ··· 1008 1010 else if (yres_virtual < yres) 1009 1011 yres_virtual = yres; 1010 1012 1011 - /* backward bug-compatibility */ 1012 - if (var->pixclock > 1) 1013 - var->pixclock -= 1; 1014 - 1015 1013 par->hw.falcon.line_width = bpp * xres / 16; 1016 1014 par->hw.falcon.line_offset = bpp * (xres_virtual - xres) / 16; 1017 1015 ··· 1066 1072 xstretch = 2; /* Double pixel width only for hicolor */ 1067 1073 /* Default values are used for vert./hor. timing if no pixelclock given. */ 1068 1074 if (var->pixclock == 0) { 1069 - int linesize; 1070 - 1071 1075 /* Choose master pixelclock depending on hor. timing */ 1072 1076 plen = 1 * xstretch; 1073 1077 if ((plen * xres + f25.right + f25.hsync + f25.left) * ··· 1084 1092 left_margin = pclock->left / plen; 1085 1093 right_margin = pclock->right / plen; 1086 1094 hsync_len = pclock->hsync / plen; 1087 - linesize = left_margin + xres + right_margin + hsync_len; 1088 1095 upper_margin = 31; 1089 1096 lower_margin = 11; 1090 1097 vsync_len = 3; ··· 1632 1641 static int falcon_pan_display(struct fb_var_screeninfo *var, 1633 1642 struct fb_info *info) 1634 1643 { 1635 - struct atafb_par *par = (struct atafb_par *)info->par; 1644 + struct atafb_par *par = info->par; 1636 1645 1637 1646 int xoffset; 1638 1647 int bpp = info->var.bits_per_pixel; ··· 2199 2208 if (regno > 255) 2200 2209 return 1; 2201 2210 2211 + red >>= 8; 2212 + green >>= 8; 2213 + blue >>= 8; 2214 + 2202 2215 switch (external_card_type) { 2203 2216 case IS_VGA: 2204 2217 OUTB(0x3c8, regno); ··· 2256 2261 2257 2262 static int pan_display(struct fb_var_screeninfo *var, struct fb_info *info) 2258 2263 { 2259 - struct atafb_par *par = (struct atafb_par *)info->par; 2264 + struct atafb_par *par = info->par; 2260 2265 2261 2266 if (!fbhw->set_screen_base || 2262 2267 (!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset)) ··· 2402 2407 static int 2403 2408 atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) 2404 2409 { 2405 - int xoffset = var->xoffset; 2406 - int yoffset = var->yoffset; 2407 - int err; 2408 - 2409 - if (var->vmode & FB_VMODE_YWRAP) { 2410 - if (yoffset < 0 || yoffset >= info->var.yres_virtual || xoffset) 2411 - return -EINVAL; 2412 - } else { 2413 - if (xoffset + info->var.xres > info->var.xres_virtual || 2414 - yoffset + info->var.yres > info->var.yres_virtual) 2415 - return -EINVAL; 2416 - } 2417 - 2418 - if (fbhw->pan_display) { 2419 - err = fbhw->pan_display(var, info); 2420 - if (err) 2421 - return err; 2422 - } else 2410 + if (!fbhw->pan_display) 2423 2411 return -EINVAL; 2424 2412 2425 - info->var.xoffset = xoffset; 2426 - info->var.yoffset = yoffset; 2427 - 2428 - if (var->vmode & FB_VMODE_YWRAP) 2429 - info->var.vmode |= FB_VMODE_YWRAP; 2430 - else 2431 - info->var.vmode &= ~FB_VMODE_YWRAP; 2432 - 2433 - return 0; 2413 + return fbhw->pan_display(var, info); 2434 2414 } 2435 2415 2436 2416 /* 2437 2417 * generic drawing routines; imageblit needs updating for image depth > 1 2438 2418 */ 2439 2419 2440 - #if BITS_PER_LONG == 32 2441 - #define BYTES_PER_LONG 4 2442 - #define SHIFT_PER_LONG 5 2443 - #elif BITS_PER_LONG == 64 2444 - #define BYTES_PER_LONG 8 2445 - #define SHIFT_PER_LONG 6 2446 - #else 2447 - #define Please update me 2448 - #endif 2449 - 2450 - 2451 2420 static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) 2452 2421 { 2453 - struct atafb_par *par = (struct atafb_par *)info->par; 2422 + struct atafb_par *par = info->par; 2454 2423 int x2, y2; 2455 2424 u32 width, height; 2456 2425 ··· 2457 2498 2458 2499 static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) 2459 2500 { 2460 - struct atafb_par *par = (struct atafb_par *)info->par; 2501 + struct atafb_par *par = info->par; 2461 2502 int x2, y2; 2462 2503 u32 dx, dy, sx, sy, width, height; 2463 2504 int rev_copy = 0; ··· 2511 2552 2512 2553 static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) 2513 2554 { 2514 - struct atafb_par *par = (struct atafb_par *)info->par; 2555 + struct atafb_par *par = info->par; 2515 2556 int x2, y2; 2516 - unsigned long *dst; 2517 - int dst_idx; 2518 2557 const char *src; 2519 2558 u32 dx, dy, width, height, pitch; 2520 2559 ··· 2539 2582 2540 2583 if (image->depth == 1) { 2541 2584 // used for font data 2542 - dst = (unsigned long *) 2543 - ((unsigned long)info->screen_base & ~(BYTES_PER_LONG - 1)); 2544 - dst_idx = ((unsigned long)info->screen_base & (BYTES_PER_LONG - 1)) * 8; 2545 - dst_idx += dy * par->next_line * 8 + dx; 2546 2585 src = image->data; 2547 2586 pitch = (image->width + 7) / 8; 2548 2587 while (height--) { ··· 2575 2622 switch (cmd) { 2576 2623 #ifdef FBCMD_GET_CURRENTPAR 2577 2624 case FBCMD_GET_CURRENTPAR: 2578 - if (copy_to_user((void *)arg, (void *)&current_par, 2625 + if (copy_to_user((void *)arg, &current_par, 2579 2626 sizeof(struct atafb_par))) 2580 2627 return -EFAULT; 2581 2628 return 0; 2582 2629 #endif 2583 2630 #ifdef FBCMD_SET_CURRENTPAR 2584 2631 case FBCMD_SET_CURRENTPAR: 2585 - if (copy_from_user((void *)&current_par, (void *)arg, 2632 + if (copy_from_user(&current_par, (void *)arg, 2586 2633 sizeof(struct atafb_par))) 2587 2634 return -EFAULT; 2588 2635 ata_set_par(&current_par); ··· 2648 2695 * hw par just decoded */ 2649 2696 static int atafb_set_par(struct fb_info *info) 2650 2697 { 2651 - struct atafb_par *par = (struct atafb_par *)info->par; 2698 + struct atafb_par *par = info->par; 2652 2699 2653 2700 /* Decode wanted screen parameters */ 2654 2701 fbhw->decode_var(&info->var, par); ··· 2934 2981 } 2935 2982 } 2936 2983 2937 - int __init atafb_setup(char *options) 2984 + static int __init atafb_setup(char *options) 2938 2985 { 2939 2986 char *this_opt; 2940 2987 int temp; ··· 2949 2996 default_par = temp; 2950 2997 mode_option = this_opt; 2951 2998 } else if (!strcmp(this_opt, "inverse")) 2952 - inverse = 1; 2999 + fb_invert_cmaps(); 2953 3000 else if (!strncmp(this_opt, "hwscroll_", 9)) { 2954 3001 hwscroll = simple_strtoul(this_opt + 9, NULL, 10); 2955 3002 if (hwscroll < 0)
+1 -1
drivers/video/fbdev/cirrusfb.c
··· 2301 2301 return error; 2302 2302 } 2303 2303 2304 - void cirrusfb_zorro_unregister(struct zorro_dev *z) 2304 + static void cirrusfb_zorro_unregister(struct zorro_dev *z) 2305 2305 { 2306 2306 struct fb_info *info = zorro_get_drvdata(z); 2307 2307
+1 -1
drivers/video/fbdev/dnfb.c
··· 280 280 .name = "dnfb", 281 281 }; 282 282 283 - int __init dnfb_init(void) 283 + static int __init dnfb_init(void) 284 284 { 285 285 int ret; 286 286
+2 -2
drivers/video/fbdev/fm2fb.c
··· 293 293 return 0; 294 294 } 295 295 296 - int __init fm2fb_setup(char *options) 296 + static int __init fm2fb_setup(char *options) 297 297 { 298 298 char *this_opt; 299 299 ··· 309 309 return 0; 310 310 } 311 311 312 - int __init fm2fb_init(void) 312 + static int __init fm2fb_init(void) 313 313 { 314 314 char *option = NULL; 315 315
+2 -2
drivers/video/fbdev/hpfb.c
··· 375 375 .remove = hpfb_remove_one, 376 376 }; 377 377 378 - int __init hpfb_init(void) 378 + static int __init hpfb_init(void) 379 379 { 380 380 unsigned int sid; 381 381 unsigned char i; ··· 415 415 return 0; 416 416 } 417 417 418 - void __exit hpfb_cleanup_module(void) 418 + static void __exit hpfb_cleanup_module(void) 419 419 { 420 420 dio_unregister_driver(&hpfb_driver); 421 421 }
+7 -2
drivers/video/fbdev/i740fb.c
··· 400 400 u32 xres, right, hslen, left, xtotal; 401 401 u32 yres, lower, vslen, upper, ytotal; 402 402 u32 vxres, xoffset, vyres, yoffset; 403 - u32 bpp, base, dacspeed24, mem; 403 + u32 bpp, base, dacspeed24, mem, freq; 404 404 u8 r7; 405 405 int i; 406 406 ··· 643 643 par->atc[VGA_ATC_OVERSCAN] = 0; 644 644 645 645 /* Calculate VCLK that most closely matches the requested dot clock */ 646 - i740_calc_vclk((((u32)1e9) / var->pixclock) * (u32)(1e3), par); 646 + freq = (((u32)1e9) / var->pixclock) * (u32)(1e3); 647 + if (freq < I740_RFREQ_FIX) { 648 + fb_dbg(info, "invalid pixclock\n"); 649 + freq = I740_RFREQ_FIX; 650 + } 651 + i740_calc_vclk(freq, par); 647 652 648 653 /* Since we program the clocks ourselves, always use VCLK2. */ 649 654 par->misc |= 0x0C;
+51 -87
drivers/video/fbdev/imxfb.c
··· 41 41 #include <video/of_videomode.h> 42 42 #include <video/videomode.h> 43 43 44 - #include <linux/platform_data/video-imxfb.h> 44 + #define PCR_TFT (1 << 31) 45 + #define PCR_BPIX_8 (3 << 25) 46 + #define PCR_BPIX_12 (4 << 25) 47 + #define PCR_BPIX_16 (5 << 25) 48 + #define PCR_BPIX_18 (6 << 25) 49 + 50 + struct imx_fb_videomode { 51 + struct fb_videomode mode; 52 + u32 pcr; 53 + bool aus_mode; 54 + unsigned char bpp; 55 + }; 45 56 46 57 /* 47 58 * Complain if VAR is out of range. ··· 667 656 668 657 static int imxfb_init_fbinfo(struct platform_device *pdev) 669 658 { 670 - struct imx_fb_platform_data *pdata = dev_get_platdata(&pdev->dev); 671 659 struct fb_info *info = platform_get_drvdata(pdev); 672 660 struct imxfb_info *fbi = info->par; 673 661 struct device_node *np; ··· 700 690 info->fbops = &imxfb_ops; 701 691 info->flags = FBINFO_FLAG_DEFAULT | 702 692 FBINFO_READS_FAST; 703 - if (pdata) { 704 - fbi->lscr1 = pdata->lscr1; 705 - fbi->dmacr = pdata->dmacr; 706 - fbi->pwmr = pdata->pwmr; 707 - } else { 708 - np = pdev->dev.of_node; 709 - info->var.grayscale = of_property_read_bool(np, 710 - "cmap-greyscale"); 711 - fbi->cmap_inverse = of_property_read_bool(np, "cmap-inverse"); 712 - fbi->cmap_static = of_property_read_bool(np, "cmap-static"); 713 693 714 - fbi->lscr1 = IMXFB_LSCR1_DEFAULT; 694 + np = pdev->dev.of_node; 695 + info->var.grayscale = of_property_read_bool(np, 696 + "cmap-greyscale"); 697 + fbi->cmap_inverse = of_property_read_bool(np, "cmap-inverse"); 698 + fbi->cmap_static = of_property_read_bool(np, "cmap-static"); 715 699 716 - of_property_read_u32(np, "fsl,lpccr", &fbi->pwmr); 700 + fbi->lscr1 = IMXFB_LSCR1_DEFAULT; 717 701 718 - of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1); 702 + of_property_read_u32(np, "fsl,lpccr", &fbi->pwmr); 719 703 720 - of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr); 721 - } 704 + of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1); 705 + 706 + of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr); 722 707 723 708 return 0; 724 709 } ··· 868 863 struct imxfb_info *fbi; 869 864 struct lcd_device *lcd; 870 865 struct fb_info *info; 871 - struct imx_fb_platform_data *pdata; 872 866 struct resource *res; 873 867 struct imx_fb_videomode *m; 874 868 const struct of_device_id *of_id; 869 + struct device_node *display_np; 875 870 int ret, i; 876 871 int bytes_per_pixel; 877 872 ··· 889 884 if (!res) 890 885 return -ENODEV; 891 886 892 - pdata = dev_get_platdata(&pdev->dev); 893 - 894 887 info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev); 895 888 if (!info) 896 889 return -ENOMEM; ··· 901 898 if (ret < 0) 902 899 goto failed_init; 903 900 904 - if (pdata) { 905 - if (!fb_mode) 906 - fb_mode = pdata->mode[0].mode.name; 901 + fb_mode = NULL; 907 902 908 - fbi->mode = pdata->mode; 909 - fbi->num_modes = pdata->num_modes; 910 - } else { 911 - struct device_node *display_np; 912 - fb_mode = NULL; 913 - 914 - display_np = of_parse_phandle(pdev->dev.of_node, "display", 0); 915 - if (!display_np) { 916 - dev_err(&pdev->dev, "No display defined in devicetree\n"); 917 - ret = -EINVAL; 918 - goto failed_of_parse; 919 - } 920 - 921 - /* 922 - * imxfb does not support more modes, we choose only the native 923 - * mode. 924 - */ 925 - fbi->num_modes = 1; 926 - 927 - fbi->mode = devm_kzalloc(&pdev->dev, 928 - sizeof(struct imx_fb_videomode), GFP_KERNEL); 929 - if (!fbi->mode) { 930 - ret = -ENOMEM; 931 - of_node_put(display_np); 932 - goto failed_of_parse; 933 - } 934 - 935 - ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode); 936 - of_node_put(display_np); 937 - if (ret) 938 - goto failed_of_parse; 903 + display_np = of_parse_phandle(pdev->dev.of_node, "display", 0); 904 + if (!display_np) { 905 + dev_err(&pdev->dev, "No display defined in devicetree\n"); 906 + ret = -EINVAL; 907 + goto failed_of_parse; 939 908 } 909 + 910 + /* 911 + * imxfb does not support more modes, we choose only the native 912 + * mode. 913 + */ 914 + fbi->num_modes = 1; 915 + 916 + fbi->mode = devm_kzalloc(&pdev->dev, 917 + sizeof(struct imx_fb_videomode), GFP_KERNEL); 918 + if (!fbi->mode) { 919 + ret = -ENOMEM; 920 + of_node_put(display_np); 921 + goto failed_of_parse; 922 + } 923 + 924 + ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode); 925 + of_node_put(display_np); 926 + if (ret) 927 + goto failed_of_parse; 940 928 941 929 /* Calculate maximum bytes used per pixel. In most cases this should 942 930 * be the same as m->bpp/8 */ ··· 936 942 for (i = 0; i < fbi->num_modes; i++, m++) 937 943 info->fix.smem_len = max_t(size_t, info->fix.smem_len, 938 944 m->mode.xres * m->mode.yres * bytes_per_pixel); 939 - 940 - res = request_mem_region(res->start, resource_size(res), 941 - DRIVER_NAME); 942 - if (!res) { 943 - ret = -EBUSY; 944 - goto failed_req; 945 - } 946 945 947 946 fbi->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); 948 947 if (IS_ERR(fbi->clk_ipg)) { ··· 970 983 goto failed_getclock; 971 984 } 972 985 973 - fbi->regs = ioremap(res->start, resource_size(res)); 974 - if (fbi->regs == NULL) { 986 + fbi->regs = devm_ioremap_resource(&pdev->dev, res); 987 + if (IS_ERR(fbi->regs)) { 975 988 dev_err(&pdev->dev, "Cannot map frame buffer registers\n"); 976 - ret = -ENOMEM; 989 + ret = PTR_ERR(fbi->regs); 977 990 goto failed_ioremap; 978 991 } 979 992 ··· 987 1000 } 988 1001 989 1002 info->fix.smem_start = fbi->map_dma; 990 - 991 - if (pdata && pdata->init) { 992 - ret = pdata->init(fbi->pdev); 993 - if (ret) 994 - goto failed_platform_init; 995 - } 996 - 997 1003 998 1004 INIT_LIST_HEAD(&info->modelist); 999 1005 for (i = 0; i < fbi->num_modes; i++) ··· 1039 1059 failed_register: 1040 1060 fb_dealloc_cmap(&info->cmap); 1041 1061 failed_cmap: 1042 - if (pdata && pdata->exit) 1043 - pdata->exit(fbi->pdev); 1044 - failed_platform_init: 1045 1062 dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, 1046 1063 fbi->map_dma); 1047 1064 failed_map: 1048 - iounmap(fbi->regs); 1049 1065 failed_ioremap: 1050 1066 failed_getclock: 1051 1067 release_mem_region(res->start, resource_size(res)); 1052 - failed_req: 1053 1068 failed_of_parse: 1054 1069 kfree(info->pseudo_palette); 1055 1070 failed_init: ··· 1054 1079 1055 1080 static int imxfb_remove(struct platform_device *pdev) 1056 1081 { 1057 - struct imx_fb_platform_data *pdata; 1058 1082 struct fb_info *info = platform_get_drvdata(pdev); 1059 1083 struct imxfb_info *fbi = info->par; 1060 - struct resource *res; 1061 - 1062 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1063 - if (!res) 1064 - return -EINVAL; 1065 1084 1066 1085 imxfb_disable_controller(fbi); 1067 1086 1068 1087 unregister_framebuffer(info); 1069 1088 fb_dealloc_cmap(&info->cmap); 1070 - pdata = dev_get_platdata(&pdev->dev); 1071 - if (pdata && pdata->exit) 1072 - pdata->exit(fbi->pdev); 1073 1089 dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, 1074 1090 fbi->map_dma); 1075 - iounmap(fbi->regs); 1076 - release_mem_region(res->start, resource_size(res)); 1077 1091 kfree(info->pseudo_palette); 1078 1092 framebuffer_release(info); 1079 1093
+1 -2
drivers/video/fbdev/omap/hwa742.c
··· 489 489 __hwa742_update_window_auto(false); 490 490 } 491 491 492 - int hwa742_update_window_async(struct fb_info *fbi, 492 + static int hwa742_update_window_async(struct fb_info *fbi, 493 493 struct omapfb_update_window *win, 494 494 void (*complete_callback)(void *arg), 495 495 void *complete_callback_data) ··· 522 522 out: 523 523 return r; 524 524 } 525 - EXPORT_SYMBOL(hwa742_update_window_async); 526 525 527 526 static int hwa742_setup_plane(int plane, int channel_out, 528 527 unsigned long offset, int screen_width,
-9
drivers/video/fbdev/omap/omapfb.h
··· 227 227 omapfb_notifier_callback_t callback, 228 228 void *callback_data); 229 229 extern int omapfb_unregister_client(struct omapfb_notifier_block *nb); 230 - extern int omapfb_update_window_async(struct fb_info *fbi, 231 - struct omapfb_update_window *win, 232 - void (*callback)(void *), 233 - void *callback_data); 234 - extern int hwa742_update_window_async(struct fb_info *fbi, 235 - struct omapfb_update_window *win, 236 - void (*callback)(void *), 237 - void *callback_data); 238 - 239 230 #endif /* __OMAPFB_H */
+1 -2
drivers/video/fbdev/omap/omapfb_main.c
··· 668 668 return r; 669 669 } 670 670 671 - int omapfb_update_window_async(struct fb_info *fbi, 671 + static int omapfb_update_window_async(struct fb_info *fbi, 672 672 struct omapfb_update_window *win, 673 673 void (*callback)(void *), 674 674 void *callback_data) ··· 714 714 715 715 return fbdev->ctrl->update_window(fbi, win, callback, callback_data); 716 716 } 717 - EXPORT_SYMBOL(omapfb_update_window_async); 718 717 719 718 static int omapfb_update_win(struct fb_info *fbi, 720 719 struct omapfb_update_window *win)
+1 -1
drivers/video/fbdev/q40fb.c
··· 133 133 .name = "q40fb", 134 134 }; 135 135 136 - int __init q40fb_init(void) 136 + static int __init q40fb_init(void) 137 137 { 138 138 int ret = 0; 139 139
+2
drivers/video/fbdev/s3fb.c
··· 905 905 value = clamp((htotal + hsstart + 1) / 2 + 2, hsstart + 4, htotal + 1); 906 906 svga_wcrt_multi(par->state.vgabase, s3_dtpc_regs, value); 907 907 908 + if (screen_size > info->screen_size) 909 + screen_size = info->screen_size; 908 910 memset_io(info->screen_base, 0x00, screen_size); 909 911 /* Device and screen back on */ 910 912 svga_wcrt_mask(par->state.vgabase, 0x17, 0x80, 0x80);
-41
drivers/video/fbdev/sa1100fb.c
··· 1224 1224 return platform_driver_register(&sa1100fb_driver); 1225 1225 } 1226 1226 1227 - int __init sa1100fb_setup(char *options) 1228 - { 1229 - #if 0 1230 - char *this_opt; 1231 - 1232 - if (!options || !*options) 1233 - return 0; 1234 - 1235 - while ((this_opt = strsep(&options, ",")) != NULL) { 1236 - 1237 - if (!strncmp(this_opt, "bpp:", 4)) 1238 - current_par.max_bpp = 1239 - simple_strtoul(this_opt + 4, NULL, 0); 1240 - 1241 - if (!strncmp(this_opt, "lccr0:", 6)) 1242 - lcd_shadow.lccr0 = 1243 - simple_strtoul(this_opt + 6, NULL, 0); 1244 - if (!strncmp(this_opt, "lccr1:", 6)) { 1245 - lcd_shadow.lccr1 = 1246 - simple_strtoul(this_opt + 6, NULL, 0); 1247 - current_par.max_xres = 1248 - (lcd_shadow.lccr1 & 0x3ff) + 16; 1249 - } 1250 - if (!strncmp(this_opt, "lccr2:", 6)) { 1251 - lcd_shadow.lccr2 = 1252 - simple_strtoul(this_opt + 6, NULL, 0); 1253 - current_par.max_yres = 1254 - (lcd_shadow. 1255 - lccr0 & LCCR0_SDS) ? ((lcd_shadow. 1256 - lccr2 & 0x3ff) + 1257 - 1) * 1258 - 2 : ((lcd_shadow.lccr2 & 0x3ff) + 1); 1259 - } 1260 - if (!strncmp(this_opt, "lccr3:", 6)) 1261 - lcd_shadow.lccr3 = 1262 - simple_strtoul(this_opt + 6, NULL, 0); 1263 - } 1264 - #endif 1265 - return 0; 1266 - } 1267 - 1268 1227 module_init(sa1100fb_init); 1269 1228 MODULE_DESCRIPTION("StrongARM-1100/1110 framebuffer driver"); 1270 1229 MODULE_LICENSE("GPL");
+2 -2
drivers/video/fbdev/sis/init.c
··· 355 355 } 356 356 break; 357 357 case 400: 358 - if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600))) { 358 + if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDheight >= 600))) { 359 359 if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; 360 360 } 361 361 break; 362 362 case 512: 363 - if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDwidth >= 768))) { 363 + if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDheight >= 768))) { 364 364 if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth]; 365 365 } 366 366 break;
+2 -4
drivers/video/fbdev/skeletonfb.c
··· 131 131 */ 132 132 static struct xxx_par __initdata current_par; 133 133 134 - int xxxfb_init(void); 135 - 136 134 /** 137 135 * xxxfb_open - Optional function. Called when the framebuffer is 138 136 * first accessed. ··· 884 886 885 887 MODULE_DEVICE_TABLE(pci, xxxfb_id_table); 886 888 887 - int __init xxxfb_init(void) 889 + static int __init xxxfb_init(void) 888 890 { 889 891 /* 890 892 * For kernel boot options (in 'video=xxxfb:<options>' format) ··· 965 967 * Only necessary if your driver takes special options, 966 968 * otherwise we fall back on the generic fb_setup(). 967 969 */ 968 - int __init xxxfb_setup(char *options) 970 + static int __init xxxfb_setup(char *options) 969 971 { 970 972 /* Parse user specified options (`video=xxxfb:') */ 971 973 }
+3 -7
drivers/video/fbdev/valkyriefb.c
··· 90 90 u32 pseudo_palette[16]; 91 91 }; 92 92 93 - /* 94 - * Exported functions 95 - */ 96 - int valkyriefb_init(void); 97 - int valkyriefb_setup(char*); 93 + static int valkyriefb_setup(char*); 98 94 99 95 static int valkyriefb_check_var(struct fb_var_screeninfo *var, 100 96 struct fb_info *info); ··· 298 302 default_vmode, default_cmode); 299 303 } 300 304 301 - int __init valkyriefb_init(void) 305 + static int __init valkyriefb_init(void) 302 306 { 303 307 struct fb_info_valkyrie *p; 304 308 unsigned long frame_buffer_phys, cmap_regs_phys; ··· 545 549 /* 546 550 * Parse user specified options (`video=valkyriefb:') 547 551 */ 548 - int __init valkyriefb_setup(char *options) 552 + static int __init valkyriefb_setup(char *options) 549 553 { 550 554 char *this_opt; 551 555
+2
drivers/video/fbdev/vt8623fb.c
··· 507 507 (info->var.vmode & FB_VMODE_DOUBLE) ? 2 : 1, 1, 508 508 1, info->node); 509 509 510 + if (screen_size > info->screen_size) 511 + screen_size = info->screen_size; 510 512 memset_io(info->screen_base, 0x00, screen_size); 511 513 512 514 /* Device and screen back on */
-70
include/linux/platform_data/video-imxfb.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * This structure describes the machine which we are running on. 4 - */ 5 - #ifndef __MACH_IMXFB_H__ 6 - #define __MACH_IMXFB_H__ 7 - 8 - #include <linux/fb.h> 9 - 10 - #define PCR_TFT (1 << 31) 11 - #define PCR_COLOR (1 << 30) 12 - #define PCR_PBSIZ_1 (0 << 28) 13 - #define PCR_PBSIZ_2 (1 << 28) 14 - #define PCR_PBSIZ_4 (2 << 28) 15 - #define PCR_PBSIZ_8 (3 << 28) 16 - #define PCR_BPIX_1 (0 << 25) 17 - #define PCR_BPIX_2 (1 << 25) 18 - #define PCR_BPIX_4 (2 << 25) 19 - #define PCR_BPIX_8 (3 << 25) 20 - #define PCR_BPIX_12 (4 << 25) 21 - #define PCR_BPIX_16 (5 << 25) 22 - #define PCR_BPIX_18 (6 << 25) 23 - #define PCR_PIXPOL (1 << 24) 24 - #define PCR_FLMPOL (1 << 23) 25 - #define PCR_LPPOL (1 << 22) 26 - #define PCR_CLKPOL (1 << 21) 27 - #define PCR_OEPOL (1 << 20) 28 - #define PCR_SCLKIDLE (1 << 19) 29 - #define PCR_END_SEL (1 << 18) 30 - #define PCR_END_BYTE_SWAP (1 << 17) 31 - #define PCR_REV_VS (1 << 16) 32 - #define PCR_ACD_SEL (1 << 15) 33 - #define PCR_ACD(x) (((x) & 0x7f) << 8) 34 - #define PCR_SCLK_SEL (1 << 7) 35 - #define PCR_SHARP (1 << 6) 36 - #define PCR_PCD(x) ((x) & 0x3f) 37 - 38 - #define PWMR_CLS(x) (((x) & 0x1ff) << 16) 39 - #define PWMR_LDMSK (1 << 15) 40 - #define PWMR_SCR1 (1 << 10) 41 - #define PWMR_SCR0 (1 << 9) 42 - #define PWMR_CC_EN (1 << 8) 43 - #define PWMR_PW(x) ((x) & 0xff) 44 - 45 - #define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26) 46 - #define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16) 47 - #define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8) 48 - #define LSCR1_GRAY2(x) (((x) & 0xf) << 4) 49 - #define LSCR1_GRAY1(x) (((x) & 0xf)) 50 - 51 - struct imx_fb_videomode { 52 - struct fb_videomode mode; 53 - u32 pcr; 54 - bool aus_mode; 55 - unsigned char bpp; 56 - }; 57 - 58 - struct imx_fb_platform_data { 59 - struct imx_fb_videomode *mode; 60 - int num_modes; 61 - 62 - u_int pwmr; 63 - u_int lscr1; 64 - u_int dmacr; 65 - 66 - int (*init)(struct platform_device *); 67 - void (*exit)(struct platform_device *); 68 - }; 69 - 70 - #endif /* ifndef __MACH_IMXFB_H__ */