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

Merge tag 'fbdev-v4.20' of https://github.com/bzolnier/linux

Pull fbdev updates from Bartlomiej Zolnierkiewicz:
"No major changes to the subsystem itself, mainly fb drivers fixes &
cleanups (atyfb & udlfb updates stand out from the rest) + removal of
no longer needed old clps711xfb driver.

Details:

- update atyfb driver - improvements for ATI Mach64 chips: detect the
dot clock divider correctly on Sparc, fix display corruptions (due
to endianness issues and improper reading of accelerator
registers), optimize scrolling performance and also fix debugging
printks (Mikulas Patocka)

- rewrite USB unplug handling in udlfb driver using framebuffer
subsystem reference counting (Mikulas Patocka)

- fix support for native-mode display-timings in atmel_lcdfb driver
(Sam Ravnborg)

- fix information leak & add missing access_ok() checks in sbuslib
(Dan Carpenter)

- allow using GPIO expanders that can sleep in ssd1307fb driver
(Michal Vokáč)

- convert omapfb driver to use GPIO descriptors instead of GPIO
numbers for Amstrad Delta board (Janusz Krzysztofik)

- fix broken Kconfig menu dependencies (Randy Dunlap)

- convert fbdev subsystem to use %pOFn instead of device_node.name
(Rob Herring)

- remove the dead old CLPS711x LCD support driver (the new CLPS711x
LCD support driver is still available)

- misc fixes (Jia-Ju Bai, Gustavo A. R. Silva)

- misc cleanups (Mehdi Bounya, Nathan Chancellor, YueHaibing)"

* tag 'fbdev-v4.20' of https://github.com/bzolnier/linux: (22 commits)
video: fbdev: remove redundant 'default n' from Kconfig-s
video: fbdev: remove dead old CLPS711x LCD support driver
Revert "video: ssd1307fb: Do not hard code active-low reset sequence"
video: fbdev: arcfb: mark expected switch fall-through
pxa168fb: remove set but not used variables 'mi'
video: ssd1307fb: Do not hard code active-low reset sequence
video: ssd1307fb: Use gpiod_set_value_cansleep() for reset
fbdev: fix broken menu dependencies
video: fbdev: sis: Remove unnecessary parentheses and commented code
video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table
fbdev: sbuslib: integer overflow in sbusfb_ioctl_helper()
fbdev: sbuslib: use checked version of put_user()
fbdev: Convert to using %pOFn instead of device_node.name
atmel_lcdfb: support native-mode display-timings
Video: vgastate: fixed a spacing coding style
atyfb: fix debugging printks
mach64: optimize wait_for_fifo
mach64: fix image corruption due to reading accelerator registers
mach64: fix display corruption on big endian machines
mach64: detect the dot clock divider correctly on sparc
...

+159 -621
+11 -48
drivers/video/fbdev/Kconfig
··· 2 2 # fbdev configuration 3 3 # 4 4 5 + config FB_CMDLINE 6 + bool 7 + 8 + config FB_NOTIFY 9 + bool 10 + 5 11 menuconfig FB 6 12 tristate "Support for frame buffer devices" 7 13 select FB_CMDLINE ··· 47 41 config FIRMWARE_EDID 48 42 bool "Enable firmware EDID" 49 43 depends on FB 50 - default n 51 44 ---help--- 52 45 This enables access to the EDID transferred from the firmware. 53 46 On the i386, this is from the Video BIOS. Enable this if DDC/I2C ··· 59 54 combination with certain motherboards and monitors are known to 60 55 suffer from this problem. 61 56 62 - config FB_CMDLINE 63 - bool 64 - 65 - config FB_NOTIFY 66 - bool 67 - 68 57 config FB_DDC 69 58 tristate 70 59 depends on FB 71 60 select I2C_ALGOBIT 72 61 select I2C 73 - default n 74 62 75 63 config FB_BOOT_VESA_SUPPORT 76 64 bool 77 65 depends on FB 78 - default n 79 66 ---help--- 80 67 If true, at least one selected framebuffer driver can take advantage 81 68 of VESA video modes set at an early boot stage via the vga= parameter. ··· 75 78 config FB_CFB_FILLRECT 76 79 tristate 77 80 depends on FB 78 - default n 79 81 ---help--- 80 82 Include the cfb_fillrect function for generic software rectangle 81 83 filling. This is used by drivers that don't provide their own ··· 83 87 config FB_CFB_COPYAREA 84 88 tristate 85 89 depends on FB 86 - default n 87 90 ---help--- 88 91 Include the cfb_copyarea function for generic software area copying. 89 92 This is used by drivers that don't provide their own (accelerated) ··· 91 96 config FB_CFB_IMAGEBLIT 92 97 tristate 93 98 depends on FB 94 - default n 95 99 ---help--- 96 100 Include the cfb_imageblit function for generic software image 97 101 blitting. This is used by drivers that don't provide their own ··· 99 105 config FB_CFB_REV_PIXELS_IN_BYTE 100 106 bool 101 107 depends on FB 102 - default n 103 108 ---help--- 104 109 Allow generic frame-buffer functions to work on displays with 1, 2 105 110 and 4 bits per pixel depths which has opposite order of pixels in ··· 107 114 config FB_SYS_FILLRECT 108 115 tristate 109 116 depends on FB 110 - default n 111 117 ---help--- 112 118 Include the sys_fillrect function for generic software rectangle 113 119 filling. This is used by drivers that don't provide their own ··· 115 123 config FB_SYS_COPYAREA 116 124 tristate 117 125 depends on FB 118 - default n 119 126 ---help--- 120 127 Include the sys_copyarea function for generic software area copying. 121 128 This is used by drivers that don't provide their own (accelerated) ··· 123 132 config FB_SYS_IMAGEBLIT 124 133 tristate 125 134 depends on FB 126 - default n 127 135 ---help--- 128 136 Include the sys_imageblit function for generic software image 129 137 blitting. This is used by drivers that don't provide their own ··· 131 141 config FB_PROVIDE_GET_FB_UNMAPPED_AREA 132 142 bool 133 143 depends on FB 134 - default n 135 144 ---help--- 136 145 Allow generic frame-buffer to provide get_fb_unmapped_area 137 146 function. ··· 162 173 config FB_SYS_FOPS 163 174 tristate 164 175 depends on FB 165 - default n 166 176 167 177 config FB_DEFERRED_IO 168 178 bool ··· 175 187 config FB_SVGALIB 176 188 tristate 177 189 depends on FB 178 - default n 179 190 ---help--- 180 191 Common utility functions useful to fbdev drivers of VGA-based 181 192 cards. ··· 182 195 config FB_MACMODES 183 196 tristate 184 197 depends on FB 185 - default n 186 198 187 199 config FB_BACKLIGHT 188 200 bool 189 201 depends on FB 190 202 select BACKLIGHT_LCD_SUPPORT 191 203 select BACKLIGHT_CLASS_DEVICE 192 - default n 193 204 194 205 config FB_MODE_HELPERS 195 206 bool "Enable Video Mode Handling Helpers" 196 207 depends on FB 197 - default n 198 208 ---help--- 199 209 This enables functions for handling video modes using the 200 210 Generalized Timing Formula and the EDID parser. A few drivers rely ··· 202 218 config FB_TILEBLITTING 203 219 bool "Enable Tile Blitting Support" 204 220 depends on FB 205 - default n 206 221 ---help--- 207 222 This enables tile blitting. Tile blitting is a drawing technique 208 223 where the screen is divided into rectangular sections (tiles), whereas ··· 312 329 hardware found in Acorn RISC PCs and other ARM-based machines. If 313 330 unsure, say N. 314 331 315 - config FB_CLPS711X_OLD 316 - tristate 317 - select FB_CFB_FILLRECT 318 - select FB_CFB_COPYAREA 319 - select FB_CFB_IMAGEBLIT 320 - 321 332 config FB_CLPS711X 322 333 tristate "CLPS711X LCD support" 323 334 depends on FB && (ARCH_CLPS711X || COMPILE_TEST) 324 - select FB_CLPS711X_OLD if ARCH_CLPS711X && !ARCH_MULTIPLATFORM 325 335 select BACKLIGHT_LCD_SUPPORT 326 336 select FB_MODE_HELPERS 327 337 select FB_SYS_FILLRECT ··· 912 936 config FB_NVIDIA_DEBUG 913 937 bool "Lots of debug output" 914 938 depends on FB_NVIDIA 915 - default n 916 939 help 917 940 Say Y here if you want the nVidia driver to output all sorts 918 941 of debugging information to provide to the maintainer when ··· 958 983 config FB_RIVA_DEBUG 959 984 bool "Lots of debug output" 960 985 depends on FB_RIVA 961 - default n 962 986 help 963 987 Say Y here if you want the Riva driver to output all sorts 964 988 of debugging information to provide to the maintainer when ··· 1240 1266 config FB_RADEON_DEBUG 1241 1267 bool "Lots of debug output from Radeon driver" 1242 1268 depends on FB_RADEON 1243 - default n 1244 1269 help 1245 1270 Say Y here if you want the Radeon driver to output all sorts 1246 1271 of debugging information to provide to the maintainer when ··· 1372 1399 config FB_SAVAGE_ACCEL 1373 1400 bool "Enable Console Acceleration" 1374 1401 depends on FB_SAVAGE 1375 - default n 1376 1402 help 1377 1403 This option will compile in console acceleration support. If 1378 1404 the resulting framebuffer console has bothersome glitches, then ··· 1428 1456 1429 1457 config FB_VIA_DIRECT_PROCFS 1430 1458 bool "direct hardware access via procfs (DEPRECATED)(DANGEROUS)" 1431 - depends on FB_VIA 1432 - default n 1433 1459 help 1434 1460 Allow direct hardware access to some output registers via procfs. 1435 1461 This is dangerous but may provide the only chance to get the ··· 1436 1466 1437 1467 config FB_VIA_X_COMPATIBILITY 1438 1468 bool "X server compatibility" 1439 - depends on FB_VIA 1440 - default n 1441 1469 help 1442 1470 This option reduces the functionality (power saving, ...) of the 1443 1471 framebuffer to avoid negative impact on the OpenChrome X server. ··· 1660 1692 config FB_WMT_GE_ROPS 1661 1693 bool "VT8500/WM8xxx accelerated raster ops support" 1662 1694 depends on (FB = y) && (FB_VT8500 || FB_WM8505) 1663 - default n 1664 1695 help 1665 1696 This adds support for accelerated raster operations on the 1666 1697 VIA VT8500 and Wondermedia 85xx series SoCs. ··· 1769 1802 1770 1803 config FB_PXA_OVERLAY 1771 1804 bool "Support PXA27x/PXA3xx Overlay(s) as framebuffer" 1772 - default n 1773 1805 depends on FB_PXA && (PXA27x || PXA3xx) 1774 1806 1775 1807 config FB_PXA_SMARTPANEL 1776 1808 bool "PXA Smartpanel LCD support" 1777 - default n 1778 1809 depends on FB_PXA 1779 1810 1780 1811 config FB_PXA_PARAMETERS 1781 1812 bool "PXA LCD command line parameters" 1782 - default n 1783 1813 depends on FB_PXA 1784 1814 ---help--- 1785 1815 Enable the use of kernel command line or module parameters ··· 1814 1850 config FB_MBX_DEBUG 1815 1851 bool "Enable debugging info via debugfs" 1816 1852 depends on FB_MBX && DEBUG_FS 1817 - default n 1818 1853 ---help--- 1819 1854 Enable this if you want debugging information using the debug 1820 1855 filesystem (debugfs) ··· 2203 2240 2204 2241 config FB_BROADSHEET 2205 2242 tristate "E-Ink Broadsheet/Epson S1D13521 controller support" 2206 - depends on FB 2243 + depends on FB && (ARCH_PXA || COMPILE_TEST) 2207 2244 select FB_SYS_FILLRECT 2208 2245 select FB_SYS_COPYAREA 2209 2246 select FB_SYS_IMAGEBLIT ··· 2271 2308 Configuration re: surface address, size, and format must be provided 2272 2309 through device tree, or plain old platform data. 2273 2310 2274 - source "drivers/video/fbdev/omap/Kconfig" 2275 - source "drivers/video/fbdev/omap2/Kconfig" 2276 - source "drivers/video/fbdev/mmp/Kconfig" 2277 - 2278 2311 config FB_SSD1307 2279 2312 tristate "Solomon SSD1307 framebuffer support" 2280 2313 depends on FB && I2C ··· 2300 2341 This driver is also available as a module. The module will be 2301 2342 called sm712fb. If you want to compile it as a module, say M 2302 2343 here and read <file:Documentation/kbuild/modules.txt>. 2344 + 2345 + source "drivers/video/fbdev/omap/Kconfig" 2346 + source "drivers/video/fbdev/omap2/Kconfig" 2347 + source "drivers/video/fbdev/mmp/Kconfig"
-1
drivers/video/fbdev/Makefile
··· 14 14 obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o 15 15 obj-$(CONFIG_FB_ARC) += arcfb.o 16 16 obj-$(CONFIG_FB_CLPS711X) += clps711x-fb.o 17 - obj-$(CONFIG_FB_CLPS711X_OLD) += clps711xfb.o 18 17 obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o 19 18 obj-$(CONFIG_FB_GRVGA) += grvga.o 20 19 obj-$(CONFIG_FB_PM2) += pm2fb.o
+2
drivers/video/fbdev/arcfb.c
··· 419 419 schedule(); 420 420 finish_wait(&arcfb_waitq, &wait); 421 421 } 422 + /* fall through */ 423 + 422 424 case FBIO_GETCONTROL2: 423 425 { 424 426 unsigned char ctl2;
+9 -34
drivers/video/fbdev/atmel_lcdfb.c
··· 22 22 #include <linux/module.h> 23 23 #include <linux/of.h> 24 24 #include <linux/of_device.h> 25 + #include <video/of_videomode.h> 25 26 #include <video/of_display_timing.h> 26 27 #include <linux/regulator/consumer.h> 27 28 #include <video/videomode.h> ··· 1029 1028 struct device *dev = &sinfo->pdev->dev; 1030 1029 struct device_node *np =dev->of_node; 1031 1030 struct device_node *display_np; 1032 - struct device_node *timings_np; 1033 - struct display_timings *timings; 1034 1031 struct atmel_lcdfb_power_ctrl_gpio *og; 1035 1032 bool is_gpio_power = false; 1033 + struct fb_videomode fb_vm; 1036 1034 struct gpio_desc *gpiod; 1035 + struct videomode vm; 1037 1036 int ret = -ENOENT; 1038 1037 int i; 1039 1038 ··· 1106 1105 pdata->lcdcon_is_backlight = of_property_read_bool(display_np, "atmel,lcdcon-backlight"); 1107 1106 pdata->lcdcon_pol_negative = of_property_read_bool(display_np, "atmel,lcdcon-backlight-inverted"); 1108 1107 1109 - timings = of_get_display_timings(display_np); 1110 - if (!timings) { 1111 - dev_err(dev, "failed to get display timings\n"); 1112 - ret = -EINVAL; 1108 + ret = of_get_videomode(display_np, &vm, OF_USE_NATIVE_MODE); 1109 + if (ret) { 1110 + dev_err(dev, "failed to get videomode from DT\n"); 1113 1111 goto put_display_node; 1114 1112 } 1115 1113 1116 - timings_np = of_get_child_by_name(display_np, "display-timings"); 1117 - if (!timings_np) { 1118 - dev_err(dev, "failed to find display-timings node\n"); 1119 - ret = -ENODEV; 1114 + ret = fb_videomode_from_videomode(&vm, &fb_vm); 1115 + if (ret < 0) 1120 1116 goto put_display_node; 1121 - } 1122 1117 1123 - for (i = 0; i < of_get_child_count(timings_np); i++) { 1124 - struct videomode vm; 1125 - struct fb_videomode fb_vm; 1118 + fb_add_videomode(&fb_vm, &info->modelist); 1126 1119 1127 - ret = videomode_from_timings(timings, &vm, i); 1128 - if (ret < 0) 1129 - goto put_timings_node; 1130 - ret = fb_videomode_from_videomode(&vm, &fb_vm); 1131 - if (ret < 0) 1132 - goto put_timings_node; 1133 - 1134 - fb_add_videomode(&fb_vm, &info->modelist); 1135 - } 1136 - 1137 - /* 1138 - * FIXME: Make sure we are not referencing any fields in display_np 1139 - * and timings_np and drop our references to them before returning to 1140 - * avoid leaking the nodes on probe deferral and driver unbind. 1141 - */ 1142 - 1143 - return 0; 1144 - 1145 - put_timings_node: 1146 - of_node_put(timings_np); 1147 1120 put_display_node: 1148 1121 of_node_put(display_np); 1149 1122 return ret;
+8 -4
drivers/video/fbdev/aty/atyfb.h
··· 147 147 u16 pci_id; 148 148 u32 accel_flags; 149 149 int blitter_may_be_busy; 150 + unsigned fifo_space; 150 151 int asleep; 151 152 int lock_blank; 152 153 unsigned long res_start; ··· 347 346 * Hardware acceleration 348 347 */ 349 348 350 - static inline void wait_for_fifo(u16 entries, const struct atyfb_par *par) 349 + static inline void wait_for_fifo(u16 entries, struct atyfb_par *par) 351 350 { 352 - while ((aty_ld_le32(FIFO_STAT, par) & 0xffff) > 353 - ((u32) (0x8000 >> entries))); 351 + unsigned fifo_space = par->fifo_space; 352 + while (entries > fifo_space) { 353 + fifo_space = 16 - fls(aty_ld_le32(FIFO_STAT, par) & 0xffff); 354 + } 355 + par->fifo_space = fifo_space - entries; 354 356 } 355 357 356 358 static inline void wait_for_idle(struct atyfb_par *par) ··· 363 359 par->blitter_may_be_busy = 0; 364 360 } 365 361 366 - extern void aty_reset_engine(const struct atyfb_par *par); 362 + extern void aty_reset_engine(struct atyfb_par *par); 367 363 extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info); 368 364 369 365 void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
+20 -16
drivers/video/fbdev/aty/atyfb_base.c
··· 1480 1480 base = 0x2000; 1481 1481 printk("debug atyfb: Mach64 non-shadow register values:"); 1482 1482 for (i = 0; i < 256; i = i+4) { 1483 - if (i % 16 == 0) 1484 - printk("\ndebug atyfb: 0x%04X: ", base + i); 1485 - printk(" %08X", aty_ld_le32(i, par)); 1483 + if (i % 16 == 0) { 1484 + pr_cont("\n"); 1485 + printk("debug atyfb: 0x%04X: ", base + i); 1486 + } 1487 + pr_cont(" %08X", aty_ld_le32(i, par)); 1486 1488 } 1487 - printk("\n\n"); 1489 + pr_cont("\n\n"); 1488 1490 1489 1491 #ifdef CONFIG_FB_ATY_CT 1490 1492 /* PLL registers */ 1491 1493 base = 0x00; 1492 1494 printk("debug atyfb: Mach64 PLL register values:"); 1493 1495 for (i = 0; i < 64; i++) { 1494 - if (i % 16 == 0) 1495 - printk("\ndebug atyfb: 0x%02X: ", base + i); 1496 + if (i % 16 == 0) { 1497 + pr_cont("\n"); 1498 + printk("debug atyfb: 0x%02X: ", base + i); 1499 + } 1496 1500 if (i % 4 == 0) 1497 - printk(" "); 1498 - printk("%02X", aty_ld_pll_ct(i, par)); 1501 + pr_cont(" "); 1502 + pr_cont("%02X", aty_ld_pll_ct(i, par)); 1499 1503 } 1500 - printk("\n\n"); 1504 + pr_cont("\n\n"); 1501 1505 #endif /* CONFIG_FB_ATY_CT */ 1502 1506 1503 1507 #ifdef CONFIG_FB_ATY_GENERIC_LCD ··· 1513 1509 for (i = 0; i <= POWER_MANAGEMENT; i++) { 1514 1510 if (i == EXT_VERT_STRETCH) 1515 1511 continue; 1516 - printk("\ndebug atyfb: 0x%04X: ", 1512 + pr_cont("\ndebug atyfb: 0x%04X: ", 1517 1513 lt_lcd_regs[i]); 1518 - printk(" %08X", aty_ld_lcd(i, par)); 1514 + pr_cont(" %08X", aty_ld_lcd(i, par)); 1519 1515 } 1520 1516 } else { 1521 1517 for (i = 0; i < 64; i++) { 1522 1518 if (i % 4 == 0) 1523 - printk("\ndebug atyfb: 0x%02X: ", 1519 + pr_cont("\ndebug atyfb: 0x%02X: ", 1524 1520 base + i); 1525 - printk(" %08X", aty_ld_lcd(i, par)); 1521 + pr_cont(" %08X", aty_ld_lcd(i, par)); 1526 1522 } 1527 1523 } 1528 - printk("\n\n"); 1524 + pr_cont("\n\n"); 1529 1525 } 1530 1526 #endif /* CONFIG_FB_ATY_GENERIC_LCD */ 1531 1527 } ··· 2601 2597 aty_ld_le32(DSP_ON_OFF, par), 2602 2598 aty_ld_le32(CLOCK_CNTL, par)); 2603 2599 for (i = 0; i < 40; i++) 2604 - printk(" %02x", aty_ld_pll_ct(i, par)); 2605 - printk("\n"); 2600 + pr_cont(" %02x", aty_ld_pll_ct(i, par)); 2601 + pr_cont("\n"); 2606 2602 } 2607 2603 #endif 2608 2604 if (par->pll_ops->init_pll)
+15 -17
drivers/video/fbdev/aty/mach64_accel.c
··· 37 37 return ((rotation << 8) | DST_24_ROTATION_ENABLE); 38 38 } 39 39 40 - void aty_reset_engine(const struct atyfb_par *par) 40 + void aty_reset_engine(struct atyfb_par *par) 41 41 { 42 42 /* reset engine */ 43 43 aty_st_le32(GEN_TEST_CNTL, ··· 50 50 /* HOST errors */ 51 51 aty_st_le32(BUS_CNTL, 52 52 aty_ld_le32(BUS_CNTL, par) | BUS_HOST_ERR_ACK | BUS_FIFO_ERR_ACK, par); 53 + 54 + par->fifo_space = 0; 53 55 } 54 56 55 57 static void reset_GTC_3D_engine(const struct atyfb_par *par) ··· 129 127 130 128 /* set host attributes */ 131 129 wait_for_fifo(13, par); 132 - aty_st_le32(HOST_CNTL, 0, par); 130 + aty_st_le32(HOST_CNTL, HOST_BYTE_ALIGN, par); 133 131 134 132 /* set pattern attributes */ 135 133 aty_st_le32(PAT_REG0, 0, par); ··· 235 233 rotation = rotation24bpp(dx, direction); 236 234 } 237 235 238 - wait_for_fifo(4, par); 236 + wait_for_fifo(5, par); 237 + aty_st_le32(DP_PIX_WIDTH, par->crtc.dp_pix_width, par); 239 238 aty_st_le32(DP_SRC, FRGD_SRC_BLIT, par); 240 239 aty_st_le32(SRC_Y_X, (sx << 16) | sy, par); 241 240 aty_st_le32(SRC_HEIGHT1_WIDTH1, (width << 16) | area->height, par); ··· 272 269 rotation = rotation24bpp(dx, DST_X_LEFT_TO_RIGHT); 273 270 } 274 271 275 - wait_for_fifo(3, par); 272 + wait_for_fifo(4, par); 273 + aty_st_le32(DP_PIX_WIDTH, par->crtc.dp_pix_width, par); 276 274 aty_st_le32(DP_FRGD_CLR, color, par); 277 275 aty_st_le32(DP_SRC, 278 276 BKGD_SRC_BKGD_CLR | FRGD_SRC_FRGD_CLR | MONO_SRC_ONE, ··· 288 284 { 289 285 struct atyfb_par *par = (struct atyfb_par *) info->par; 290 286 u32 src_bytes, dx = image->dx, dy = image->dy, width = image->width; 291 - u32 pix_width_save, pix_width, host_cntl, rotation = 0, src, mix; 287 + u32 pix_width, rotation = 0, src, mix; 292 288 293 289 if (par->asleep) 294 290 return; ··· 300 296 return; 301 297 } 302 298 303 - pix_width = pix_width_save = aty_ld_le32(DP_PIX_WIDTH, par); 304 - host_cntl = aty_ld_le32(HOST_CNTL, par) | HOST_BYTE_ALIGN; 299 + pix_width = par->crtc.dp_pix_width; 305 300 306 301 switch (image->depth) { 307 302 case 1: ··· 348 345 * since Rage 3D IIc we have DP_HOST_TRIPLE_EN bit 349 346 * this hwaccelerated triple has an issue with not aligned data 350 347 */ 351 - if (M64_HAS(HW_TRIPLE) && image->width % 8 == 0) 348 + if (image->depth == 1 && M64_HAS(HW_TRIPLE) && image->width % 8 == 0) 352 349 pix_width |= DP_HOST_TRIPLE_EN; 353 350 } 354 351 ··· 373 370 mix = FRGD_MIX_D_XOR_S | BKGD_MIX_D; 374 371 } 375 372 376 - wait_for_fifo(6, par); 377 - aty_st_le32(DP_WRITE_MASK, 0xFFFFFFFF, par); 373 + wait_for_fifo(5, par); 378 374 aty_st_le32(DP_PIX_WIDTH, pix_width, par); 379 375 aty_st_le32(DP_MIX, mix, par); 380 376 aty_st_le32(DP_SRC, src, par); 381 - aty_st_le32(HOST_CNTL, host_cntl, par); 377 + aty_st_le32(HOST_CNTL, HOST_BYTE_ALIGN, par); 382 378 aty_st_le32(DST_CNTL, DST_Y_TOP_TO_BOTTOM | DST_X_LEFT_TO_RIGHT | rotation, par); 383 379 384 380 draw_rect(dx, dy, width, image->height, par); 385 381 src_bytes = (((image->width * image->depth) + 7) / 8) * image->height; 386 382 387 383 /* manual triple each pixel */ 388 - if (info->var.bits_per_pixel == 24 && !(pix_width & DP_HOST_TRIPLE_EN)) { 384 + if (image->depth == 1 && info->var.bits_per_pixel == 24 && !(pix_width & DP_HOST_TRIPLE_EN)) { 389 385 int inbit, outbit, mult24, byte_id_in_dword, width; 390 386 u8 *pbitmapin = (u8*)image->data, *pbitmapout; 391 387 u32 hostdword; ··· 417 415 } 418 416 } 419 417 wait_for_fifo(1, par); 420 - aty_st_le32(HOST_DATA0, hostdword, par); 418 + aty_st_le32(HOST_DATA0, le32_to_cpu(hostdword), par); 421 419 } 422 420 } else { 423 421 u32 *pbitmap, dwords = (src_bytes + 3) / 4; ··· 426 424 aty_st_le32(HOST_DATA0, get_unaligned_le32(pbitmap), par); 427 425 } 428 426 } 429 - 430 - /* restore pix_width */ 431 - wait_for_fifo(1, par); 432 - aty_st_le32(DP_PIX_WIDTH, pix_width_save, par); 433 427 }
+1 -3
drivers/video/fbdev/cg14.c
··· 355 355 static void cg14_init_fix(struct fb_info *info, int linebytes, 356 356 struct device_node *dp) 357 357 { 358 - const char *name = dp->name; 359 - 360 - strlcpy(info->fix.id, name, sizeof(info->fix.id)); 358 + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); 361 359 362 360 info->fix.type = FB_TYPE_PACKED_PIXELS; 363 361 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
+1 -1
drivers/video/fbdev/cg3.c
··· 246 246 static void cg3_init_fix(struct fb_info *info, int linebytes, 247 247 struct device_node *dp) 248 248 { 249 - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); 249 + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); 250 250 251 251 info->fix.type = FB_TYPE_PACKED_PIXELS; 252 252 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
-314
drivers/video/fbdev/clps711xfb.c
··· 1 - /* 2 - * linux/drivers/video/clps711xfb.c 3 - * 4 - * Copyright (C) 2000-2001 Deep Blue Solutions Ltd. 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation; either version 2 of the License, or 9 - * (at your option) any later version. 10 - * 11 - * This program is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - * GNU General Public License for more details. 15 - * 16 - * You should have received a copy of the GNU General Public License 17 - * along with this program; if not, write to the Free Software 18 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 - * 20 - * Framebuffer driver for the CLPS7111 and EP7212 processors. 21 - */ 22 - #include <linux/mm.h> 23 - #include <linux/module.h> 24 - #include <linux/kernel.h> 25 - #include <linux/slab.h> 26 - #include <linux/fb.h> 27 - #include <linux/init.h> 28 - #include <linux/delay.h> 29 - #include <linux/platform_device.h> 30 - 31 - #include <mach/hardware.h> 32 - #include <asm/mach-types.h> 33 - #include <linux/uaccess.h> 34 - 35 - struct fb_info *cfb; 36 - 37 - #define CMAP_MAX_SIZE 16 38 - 39 - /* 40 - * LCD AC Prescale. This comes from the LCD panel manufacturers specifications. 41 - * This determines how many clocks + 1 of CL1 before the M signal toggles. 42 - * The number of lines on the display must not be divisible by this number. 43 - */ 44 - static unsigned int lcd_ac_prescale = 13; 45 - 46 - /* 47 - * Set a single color register. Return != 0 for invalid regno. 48 - */ 49 - static int 50 - clps7111fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, 51 - u_int transp, struct fb_info *info) 52 - { 53 - unsigned int level, mask, shift, pal; 54 - 55 - if (regno >= (1 << info->var.bits_per_pixel)) 56 - return 1; 57 - 58 - /* gray = 0.30*R + 0.58*G + 0.11*B */ 59 - level = (red * 77 + green * 151 + blue * 28) >> 20; 60 - 61 - /* 62 - * On an LCD, a high value is dark, while a low value is light. 63 - * So we invert the level. 64 - * 65 - * This isn't true on all machines, so we only do it on EDB7211. 66 - * --rmk 67 - */ 68 - if (machine_is_edb7211()) { 69 - level = 15 - level; 70 - } 71 - 72 - shift = 4 * (regno & 7); 73 - level <<= shift; 74 - mask = 15 << shift; 75 - level &= mask; 76 - 77 - regno = regno < 8 ? PALLSW : PALMSW; 78 - 79 - pal = clps_readl(regno); 80 - pal = (pal & ~mask) | level; 81 - clps_writel(pal, regno); 82 - 83 - return 0; 84 - } 85 - 86 - /* 87 - * Validate the purposed mode. 88 - */ 89 - static int 90 - clps7111fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) 91 - { 92 - var->transp.msb_right = 0; 93 - var->transp.offset = 0; 94 - var->transp.length = 0; 95 - var->red.msb_right = 0; 96 - var->red.offset = 0; 97 - var->red.length = var->bits_per_pixel; 98 - var->green = var->red; 99 - var->blue = var->red; 100 - 101 - if (var->bits_per_pixel > 4) 102 - return -EINVAL; 103 - 104 - return 0; 105 - } 106 - 107 - /* 108 - * Set the hardware state. 109 - */ 110 - static int 111 - clps7111fb_set_par(struct fb_info *info) 112 - { 113 - unsigned int lcdcon, syscon, pixclock; 114 - 115 - switch (info->var.bits_per_pixel) { 116 - case 1: 117 - info->fix.visual = FB_VISUAL_MONO01; 118 - break; 119 - case 2: 120 - info->fix.visual = FB_VISUAL_PSEUDOCOLOR; 121 - break; 122 - case 4: 123 - info->fix.visual = FB_VISUAL_PSEUDOCOLOR; 124 - break; 125 - } 126 - 127 - info->fix.line_length = info->var.xres_virtual * info->var.bits_per_pixel / 8; 128 - 129 - lcdcon = (info->var.xres_virtual * info->var.yres_virtual * info->var.bits_per_pixel) / 128 - 1; 130 - lcdcon |= ((info->var.xres_virtual / 16) - 1) << 13; 131 - lcdcon |= lcd_ac_prescale << 25; 132 - 133 - /* 134 - * Calculate pixel prescale value from the pixclock. This is: 135 - * 36.864MHz / pixclock_mhz - 1. 136 - * However, pixclock is in picoseconds, so this ends up being: 137 - * 36864000 * pixclock_ps / 10^12 - 1 138 - * and this will overflow the 32-bit math. We perform this as 139 - * (9 * 4096000 == 36864000): 140 - * pixclock_ps * 9 * (4096000 / 10^12) - 1 141 - */ 142 - pixclock = 9 * info->var.pixclock / 244140 - 1; 143 - lcdcon |= pixclock << 19; 144 - 145 - if (info->var.bits_per_pixel == 4) 146 - lcdcon |= LCDCON_GSMD; 147 - if (info->var.bits_per_pixel >= 2) 148 - lcdcon |= LCDCON_GSEN; 149 - 150 - /* 151 - * LCDCON must only be changed while the LCD is disabled 152 - */ 153 - syscon = clps_readl(SYSCON1); 154 - clps_writel(syscon & ~SYSCON1_LCDEN, SYSCON1); 155 - clps_writel(lcdcon, LCDCON); 156 - clps_writel(syscon | SYSCON1_LCDEN, SYSCON1); 157 - return 0; 158 - } 159 - 160 - static int clps7111fb_blank(int blank, struct fb_info *info) 161 - { 162 - /* Enable/Disable LCD controller. */ 163 - if (blank) 164 - clps_writel(clps_readl(SYSCON1) & ~SYSCON1_LCDEN, SYSCON1); 165 - else 166 - clps_writel(clps_readl(SYSCON1) | SYSCON1_LCDEN, SYSCON1); 167 - 168 - return 0; 169 - } 170 - 171 - static struct fb_ops clps7111fb_ops = { 172 - .owner = THIS_MODULE, 173 - .fb_check_var = clps7111fb_check_var, 174 - .fb_set_par = clps7111fb_set_par, 175 - .fb_setcolreg = clps7111fb_setcolreg, 176 - .fb_blank = clps7111fb_blank, 177 - .fb_fillrect = cfb_fillrect, 178 - .fb_copyarea = cfb_copyarea, 179 - .fb_imageblit = cfb_imageblit, 180 - }; 181 - 182 - static void clps711x_guess_lcd_params(struct fb_info *info) 183 - { 184 - unsigned int lcdcon, syscon, size; 185 - unsigned long phys_base = PAGE_OFFSET; 186 - void *virt_base = (void *)PAGE_OFFSET; 187 - 188 - info->var.xres_virtual = 640; 189 - info->var.yres_virtual = 240; 190 - info->var.bits_per_pixel = 4; 191 - info->var.activate = FB_ACTIVATE_NOW; 192 - info->var.height = -1; 193 - info->var.width = -1; 194 - info->var.pixclock = 93006; /* 10.752MHz pixel clock */ 195 - 196 - /* 197 - * If the LCD controller is already running, decode the values 198 - * in LCDCON to xres/yres/bpp/pixclock/acprescale 199 - */ 200 - syscon = clps_readl(SYSCON1); 201 - if (syscon & SYSCON1_LCDEN) { 202 - lcdcon = clps_readl(LCDCON); 203 - 204 - /* 205 - * Decode GSMD and GSEN bits to bits per pixel 206 - */ 207 - switch (lcdcon & (LCDCON_GSMD | LCDCON_GSEN)) { 208 - case LCDCON_GSMD | LCDCON_GSEN: 209 - info->var.bits_per_pixel = 4; 210 - break; 211 - 212 - case LCDCON_GSEN: 213 - info->var.bits_per_pixel = 2; 214 - break; 215 - 216 - default: 217 - info->var.bits_per_pixel = 1; 218 - break; 219 - } 220 - 221 - /* 222 - * Decode xres/yres 223 - */ 224 - info->var.xres_virtual = (((lcdcon >> 13) & 0x3f) + 1) * 16; 225 - info->var.yres_virtual = (((lcdcon & 0x1fff) + 1) * 128) / 226 - (info->var.xres_virtual * 227 - info->var.bits_per_pixel); 228 - 229 - /* 230 - * Calculate pixclock 231 - */ 232 - info->var.pixclock = (((lcdcon >> 19) & 0x3f) + 1) * 244140 / 9; 233 - 234 - /* 235 - * Grab AC prescale 236 - */ 237 - lcd_ac_prescale = (lcdcon >> 25) & 0x1f; 238 - } 239 - 240 - info->var.xres = info->var.xres_virtual; 241 - info->var.yres = info->var.yres_virtual; 242 - info->var.grayscale = info->var.bits_per_pixel > 1; 243 - 244 - size = info->var.xres * info->var.yres * info->var.bits_per_pixel / 8; 245 - 246 - /* 247 - * Might be worth checking to see if we can use the on-board 248 - * RAM if size here... 249 - * CLPS7110 - no on-board SRAM 250 - * EP7212 - 38400 bytes 251 - */ 252 - if (size <= 38400) { 253 - printk(KERN_INFO "CLPS711xFB: could use on-board SRAM?\n"); 254 - } 255 - 256 - if ((syscon & SYSCON1_LCDEN) == 0) { 257 - /* 258 - * The display isn't running. Ensure that 259 - * the display memory is empty. 260 - */ 261 - memset(virt_base, 0, size); 262 - } 263 - 264 - info->screen_base = virt_base; 265 - info->fix.smem_start = phys_base; 266 - info->fix.smem_len = PAGE_ALIGN(size); 267 - info->fix.type = FB_TYPE_PACKED_PIXELS; 268 - } 269 - 270 - static int clps711x_fb_probe(struct platform_device *pdev) 271 - { 272 - int err = -ENOMEM; 273 - 274 - if (fb_get_options("clps711xfb", NULL)) 275 - return -ENODEV; 276 - 277 - cfb = kzalloc(sizeof(*cfb), GFP_KERNEL); 278 - if (!cfb) 279 - goto out; 280 - 281 - strcpy(cfb->fix.id, "clps711x"); 282 - 283 - cfb->fbops = &clps7111fb_ops; 284 - cfb->flags = FBINFO_DEFAULT; 285 - 286 - clps711x_guess_lcd_params(cfb); 287 - 288 - fb_alloc_cmap(&cfb->cmap, CMAP_MAX_SIZE, 0); 289 - 290 - err = register_framebuffer(cfb); 291 - 292 - out: return err; 293 - } 294 - 295 - static int clps711x_fb_remove(struct platform_device *pdev) 296 - { 297 - unregister_framebuffer(cfb); 298 - kfree(cfb); 299 - 300 - return 0; 301 - } 302 - 303 - static struct platform_driver clps711x_fb_driver = { 304 - .driver = { 305 - .name = "video-clps711x", 306 - }, 307 - .probe = clps711x_fb_probe, 308 - .remove = clps711x_fb_remove, 309 - }; 310 - module_platform_driver(clps711x_fb_driver); 311 - 312 - MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); 313 - MODULE_DESCRIPTION("CLPS711X framebuffer driver"); 314 - MODULE_LICENSE("GPL");
+2 -2
drivers/video/fbdev/core/fbmon.c
··· 1480 1480 if (ret) 1481 1481 return ret; 1482 1482 1483 - pr_debug("%pOF: got %dx%d display mode from %s\n", 1484 - np, vm.hactive, vm.vactive, np->name); 1483 + pr_debug("%pOF: got %dx%d display mode\n", 1484 + np, vm.hactive, vm.vactive); 1485 1485 dump_fb_videomode(fb); 1486 1486 1487 1487 return 0;
+1 -1
drivers/video/fbdev/imsttfb.c
··· 1473 1473 1474 1474 dp = pci_device_to_OF_node(pdev); 1475 1475 if(dp) 1476 - printk(KERN_INFO "%s: OF name %s\n",__func__, dp->name); 1476 + printk(KERN_INFO "%s: OF name %pOFn\n",__func__, dp); 1477 1477 else if (IS_ENABLED(CONFIG_OF)) 1478 1478 printk(KERN_ERR "imsttfb: no OF node for pci device\n"); 1479 1479
+1 -1
drivers/video/fbdev/leo.c
··· 434 434 static void 435 435 leo_init_fix(struct fb_info *info, struct device_node *dp) 436 436 { 437 - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); 437 + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); 438 438 439 439 info->fix.type = FB_TYPE_PACKED_PIXELS; 440 440 info->fix.visual = FB_VISUAL_TRUECOLOR;
-1
drivers/video/fbdev/mmp/hw/Kconfig
··· 3 3 config MMP_DISP_CONTROLLER 4 4 bool "mmp display controller hw support" 5 5 depends on CPU_PXA910 || CPU_MMP2 6 - default n 7 6 help 8 7 Marvell MMP display hw controller support 9 8 this controller is used on Marvell PXA910 and
-1
drivers/video/fbdev/mmp/panel/Kconfig
··· 2 2 config MMP_PANEL_TPOHVGA 3 3 bool "tpohvga panel TJ032MD01BW support" 4 4 depends on SPI_MASTER 5 - default n 6 5 help 7 6 tpohvga panel support
+8 -4
drivers/video/fbdev/offb.c
··· 419 419 var = &info->var; 420 420 info->par = par; 421 421 422 - strcpy(fix->id, "OFfb "); 423 - strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); 424 - fix->id[sizeof(fix->id) - 1] = '\0'; 422 + if (name) { 423 + strcpy(fix->id, "OFfb "); 424 + strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); 425 + fix->id[sizeof(fix->id) - 1] = '\0'; 426 + } else 427 + snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp); 428 + 425 429 426 430 var->xres = var->xres_virtual = width; 427 431 var->yres = var->yres_virtual = height; ··· 648 644 /* kludge for valkyrie */ 649 645 if (strcmp(dp->name, "valkyrie") == 0) 650 646 address += 0x1000; 651 - offb_init_fb(no_real_node ? "bootx" : dp->name, 647 + offb_init_fb(no_real_node ? "bootx" : NULL, 652 648 width, height, depth, pitch, address, 653 649 foreign_endian, no_real_node ? NULL : dp); 654 650 }
+22 -33
drivers/video/fbdev/omap/lcd_ams_delta.c
··· 24 24 #include <linux/platform_device.h> 25 25 #include <linux/io.h> 26 26 #include <linux/delay.h> 27 + #include <linux/gpio/consumer.h> 27 28 #include <linux/lcd.h> 28 - #include <linux/gpio.h> 29 29 30 30 #include <mach/hardware.h> 31 - #include <mach/board-ams-delta.h> 32 31 33 32 #include "omapfb.h" 34 33 ··· 40 41 /* LCD class device section */ 41 42 42 43 static int ams_delta_lcd; 44 + static struct gpio_desc *gpiod_vblen; 45 + static struct gpio_desc *gpiod_ndisp; 43 46 44 47 static int ams_delta_lcd_set_power(struct lcd_device *dev, int power) 45 48 { ··· 100 99 101 100 /* omapfb panel section */ 102 101 103 - static const struct gpio _gpios[] = { 104 - { 105 - .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN, 106 - .flags = GPIOF_OUT_INIT_LOW, 107 - .label = "lcd_vblen", 108 - }, 109 - { 110 - .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP, 111 - .flags = GPIOF_OUT_INIT_LOW, 112 - .label = "lcd_ndisp", 113 - }, 114 - }; 115 - 116 - static int ams_delta_panel_init(struct lcd_panel *panel, 117 - struct omapfb_device *fbdev) 118 - { 119 - return gpio_request_array(_gpios, ARRAY_SIZE(_gpios)); 120 - } 121 - 122 - static void ams_delta_panel_cleanup(struct lcd_panel *panel) 123 - { 124 - gpio_free_array(_gpios, ARRAY_SIZE(_gpios)); 125 - } 126 - 127 102 static int ams_delta_panel_enable(struct lcd_panel *panel) 128 103 { 129 - gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 1); 130 - gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 1); 104 + gpiod_set_value(gpiod_ndisp, 1); 105 + gpiod_set_value(gpiod_vblen, 1); 131 106 return 0; 132 107 } 133 108 134 109 static void ams_delta_panel_disable(struct lcd_panel *panel) 135 110 { 136 - gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 0); 137 - gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0); 111 + gpiod_set_value(gpiod_vblen, 0); 112 + gpiod_set_value(gpiod_ndisp, 0); 138 113 } 139 114 140 115 static struct lcd_panel ams_delta_panel = { ··· 131 154 .pcd = 0, 132 155 .acb = 37, 133 156 134 - .init = ams_delta_panel_init, 135 - .cleanup = ams_delta_panel_cleanup, 136 157 .enable = ams_delta_panel_enable, 137 158 .disable = ams_delta_panel_disable, 138 159 }; ··· 141 166 static int ams_delta_panel_probe(struct platform_device *pdev) 142 167 { 143 168 struct lcd_device *lcd_device = NULL; 144 - #ifdef CONFIG_LCD_CLASS_DEVICE 145 169 int ret; 146 170 171 + gpiod_vblen = devm_gpiod_get(&pdev->dev, "vblen", GPIOD_OUT_LOW); 172 + if (IS_ERR(gpiod_vblen)) { 173 + ret = PTR_ERR(gpiod_vblen); 174 + dev_err(&pdev->dev, "VBLEN GPIO request failed (%d)\n", ret); 175 + return ret; 176 + } 177 + 178 + gpiod_ndisp = devm_gpiod_get(&pdev->dev, "ndisp", GPIOD_OUT_LOW); 179 + if (IS_ERR(gpiod_ndisp)) { 180 + ret = PTR_ERR(gpiod_ndisp); 181 + dev_err(&pdev->dev, "NDISP GPIO request failed (%d)\n", ret); 182 + return ret; 183 + } 184 + 185 + #ifdef CONFIG_LCD_CLASS_DEVICE 147 186 lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL, 148 187 &ams_delta_lcd_ops); 149 188
-7
drivers/video/fbdev/omap2/omapfb/dss/Kconfig
··· 10 10 11 11 config FB_OMAP2_DSS_DEBUG 12 12 bool "Debug support" 13 - default n 14 13 help 15 14 This enables printing of debug messages. Alternatively, debug messages 16 15 can also be enabled by setting CONFIG_DYNAMIC_DEBUG and then setting ··· 18 19 config FB_OMAP2_DSS_DEBUGFS 19 20 bool "Debugfs filesystem support" 20 21 depends on DEBUG_FS 21 - default n 22 22 help 23 23 This enables debugfs for OMAPDSS at <debugfs>/omapdss. This enables 24 24 querying about clock configuration and register configuration of dss, ··· 26 28 config FB_OMAP2_DSS_COLLECT_IRQ_STATS 27 29 bool "Collect DSS IRQ statistics" 28 30 depends on FB_OMAP2_DSS_DEBUGFS 29 - default n 30 31 help 31 32 Collect DSS IRQ statistics, printable via debugfs. 32 33 ··· 42 45 config FB_OMAP2_DSS_RFBI 43 46 bool "RFBI support" 44 47 depends on BROKEN 45 - default n 46 48 help 47 49 MIPI DBI support (RFBI, Remote Framebuffer Interface, in Texas 48 50 Instrument's terminology). ··· 69 73 70 74 config FB_OMAP5_DSS_HDMI 71 75 bool "HDMI support for OMAP5" 72 - default n 73 76 select FB_OMAP2_DSS_HDMI_COMMON 74 77 help 75 78 HDMI Interface for OMAP5 and similar cores. This adds the High ··· 77 82 78 83 config FB_OMAP2_DSS_SDI 79 84 bool "SDI support" 80 - default n 81 85 help 82 86 SDI (Serial Display Interface) support. 83 87 ··· 85 91 86 92 config FB_OMAP2_DSS_DSI 87 93 bool "DSI support" 88 - default n 89 94 help 90 95 MIPI DSI (Display Serial Interface) support. 91 96
+1 -1
drivers/video/fbdev/p9100.c
··· 239 239 240 240 static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) 241 241 { 242 - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); 242 + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); 243 243 244 244 info->fix.type = FB_TYPE_PACKED_PIXELS; 245 245 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
-3
drivers/video/fbdev/pxa168fb.c
··· 405 405 struct fb_var_screeninfo *var = &info->var; 406 406 struct fb_videomode mode; 407 407 u32 x; 408 - struct pxa168fb_mach_info *mi; 409 - 410 - mi = dev_get_platdata(fbi->dev); 411 408 412 409 /* 413 410 * Set additional mode info.
+14 -14
drivers/video/fbdev/sbuslib.c
··· 106 106 struct fbtype __user *f = (struct fbtype __user *) arg; 107 107 108 108 if (put_user(type, &f->fb_type) || 109 - __put_user(info->var.yres, &f->fb_height) || 110 - __put_user(info->var.xres, &f->fb_width) || 111 - __put_user(fb_depth, &f->fb_depth) || 112 - __put_user(0, &f->fb_cmsize) || 113 - __put_user(fb_size, &f->fb_cmsize)) 109 + put_user(info->var.yres, &f->fb_height) || 110 + put_user(info->var.xres, &f->fb_width) || 111 + put_user(fb_depth, &f->fb_depth) || 112 + put_user(0, &f->fb_cmsize) || 113 + put_user(fb_size, &f->fb_cmsize)) 114 114 return -EFAULT; 115 115 return 0; 116 116 } ··· 125 125 unsigned int index, count, i; 126 126 127 127 if (get_user(index, &c->index) || 128 - __get_user(count, &c->count) || 129 - __get_user(ured, &c->red) || 130 - __get_user(ugreen, &c->green) || 131 - __get_user(ublue, &c->blue)) 128 + get_user(count, &c->count) || 129 + get_user(ured, &c->red) || 130 + get_user(ugreen, &c->green) || 131 + get_user(ublue, &c->blue)) 132 132 return -EFAULT; 133 133 134 134 cmap.len = 1; ··· 165 165 u8 red, green, blue; 166 166 167 167 if (get_user(index, &c->index) || 168 - __get_user(count, &c->count) || 169 - __get_user(ured, &c->red) || 170 - __get_user(ugreen, &c->green) || 171 - __get_user(ublue, &c->blue)) 168 + get_user(count, &c->count) || 169 + get_user(ured, &c->red) || 170 + get_user(ugreen, &c->green) || 171 + get_user(ublue, &c->blue)) 172 172 return -EFAULT; 173 173 174 - if (index + count > cmap->len) 174 + if (index > cmap->len || count > cmap->len - index) 175 175 return -EINVAL; 176 176 177 177 for (i = 0; i < count; i++) {
+1 -3
drivers/video/fbdev/sis/init301.c
··· 848 848 SiS_DDC2Delay(SiS_Pr, 0x4000); 849 849 } 850 850 851 - } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* || 852 - (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || 853 - (SiS_Pr->SiS_CustomT == CUT_CLEVO1400) */ ) { /* 315 series, LVDS; Special */ 851 + } else if (SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* 315 series, LVDS; Special */ 854 852 855 853 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { 856 854 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
+2 -2
drivers/video/fbdev/ssd1307fb.c
··· 667 667 668 668 if (par->reset) { 669 669 /* Reset the screen */ 670 - gpiod_set_value(par->reset, 0); 670 + gpiod_set_value_cansleep(par->reset, 0); 671 671 udelay(4); 672 - gpiod_set_value(par->reset, 1); 672 + gpiod_set_value_cansleep(par->reset, 1); 673 673 udelay(4); 674 674 } 675 675
+38 -105
drivers/video/fbdev/udlfb.c
··· 916 916 917 917 dlfb->fb_count++; 918 918 919 - kref_get(&dlfb->kref); 920 - 921 919 if (fb_defio && (info->fbdefio == NULL)) { 922 920 /* enable defio at last moment if not disabled by client */ 923 921 ··· 938 940 return 0; 939 941 } 940 942 941 - /* 942 - * Called when all client interfaces to start transactions have been disabled, 943 - * and all references to our device instance (dlfb_data) are released. 944 - * Every transaction must have a reference, so we know are fully spun down 945 - */ 946 - static void dlfb_free(struct kref *kref) 943 + static void dlfb_ops_destroy(struct fb_info *info) 947 944 { 948 - struct dlfb_data *dlfb = container_of(kref, struct dlfb_data, kref); 945 + struct dlfb_data *dlfb = info->par; 946 + 947 + if (info->cmap.len != 0) 948 + fb_dealloc_cmap(&info->cmap); 949 + if (info->monspecs.modedb) 950 + fb_destroy_modedb(info->monspecs.modedb); 951 + vfree(info->screen_base); 952 + 953 + fb_destroy_modelist(&info->modelist); 949 954 950 955 while (!list_empty(&dlfb->deferred_free)) { 951 956 struct dlfb_deferred_free *d = list_entry(dlfb->deferred_free.next, struct dlfb_deferred_free, list); ··· 958 957 } 959 958 vfree(dlfb->backing_buffer); 960 959 kfree(dlfb->edid); 960 + usb_put_dev(dlfb->udev); 961 961 kfree(dlfb); 962 + 963 + /* Assume info structure is freed after this point */ 964 + framebuffer_release(info); 962 965 } 963 966 964 - static void dlfb_free_framebuffer(struct dlfb_data *dlfb) 965 - { 966 - struct fb_info *info = dlfb->info; 967 - 968 - if (info) { 969 - unregister_framebuffer(info); 970 - 971 - if (info->cmap.len != 0) 972 - fb_dealloc_cmap(&info->cmap); 973 - if (info->monspecs.modedb) 974 - fb_destroy_modedb(info->monspecs.modedb); 975 - vfree(info->screen_base); 976 - 977 - fb_destroy_modelist(&info->modelist); 978 - 979 - dlfb->info = NULL; 980 - 981 - /* Assume info structure is freed after this point */ 982 - framebuffer_release(info); 983 - } 984 - 985 - /* ref taken in probe() as part of registering framebfufer */ 986 - kref_put(&dlfb->kref, dlfb_free); 987 - } 988 - 989 - static void dlfb_free_framebuffer_work(struct work_struct *work) 990 - { 991 - struct dlfb_data *dlfb = container_of(work, struct dlfb_data, 992 - free_framebuffer_work.work); 993 - dlfb_free_framebuffer(dlfb); 994 - } 995 967 /* 996 968 * Assumes caller is holding info->lock mutex (for open and release at least) 997 969 */ ··· 974 1000 975 1001 dlfb->fb_count--; 976 1002 977 - /* We can't free fb_info here - fbmem will touch it when we return */ 978 - if (dlfb->virtualized && (dlfb->fb_count == 0)) 979 - schedule_delayed_work(&dlfb->free_framebuffer_work, HZ); 980 - 981 1003 if ((dlfb->fb_count == 0) && (info->fbdefio)) { 982 1004 fb_deferred_io_cleanup(info); 983 1005 kfree(info->fbdefio); ··· 982 1012 } 983 1013 984 1014 dev_dbg(info->dev, "release, user=%d count=%d\n", user, dlfb->fb_count); 985 - 986 - kref_put(&dlfb->kref, dlfb_free); 987 1015 988 1016 return 0; 989 1017 } ··· 1140 1172 .fb_blank = dlfb_ops_blank, 1141 1173 .fb_check_var = dlfb_ops_check_var, 1142 1174 .fb_set_par = dlfb_ops_set_par, 1175 + .fb_destroy = dlfb_ops_destroy, 1143 1176 }; 1144 1177 1145 1178 ··· 1584 1615 return true; 1585 1616 } 1586 1617 1587 - static void dlfb_init_framebuffer_work(struct work_struct *work); 1588 - 1589 1618 static int dlfb_usb_probe(struct usb_interface *intf, 1590 1619 const struct usb_device_id *id) 1591 1620 { 1621 + int i; 1622 + const struct device_attribute *attr; 1592 1623 struct dlfb_data *dlfb; 1624 + struct fb_info *info; 1593 1625 int retval = -ENOMEM; 1594 1626 struct usb_device *usbdev = interface_to_usbdev(intf); 1595 1627 ··· 1601 1631 goto error; 1602 1632 } 1603 1633 1604 - kref_init(&dlfb->kref); /* matching kref_put in usb .disconnect fn */ 1605 1634 INIT_LIST_HEAD(&dlfb->deferred_free); 1606 1635 1607 - dlfb->udev = usbdev; 1636 + dlfb->udev = usb_get_dev(usbdev); 1608 1637 usb_set_intfdata(intf, dlfb); 1609 1638 1610 1639 dev_dbg(&intf->dev, "console enable=%d\n", console); ··· 1626 1657 } 1627 1658 1628 1659 1629 - if (!dlfb_alloc_urb_list(dlfb, WRITES_IN_FLIGHT, MAX_TRANSFER)) { 1630 - retval = -ENOMEM; 1631 - dev_err(&intf->dev, "unable to allocate urb list\n"); 1632 - goto error; 1633 - } 1634 - 1635 - kref_get(&dlfb->kref); /* matching kref_put in free_framebuffer_work */ 1636 - 1637 - /* We don't register a new USB class. Our client interface is dlfbev */ 1638 - 1639 - /* Workitem keep things fast & simple during USB enumeration */ 1640 - INIT_DELAYED_WORK(&dlfb->init_framebuffer_work, 1641 - dlfb_init_framebuffer_work); 1642 - schedule_delayed_work(&dlfb->init_framebuffer_work, 0); 1643 - 1644 - return 0; 1645 - 1646 - error: 1647 - if (dlfb) { 1648 - 1649 - kref_put(&dlfb->kref, dlfb_free); /* last ref from kref_init */ 1650 - 1651 - /* dev has been deallocated. Do not dereference */ 1652 - } 1653 - 1654 - return retval; 1655 - } 1656 - 1657 - static void dlfb_init_framebuffer_work(struct work_struct *work) 1658 - { 1659 - int i, retval; 1660 - struct fb_info *info; 1661 - const struct device_attribute *attr; 1662 - struct dlfb_data *dlfb = container_of(work, struct dlfb_data, 1663 - init_framebuffer_work.work); 1664 - 1665 1660 /* allocates framebuffer driver structure, not framebuffer memory */ 1666 1661 info = framebuffer_alloc(0, &dlfb->udev->dev); 1667 1662 if (!info) { ··· 1639 1706 dlfb->ops = dlfb_ops; 1640 1707 info->fbops = &dlfb->ops; 1641 1708 1709 + INIT_LIST_HEAD(&info->modelist); 1710 + 1711 + if (!dlfb_alloc_urb_list(dlfb, WRITES_IN_FLIGHT, MAX_TRANSFER)) { 1712 + retval = -ENOMEM; 1713 + dev_err(&intf->dev, "unable to allocate urb list\n"); 1714 + goto error; 1715 + } 1716 + 1717 + /* We don't register a new USB class. Our client interface is dlfbev */ 1718 + 1642 1719 retval = fb_alloc_cmap(&info->cmap, 256, 0); 1643 1720 if (retval < 0) { 1644 1721 dev_err(info->device, "cmap allocation failed: %d\n", retval); 1645 1722 goto error; 1646 1723 } 1647 - 1648 - INIT_DELAYED_WORK(&dlfb->free_framebuffer_work, 1649 - dlfb_free_framebuffer_work); 1650 - 1651 - INIT_LIST_HEAD(&info->modelist); 1652 1724 1653 1725 retval = dlfb_setup_modes(dlfb, info, NULL, 0); 1654 1726 if (retval != 0) { ··· 1698 1760 dev_name(info->dev), info->var.xres, info->var.yres, 1699 1761 ((dlfb->backing_buffer) ? 1700 1762 info->fix.smem_len * 2 : info->fix.smem_len) >> 10); 1701 - return; 1763 + return 0; 1702 1764 1703 1765 error: 1704 - dlfb_free_framebuffer(dlfb); 1766 + if (dlfb->info) { 1767 + dlfb_ops_destroy(dlfb->info); 1768 + } else if (dlfb) { 1769 + usb_put_dev(dlfb->udev); 1770 + kfree(dlfb); 1771 + } 1772 + return retval; 1705 1773 } 1706 1774 1707 1775 static void dlfb_usb_disconnect(struct usb_interface *intf) ··· 1735 1791 for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) 1736 1792 device_remove_file(info->dev, &fb_device_attrs[i]); 1737 1793 device_remove_bin_file(info->dev, &edid_attr); 1738 - unlink_framebuffer(info); 1739 1794 } 1740 1795 1741 - usb_set_intfdata(intf, NULL); 1742 - dlfb->udev = NULL; 1743 - 1744 - /* if clients still have us open, will be freed on last close */ 1745 - if (dlfb->fb_count == 0) 1746 - schedule_delayed_work(&dlfb->free_framebuffer_work, 0); 1747 - 1748 - /* release reference taken by kref_init in probe() */ 1749 - kref_put(&dlfb->kref, dlfb_free); 1750 - 1751 - /* consider dlfb_data freed */ 1796 + unregister_framebuffer(info); 1752 1797 } 1753 1798 1754 1799 static struct usb_driver dlfb_driver = {
+1 -1
drivers/video/of_display_timing.c
··· 170 170 goto entryfail; 171 171 } 172 172 173 - pr_debug("%pOF: using %s as default timing\n", np, entry->name); 173 + pr_debug("%pOF: using %pOFn as default timing\n", np, entry); 174 174 175 175 native_mode = entry; 176 176
+1 -1
drivers/video/vgastate.c
··· 455 455 return 0; 456 456 } 457 457 458 - int restore_vga (struct vgastate *state) 458 + int restore_vga(struct vgastate *state) 459 459 { 460 460 if (state->vidstate == NULL) 461 461 return 1;
-3
include/video/udlfb.h
··· 36 36 struct usb_device *udev; 37 37 struct fb_info *info; 38 38 struct urb_list urbs; 39 - struct kref kref; 40 39 char *backing_buffer; 41 40 int fb_count; 42 41 bool virtualized; /* true when physical usb device not present */ 43 - struct delayed_work init_framebuffer_work; 44 - struct delayed_work free_framebuffer_work; 45 42 atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */ 46 43 atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */ 47 44 char *edid; /* null until we read edid from hw or get from sysfs */