diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-31 14:41:37 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-31 14:41:37 -0400 |
| commit | a9ac6cc47bbb0fdd042012044f737ba13da10cb4 (patch) | |
| tree | 474165fefdfd8cec489f1699906a9a40874ad812 /drivers/video/fbdev | |
| parent | d547d44e5c5dd82b32c2399632b254395a099072 (diff) | |
| parent | 217188d9f985bd3ce8c9a0cd50ca35be62d0f8c6 (diff) | |
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
...
Diffstat (limited to 'drivers/video/fbdev')
24 files changed, 156 insertions, 615 deletions
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 591a13a59787..e413f54208f4 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig | |||
| @@ -2,6 +2,12 @@ | |||
| 2 | # fbdev configuration | 2 | # fbdev configuration |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | config FB_CMDLINE | ||
| 6 | bool | ||
| 7 | |||
| 8 | config FB_NOTIFY | ||
| 9 | bool | ||
| 10 | |||
| 5 | menuconfig FB | 11 | menuconfig FB |
| 6 | tristate "Support for frame buffer devices" | 12 | tristate "Support for frame buffer devices" |
| 7 | select FB_CMDLINE | 13 | select FB_CMDLINE |
| @@ -41,7 +47,6 @@ menuconfig FB | |||
| 41 | config FIRMWARE_EDID | 47 | config FIRMWARE_EDID |
| 42 | bool "Enable firmware EDID" | 48 | bool "Enable firmware EDID" |
| 43 | depends on FB | 49 | depends on FB |
| 44 | default n | ||
| 45 | ---help--- | 50 | ---help--- |
| 46 | This enables access to the EDID transferred from the firmware. | 51 | This enables access to the EDID transferred from the firmware. |
| 47 | On the i386, this is from the Video BIOS. Enable this if DDC/I2C | 52 | On the i386, this is from the Video BIOS. Enable this if DDC/I2C |
| @@ -54,23 +59,15 @@ config FIRMWARE_EDID | |||
| 54 | combination with certain motherboards and monitors are known to | 59 | combination with certain motherboards and monitors are known to |
| 55 | suffer from this problem. | 60 | suffer from this problem. |
| 56 | 61 | ||
| 57 | config FB_CMDLINE | ||
| 58 | bool | ||
| 59 | |||
| 60 | config FB_NOTIFY | ||
| 61 | bool | ||
| 62 | |||
| 63 | config FB_DDC | 62 | config FB_DDC |
| 64 | tristate | 63 | tristate |
| 65 | depends on FB | 64 | depends on FB |
| 66 | select I2C_ALGOBIT | 65 | select I2C_ALGOBIT |
| 67 | select I2C | 66 | select I2C |
| 68 | default n | ||
| 69 | 67 | ||
| 70 | config FB_BOOT_VESA_SUPPORT | 68 | config FB_BOOT_VESA_SUPPORT |
| 71 | bool | 69 | bool |
| 72 | depends on FB | 70 | depends on FB |
| 73 | default n | ||
| 74 | ---help--- | 71 | ---help--- |
| 75 | If true, at least one selected framebuffer driver can take advantage | 72 | If true, at least one selected framebuffer driver can take advantage |
| 76 | of VESA video modes set at an early boot stage via the vga= parameter. | 73 | of VESA video modes set at an early boot stage via the vga= parameter. |
| @@ -78,7 +75,6 @@ config FB_BOOT_VESA_SUPPORT | |||
| 78 | config FB_CFB_FILLRECT | 75 | config FB_CFB_FILLRECT |
| 79 | tristate | 76 | tristate |
| 80 | depends on FB | 77 | depends on FB |
| 81 | default n | ||
| 82 | ---help--- | 78 | ---help--- |
| 83 | Include the cfb_fillrect function for generic software rectangle | 79 | Include the cfb_fillrect function for generic software rectangle |
| 84 | filling. This is used by drivers that don't provide their own | 80 | filling. This is used by drivers that don't provide their own |
| @@ -87,7 +83,6 @@ config FB_CFB_FILLRECT | |||
| 87 | config FB_CFB_COPYAREA | 83 | config FB_CFB_COPYAREA |
| 88 | tristate | 84 | tristate |
| 89 | depends on FB | 85 | depends on FB |
| 90 | default n | ||
| 91 | ---help--- | 86 | ---help--- |
| 92 | Include the cfb_copyarea function for generic software area copying. | 87 | Include the cfb_copyarea function for generic software area copying. |
| 93 | This is used by drivers that don't provide their own (accelerated) | 88 | This is used by drivers that don't provide their own (accelerated) |
| @@ -96,7 +91,6 @@ config FB_CFB_COPYAREA | |||
| 96 | config FB_CFB_IMAGEBLIT | 91 | config FB_CFB_IMAGEBLIT |
| 97 | tristate | 92 | tristate |
| 98 | depends on FB | 93 | depends on FB |
| 99 | default n | ||
| 100 | ---help--- | 94 | ---help--- |
| 101 | Include the cfb_imageblit function for generic software image | 95 | Include the cfb_imageblit function for generic software image |
| 102 | blitting. This is used by drivers that don't provide their own | 96 | blitting. This is used by drivers that don't provide their own |
| @@ -105,7 +99,6 @@ config FB_CFB_IMAGEBLIT | |||
| 105 | config FB_CFB_REV_PIXELS_IN_BYTE | 99 | config FB_CFB_REV_PIXELS_IN_BYTE |
| 106 | bool | 100 | bool |
| 107 | depends on FB | 101 | depends on FB |
| 108 | default n | ||
| 109 | ---help--- | 102 | ---help--- |
| 110 | Allow generic frame-buffer functions to work on displays with 1, 2 | 103 | Allow generic frame-buffer functions to work on displays with 1, 2 |
| 111 | and 4 bits per pixel depths which has opposite order of pixels in | 104 | and 4 bits per pixel depths which has opposite order of pixels in |
| @@ -114,7 +107,6 @@ config FB_CFB_REV_PIXELS_IN_BYTE | |||
| 114 | config FB_SYS_FILLRECT | 107 | config FB_SYS_FILLRECT |
| 115 | tristate | 108 | tristate |
| 116 | depends on FB | 109 | depends on FB |
| 117 | default n | ||
| 118 | ---help--- | 110 | ---help--- |
| 119 | Include the sys_fillrect function for generic software rectangle | 111 | Include the sys_fillrect function for generic software rectangle |
| 120 | filling. This is used by drivers that don't provide their own | 112 | filling. This is used by drivers that don't provide their own |
| @@ -123,7 +115,6 @@ config FB_SYS_FILLRECT | |||
| 123 | config FB_SYS_COPYAREA | 115 | config FB_SYS_COPYAREA |
| 124 | tristate | 116 | tristate |
| 125 | depends on FB | 117 | depends on FB |
| 126 | default n | ||
| 127 | ---help--- | 118 | ---help--- |
| 128 | Include the sys_copyarea function for generic software area copying. | 119 | Include the sys_copyarea function for generic software area copying. |
| 129 | This is used by drivers that don't provide their own (accelerated) | 120 | This is used by drivers that don't provide their own (accelerated) |
| @@ -132,7 +123,6 @@ config FB_SYS_COPYAREA | |||
| 132 | config FB_SYS_IMAGEBLIT | 123 | config FB_SYS_IMAGEBLIT |
| 133 | tristate | 124 | tristate |
| 134 | depends on FB | 125 | depends on FB |
| 135 | default n | ||
| 136 | ---help--- | 126 | ---help--- |
| 137 | Include the sys_imageblit function for generic software image | 127 | Include the sys_imageblit function for generic software image |
| 138 | blitting. This is used by drivers that don't provide their own | 128 | blitting. This is used by drivers that don't provide their own |
| @@ -141,7 +131,6 @@ config FB_SYS_IMAGEBLIT | |||
| 141 | config FB_PROVIDE_GET_FB_UNMAPPED_AREA | 131 | config FB_PROVIDE_GET_FB_UNMAPPED_AREA |
| 142 | bool | 132 | bool |
| 143 | depends on FB | 133 | depends on FB |
| 144 | default n | ||
| 145 | ---help--- | 134 | ---help--- |
| 146 | Allow generic frame-buffer to provide get_fb_unmapped_area | 135 | Allow generic frame-buffer to provide get_fb_unmapped_area |
| 147 | function. | 136 | function. |
| @@ -173,7 +162,6 @@ endchoice | |||
| 173 | config FB_SYS_FOPS | 162 | config FB_SYS_FOPS |
| 174 | tristate | 163 | tristate |
| 175 | depends on FB | 164 | depends on FB |
| 176 | default n | ||
| 177 | 165 | ||
| 178 | config FB_DEFERRED_IO | 166 | config FB_DEFERRED_IO |
| 179 | bool | 167 | bool |
| @@ -187,7 +175,6 @@ config FB_HECUBA | |||
| 187 | config FB_SVGALIB | 175 | config FB_SVGALIB |
| 188 | tristate | 176 | tristate |
| 189 | depends on FB | 177 | depends on FB |
| 190 | default n | ||
| 191 | ---help--- | 178 | ---help--- |
| 192 | Common utility functions useful to fbdev drivers of VGA-based | 179 | Common utility functions useful to fbdev drivers of VGA-based |
| 193 | cards. | 180 | cards. |
| @@ -195,19 +182,16 @@ config FB_SVGALIB | |||
| 195 | config FB_MACMODES | 182 | config FB_MACMODES |
| 196 | tristate | 183 | tristate |
| 197 | depends on FB | 184 | depends on FB |
| 198 | default n | ||
| 199 | 185 | ||
| 200 | config FB_BACKLIGHT | 186 | config FB_BACKLIGHT |
| 201 | bool | 187 | bool |
| 202 | depends on FB | 188 | depends on FB |
| 203 | select BACKLIGHT_LCD_SUPPORT | 189 | select BACKLIGHT_LCD_SUPPORT |
| 204 | select BACKLIGHT_CLASS_DEVICE | 190 | select BACKLIGHT_CLASS_DEVICE |
| 205 | default n | ||
| 206 | 191 | ||
| 207 | config FB_MODE_HELPERS | 192 | config FB_MODE_HELPERS |
| 208 | bool "Enable Video Mode Handling Helpers" | 193 | bool "Enable Video Mode Handling Helpers" |
| 209 | depends on FB | 194 | depends on FB |
| 210 | default n | ||
| 211 | ---help--- | 195 | ---help--- |
| 212 | This enables functions for handling video modes using the | 196 | This enables functions for handling video modes using the |
| 213 | Generalized Timing Formula and the EDID parser. A few drivers rely | 197 | Generalized Timing Formula and the EDID parser. A few drivers rely |
| @@ -218,7 +202,6 @@ config FB_MODE_HELPERS | |||
| 218 | config FB_TILEBLITTING | 202 | config FB_TILEBLITTING |
| 219 | bool "Enable Tile Blitting Support" | 203 | bool "Enable Tile Blitting Support" |
| 220 | depends on FB | 204 | depends on FB |
| 221 | default n | ||
| 222 | ---help--- | 205 | ---help--- |
| 223 | This enables tile blitting. Tile blitting is a drawing technique | 206 | This enables tile blitting. Tile blitting is a drawing technique |
| 224 | where the screen is divided into rectangular sections (tiles), whereas | 207 | where the screen is divided into rectangular sections (tiles), whereas |
| @@ -329,16 +312,9 @@ config FB_ACORN | |||
| 329 | hardware found in Acorn RISC PCs and other ARM-based machines. If | 312 | hardware found in Acorn RISC PCs and other ARM-based machines. If |
| 330 | unsure, say N. | 313 | unsure, say N. |
| 331 | 314 | ||
| 332 | config FB_CLPS711X_OLD | ||
| 333 | tristate | ||
| 334 | select FB_CFB_FILLRECT | ||
| 335 | select FB_CFB_COPYAREA | ||
| 336 | select FB_CFB_IMAGEBLIT | ||
| 337 | |||
| 338 | config FB_CLPS711X | 315 | config FB_CLPS711X |
| 339 | tristate "CLPS711X LCD support" | 316 | tristate "CLPS711X LCD support" |
| 340 | depends on FB && (ARCH_CLPS711X || COMPILE_TEST) | 317 | depends on FB && (ARCH_CLPS711X || COMPILE_TEST) |
| 341 | select FB_CLPS711X_OLD if ARCH_CLPS711X && !ARCH_MULTIPLATFORM | ||
| 342 | select BACKLIGHT_LCD_SUPPORT | 318 | select BACKLIGHT_LCD_SUPPORT |
| 343 | select FB_MODE_HELPERS | 319 | select FB_MODE_HELPERS |
| 344 | select FB_SYS_FILLRECT | 320 | select FB_SYS_FILLRECT |
| @@ -936,7 +912,6 @@ config FB_NVIDIA_I2C | |||
| 936 | config FB_NVIDIA_DEBUG | 912 | config FB_NVIDIA_DEBUG |
| 937 | bool "Lots of debug output" | 913 | bool "Lots of debug output" |
| 938 | depends on FB_NVIDIA | 914 | depends on FB_NVIDIA |
| 939 | default n | ||
| 940 | help | 915 | help |
| 941 | Say Y here if you want the nVidia driver to output all sorts | 916 | Say Y here if you want the nVidia driver to output all sorts |
| 942 | of debugging information to provide to the maintainer when | 917 | of debugging information to provide to the maintainer when |
| @@ -983,7 +958,6 @@ config FB_RIVA_I2C | |||
| 983 | config FB_RIVA_DEBUG | 958 | config FB_RIVA_DEBUG |
| 984 | bool "Lots of debug output" | 959 | bool "Lots of debug output" |
| 985 | depends on FB_RIVA | 960 | depends on FB_RIVA |
| 986 | default n | ||
| 987 | help | 961 | help |
| 988 | Say Y here if you want the Riva driver to output all sorts | 962 | Say Y here if you want the Riva driver to output all sorts |
| 989 | of debugging information to provide to the maintainer when | 963 | of debugging information to provide to the maintainer when |
| @@ -1266,7 +1240,6 @@ config FB_RADEON_BACKLIGHT | |||
| 1266 | config FB_RADEON_DEBUG | 1240 | config FB_RADEON_DEBUG |
| 1267 | bool "Lots of debug output from Radeon driver" | 1241 | bool "Lots of debug output from Radeon driver" |
| 1268 | depends on FB_RADEON | 1242 | depends on FB_RADEON |
| 1269 | default n | ||
| 1270 | help | 1243 | help |
| 1271 | Say Y here if you want the Radeon driver to output all sorts | 1244 | Say Y here if you want the Radeon driver to output all sorts |
| 1272 | of debugging information to provide to the maintainer when | 1245 | of debugging information to provide to the maintainer when |
| @@ -1399,7 +1372,6 @@ config FB_SAVAGE_I2C | |||
| 1399 | config FB_SAVAGE_ACCEL | 1372 | config FB_SAVAGE_ACCEL |
| 1400 | bool "Enable Console Acceleration" | 1373 | bool "Enable Console Acceleration" |
| 1401 | depends on FB_SAVAGE | 1374 | depends on FB_SAVAGE |
| 1402 | default n | ||
| 1403 | help | 1375 | help |
| 1404 | This option will compile in console acceleration support. If | 1376 | This option will compile in console acceleration support. If |
| 1405 | the resulting framebuffer console has bothersome glitches, then | 1377 | the resulting framebuffer console has bothersome glitches, then |
| @@ -1456,8 +1428,6 @@ if FB_VIA | |||
| 1456 | 1428 | ||
| 1457 | config FB_VIA_DIRECT_PROCFS | 1429 | config FB_VIA_DIRECT_PROCFS |
| 1458 | bool "direct hardware access via procfs (DEPRECATED)(DANGEROUS)" | 1430 | bool "direct hardware access via procfs (DEPRECATED)(DANGEROUS)" |
| 1459 | depends on FB_VIA | ||
| 1460 | default n | ||
| 1461 | help | 1431 | help |
| 1462 | Allow direct hardware access to some output registers via procfs. | 1432 | Allow direct hardware access to some output registers via procfs. |
| 1463 | This is dangerous but may provide the only chance to get the | 1433 | This is dangerous but may provide the only chance to get the |
| @@ -1466,8 +1436,6 @@ config FB_VIA_DIRECT_PROCFS | |||
| 1466 | 1436 | ||
| 1467 | config FB_VIA_X_COMPATIBILITY | 1437 | config FB_VIA_X_COMPATIBILITY |
| 1468 | bool "X server compatibility" | 1438 | bool "X server compatibility" |
| 1469 | depends on FB_VIA | ||
| 1470 | default n | ||
| 1471 | help | 1439 | help |
| 1472 | This option reduces the functionality (power saving, ...) of the | 1440 | This option reduces the functionality (power saving, ...) of the |
| 1473 | framebuffer to avoid negative impact on the OpenChrome X server. | 1441 | framebuffer to avoid negative impact on the OpenChrome X server. |
| @@ -1692,7 +1660,6 @@ config FB_WM8505 | |||
| 1692 | config FB_WMT_GE_ROPS | 1660 | config FB_WMT_GE_ROPS |
| 1693 | bool "VT8500/WM8xxx accelerated raster ops support" | 1661 | bool "VT8500/WM8xxx accelerated raster ops support" |
| 1694 | depends on (FB = y) && (FB_VT8500 || FB_WM8505) | 1662 | depends on (FB = y) && (FB_VT8500 || FB_WM8505) |
| 1695 | default n | ||
| 1696 | help | 1663 | help |
| 1697 | This adds support for accelerated raster operations on the | 1664 | This adds support for accelerated raster operations on the |
| 1698 | VIA VT8500 and Wondermedia 85xx series SoCs. | 1665 | VIA VT8500 and Wondermedia 85xx series SoCs. |
| @@ -1802,17 +1769,14 @@ config FB_PXA | |||
| 1802 | 1769 | ||
| 1803 | config FB_PXA_OVERLAY | 1770 | config FB_PXA_OVERLAY |
| 1804 | bool "Support PXA27x/PXA3xx Overlay(s) as framebuffer" | 1771 | bool "Support PXA27x/PXA3xx Overlay(s) as framebuffer" |
| 1805 | default n | ||
| 1806 | depends on FB_PXA && (PXA27x || PXA3xx) | 1772 | depends on FB_PXA && (PXA27x || PXA3xx) |
| 1807 | 1773 | ||
| 1808 | config FB_PXA_SMARTPANEL | 1774 | config FB_PXA_SMARTPANEL |
| 1809 | bool "PXA Smartpanel LCD support" | 1775 | bool "PXA Smartpanel LCD support" |
| 1810 | default n | ||
| 1811 | depends on FB_PXA | 1776 | depends on FB_PXA |
| 1812 | 1777 | ||
| 1813 | config FB_PXA_PARAMETERS | 1778 | config FB_PXA_PARAMETERS |
| 1814 | bool "PXA LCD command line parameters" | 1779 | bool "PXA LCD command line parameters" |
| 1815 | default n | ||
| 1816 | depends on FB_PXA | 1780 | depends on FB_PXA |
| 1817 | ---help--- | 1781 | ---help--- |
| 1818 | Enable the use of kernel command line or module parameters | 1782 | Enable the use of kernel command line or module parameters |
| @@ -1850,7 +1814,6 @@ config FB_MBX | |||
| 1850 | config FB_MBX_DEBUG | 1814 | config FB_MBX_DEBUG |
| 1851 | bool "Enable debugging info via debugfs" | 1815 | bool "Enable debugging info via debugfs" |
| 1852 | depends on FB_MBX && DEBUG_FS | 1816 | depends on FB_MBX && DEBUG_FS |
| 1853 | default n | ||
| 1854 | ---help--- | 1817 | ---help--- |
| 1855 | Enable this if you want debugging information using the debug | 1818 | Enable this if you want debugging information using the debug |
| 1856 | filesystem (debugfs) | 1819 | filesystem (debugfs) |
| @@ -2240,7 +2203,7 @@ config FB_MX3 | |||
| 2240 | 2203 | ||
| 2241 | config FB_BROADSHEET | 2204 | config FB_BROADSHEET |
| 2242 | tristate "E-Ink Broadsheet/Epson S1D13521 controller support" | 2205 | tristate "E-Ink Broadsheet/Epson S1D13521 controller support" |
| 2243 | depends on FB | 2206 | depends on FB && (ARCH_PXA || COMPILE_TEST) |
| 2244 | select FB_SYS_FILLRECT | 2207 | select FB_SYS_FILLRECT |
| 2245 | select FB_SYS_COPYAREA | 2208 | select FB_SYS_COPYAREA |
| 2246 | select FB_SYS_IMAGEBLIT | 2209 | select FB_SYS_IMAGEBLIT |
| @@ -2308,10 +2271,6 @@ config FB_SIMPLE | |||
| 2308 | Configuration re: surface address, size, and format must be provided | 2271 | Configuration re: surface address, size, and format must be provided |
| 2309 | through device tree, or plain old platform data. | 2272 | through device tree, or plain old platform data. |
| 2310 | 2273 | ||
| 2311 | source "drivers/video/fbdev/omap/Kconfig" | ||
| 2312 | source "drivers/video/fbdev/omap2/Kconfig" | ||
| 2313 | source "drivers/video/fbdev/mmp/Kconfig" | ||
| 2314 | |||
| 2315 | config FB_SSD1307 | 2274 | config FB_SSD1307 |
| 2316 | tristate "Solomon SSD1307 framebuffer support" | 2275 | tristate "Solomon SSD1307 framebuffer support" |
| 2317 | depends on FB && I2C | 2276 | depends on FB && I2C |
| @@ -2341,3 +2300,7 @@ config FB_SM712 | |||
| 2341 | This driver is also available as a module. The module will be | 2300 | This driver is also available as a module. The module will be |
| 2342 | called sm712fb. If you want to compile it as a module, say M | 2301 | called sm712fb. If you want to compile it as a module, say M |
| 2343 | here and read <file:Documentation/kbuild/modules.txt>. | 2302 | here and read <file:Documentation/kbuild/modules.txt>. |
| 2303 | |||
| 2304 | source "drivers/video/fbdev/omap/Kconfig" | ||
| 2305 | source "drivers/video/fbdev/omap2/Kconfig" | ||
| 2306 | source "drivers/video/fbdev/mmp/Kconfig" | ||
diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile index 13c900320c2c..846b0c9ea9db 100644 --- a/drivers/video/fbdev/Makefile +++ b/drivers/video/fbdev/Makefile | |||
| @@ -14,7 +14,6 @@ obj-$(CONFIG_FB_WMT_GE_ROPS) += wmt_ge_rops.o | |||
| 14 | obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o | 14 | obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o |
| 15 | obj-$(CONFIG_FB_ARC) += arcfb.o | 15 | obj-$(CONFIG_FB_ARC) += arcfb.o |
| 16 | obj-$(CONFIG_FB_CLPS711X) += clps711x-fb.o | 16 | obj-$(CONFIG_FB_CLPS711X) += clps711x-fb.o |
| 17 | obj-$(CONFIG_FB_CLPS711X_OLD) += clps711xfb.o | ||
| 18 | obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o | 17 | obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o |
| 19 | obj-$(CONFIG_FB_GRVGA) += grvga.o | 18 | obj-$(CONFIG_FB_GRVGA) += grvga.o |
| 20 | obj-$(CONFIG_FB_PM2) += pm2fb.o | 19 | obj-$(CONFIG_FB_PM2) += pm2fb.o |
diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c index 7e87d0d61658..a48741aab240 100644 --- a/drivers/video/fbdev/arcfb.c +++ b/drivers/video/fbdev/arcfb.c | |||
| @@ -419,6 +419,8 @@ static int arcfb_ioctl(struct fb_info *info, | |||
| 419 | schedule(); | 419 | schedule(); |
| 420 | finish_wait(&arcfb_waitq, &wait); | 420 | finish_wait(&arcfb_waitq, &wait); |
| 421 | } | 421 | } |
| 422 | /* fall through */ | ||
| 423 | |||
| 422 | case FBIO_GETCONTROL2: | 424 | case FBIO_GETCONTROL2: |
| 423 | { | 425 | { |
| 424 | unsigned char ctl2; | 426 | unsigned char ctl2; |
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 076d24afbd72..4ed55e6bbb84 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/of.h> | 23 | #include <linux/of.h> |
| 24 | #include <linux/of_device.h> | 24 | #include <linux/of_device.h> |
| 25 | #include <video/of_videomode.h> | ||
| 25 | #include <video/of_display_timing.h> | 26 | #include <video/of_display_timing.h> |
| 26 | #include <linux/regulator/consumer.h> | 27 | #include <linux/regulator/consumer.h> |
| 27 | #include <video/videomode.h> | 28 | #include <video/videomode.h> |
| @@ -1028,11 +1029,11 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) | |||
| 1028 | struct device *dev = &sinfo->pdev->dev; | 1029 | struct device *dev = &sinfo->pdev->dev; |
| 1029 | struct device_node *np =dev->of_node; | 1030 | struct device_node *np =dev->of_node; |
| 1030 | struct device_node *display_np; | 1031 | struct device_node *display_np; |
| 1031 | struct device_node *timings_np; | ||
| 1032 | struct display_timings *timings; | ||
| 1033 | struct atmel_lcdfb_power_ctrl_gpio *og; | 1032 | struct atmel_lcdfb_power_ctrl_gpio *og; |
| 1034 | bool is_gpio_power = false; | 1033 | bool is_gpio_power = false; |
| 1034 | struct fb_videomode fb_vm; | ||
| 1035 | struct gpio_desc *gpiod; | 1035 | struct gpio_desc *gpiod; |
| 1036 | struct videomode vm; | ||
| 1036 | int ret = -ENOENT; | 1037 | int ret = -ENOENT; |
| 1037 | int i; | 1038 | int i; |
| 1038 | 1039 | ||
| @@ -1105,44 +1106,18 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) | |||
| 1105 | pdata->lcdcon_is_backlight = of_property_read_bool(display_np, "atmel,lcdcon-backlight"); | 1106 | pdata->lcdcon_is_backlight = of_property_read_bool(display_np, "atmel,lcdcon-backlight"); |
| 1106 | pdata->lcdcon_pol_negative = of_property_read_bool(display_np, "atmel,lcdcon-backlight-inverted"); | 1107 | pdata->lcdcon_pol_negative = of_property_read_bool(display_np, "atmel,lcdcon-backlight-inverted"); |
| 1107 | 1108 | ||
| 1108 | timings = of_get_display_timings(display_np); | 1109 | ret = of_get_videomode(display_np, &vm, OF_USE_NATIVE_MODE); |
| 1109 | if (!timings) { | 1110 | if (ret) { |
| 1110 | dev_err(dev, "failed to get display timings\n"); | 1111 | dev_err(dev, "failed to get videomode from DT\n"); |
| 1111 | ret = -EINVAL; | ||
| 1112 | goto put_display_node; | 1112 | goto put_display_node; |
| 1113 | } | 1113 | } |
| 1114 | 1114 | ||
| 1115 | timings_np = of_get_child_by_name(display_np, "display-timings"); | 1115 | ret = fb_videomode_from_videomode(&vm, &fb_vm); |
| 1116 | if (!timings_np) { | 1116 | if (ret < 0) |
| 1117 | dev_err(dev, "failed to find display-timings node\n"); | ||
| 1118 | ret = -ENODEV; | ||
| 1119 | goto put_display_node; | 1117 | goto put_display_node; |
| 1120 | } | ||
| 1121 | 1118 | ||
| 1122 | for (i = 0; i < of_get_child_count(timings_np); i++) { | 1119 | fb_add_videomode(&fb_vm, &info->modelist); |
| 1123 | struct videomode vm; | ||
| 1124 | struct fb_videomode fb_vm; | ||
| 1125 | |||
| 1126 | ret = videomode_from_timings(timings, &vm, i); | ||
| 1127 | if (ret < 0) | ||
| 1128 | goto put_timings_node; | ||
| 1129 | ret = fb_videomode_from_videomode(&vm, &fb_vm); | ||
| 1130 | if (ret < 0) | ||
| 1131 | goto put_timings_node; | ||
| 1132 | |||
| 1133 | fb_add_videomode(&fb_vm, &info->modelist); | ||
| 1134 | } | ||
| 1135 | |||
| 1136 | /* | ||
| 1137 | * FIXME: Make sure we are not referencing any fields in display_np | ||
| 1138 | * and timings_np and drop our references to them before returning to | ||
| 1139 | * avoid leaking the nodes on probe deferral and driver unbind. | ||
| 1140 | */ | ||
| 1141 | |||
| 1142 | return 0; | ||
| 1143 | 1120 | ||
| 1144 | put_timings_node: | ||
| 1145 | of_node_put(timings_np); | ||
| 1146 | put_display_node: | 1121 | put_display_node: |
| 1147 | of_node_put(display_np); | 1122 | of_node_put(display_np); |
| 1148 | return ret; | 1123 | return ret; |
diff --git a/drivers/video/fbdev/aty/atyfb.h b/drivers/video/fbdev/aty/atyfb.h index d09bab3bf224..e5a347c58180 100644 --- a/drivers/video/fbdev/aty/atyfb.h +++ b/drivers/video/fbdev/aty/atyfb.h | |||
| @@ -147,6 +147,7 @@ struct atyfb_par { | |||
| 147 | u16 pci_id; | 147 | u16 pci_id; |
| 148 | u32 accel_flags; | 148 | u32 accel_flags; |
| 149 | int blitter_may_be_busy; | 149 | int blitter_may_be_busy; |
| 150 | unsigned fifo_space; | ||
| 150 | int asleep; | 151 | int asleep; |
| 151 | int lock_blank; | 152 | int lock_blank; |
| 152 | unsigned long res_start; | 153 | unsigned long res_start; |
| @@ -346,10 +347,13 @@ extern int aty_init_cursor(struct fb_info *info); | |||
| 346 | * Hardware acceleration | 347 | * Hardware acceleration |
| 347 | */ | 348 | */ |
| 348 | 349 | ||
| 349 | static inline void wait_for_fifo(u16 entries, const struct atyfb_par *par) | 350 | static inline void wait_for_fifo(u16 entries, struct atyfb_par *par) |
| 350 | { | 351 | { |
| 351 | while ((aty_ld_le32(FIFO_STAT, par) & 0xffff) > | 352 | unsigned fifo_space = par->fifo_space; |
| 352 | ((u32) (0x8000 >> entries))); | 353 | while (entries > fifo_space) { |
| 354 | fifo_space = 16 - fls(aty_ld_le32(FIFO_STAT, par) & 0xffff); | ||
| 355 | } | ||
| 356 | par->fifo_space = fifo_space - entries; | ||
| 353 | } | 357 | } |
| 354 | 358 | ||
| 355 | static inline void wait_for_idle(struct atyfb_par *par) | 359 | static inline void wait_for_idle(struct atyfb_par *par) |
| @@ -359,7 +363,7 @@ static inline void wait_for_idle(struct atyfb_par *par) | |||
| 359 | par->blitter_may_be_busy = 0; | 363 | par->blitter_may_be_busy = 0; |
| 360 | } | 364 | } |
| 361 | 365 | ||
| 362 | extern void aty_reset_engine(const struct atyfb_par *par); | 366 | extern void aty_reset_engine(struct atyfb_par *par); |
| 363 | extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info); | 367 | extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info); |
| 364 | 368 | ||
| 365 | void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); | 369 | void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); |
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index 05111e90f168..b6fe103df145 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c | |||
| @@ -1480,24 +1480,28 @@ static int atyfb_set_par(struct fb_info *info) | |||
| 1480 | base = 0x2000; | 1480 | base = 0x2000; |
| 1481 | printk("debug atyfb: Mach64 non-shadow register values:"); | 1481 | printk("debug atyfb: Mach64 non-shadow register values:"); |
| 1482 | for (i = 0; i < 256; i = i+4) { | 1482 | for (i = 0; i < 256; i = i+4) { |
| 1483 | if (i % 16 == 0) | 1483 | if (i % 16 == 0) { |
| 1484 | printk("\ndebug atyfb: 0x%04X: ", base + i); | 1484 | pr_cont("\n"); |
| 1485 | printk(" %08X", aty_ld_le32(i, par)); | 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 | #ifdef CONFIG_FB_ATY_CT | 1491 | #ifdef CONFIG_FB_ATY_CT |
| 1490 | /* PLL registers */ | 1492 | /* PLL registers */ |
| 1491 | base = 0x00; | 1493 | base = 0x00; |
| 1492 | printk("debug atyfb: Mach64 PLL register values:"); | 1494 | printk("debug atyfb: Mach64 PLL register values:"); |
| 1493 | for (i = 0; i < 64; i++) { | 1495 | for (i = 0; i < 64; i++) { |
| 1494 | if (i % 16 == 0) | 1496 | if (i % 16 == 0) { |
| 1495 | printk("\ndebug atyfb: 0x%02X: ", base + i); | 1497 | pr_cont("\n"); |
| 1498 | printk("debug atyfb: 0x%02X: ", base + i); | ||
| 1499 | } | ||
| 1496 | if (i % 4 == 0) | 1500 | if (i % 4 == 0) |
| 1497 | printk(" "); | 1501 | pr_cont(" "); |
| 1498 | printk("%02X", aty_ld_pll_ct(i, par)); | 1502 | pr_cont("%02X", aty_ld_pll_ct(i, par)); |
| 1499 | } | 1503 | } |
| 1500 | printk("\n\n"); | 1504 | pr_cont("\n\n"); |
| 1501 | #endif /* CONFIG_FB_ATY_CT */ | 1505 | #endif /* CONFIG_FB_ATY_CT */ |
| 1502 | 1506 | ||
| 1503 | #ifdef CONFIG_FB_ATY_GENERIC_LCD | 1507 | #ifdef CONFIG_FB_ATY_GENERIC_LCD |
| @@ -1509,19 +1513,19 @@ static int atyfb_set_par(struct fb_info *info) | |||
| 1509 | for (i = 0; i <= POWER_MANAGEMENT; i++) { | 1513 | for (i = 0; i <= POWER_MANAGEMENT; i++) { |
| 1510 | if (i == EXT_VERT_STRETCH) | 1514 | if (i == EXT_VERT_STRETCH) |
| 1511 | continue; | 1515 | continue; |
| 1512 | printk("\ndebug atyfb: 0x%04X: ", | 1516 | pr_cont("\ndebug atyfb: 0x%04X: ", |
| 1513 | lt_lcd_regs[i]); | 1517 | lt_lcd_regs[i]); |
| 1514 | printk(" %08X", aty_ld_lcd(i, par)); | 1518 | pr_cont(" %08X", aty_ld_lcd(i, par)); |
| 1515 | } | 1519 | } |
| 1516 | } else { | 1520 | } else { |
| 1517 | for (i = 0; i < 64; i++) { | 1521 | for (i = 0; i < 64; i++) { |
| 1518 | if (i % 4 == 0) | 1522 | if (i % 4 == 0) |
| 1519 | printk("\ndebug atyfb: 0x%02X: ", | 1523 | pr_cont("\ndebug atyfb: 0x%02X: ", |
| 1520 | base + i); | 1524 | base + i); |
| 1521 | printk(" %08X", aty_ld_lcd(i, par)); | 1525 | pr_cont(" %08X", aty_ld_lcd(i, par)); |
| 1522 | } | 1526 | } |
| 1523 | } | 1527 | } |
| 1524 | printk("\n\n"); | 1528 | pr_cont("\n\n"); |
| 1525 | } | 1529 | } |
| 1526 | #endif /* CONFIG_FB_ATY_GENERIC_LCD */ | 1530 | #endif /* CONFIG_FB_ATY_GENERIC_LCD */ |
| 1527 | } | 1531 | } |
| @@ -2597,8 +2601,8 @@ static int aty_init(struct fb_info *info) | |||
| 2597 | aty_ld_le32(DSP_ON_OFF, par), | 2601 | aty_ld_le32(DSP_ON_OFF, par), |
| 2598 | aty_ld_le32(CLOCK_CNTL, par)); | 2602 | aty_ld_le32(CLOCK_CNTL, par)); |
| 2599 | for (i = 0; i < 40; i++) | 2603 | for (i = 0; i < 40; i++) |
| 2600 | printk(" %02x", aty_ld_pll_ct(i, par)); | 2604 | pr_cont(" %02x", aty_ld_pll_ct(i, par)); |
| 2601 | printk("\n"); | 2605 | pr_cont("\n"); |
| 2602 | } | 2606 | } |
| 2603 | #endif | 2607 | #endif |
| 2604 | if (par->pll_ops->init_pll) | 2608 | if (par->pll_ops->init_pll) |
diff --git a/drivers/video/fbdev/aty/mach64_accel.c b/drivers/video/fbdev/aty/mach64_accel.c index 2541a0e0de76..e4b2c89baee2 100644 --- a/drivers/video/fbdev/aty/mach64_accel.c +++ b/drivers/video/fbdev/aty/mach64_accel.c | |||
| @@ -37,7 +37,7 @@ static u32 rotation24bpp(u32 dx, u32 direction) | |||
| 37 | return ((rotation << 8) | DST_24_ROTATION_ENABLE); | 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 | /* reset engine */ | 42 | /* reset engine */ |
| 43 | aty_st_le32(GEN_TEST_CNTL, | 43 | aty_st_le32(GEN_TEST_CNTL, |
| @@ -50,6 +50,8 @@ void aty_reset_engine(const struct atyfb_par *par) | |||
| 50 | /* HOST errors */ | 50 | /* HOST errors */ |
| 51 | aty_st_le32(BUS_CNTL, | 51 | aty_st_le32(BUS_CNTL, |
| 52 | aty_ld_le32(BUS_CNTL, par) | BUS_HOST_ERR_ACK | BUS_FIFO_ERR_ACK, par); | 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 | static void reset_GTC_3D_engine(const struct atyfb_par *par) | 57 | static void reset_GTC_3D_engine(const struct atyfb_par *par) |
| @@ -127,7 +129,7 @@ void aty_init_engine(struct atyfb_par *par, struct fb_info *info) | |||
| 127 | 129 | ||
| 128 | /* set host attributes */ | 130 | /* set host attributes */ |
| 129 | wait_for_fifo(13, par); | 131 | wait_for_fifo(13, par); |
| 130 | aty_st_le32(HOST_CNTL, 0, par); | 132 | aty_st_le32(HOST_CNTL, HOST_BYTE_ALIGN, par); |
| 131 | 133 | ||
| 132 | /* set pattern attributes */ | 134 | /* set pattern attributes */ |
| 133 | aty_st_le32(PAT_REG0, 0, par); | 135 | aty_st_le32(PAT_REG0, 0, par); |
| @@ -233,7 +235,8 @@ void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) | |||
| 233 | rotation = rotation24bpp(dx, direction); | 235 | rotation = rotation24bpp(dx, direction); |
| 234 | } | 236 | } |
| 235 | 237 | ||
| 236 | wait_for_fifo(4, par); | 238 | wait_for_fifo(5, par); |
| 239 | aty_st_le32(DP_PIX_WIDTH, par->crtc.dp_pix_width, par); | ||
| 237 | aty_st_le32(DP_SRC, FRGD_SRC_BLIT, par); | 240 | aty_st_le32(DP_SRC, FRGD_SRC_BLIT, par); |
| 238 | aty_st_le32(SRC_Y_X, (sx << 16) | sy, par); | 241 | aty_st_le32(SRC_Y_X, (sx << 16) | sy, par); |
| 239 | aty_st_le32(SRC_HEIGHT1_WIDTH1, (width << 16) | area->height, par); | 242 | aty_st_le32(SRC_HEIGHT1_WIDTH1, (width << 16) | area->height, par); |
| @@ -269,7 +272,8 @@ void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) | |||
| 269 | rotation = rotation24bpp(dx, DST_X_LEFT_TO_RIGHT); | 272 | rotation = rotation24bpp(dx, DST_X_LEFT_TO_RIGHT); |
| 270 | } | 273 | } |
| 271 | 274 | ||
| 272 | wait_for_fifo(3, par); | 275 | wait_for_fifo(4, par); |
| 276 | aty_st_le32(DP_PIX_WIDTH, par->crtc.dp_pix_width, par); | ||
| 273 | aty_st_le32(DP_FRGD_CLR, color, par); | 277 | aty_st_le32(DP_FRGD_CLR, color, par); |
| 274 | aty_st_le32(DP_SRC, | 278 | aty_st_le32(DP_SRC, |
| 275 | BKGD_SRC_BKGD_CLR | FRGD_SRC_FRGD_CLR | MONO_SRC_ONE, | 279 | BKGD_SRC_BKGD_CLR | FRGD_SRC_FRGD_CLR | MONO_SRC_ONE, |
| @@ -284,7 +288,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
| 284 | { | 288 | { |
| 285 | struct atyfb_par *par = (struct atyfb_par *) info->par; | 289 | struct atyfb_par *par = (struct atyfb_par *) info->par; |
| 286 | u32 src_bytes, dx = image->dx, dy = image->dy, width = image->width; | 290 | u32 src_bytes, dx = image->dx, dy = image->dy, width = image->width; |
| 287 | u32 pix_width_save, pix_width, host_cntl, rotation = 0, src, mix; | 291 | u32 pix_width, rotation = 0, src, mix; |
| 288 | 292 | ||
| 289 | if (par->asleep) | 293 | if (par->asleep) |
| 290 | return; | 294 | return; |
| @@ -296,8 +300,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
| 296 | return; | 300 | return; |
| 297 | } | 301 | } |
| 298 | 302 | ||
| 299 | pix_width = pix_width_save = aty_ld_le32(DP_PIX_WIDTH, par); | 303 | pix_width = par->crtc.dp_pix_width; |
| 300 | host_cntl = aty_ld_le32(HOST_CNTL, par) | HOST_BYTE_ALIGN; | ||
| 301 | 304 | ||
| 302 | switch (image->depth) { | 305 | switch (image->depth) { |
| 303 | case 1: | 306 | case 1: |
| @@ -345,7 +348,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
| 345 | * since Rage 3D IIc we have DP_HOST_TRIPLE_EN bit | 348 | * since Rage 3D IIc we have DP_HOST_TRIPLE_EN bit |
| 346 | * this hwaccelerated triple has an issue with not aligned data | 349 | * this hwaccelerated triple has an issue with not aligned data |
| 347 | */ | 350 | */ |
| 348 | if (M64_HAS(HW_TRIPLE) && image->width % 8 == 0) | 351 | if (image->depth == 1 && M64_HAS(HW_TRIPLE) && image->width % 8 == 0) |
| 349 | pix_width |= DP_HOST_TRIPLE_EN; | 352 | pix_width |= DP_HOST_TRIPLE_EN; |
| 350 | } | 353 | } |
| 351 | 354 | ||
| @@ -370,19 +373,18 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
| 370 | mix = FRGD_MIX_D_XOR_S | BKGD_MIX_D; | 373 | mix = FRGD_MIX_D_XOR_S | BKGD_MIX_D; |
| 371 | } | 374 | } |
| 372 | 375 | ||
| 373 | wait_for_fifo(6, par); | 376 | wait_for_fifo(5, par); |
| 374 | aty_st_le32(DP_WRITE_MASK, 0xFFFFFFFF, par); | ||
| 375 | aty_st_le32(DP_PIX_WIDTH, pix_width, par); | 377 | aty_st_le32(DP_PIX_WIDTH, pix_width, par); |
| 376 | aty_st_le32(DP_MIX, mix, par); | 378 | aty_st_le32(DP_MIX, mix, par); |
| 377 | aty_st_le32(DP_SRC, src, par); | 379 | aty_st_le32(DP_SRC, src, par); |
| 378 | aty_st_le32(HOST_CNTL, host_cntl, par); | 380 | aty_st_le32(HOST_CNTL, HOST_BYTE_ALIGN, par); |
| 379 | aty_st_le32(DST_CNTL, DST_Y_TOP_TO_BOTTOM | DST_X_LEFT_TO_RIGHT | rotation, par); | 381 | aty_st_le32(DST_CNTL, DST_Y_TOP_TO_BOTTOM | DST_X_LEFT_TO_RIGHT | rotation, par); |
| 380 | 382 | ||
| 381 | draw_rect(dx, dy, width, image->height, par); | 383 | draw_rect(dx, dy, width, image->height, par); |
| 382 | src_bytes = (((image->width * image->depth) + 7) / 8) * image->height; | 384 | src_bytes = (((image->width * image->depth) + 7) / 8) * image->height; |
| 383 | 385 | ||
| 384 | /* manual triple each pixel */ | 386 | /* manual triple each pixel */ |
| 385 | if (info->var.bits_per_pixel == 24 && !(pix_width & DP_HOST_TRIPLE_EN)) { | 387 | if (image->depth == 1 && info->var.bits_per_pixel == 24 && !(pix_width & DP_HOST_TRIPLE_EN)) { |
| 386 | int inbit, outbit, mult24, byte_id_in_dword, width; | 388 | int inbit, outbit, mult24, byte_id_in_dword, width; |
| 387 | u8 *pbitmapin = (u8*)image->data, *pbitmapout; | 389 | u8 *pbitmapin = (u8*)image->data, *pbitmapout; |
| 388 | u32 hostdword; | 390 | u32 hostdword; |
| @@ -415,7 +417,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
| 415 | } | 417 | } |
| 416 | } | 418 | } |
| 417 | wait_for_fifo(1, par); | 419 | wait_for_fifo(1, par); |
| 418 | aty_st_le32(HOST_DATA0, hostdword, par); | 420 | aty_st_le32(HOST_DATA0, le32_to_cpu(hostdword), par); |
| 419 | } | 421 | } |
| 420 | } else { | 422 | } else { |
| 421 | u32 *pbitmap, dwords = (src_bytes + 3) / 4; | 423 | u32 *pbitmap, dwords = (src_bytes + 3) / 4; |
| @@ -424,8 +426,4 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
| 424 | aty_st_le32(HOST_DATA0, get_unaligned_le32(pbitmap), par); | 426 | aty_st_le32(HOST_DATA0, get_unaligned_le32(pbitmap), par); |
| 425 | } | 427 | } |
| 426 | } | 428 | } |
| 427 | |||
| 428 | /* restore pix_width */ | ||
| 429 | wait_for_fifo(1, par); | ||
| 430 | aty_st_le32(DP_PIX_WIDTH, pix_width_save, par); | ||
| 431 | } | 429 | } |
diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c index 8de88b129b62..9af54c2368fd 100644 --- a/drivers/video/fbdev/cg14.c +++ b/drivers/video/fbdev/cg14.c | |||
| @@ -355,9 +355,7 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | |||
| 355 | static void cg14_init_fix(struct fb_info *info, int linebytes, | 355 | static void cg14_init_fix(struct fb_info *info, int linebytes, |
| 356 | struct device_node *dp) | 356 | struct device_node *dp) |
| 357 | { | 357 | { |
| 358 | const char *name = dp->name; | 358 | snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); |
| 359 | |||
| 360 | strlcpy(info->fix.id, name, sizeof(info->fix.id)); | ||
| 361 | 359 | ||
| 362 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 360 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 363 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 361 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c index 6c334260cf53..1bd95b02f3aa 100644 --- a/drivers/video/fbdev/cg3.c +++ b/drivers/video/fbdev/cg3.c | |||
| @@ -246,7 +246,7 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | |||
| 246 | static void cg3_init_fix(struct fb_info *info, int linebytes, | 246 | static void cg3_init_fix(struct fb_info *info, int linebytes, |
| 247 | struct device_node *dp) | 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 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 251 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 252 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 252 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
diff --git a/drivers/video/fbdev/clps711xfb.c b/drivers/video/fbdev/clps711xfb.c deleted file mode 100644 index 7693aea8fb23..000000000000 --- a/drivers/video/fbdev/clps711xfb.c +++ /dev/null | |||
| @@ -1,314 +0,0 @@ | |||
| 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"); | ||
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c index 852d86c1c527..dd3128990776 100644 --- a/drivers/video/fbdev/core/fbmon.c +++ b/drivers/video/fbdev/core/fbmon.c | |||
| @@ -1480,8 +1480,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb, | |||
| 1480 | if (ret) | 1480 | if (ret) |
| 1481 | return ret; | 1481 | return ret; |
| 1482 | 1482 | ||
| 1483 | pr_debug("%pOF: got %dx%d display mode from %s\n", | 1483 | pr_debug("%pOF: got %dx%d display mode\n", |
| 1484 | np, vm.hactive, vm.vactive, np->name); | 1484 | np, vm.hactive, vm.vactive); |
| 1485 | dump_fb_videomode(fb); | 1485 | dump_fb_videomode(fb); |
| 1486 | 1486 | ||
| 1487 | return 0; | 1487 | return 0; |
diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c index ecdcf358ad5e..901ca4ed10e9 100644 --- a/drivers/video/fbdev/imsttfb.c +++ b/drivers/video/fbdev/imsttfb.c | |||
| @@ -1473,7 +1473,7 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 1473 | 1473 | ||
| 1474 | dp = pci_device_to_OF_node(pdev); | 1474 | dp = pci_device_to_OF_node(pdev); |
| 1475 | if(dp) | 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 | else if (IS_ENABLED(CONFIG_OF)) | 1477 | else if (IS_ENABLED(CONFIG_OF)) |
| 1478 | printk(KERN_ERR "imsttfb: no OF node for pci device\n"); | 1478 | printk(KERN_ERR "imsttfb: no OF node for pci device\n"); |
| 1479 | 1479 | ||
diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c index 71862188f528..446ac3364bad 100644 --- a/drivers/video/fbdev/leo.c +++ b/drivers/video/fbdev/leo.c | |||
| @@ -434,7 +434,7 @@ static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | |||
| 434 | static void | 434 | static void |
| 435 | leo_init_fix(struct fb_info *info, struct device_node *dp) | 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 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 439 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 440 | info->fix.visual = FB_VISUAL_TRUECOLOR; | 440 | info->fix.visual = FB_VISUAL_TRUECOLOR; |
diff --git a/drivers/video/fbdev/mmp/hw/Kconfig b/drivers/video/fbdev/mmp/hw/Kconfig index c735d133895c..fcb711143fb2 100644 --- a/drivers/video/fbdev/mmp/hw/Kconfig +++ b/drivers/video/fbdev/mmp/hw/Kconfig | |||
| @@ -3,7 +3,6 @@ if MMP_DISP | |||
| 3 | config MMP_DISP_CONTROLLER | 3 | config MMP_DISP_CONTROLLER |
| 4 | bool "mmp display controller hw support" | 4 | bool "mmp display controller hw support" |
| 5 | depends on CPU_PXA910 || CPU_MMP2 | 5 | depends on CPU_PXA910 || CPU_MMP2 |
| 6 | default n | ||
| 7 | help | 6 | help |
| 8 | Marvell MMP display hw controller support | 7 | Marvell MMP display hw controller support |
| 9 | this controller is used on Marvell PXA910 and | 8 | this controller is used on Marvell PXA910 and |
diff --git a/drivers/video/fbdev/mmp/panel/Kconfig b/drivers/video/fbdev/mmp/panel/Kconfig index 808890f7064b..f58558795f39 100644 --- a/drivers/video/fbdev/mmp/panel/Kconfig +++ b/drivers/video/fbdev/mmp/panel/Kconfig | |||
| @@ -2,6 +2,5 @@ | |||
| 2 | config MMP_PANEL_TPOHVGA | 2 | config MMP_PANEL_TPOHVGA |
| 3 | bool "tpohvga panel TJ032MD01BW support" | 3 | bool "tpohvga panel TJ032MD01BW support" |
| 4 | depends on SPI_MASTER | 4 | depends on SPI_MASTER |
| 5 | default n | ||
| 6 | help | 5 | help |
| 7 | tpohvga panel support | 6 | tpohvga panel support |
diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index 77c0a2f45b3b..31f769d67195 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c | |||
| @@ -419,9 +419,13 @@ static void __init offb_init_fb(const char *name, | |||
| 419 | var = &info->var; | 419 | var = &info->var; |
| 420 | info->par = par; | 420 | info->par = par; |
| 421 | 421 | ||
| 422 | strcpy(fix->id, "OFfb "); | 422 | if (name) { |
| 423 | strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); | 423 | strcpy(fix->id, "OFfb "); |
| 424 | fix->id[sizeof(fix->id) - 1] = '\0'; | 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 | var->xres = var->xres_virtual = width; | 430 | var->xres = var->xres_virtual = width; |
| 427 | var->yres = var->yres_virtual = height; | 431 | var->yres = var->yres_virtual = height; |
| @@ -644,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node) | |||
| 644 | /* kludge for valkyrie */ | 648 | /* kludge for valkyrie */ |
| 645 | if (strcmp(dp->name, "valkyrie") == 0) | 649 | if (strcmp(dp->name, "valkyrie") == 0) |
| 646 | address += 0x1000; | 650 | address += 0x1000; |
| 647 | offb_init_fb(no_real_node ? "bootx" : dp->name, | 651 | offb_init_fb(no_real_node ? "bootx" : NULL, |
| 648 | width, height, depth, pitch, address, | 652 | width, height, depth, pitch, address, |
| 649 | foreign_endian, no_real_node ? NULL : dp); | 653 | foreign_endian, no_real_node ? NULL : dp); |
| 650 | } | 654 | } |
diff --git a/drivers/video/fbdev/omap/lcd_ams_delta.c b/drivers/video/fbdev/omap/lcd_ams_delta.c index e8c748a0dfe2..cddbd00cbf9f 100644 --- a/drivers/video/fbdev/omap/lcd_ams_delta.c +++ b/drivers/video/fbdev/omap/lcd_ams_delta.c | |||
| @@ -24,11 +24,10 @@ | |||
| 24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
| 26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
| 27 | #include <linux/gpio/consumer.h> | ||
| 27 | #include <linux/lcd.h> | 28 | #include <linux/lcd.h> |
| 28 | #include <linux/gpio.h> | ||
| 29 | 29 | ||
| 30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
| 31 | #include <mach/board-ams-delta.h> | ||
| 32 | 31 | ||
| 33 | #include "omapfb.h" | 32 | #include "omapfb.h" |
| 34 | 33 | ||
| @@ -41,6 +40,8 @@ | |||
| 41 | /* LCD class device section */ | 40 | /* LCD class device section */ |
| 42 | 41 | ||
| 43 | static int ams_delta_lcd; | 42 | static int ams_delta_lcd; |
| 43 | static struct gpio_desc *gpiod_vblen; | ||
| 44 | static struct gpio_desc *gpiod_ndisp; | ||
| 44 | 45 | ||
| 45 | static int ams_delta_lcd_set_power(struct lcd_device *dev, int power) | 46 | static int ams_delta_lcd_set_power(struct lcd_device *dev, int power) |
| 46 | { | 47 | { |
| @@ -99,41 +100,17 @@ static struct lcd_ops ams_delta_lcd_ops = { | |||
| 99 | 100 | ||
| 100 | /* omapfb panel section */ | 101 | /* omapfb panel section */ |
| 101 | 102 | ||
| 102 | static const struct gpio _gpios[] = { | ||
| 103 | { | ||
| 104 | .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN, | ||
| 105 | .flags = GPIOF_OUT_INIT_LOW, | ||
| 106 | .label = "lcd_vblen", | ||
| 107 | }, | ||
| 108 | { | ||
| 109 | .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP, | ||
| 110 | .flags = GPIOF_OUT_INIT_LOW, | ||
| 111 | .label = "lcd_ndisp", | ||
| 112 | }, | ||
| 113 | }; | ||
| 114 | |||
| 115 | static int ams_delta_panel_init(struct lcd_panel *panel, | ||
| 116 | struct omapfb_device *fbdev) | ||
| 117 | { | ||
| 118 | return gpio_request_array(_gpios, ARRAY_SIZE(_gpios)); | ||
| 119 | } | ||
| 120 | |||
| 121 | static void ams_delta_panel_cleanup(struct lcd_panel *panel) | ||
| 122 | { | ||
| 123 | gpio_free_array(_gpios, ARRAY_SIZE(_gpios)); | ||
| 124 | } | ||
| 125 | |||
| 126 | static int ams_delta_panel_enable(struct lcd_panel *panel) | 103 | static int ams_delta_panel_enable(struct lcd_panel *panel) |
| 127 | { | 104 | { |
| 128 | gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 1); | 105 | gpiod_set_value(gpiod_ndisp, 1); |
| 129 | gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 1); | 106 | gpiod_set_value(gpiod_vblen, 1); |
| 130 | return 0; | 107 | return 0; |
| 131 | } | 108 | } |
| 132 | 109 | ||
| 133 | static void ams_delta_panel_disable(struct lcd_panel *panel) | 110 | static void ams_delta_panel_disable(struct lcd_panel *panel) |
| 134 | { | 111 | { |
| 135 | gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 0); | 112 | gpiod_set_value(gpiod_vblen, 0); |
| 136 | gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0); | 113 | gpiod_set_value(gpiod_ndisp, 0); |
| 137 | } | 114 | } |
| 138 | 115 | ||
| 139 | static struct lcd_panel ams_delta_panel = { | 116 | static struct lcd_panel ams_delta_panel = { |
| @@ -154,8 +131,6 @@ static struct lcd_panel ams_delta_panel = { | |||
| 154 | .pcd = 0, | 131 | .pcd = 0, |
| 155 | .acb = 37, | 132 | .acb = 37, |
| 156 | 133 | ||
| 157 | .init = ams_delta_panel_init, | ||
| 158 | .cleanup = ams_delta_panel_cleanup, | ||
| 159 | .enable = ams_delta_panel_enable, | 134 | .enable = ams_delta_panel_enable, |
| 160 | .disable = ams_delta_panel_disable, | 135 | .disable = ams_delta_panel_disable, |
| 161 | }; | 136 | }; |
| @@ -166,9 +141,23 @@ static struct lcd_panel ams_delta_panel = { | |||
| 166 | static int ams_delta_panel_probe(struct platform_device *pdev) | 141 | static int ams_delta_panel_probe(struct platform_device *pdev) |
| 167 | { | 142 | { |
| 168 | struct lcd_device *lcd_device = NULL; | 143 | struct lcd_device *lcd_device = NULL; |
| 169 | #ifdef CONFIG_LCD_CLASS_DEVICE | ||
| 170 | int ret; | 144 | int ret; |
| 171 | 145 | ||
| 146 | gpiod_vblen = devm_gpiod_get(&pdev->dev, "vblen", GPIOD_OUT_LOW); | ||
| 147 | if (IS_ERR(gpiod_vblen)) { | ||
| 148 | ret = PTR_ERR(gpiod_vblen); | ||
| 149 | dev_err(&pdev->dev, "VBLEN GPIO request failed (%d)\n", ret); | ||
| 150 | return ret; | ||
| 151 | } | ||
| 152 | |||
| 153 | gpiod_ndisp = devm_gpiod_get(&pdev->dev, "ndisp", GPIOD_OUT_LOW); | ||
| 154 | if (IS_ERR(gpiod_ndisp)) { | ||
| 155 | ret = PTR_ERR(gpiod_ndisp); | ||
| 156 | dev_err(&pdev->dev, "NDISP GPIO request failed (%d)\n", ret); | ||
| 157 | return ret; | ||
| 158 | } | ||
| 159 | |||
| 160 | #ifdef CONFIG_LCD_CLASS_DEVICE | ||
| 172 | lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL, | 161 | lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL, |
| 173 | &ams_delta_lcd_ops); | 162 | &ams_delta_lcd_ops); |
| 174 | 163 | ||
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/Kconfig b/drivers/video/fbdev/omap2/omapfb/dss/Kconfig index 6d0bb27e4f85..356b89b378d4 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/Kconfig +++ b/drivers/video/fbdev/omap2/omapfb/dss/Kconfig | |||
| @@ -10,7 +10,6 @@ config FB_OMAP2_DSS | |||
| 10 | 10 | ||
| 11 | config FB_OMAP2_DSS_DEBUG | 11 | config FB_OMAP2_DSS_DEBUG |
| 12 | bool "Debug support" | 12 | bool "Debug support" |
| 13 | default n | ||
| 14 | help | 13 | help |
| 15 | This enables printing of debug messages. Alternatively, debug messages | 14 | This enables printing of debug messages. Alternatively, debug messages |
| 16 | can also be enabled by setting CONFIG_DYNAMIC_DEBUG and then setting | 15 | can also be enabled by setting CONFIG_DYNAMIC_DEBUG and then setting |
| @@ -19,7 +18,6 @@ config FB_OMAP2_DSS_DEBUG | |||
| 19 | config FB_OMAP2_DSS_DEBUGFS | 18 | config FB_OMAP2_DSS_DEBUGFS |
| 20 | bool "Debugfs filesystem support" | 19 | bool "Debugfs filesystem support" |
| 21 | depends on DEBUG_FS | 20 | depends on DEBUG_FS |
| 22 | default n | ||
| 23 | help | 21 | help |
| 24 | This enables debugfs for OMAPDSS at <debugfs>/omapdss. This enables | 22 | This enables debugfs for OMAPDSS at <debugfs>/omapdss. This enables |
| 25 | querying about clock configuration and register configuration of dss, | 23 | querying about clock configuration and register configuration of dss, |
| @@ -28,7 +26,6 @@ config FB_OMAP2_DSS_DEBUGFS | |||
| 28 | config FB_OMAP2_DSS_COLLECT_IRQ_STATS | 26 | config FB_OMAP2_DSS_COLLECT_IRQ_STATS |
| 29 | bool "Collect DSS IRQ statistics" | 27 | bool "Collect DSS IRQ statistics" |
| 30 | depends on FB_OMAP2_DSS_DEBUGFS | 28 | depends on FB_OMAP2_DSS_DEBUGFS |
| 31 | default n | ||
| 32 | help | 29 | help |
| 33 | Collect DSS IRQ statistics, printable via debugfs. | 30 | Collect DSS IRQ statistics, printable via debugfs. |
| 34 | 31 | ||
| @@ -45,7 +42,6 @@ config FB_OMAP2_DSS_DPI | |||
| 45 | config FB_OMAP2_DSS_RFBI | 42 | config FB_OMAP2_DSS_RFBI |
| 46 | bool "RFBI support" | 43 | bool "RFBI support" |
| 47 | depends on BROKEN | 44 | depends on BROKEN |
| 48 | default n | ||
| 49 | help | 45 | help |
| 50 | MIPI DBI support (RFBI, Remote Framebuffer Interface, in Texas | 46 | MIPI DBI support (RFBI, Remote Framebuffer Interface, in Texas |
| 51 | Instrument's terminology). | 47 | Instrument's terminology). |
| @@ -73,7 +69,6 @@ config FB_OMAP4_DSS_HDMI | |||
| 73 | 69 | ||
| 74 | config FB_OMAP5_DSS_HDMI | 70 | config FB_OMAP5_DSS_HDMI |
| 75 | bool "HDMI support for OMAP5" | 71 | bool "HDMI support for OMAP5" |
| 76 | default n | ||
| 77 | select FB_OMAP2_DSS_HDMI_COMMON | 72 | select FB_OMAP2_DSS_HDMI_COMMON |
| 78 | help | 73 | help |
| 79 | HDMI Interface for OMAP5 and similar cores. This adds the High | 74 | HDMI Interface for OMAP5 and similar cores. This adds the High |
| @@ -82,7 +77,6 @@ config FB_OMAP5_DSS_HDMI | |||
| 82 | 77 | ||
| 83 | config FB_OMAP2_DSS_SDI | 78 | config FB_OMAP2_DSS_SDI |
| 84 | bool "SDI support" | 79 | bool "SDI support" |
| 85 | default n | ||
| 86 | help | 80 | help |
| 87 | SDI (Serial Display Interface) support. | 81 | SDI (Serial Display Interface) support. |
| 88 | 82 | ||
| @@ -91,7 +85,6 @@ config FB_OMAP2_DSS_SDI | |||
| 91 | 85 | ||
| 92 | config FB_OMAP2_DSS_DSI | 86 | config FB_OMAP2_DSS_DSI |
| 93 | bool "DSI support" | 87 | bool "DSI support" |
| 94 | default n | ||
| 95 | help | 88 | help |
| 96 | MIPI DSI (Display Serial Interface) support. | 89 | MIPI DSI (Display Serial Interface) support. |
| 97 | 90 | ||
diff --git a/drivers/video/fbdev/p9100.c b/drivers/video/fbdev/p9100.c index 64de5cda541d..c4283e9e95af 100644 --- a/drivers/video/fbdev/p9100.c +++ b/drivers/video/fbdev/p9100.c | |||
| @@ -239,7 +239,7 @@ static int p9100_ioctl(struct fb_info *info, unsigned int cmd, | |||
| 239 | 239 | ||
| 240 | static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) | 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 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 244 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 245 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 245 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c index d059d04c63ac..e31340fad3c7 100644 --- a/drivers/video/fbdev/pxa168fb.c +++ b/drivers/video/fbdev/pxa168fb.c | |||
| @@ -405,9 +405,6 @@ static int pxa168fb_set_par(struct fb_info *info) | |||
| 405 | struct fb_var_screeninfo *var = &info->var; | 405 | struct fb_var_screeninfo *var = &info->var; |
| 406 | struct fb_videomode mode; | 406 | struct fb_videomode mode; |
| 407 | u32 x; | 407 | u32 x; |
| 408 | struct pxa168fb_mach_info *mi; | ||
| 409 | |||
| 410 | mi = dev_get_platdata(fbi->dev); | ||
| 411 | 408 | ||
| 412 | /* | 409 | /* |
| 413 | * Set additional mode info. | 410 | * Set additional mode info. |
diff --git a/drivers/video/fbdev/sbuslib.c b/drivers/video/fbdev/sbuslib.c index a436d44f1b7f..01a7110e61a7 100644 --- a/drivers/video/fbdev/sbuslib.c +++ b/drivers/video/fbdev/sbuslib.c | |||
| @@ -106,11 +106,11 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, | |||
| 106 | struct fbtype __user *f = (struct fbtype __user *) arg; | 106 | struct fbtype __user *f = (struct fbtype __user *) arg; |
| 107 | 107 | ||
| 108 | if (put_user(type, &f->fb_type) || | 108 | if (put_user(type, &f->fb_type) || |
| 109 | __put_user(info->var.yres, &f->fb_height) || | 109 | put_user(info->var.yres, &f->fb_height) || |
| 110 | __put_user(info->var.xres, &f->fb_width) || | 110 | put_user(info->var.xres, &f->fb_width) || |
| 111 | __put_user(fb_depth, &f->fb_depth) || | 111 | put_user(fb_depth, &f->fb_depth) || |
| 112 | __put_user(0, &f->fb_cmsize) || | 112 | put_user(0, &f->fb_cmsize) || |
| 113 | __put_user(fb_size, &f->fb_cmsize)) | 113 | put_user(fb_size, &f->fb_cmsize)) |
| 114 | return -EFAULT; | 114 | return -EFAULT; |
| 115 | return 0; | 115 | return 0; |
| 116 | } | 116 | } |
| @@ -125,10 +125,10 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, | |||
| 125 | unsigned int index, count, i; | 125 | unsigned int index, count, i; |
| 126 | 126 | ||
| 127 | if (get_user(index, &c->index) || | 127 | if (get_user(index, &c->index) || |
| 128 | __get_user(count, &c->count) || | 128 | get_user(count, &c->count) || |
| 129 | __get_user(ured, &c->red) || | 129 | get_user(ured, &c->red) || |
| 130 | __get_user(ugreen, &c->green) || | 130 | get_user(ugreen, &c->green) || |
| 131 | __get_user(ublue, &c->blue)) | 131 | get_user(ublue, &c->blue)) |
| 132 | return -EFAULT; | 132 | return -EFAULT; |
| 133 | 133 | ||
| 134 | cmap.len = 1; | 134 | cmap.len = 1; |
| @@ -165,13 +165,13 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, | |||
| 165 | u8 red, green, blue; | 165 | u8 red, green, blue; |
| 166 | 166 | ||
| 167 | if (get_user(index, &c->index) || | 167 | if (get_user(index, &c->index) || |
| 168 | __get_user(count, &c->count) || | 168 | get_user(count, &c->count) || |
| 169 | __get_user(ured, &c->red) || | 169 | get_user(ured, &c->red) || |
| 170 | __get_user(ugreen, &c->green) || | 170 | get_user(ugreen, &c->green) || |
| 171 | __get_user(ublue, &c->blue)) | 171 | get_user(ublue, &c->blue)) |
| 172 | return -EFAULT; | 172 | return -EFAULT; |
| 173 | 173 | ||
| 174 | if (index + count > cmap->len) | 174 | if (index > cmap->len || count > cmap->len - index) |
| 175 | return -EINVAL; | 175 | return -EINVAL; |
| 176 | 176 | ||
| 177 | for (i = 0; i < count; i++) { | 177 | for (i = 0; i < count; i++) { |
diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c index 27a2b72e50e8..a8fb41f1a258 100644 --- a/drivers/video/fbdev/sis/init301.c +++ b/drivers/video/fbdev/sis/init301.c | |||
| @@ -848,9 +848,7 @@ SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime) | |||
| 848 | SiS_DDC2Delay(SiS_Pr, 0x4000); | 848 | SiS_DDC2Delay(SiS_Pr, 0x4000); |
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* || | 851 | } else if (SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* 315 series, LVDS; Special */ |
| 852 | (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || | ||
| 853 | (SiS_Pr->SiS_CustomT == CUT_CLEVO1400) */ ) { /* 315 series, LVDS; Special */ | ||
| 854 | 852 | ||
| 855 | if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { | 853 | if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { |
| 856 | PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); | 854 | PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); |
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 6439231f2db2..4061a20cfe24 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c | |||
| @@ -667,9 +667,9 @@ static int ssd1307fb_probe(struct i2c_client *client, | |||
| 667 | 667 | ||
| 668 | if (par->reset) { | 668 | if (par->reset) { |
| 669 | /* Reset the screen */ | 669 | /* Reset the screen */ |
| 670 | gpiod_set_value(par->reset, 0); | 670 | gpiod_set_value_cansleep(par->reset, 0); |
| 671 | udelay(4); | 671 | udelay(4); |
| 672 | gpiod_set_value(par->reset, 1); | 672 | gpiod_set_value_cansleep(par->reset, 1); |
| 673 | udelay(4); | 673 | udelay(4); |
| 674 | } | 674 | } |
| 675 | 675 | ||
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index afbd6101c78e..070026a7e55a 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c | |||
| @@ -916,8 +916,6 @@ static int dlfb_ops_open(struct fb_info *info, int user) | |||
| 916 | 916 | ||
| 917 | dlfb->fb_count++; | 917 | dlfb->fb_count++; |
| 918 | 918 | ||
| 919 | kref_get(&dlfb->kref); | ||
| 920 | |||
| 921 | if (fb_defio && (info->fbdefio == NULL)) { | 919 | if (fb_defio && (info->fbdefio == NULL)) { |
| 922 | /* enable defio at last moment if not disabled by client */ | 920 | /* enable defio at last moment if not disabled by client */ |
| 923 | 921 | ||
| @@ -940,14 +938,17 @@ static int dlfb_ops_open(struct fb_info *info, int user) | |||
| 940 | return 0; | 938 | return 0; |
| 941 | } | 939 | } |
| 942 | 940 | ||
| 943 | /* | 941 | static void dlfb_ops_destroy(struct fb_info *info) |
| 944 | * Called when all client interfaces to start transactions have been disabled, | ||
| 945 | * and all references to our device instance (dlfb_data) are released. | ||
| 946 | * Every transaction must have a reference, so we know are fully spun down | ||
| 947 | */ | ||
| 948 | static void dlfb_free(struct kref *kref) | ||
| 949 | { | 942 | { |
| 950 | struct dlfb_data *dlfb = container_of(kref, struct dlfb_data, kref); | 943 | struct dlfb_data *dlfb = info->par; |
| 944 | |||
| 945 | if (info->cmap.len != 0) | ||
| 946 | fb_dealloc_cmap(&info->cmap); | ||
| 947 | if (info->monspecs.modedb) | ||
| 948 | fb_destroy_modedb(info->monspecs.modedb); | ||
| 949 | vfree(info->screen_base); | ||
| 950 | |||
| 951 | fb_destroy_modelist(&info->modelist); | ||
| 951 | 952 | ||
| 952 | while (!list_empty(&dlfb->deferred_free)) { | 953 | while (!list_empty(&dlfb->deferred_free)) { |
| 953 | struct dlfb_deferred_free *d = list_entry(dlfb->deferred_free.next, struct dlfb_deferred_free, list); | 954 | struct dlfb_deferred_free *d = list_entry(dlfb->deferred_free.next, struct dlfb_deferred_free, list); |
| @@ -957,40 +958,13 @@ static void dlfb_free(struct kref *kref) | |||
| 957 | } | 958 | } |
| 958 | vfree(dlfb->backing_buffer); | 959 | vfree(dlfb->backing_buffer); |
| 959 | kfree(dlfb->edid); | 960 | kfree(dlfb->edid); |
| 961 | usb_put_dev(dlfb->udev); | ||
| 960 | kfree(dlfb); | 962 | kfree(dlfb); |
| 961 | } | ||
| 962 | |||
| 963 | static void dlfb_free_framebuffer(struct dlfb_data *dlfb) | ||
| 964 | { | ||
| 965 | struct fb_info *info = dlfb->info; | ||
| 966 | |||
| 967 | if (info) { | ||
| 968 | unregister_framebuffer(info); | ||
| 969 | |||
| 970 | if (info->cmap.len != 0) | ||
| 971 | fb_dealloc_cmap(&info->cmap); | ||
| 972 | if (info->monspecs.modedb) | ||
| 973 | fb_destroy_modedb(info->monspecs.modedb); | ||
| 974 | vfree(info->screen_base); | ||
| 975 | |||
| 976 | fb_destroy_modelist(&info->modelist); | ||
| 977 | |||
| 978 | dlfb->info = NULL; | ||
| 979 | |||
| 980 | /* Assume info structure is freed after this point */ | ||
| 981 | framebuffer_release(info); | ||
| 982 | } | ||
| 983 | 963 | ||
| 984 | /* ref taken in probe() as part of registering framebfufer */ | 964 | /* Assume info structure is freed after this point */ |
| 985 | kref_put(&dlfb->kref, dlfb_free); | 965 | framebuffer_release(info); |
| 986 | } | 966 | } |
| 987 | 967 | ||
| 988 | static void dlfb_free_framebuffer_work(struct work_struct *work) | ||
| 989 | { | ||
| 990 | struct dlfb_data *dlfb = container_of(work, struct dlfb_data, | ||
| 991 | free_framebuffer_work.work); | ||
| 992 | dlfb_free_framebuffer(dlfb); | ||
| 993 | } | ||
| 994 | /* | 968 | /* |
| 995 | * Assumes caller is holding info->lock mutex (for open and release at least) | 969 | * Assumes caller is holding info->lock mutex (for open and release at least) |
| 996 | */ | 970 | */ |
| @@ -1000,10 +974,6 @@ static int dlfb_ops_release(struct fb_info *info, int user) | |||
| 1000 | 974 | ||
| 1001 | dlfb->fb_count--; | 975 | dlfb->fb_count--; |
| 1002 | 976 | ||
| 1003 | /* We can't free fb_info here - fbmem will touch it when we return */ | ||
| 1004 | if (dlfb->virtualized && (dlfb->fb_count == 0)) | ||
| 1005 | schedule_delayed_work(&dlfb->free_framebuffer_work, HZ); | ||
| 1006 | |||
| 1007 | if ((dlfb->fb_count == 0) && (info->fbdefio)) { | 977 | if ((dlfb->fb_count == 0) && (info->fbdefio)) { |
| 1008 | fb_deferred_io_cleanup(info); | 978 | fb_deferred_io_cleanup(info); |
| 1009 | kfree(info->fbdefio); | 979 | kfree(info->fbdefio); |
| @@ -1013,8 +983,6 @@ static int dlfb_ops_release(struct fb_info *info, int user) | |||
| 1013 | 983 | ||
| 1014 | dev_dbg(info->dev, "release, user=%d count=%d\n", user, dlfb->fb_count); | 984 | dev_dbg(info->dev, "release, user=%d count=%d\n", user, dlfb->fb_count); |
| 1015 | 985 | ||
| 1016 | kref_put(&dlfb->kref, dlfb_free); | ||
| 1017 | |||
| 1018 | return 0; | 986 | return 0; |
| 1019 | } | 987 | } |
| 1020 | 988 | ||
| @@ -1172,6 +1140,7 @@ static struct fb_ops dlfb_ops = { | |||
| 1172 | .fb_blank = dlfb_ops_blank, | 1140 | .fb_blank = dlfb_ops_blank, |
| 1173 | .fb_check_var = dlfb_ops_check_var, | 1141 | .fb_check_var = dlfb_ops_check_var, |
| 1174 | .fb_set_par = dlfb_ops_set_par, | 1142 | .fb_set_par = dlfb_ops_set_par, |
| 1143 | .fb_destroy = dlfb_ops_destroy, | ||
| 1175 | }; | 1144 | }; |
| 1176 | 1145 | ||
| 1177 | 1146 | ||
| @@ -1615,12 +1584,13 @@ success: | |||
| 1615 | return true; | 1584 | return true; |
| 1616 | } | 1585 | } |
| 1617 | 1586 | ||
| 1618 | static void dlfb_init_framebuffer_work(struct work_struct *work); | ||
| 1619 | |||
| 1620 | static int dlfb_usb_probe(struct usb_interface *intf, | 1587 | static int dlfb_usb_probe(struct usb_interface *intf, |
| 1621 | const struct usb_device_id *id) | 1588 | const struct usb_device_id *id) |
| 1622 | { | 1589 | { |
| 1590 | int i; | ||
| 1591 | const struct device_attribute *attr; | ||
| 1623 | struct dlfb_data *dlfb; | 1592 | struct dlfb_data *dlfb; |
| 1593 | struct fb_info *info; | ||
| 1624 | int retval = -ENOMEM; | 1594 | int retval = -ENOMEM; |
| 1625 | struct usb_device *usbdev = interface_to_usbdev(intf); | 1595 | struct usb_device *usbdev = interface_to_usbdev(intf); |
| 1626 | 1596 | ||
| @@ -1631,10 +1601,9 @@ static int dlfb_usb_probe(struct usb_interface *intf, | |||
| 1631 | goto error; | 1601 | goto error; |
| 1632 | } | 1602 | } |
| 1633 | 1603 | ||
| 1634 | kref_init(&dlfb->kref); /* matching kref_put in usb .disconnect fn */ | ||
| 1635 | INIT_LIST_HEAD(&dlfb->deferred_free); | 1604 | INIT_LIST_HEAD(&dlfb->deferred_free); |
| 1636 | 1605 | ||
| 1637 | dlfb->udev = usbdev; | 1606 | dlfb->udev = usb_get_dev(usbdev); |
| 1638 | usb_set_intfdata(intf, dlfb); | 1607 | usb_set_intfdata(intf, dlfb); |
| 1639 | 1608 | ||
| 1640 | dev_dbg(&intf->dev, "console enable=%d\n", console); | 1609 | dev_dbg(&intf->dev, "console enable=%d\n", console); |
| @@ -1657,42 +1626,6 @@ static int dlfb_usb_probe(struct usb_interface *intf, | |||
| 1657 | } | 1626 | } |
| 1658 | 1627 | ||
| 1659 | 1628 | ||
| 1660 | if (!dlfb_alloc_urb_list(dlfb, WRITES_IN_FLIGHT, MAX_TRANSFER)) { | ||
| 1661 | retval = -ENOMEM; | ||
| 1662 | dev_err(&intf->dev, "unable to allocate urb list\n"); | ||
| 1663 | goto error; | ||
| 1664 | } | ||
| 1665 | |||
| 1666 | kref_get(&dlfb->kref); /* matching kref_put in free_framebuffer_work */ | ||
| 1667 | |||
| 1668 | /* We don't register a new USB class. Our client interface is dlfbev */ | ||
| 1669 | |||
| 1670 | /* Workitem keep things fast & simple during USB enumeration */ | ||
| 1671 | INIT_DELAYED_WORK(&dlfb->init_framebuffer_work, | ||
| 1672 | dlfb_init_framebuffer_work); | ||
| 1673 | schedule_delayed_work(&dlfb->init_framebuffer_work, 0); | ||
| 1674 | |||
| 1675 | return 0; | ||
| 1676 | |||
| 1677 | error: | ||
| 1678 | if (dlfb) { | ||
| 1679 | |||
| 1680 | kref_put(&dlfb->kref, dlfb_free); /* last ref from kref_init */ | ||
| 1681 | |||
| 1682 | /* dev has been deallocated. Do not dereference */ | ||
| 1683 | } | ||
| 1684 | |||
| 1685 | return retval; | ||
| 1686 | } | ||
| 1687 | |||
| 1688 | static void dlfb_init_framebuffer_work(struct work_struct *work) | ||
| 1689 | { | ||
| 1690 | int i, retval; | ||
| 1691 | struct fb_info *info; | ||
| 1692 | const struct device_attribute *attr; | ||
| 1693 | struct dlfb_data *dlfb = container_of(work, struct dlfb_data, | ||
| 1694 | init_framebuffer_work.work); | ||
| 1695 | |||
| 1696 | /* allocates framebuffer driver structure, not framebuffer memory */ | 1629 | /* allocates framebuffer driver structure, not framebuffer memory */ |
| 1697 | info = framebuffer_alloc(0, &dlfb->udev->dev); | 1630 | info = framebuffer_alloc(0, &dlfb->udev->dev); |
| 1698 | if (!info) { | 1631 | if (!info) { |
| @@ -1706,17 +1639,22 @@ static void dlfb_init_framebuffer_work(struct work_struct *work) | |||
| 1706 | dlfb->ops = dlfb_ops; | 1639 | dlfb->ops = dlfb_ops; |
| 1707 | info->fbops = &dlfb->ops; | 1640 | info->fbops = &dlfb->ops; |
| 1708 | 1641 | ||
| 1642 | INIT_LIST_HEAD(&info->modelist); | ||
| 1643 | |||
| 1644 | if (!dlfb_alloc_urb_list(dlfb, WRITES_IN_FLIGHT, MAX_TRANSFER)) { | ||
| 1645 | retval = -ENOMEM; | ||
| 1646 | dev_err(&intf->dev, "unable to allocate urb list\n"); | ||
| 1647 | goto error; | ||
| 1648 | } | ||
| 1649 | |||
| 1650 | /* We don't register a new USB class. Our client interface is dlfbev */ | ||
| 1651 | |||
| 1709 | retval = fb_alloc_cmap(&info->cmap, 256, 0); | 1652 | retval = fb_alloc_cmap(&info->cmap, 256, 0); |
| 1710 | if (retval < 0) { | 1653 | if (retval < 0) { |
| 1711 | dev_err(info->device, "cmap allocation failed: %d\n", retval); | 1654 | dev_err(info->device, "cmap allocation failed: %d\n", retval); |
| 1712 | goto error; | 1655 | goto error; |
| 1713 | } | 1656 | } |
| 1714 | 1657 | ||
| 1715 | INIT_DELAYED_WORK(&dlfb->free_framebuffer_work, | ||
| 1716 | dlfb_free_framebuffer_work); | ||
| 1717 | |||
| 1718 | INIT_LIST_HEAD(&info->modelist); | ||
| 1719 | |||
| 1720 | retval = dlfb_setup_modes(dlfb, info, NULL, 0); | 1658 | retval = dlfb_setup_modes(dlfb, info, NULL, 0); |
| 1721 | if (retval != 0) { | 1659 | if (retval != 0) { |
| 1722 | dev_err(info->device, | 1660 | dev_err(info->device, |
| @@ -1760,10 +1698,16 @@ static void dlfb_init_framebuffer_work(struct work_struct *work) | |||
| 1760 | dev_name(info->dev), info->var.xres, info->var.yres, | 1698 | dev_name(info->dev), info->var.xres, info->var.yres, |
| 1761 | ((dlfb->backing_buffer) ? | 1699 | ((dlfb->backing_buffer) ? |
| 1762 | info->fix.smem_len * 2 : info->fix.smem_len) >> 10); | 1700 | info->fix.smem_len * 2 : info->fix.smem_len) >> 10); |
| 1763 | return; | 1701 | return 0; |
| 1764 | 1702 | ||
| 1765 | error: | 1703 | error: |
| 1766 | dlfb_free_framebuffer(dlfb); | 1704 | if (dlfb->info) { |
| 1705 | dlfb_ops_destroy(dlfb->info); | ||
| 1706 | } else if (dlfb) { | ||
| 1707 | usb_put_dev(dlfb->udev); | ||
| 1708 | kfree(dlfb); | ||
| 1709 | } | ||
| 1710 | return retval; | ||
| 1767 | } | 1711 | } |
| 1768 | 1712 | ||
| 1769 | static void dlfb_usb_disconnect(struct usb_interface *intf) | 1713 | static void dlfb_usb_disconnect(struct usb_interface *intf) |
| @@ -1791,20 +1735,9 @@ static void dlfb_usb_disconnect(struct usb_interface *intf) | |||
| 1791 | for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) | 1735 | for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) |
| 1792 | device_remove_file(info->dev, &fb_device_attrs[i]); | 1736 | device_remove_file(info->dev, &fb_device_attrs[i]); |
| 1793 | device_remove_bin_file(info->dev, &edid_attr); | 1737 | device_remove_bin_file(info->dev, &edid_attr); |
| 1794 | unlink_framebuffer(info); | ||
| 1795 | } | 1738 | } |
| 1796 | 1739 | ||
| 1797 | usb_set_intfdata(intf, NULL); | 1740 | unregister_framebuffer(info); |
| 1798 | dlfb->udev = NULL; | ||
| 1799 | |||
| 1800 | /* if clients still have us open, will be freed on last close */ | ||
| 1801 | if (dlfb->fb_count == 0) | ||
| 1802 | schedule_delayed_work(&dlfb->free_framebuffer_work, 0); | ||
| 1803 | |||
| 1804 | /* release reference taken by kref_init in probe() */ | ||
| 1805 | kref_put(&dlfb->kref, dlfb_free); | ||
| 1806 | |||
| 1807 | /* consider dlfb_data freed */ | ||
| 1808 | } | 1741 | } |
| 1809 | 1742 | ||
| 1810 | static struct usb_driver dlfb_driver = { | 1743 | static struct usb_driver dlfb_driver = { |
