From dc4bb474cd1ff39dcda996344114edb47cc8df04 Mon Sep 17 00:00:00 2001 From: Sherman Yin Date: Wed, 2 Apr 2014 15:40:39 -0700 Subject: pinctrl: fix typo in bindings documentation Fixed the missing comma in DT node example. Signed-off-by: Sherman Yin Signed-off-by: Linus Walleij --- Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt index c119debe6bab..67a5db95f189 100644 --- a/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt @@ -119,7 +119,7 @@ Optional Properties (for HDMI pins): Example: // pin controller node pinctrl@35004800 { - compatible = "brcmbcm11351-pinctrl"; + compatible = "brcm,bcm11351-pinctrl"; reg = <0x35004800 0x430>; // pin configuration node -- cgit v1.2.3 From cc253d7cebb9a1b43f47409acd8b7942e125ea61 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Thu, 24 Oct 2013 22:40:19 +0200 Subject: of: add vendor prefix for ISEE 2007 S.L. This trivial patch adds ISEE 2007 S.L. to the list of devicetree vendor prefixes. Acked-by: Kumar Gala Signed-off-by: Javier Martinez Canillas Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 0f01c9bf19c8..04eed97e45c5 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -58,6 +58,7 @@ idt Integrated Device Technologies, Inc. img Imagination Technologies Ltd. intel Intel Corporation intercontrol Inter Control Group +isee ISEE 2007 S.L. isl Intersil karo Ka-Ro electronics GmbH lacie LaCie -- cgit v1.2.3 From a438311b715b76d9683a6d0dfccea6603b08083f Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Thu, 3 Apr 2014 10:33:49 +0200 Subject: of: add vendor prefix for I2SE GmbH Add i2se to the list of DT vendor prefixes. Signed-off-by: Stefan Wahren Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 04eed97e45c5..233a4957fd18 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -53,6 +53,7 @@ haoyu Haoyu Microelectronic Co. Ltd. hisilicon Hisilicon Limited. honeywell Honeywell hp Hewlett Packard +i2se I2SE GmbH ibm International Business Machines (IBM) idt Integrated Device Technologies, Inc. img Imagination Technologies Ltd. -- cgit v1.2.3 From e7d2e3af864cf1ac2548b8f3deb2956395a8abd3 Mon Sep 17 00:00:00 2001 From: Dinh Nguyen Date: Wed, 2 Apr 2014 21:52:07 -0500 Subject: dt-bindings: add vendor-prefix for Newhaven Display Newhaven Display provides the worldwide marketplace with cost effective high quality display devices ranging from OLED and LCD Displays to VFD Displays. Signed-off-by: Dinh Nguyen Reviewed-by: Pavel Machek Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 233a4957fd18..5cfb6c102fcc 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -75,6 +75,7 @@ moxa Moxa national National Semiconductor neonode Neonode Inc. netgear NETGEAR +newhaven Newhaven Display International nintendo Nintendo nokia Nokia nvidia NVIDIA -- cgit v1.2.3 From 401a97d2c0f20a0b6cfe6d035b638fe2b6e8e97c Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Sat, 22 Mar 2014 13:45:57 +0100 Subject: DT: bindings: add missing Marvell Kirkwood SoC documentation Marvell Kirkwood SoC binding have not yet been documented. Add the documentation including the supported SoCs and boards. Signed-off-by: Andrew Lunn Acked-by: Jason Cooper Signed-off-by: Rob Herring --- .../devicetree/bindings/arm/marvell,kirkwood.txt | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/marvell,kirkwood.txt (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt b/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt new file mode 100644 index 000000000000..925ecbf6e7b7 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt @@ -0,0 +1,97 @@ +Marvell Kirkwood SoC Family Device Tree Bindings +------------------------------------------------ + +Boards with a SoC of the Marvell Kirkwook family, eg 88f6281 + +* Required root node properties: +compatible: must contain "marvell,kirkwood" + +In addition, the above compatible shall be extended with the specific +SoC. Currently known SoC compatibles are: + +"marvell,kirkwood-88f6192" +"marvell,kirkwood-88f6281" +"marvell,kirkwood-88f6282" +"marvell,kirkwood-88f6283" +"marvell,kirkwood-88f6702" +"marvell,kirkwood-98DX4122" + +And in addition, the compatible shall be extended with the specific +board. Currently known boards are: + +"buffalo,lschlv2" +"buffalo,lsxhl" +"buffalo,lsxl" +"dlink,dns-320" +"dlink,dns-320-a1" +"dlink,dns-325" +"dlink,dns-325-a1" +"dlink,dns-kirkwood" +"excito,b3" +"globalscale,dreamplug-003-ds2001" +"globalscale,guruplug" +"globalscale,guruplug-server-plus" +"globalscale,sheevaplug" +"globalscale,sheevaplug" +"globalscale,sheevaplug-esata" +"globalscale,sheevaplug-esata-rev13" +"iom,iconnect" +"iom,iconnect-1.1" +"iom,ix2-200" +"keymile,km_kirkwood" +"lacie,cloudbox" +"lacie,inetspace_v2" +"lacie,laplug" +"lacie,netspace_lite_v2" +"lacie,netspace_max_v2" +"lacie,netspace_mini_v2" +"lacie,netspace_v2" +"marvell,db-88f6281-bp" +"marvell,db-88f6282-bp" +"marvell,mv88f6281gtw-ge" +"marvell,rd88f6281" +"marvell,rd88f6281" +"marvell,rd88f6281-a0" +"marvell,rd88f6281-a1" +"mpl,cec4" +"mpl,cec4-10" +"netgear,readynas" +"netgear,readynas" +"netgear,readynas-duo-v2" +"netgear,readynas-nv+-v2" +"plathome,openblocks-a6" +"plathome,openblocks-a7" +"raidsonic,ib-nas6210" +"raidsonic,ib-nas6210-b" +"raidsonic,ib-nas6220" +"raidsonic,ib-nas6220-b" +"raidsonic,ib-nas62x0" +"seagate,dockstar" +"seagate,goflexnet" +"synology,ds109" +"synology,ds110jv10" +"synology,ds110jv20" +"synology,ds110jv30" +"synology,ds111" +"synology,ds209" +"synology,ds210jv10" +"synology,ds210jv20" +"synology,ds212" +"synology,ds212jv10" +"synology,ds212jv20" +"synology,ds212pv10" +"synology,ds409" +"synology,ds409slim" +"synology,ds410j" +"synology,ds411" +"synology,ds411j" +"synology,ds411slim" +"synology,ds413jv10" +"synology,rs212" +"synology,rs409" +"synology,rs411" +"synology,rs812" +"usi,topkick" +"usi,topkick-1281P2" +"zyxel,nsa310" +"zyxel,nsa310a" -- cgit v1.2.3 From 552481aace37a3698a2389bba04ae43fc969803b Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Sat, 22 Mar 2014 13:45:56 +0100 Subject: DT: Vendor: Add prefixes used by Kirkwood devices Add a number of vendor prefixes by kirkwood devices. These are not all stock tickers, but have been in use for a while so changing would not be easy. Signed-off-by: Andrew Lunn Acked-by: Jason Cooper Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 5cfb6c102fcc..36b8530718db 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -22,6 +22,7 @@ auo AU Optronics Corporation avago Avago Technologies bosch Bosch Sensortec GmbH brcm Broadcom Corporation +buffalo Buffalo, Inc. calxeda Calxeda capella Capella Microsystems, Inc cavium Cavium, Inc. @@ -33,8 +34,8 @@ cortina Cortina Systems, Inc. crystalfontz Crystalfontz America, Inc. dallas Maxim Integrated Products (formerly Dallas Semiconductor) davicom DAVICOM Semiconductor, Inc. -dlink D-Link Systems, Inc. denx Denx Software Engineering +dlink D-Link Corporation dmo Data Modul AG edt Emerging Display Technologies emmicro EM Microelectronic @@ -42,6 +43,7 @@ epfl Ecole Polytechnique Fédérale de Lausanne epson Seiko Epson Corp. est ESTeem Wireless Modems eukrea Eukréa Electromatique +excito Excito fsl Freescale Semiconductor GEFanuc GE Fanuc Intelligent Platforms Embedded Systems, Inc. gef GE Fanuc Intelligent Platforms Embedded Systems, Inc. @@ -56,12 +58,14 @@ hp Hewlett Packard i2se I2SE GmbH ibm International Business Machines (IBM) idt Integrated Device Technologies, Inc. +iom Iomega Corporation img Imagination Technologies Ltd. intel Intel Corporation intercontrol Inter Control Group isee ISEE 2007 S.L. isl Intersil karo Ka-Ro electronics GmbH +keymile Keymile GmbH lacie LaCie lantiq Lantiq Semiconductor lg LG Corporation @@ -72,6 +76,8 @@ maxim Maxim Integrated Products microchip Microchip Technology Inc. mosaixtech Mosaix Technologies, Inc. moxa Moxa +mpl MPL AG +mxicy Macronix International Co., Ltd. national National Semiconductor neonode Neonode Inc. netgear NETGEAR @@ -85,10 +91,12 @@ opencores OpenCores.org panasonic Panasonic Corporation phytec PHYTEC Messtechnik GmbH picochip Picochip Ltd +plathome Plat'Home Co., Ltd. powervr PowerVR (deprecated, use img) qca Qualcomm Atheros, Inc. qcom Qualcomm Technologies, Inc qnap QNAP Systems, Inc. +raidsonic RaidSonic Technology GmbH ralink Mediatek/Ralink Technology Corp. ramtron Ramtron International realtek Realtek Semiconductor Corp. @@ -98,6 +106,7 @@ rockchip Fuzhou Rockchip Electronics Co., Ltd samsung Samsung Semiconductor sbs Smart Battery System schindler Schindler +seagate Seagate Technology PLC sil Silicon Image silabs Silicon Laboratories simtek @@ -114,6 +123,7 @@ ti Texas Instruments tlm Trusted Logic Mobility toshiba Toshiba Corporation toumaz Toumaz +usi Universal Scientifc Industrial Co., Ltd. v3 V3 Semiconductor via VIA Technologies, Inc. voipac Voipac Technologies s.r.o. @@ -122,3 +132,4 @@ wlf Wolfson Microelectronics wm Wondermedia Technologies, Inc. xes Extreme Engineering Solutions (X-ES) xlnx Xilinx +zyxel ZyXEL Communications Corp. -- cgit v1.2.3 From 3443dd19da985da337cd0be20435cc98aa8c7915 Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Sat, 22 Mar 2014 13:45:59 +0100 Subject: DT: I2C: Add trivial bindings used by kirkwood boards Add a number of eeproms and temperature sensors/fan controllers used by kirkwood boards. Signed-off-by: Andrew Lunn Acked-by: Jason Cooper Signed-off-by: Rob Herring --- .../devicetree/bindings/i2c/trivial-devices.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index 71724d026ffa..bef86e57c388 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt @@ -13,8 +13,22 @@ ad,ad7414 SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert an ad,adm9240 ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems adi,adt7461 +/-1C TDM Extended Temp Range I.C adt7461 +/-1C TDM Extended Temp Range I.C +adi,adt7473 +/-1C TDM Extended Temp Range I.C +adi,adt7475 +/-1C TDM Extended Temp Range I.C +adi,adt7476 +/-1C TDM Extended Temp Range I.C +adi,adt7490 +/-1C TDM Extended Temp Range I.C at,24c08 i2c serial eeprom (24cxx) +atmel,24c00 i2c serial eeprom (24cxx) +atmel,24c01 i2c serial eeprom (24cxx) atmel,24c02 i2c serial eeprom (24cxx) +atmel,24c04 i2c serial eeprom (24cxx) +atmel,24c16 i2c serial eeprom (24cxx) +atmel,24c32 i2c serial eeprom (24cxx) +atmel,24c64 i2c serial eeprom (24cxx) +atmel,24c128 i2c serial eeprom (24cxx) +atmel,24c256 i2c serial eeprom (24cxx) +atmel,24c512 i2c serial eeprom (24cxx) +atmel,24c1024 i2c serial eeprom (24cxx) atmel,at97sc3204t i2c trusted platform module (TPM) capella,cm32181 CM32181: Ambient Light Sensor catalyst,24c32 i2c serial eeprom @@ -46,8 +60,10 @@ maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface mc,rv3029c2 Real Time Clock Module with I2C-Bus +national,lm63 Temperature sensor with integrated fan control national,lm75 I2C TEMP SENSOR national,lm80 Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor +national,lm85 Temperature sensor with integrated fan control national,lm92 ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface nuvoton,npct501 i2c trusted platform module (TPM) nxp,pca9556 Octal SMBus and I2C registered interface -- cgit v1.2.3 From 42dc102dc3c026267dc2100c27f9e4d5283c3644 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Thu, 3 Apr 2014 19:01:35 +0400 Subject: of: Add vendor prefix for Digi International Inc. Using "digi" for Digi International Inc. Additionally, this patch keep "dlink" entry sorted alphabetically. Signed-off-by: Alexander Shiyan Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 36b8530718db..fad44cab68b8 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -35,6 +35,7 @@ crystalfontz Crystalfontz America, Inc. dallas Maxim Integrated Products (formerly Dallas Semiconductor) davicom DAVICOM Semiconductor, Inc. denx Denx Software Engineering +digi Digi International Inc. dlink D-Link Corporation dmo Data Modul AG edt Emerging Display Technologies -- cgit v1.2.3 From f3afa2259457e46bbb6285bcc1032ecc0f76fdd7 Mon Sep 17 00:00:00 2001 From: Steffen Trumtrar Date: Mon, 31 Mar 2014 17:36:53 +0200 Subject: DT: add vendor prefix for EBV Elektronik Add vendor prefix for EBV Elektronik. Signed-off-by: Steffen Trumtrar Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index fad44cab68b8..abc308083acb 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -38,6 +38,7 @@ denx Denx Software Engineering digi Digi International Inc. dlink D-Link Corporation dmo Data Modul AG +ebv EBV Elektronik edt Emerging Display Technologies emmicro EM Microelectronic epfl Ecole Polytechnique Fédérale de Lausanne -- cgit v1.2.3 From b9d12085f2f531fdea67f0361564e0812696227c Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 15 Apr 2014 15:50:19 +0200 Subject: net: phy: add minimal support for QSGMII PHY This commit adds the necessary definitions for the PHY layer to recognize "qsgmii" as a valid PHY interface. A QSMII interface, as defined at http://en.wikipedia.org/wiki/Media_Independent_Interface#Quad_Serial_Gigabit_Media_Independent_Interface, is "is a method of combining four SGMII lines into a 5Gbit/s interface. QSGMII, like SGMII, uses LVDS signalling for the TX and RX data and a single LVDS clock signal. QSGMII uses significantly fewer signal lines than four SGMII busses." This type of MAC <-> PHY connection might require special handling on the MAC driver side, so it should be possible to express this type of MAC <-> PHY connection, for example in the Device Tree. Signed-off-by: Thomas Petazzoni Cc: devicetree@vger.kernel.org Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- Documentation/devicetree/bindings/net/ethernet.txt | 2 +- include/linux/phy.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/net/ethernet.txt b/Documentation/devicetree/bindings/net/ethernet.txt index 9ecd43d8792c..3fc360523bc9 100644 --- a/Documentation/devicetree/bindings/net/ethernet.txt +++ b/Documentation/devicetree/bindings/net/ethernet.txt @@ -10,7 +10,7 @@ The following properties are common to the Ethernet controllers: - max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than the maximum frame size (there's contradiction in ePAPR). - phy-mode: string, operation mode of the PHY interface; supported values are - "mii", "gmii", "sgmii", "tbi", "rev-mii", "rmii", "rgmii", "rgmii-id", + "mii", "gmii", "sgmii", "qsgmii", "tbi", "rev-mii", "rmii", "rgmii", "rgmii-id", "rgmii-rxid", "rgmii-txid", "rtbi", "smii", "xgmii"; this is now a de-facto standard property; - phy-connection-type: the same as "phy-mode" property but described in ePAPR; diff --git a/include/linux/phy.h b/include/linux/phy.h index 24126c4b27b5..4d0221fd0688 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -75,6 +75,7 @@ typedef enum { PHY_INTERFACE_MODE_SMII, PHY_INTERFACE_MODE_XGMII, PHY_INTERFACE_MODE_MOCA, + PHY_INTERFACE_MODE_QSGMII, PHY_INTERFACE_MODE_MAX, } phy_interface_t; @@ -116,6 +117,8 @@ static inline const char *phy_modes(phy_interface_t interface) return "xgmii"; case PHY_INTERFACE_MODE_MOCA: return "moca"; + case PHY_INTERFACE_MODE_QSGMII: + return "qsgmii"; default: return "unknown"; } -- cgit v1.2.3 From 408065998443831d3369c6bfdc8862c1d02a91dd Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 2 Apr 2014 09:37:08 -0700 Subject: stable_kernel_rules: spelling/word usage "than" should be "then" Signed-off-by: Brian Norris Signed-off-by: Greg Kroah-Hartman --- Documentation/stable_kernel_rules.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/stable_kernel_rules.txt b/Documentation/stable_kernel_rules.txt index b0714d8f678a..cbc2f03056bd 100644 --- a/Documentation/stable_kernel_rules.txt +++ b/Documentation/stable_kernel_rules.txt @@ -39,7 +39,7 @@ Procedure for submitting patches to the -stable tree: the stable tree without anything else needing to be done by the author or subsystem maintainer. - If the patch requires other patches as prerequisites which can be - cherry-picked than this can be specified in the following format in + cherry-picked, then this can be specified in the following format in the sign-off area: Cc: # 3.3.x: a1f84a3: sched: Check for idle -- cgit v1.2.3 From 06d96c0ff77f20dbf5fc93c8cfa9a2a9690fd67e Mon Sep 17 00:00:00 2001 From: Lin Yongting Date: Wed, 16 Apr 2014 23:25:28 +0800 Subject: Chinese: add translation of io_ordering.txt This is a Chinese translated version of Documentation/io_ordering.txt Signed-off-by: Lin Yongting Signed-off-by: Greg Kroah-Hartman --- Documentation/zh_CN/io_ordering.txt | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/zh_CN/io_ordering.txt (limited to 'Documentation') diff --git a/Documentation/zh_CN/io_ordering.txt b/Documentation/zh_CN/io_ordering.txt new file mode 100644 index 000000000000..e592daf4e014 --- /dev/null +++ b/Documentation/zh_CN/io_ordering.txt @@ -0,0 +1,67 @@ +Chinese translated version of Documentation/io_orderings.txt + +If you have any comment or update to the content, please contact the +original document maintainer directly. However, if you have a problem +communicating in English you can also ask the Chinese maintainer for +help. Contact the Chinese maintainer if this translation is outdated +or if there is a problem with the translation. + +Chinese maintainer: Lin Yongting +--------------------------------------------------------------------- +Documentation/io_ordering.txt 的中文翻译 + +如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 +交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 +译存在问题,请联系中文版维护者。 + +中文版维护者: 林永听 Lin Yongting +中文版翻译者: 林永听 Lin Yongting +中文版校译者: 林永听 Lin Yongting + + +以下为正文 +--------------------------------------------------------------------- + +在某些平台上,所谓的内存映射I/O是弱顺序。在这些平台上,驱动开发者有责任 +保证I/O内存映射地址的写操作按程序图意的顺序达到设备。通常读取一个“安全” +设备寄存器或桥寄存器,触发IO芯片清刷未处理的写操作到达设备后才处理读操作, +而达到保证目的。驱动程序通常在spinlock保护的临界区退出之前使用这种技术。 +这也可以保证后面的写操作只在前面的写操作之后到达设备(这非常类似于内存 +屏障操作,mb(),不过仅适用于I/O)。 + +假设一个设备驱动程的具体例子: + + ... +CPU A: spin_lock_irqsave(&dev_lock, flags) +CPU A: val = readl(my_status); +CPU A: ... +CPU A: writel(newval, ring_ptr); +CPU A: spin_unlock_irqrestore(&dev_lock, flags) + ... +CPU B: spin_lock_irqsave(&dev_lock, flags) +CPU B: val = readl(my_status); +CPU B: ... +CPU B: writel(newval2, ring_ptr); +CPU B: spin_unlock_irqrestore(&dev_lock, flags) + ... + +上述例子中,设备可能会先接收到newval2的值,然后接收到newval的值,问题就 +发生了。不过很容易通过下面方法来修复: + + ... +CPU A: spin_lock_irqsave(&dev_lock, flags) +CPU A: val = readl(my_status); +CPU A: ... +CPU A: writel(newval, ring_ptr); +CPU A: (void)readl(safe_register); /* 配置寄存器?*/ +CPU A: spin_unlock_irqrestore(&dev_lock, flags) + ... +CPU B: spin_lock_irqsave(&dev_lock, flags) +CPU B: val = readl(my_status); +CPU B: ... +CPU B: writel(newval2, ring_ptr); +CPU B: (void)readl(safe_register); /* 配置寄存器?*/ +CPU B: spin_unlock_irqrestore(&dev_lock, flags) + +在解决方案中,读取safe_register寄存器,触发IO芯片清刷未处理的写操作, +再处理后面的读操作,防止引发数据不一致问题。 -- cgit v1.2.3 From 98b0f811aade1b7c6e7806c86aa0befd5919d65f Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 14 Apr 2014 18:52:14 +0200 Subject: Documentation: Update stable address in Chinese and Japanese translations The English and Korean translations were updated, the Chinese and Japanese weren't. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman --- Documentation/ja_JP/HOWTO | 2 +- Documentation/ja_JP/stable_kernel_rules.txt | 6 +++--- Documentation/zh_CN/HOWTO | 2 +- Documentation/zh_CN/stable_kernel_rules.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Documentation') diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO index 0091a8215ac1..b61885c35ce1 100644 --- a/Documentation/ja_JP/HOWTO +++ b/Documentation/ja_JP/HOWTO @@ -315,7 +315,7 @@ Andrew Morton が Linux-kernel メーリングリストにカーネルリリー もし、3.x.y カーネルが存在しない場合には、番号が一番大きい 3.x が 最新の安定版カーネルです。 -3.x.y は "stable" チーム でメンテされており、必 +3.x.y は "stable" チーム でメンテされており、必 要に応じてリリースされます。通常のリリース期間は 2週間毎ですが、差し迫っ た問題がなければもう少し長くなることもあります。セキュリティ関連の問題 の場合はこれに対してだいたいの場合、すぐにリリースがされます。 diff --git a/Documentation/ja_JP/stable_kernel_rules.txt b/Documentation/ja_JP/stable_kernel_rules.txt index 14265837c4ce..9dbda9b5d21e 100644 --- a/Documentation/ja_JP/stable_kernel_rules.txt +++ b/Documentation/ja_JP/stable_kernel_rules.txt @@ -50,16 +50,16 @@ linux-2.6.29/Documentation/stable_kernel_rules.txt -stable ツリーにパッチを送付する手続き- - - 上記の規則に従っているかを確認した後に、stable@kernel.org にパッチ + - 上記の規則に従っているかを確認した後に、stable@vger.kernel.org にパッチ を送る。 - 送信者はパッチがキューに受け付けられた際には ACK を、却下された場合 には NAK を受け取る。この反応は開発者たちのスケジュールによって、数 日かかる場合がある。 - もし受け取られたら、パッチは他の開発者たちと関連するサブシステムの メンテナーによるレビューのために -stable キューに追加される。 - - パッチに stable@kernel.org のアドレスが付加されているときには、それ + - パッチに stable@vger.kernel.org のアドレスが付加されているときには、それ が Linus のツリーに入る時に自動的に stable チームに email される。 - - セキュリティパッチはこのエイリアス (stable@kernel.org) に送られるべ + - セキュリティパッチはこのエイリアス (stable@vger.kernel.org) に送られるべ きではなく、代わりに security@kernel.org のアドレスに送られる。 レビューサイクル- diff --git a/Documentation/zh_CN/HOWTO b/Documentation/zh_CN/HOWTO index 6c914aa87e71..54ea24ff63c7 100644 --- a/Documentation/zh_CN/HOWTO +++ b/Documentation/zh_CN/HOWTO @@ -237,7 +237,7 @@ kernel.org网站的pub/linux/kernel/v2.6/目录下找到它。它的开发遵循 如果没有2.6.x.y版本内核存在,那么最新的2.6.x版本内核就相当于是当前的稳定 版内核。 -2.6.x.y版本由“稳定版”小组(邮件地址)维护,一般隔周发 +2.6.x.y版本由“稳定版”小组(邮件地址)维护,一般隔周发 布新版本。 内核源码中的Documentation/stable_kernel_rules.txt文件具体描述了可被稳定 diff --git a/Documentation/zh_CN/stable_kernel_rules.txt b/Documentation/zh_CN/stable_kernel_rules.txt index b5b9b0ab02fd..26ea5ed7cd9c 100644 --- a/Documentation/zh_CN/stable_kernel_rules.txt +++ b/Documentation/zh_CN/stable_kernel_rules.txt @@ -42,7 +42,7 @@ Documentation/stable_kernel_rules.txt 的中文翻译 向稳定版代码树提交补丁的过程: - - 在确认了补丁符合以上的规则后,将补丁发送到stable@kernel.org。 + - 在确认了补丁符合以上的规则后,将补丁发送到stable@vger.kernel.org。 - 如果补丁被接受到队列里,发送者会收到一个ACK回复,如果没有被接受,收 到的是NAK回复。回复需要几天的时间,这取决于开发者的时间安排。 - 被接受的补丁会被加到稳定版本队列里,等待其他开发者的审查。 -- cgit v1.2.3 From 4ea8dafd2475e26b3cee3836bc6e6fddbdfb2721 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Tue, 25 Mar 2014 15:53:12 +0100 Subject: serial: efm32: use $vendor,$device scheme for compatible string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wolfram Sang pointed out that "efm32,$device" is non-standard. So use the common scheme and prefix device with "efm32-". The old compatible string is left in place until arch/arm/boot/dts/efm32* is fixed. Reported-by: Wolfram Sang Signed-off-by: Uwe Kleine-König Acked-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/serial/efm32-uart.txt | 4 ++-- drivers/tty/serial/efm32-uart.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/serial/efm32-uart.txt b/Documentation/devicetree/bindings/serial/efm32-uart.txt index 1984bdfbd545..3ca01336b837 100644 --- a/Documentation/devicetree/bindings/serial/efm32-uart.txt +++ b/Documentation/devicetree/bindings/serial/efm32-uart.txt @@ -1,7 +1,7 @@ * Energymicro efm32 UART Required properties: -- compatible : Should be "efm32,uart" +- compatible : Should be "energymicro,efm32-uart" - reg : Address and length of the register set - interrupts : Should contain uart interrupt @@ -13,7 +13,7 @@ Optional properties: Example: uart@0x4000c400 { - compatible = "efm32,uart"; + compatible = "energymicro,efm32-uart"; reg = <0x4000c400 0x400>; interrupts = <15>; efm32,location = <0>; diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c index 028582e924a5..c167a710dc39 100644 --- a/drivers/tty/serial/efm32-uart.c +++ b/drivers/tty/serial/efm32-uart.c @@ -798,6 +798,9 @@ static int efm32_uart_remove(struct platform_device *pdev) static const struct of_device_id efm32_uart_dt_ids[] = { { + .compatible = "energymicro,efm32-uart", + }, { + /* doesn't follow the "vendor,device" scheme, don't use */ .compatible = "efm32,uart", }, { /* sentinel */ -- cgit v1.2.3 From 3053075cea4e1d385cf0b003ffeb860cc8b378fb Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 31 Mar 2014 14:54:25 +0200 Subject: Documentation/serial: Delete obsolete driver documentation These serial drivers were removed in kernel v3.1, so we can drop their documentation files and references to their magic numbers and parameters. There are still references to these old drivers in Documentation/devices.txt but I'm afraid they can't be removed. Signed-off-by: Jean Delvare Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Rob Landley Signed-off-by: Greg Kroah-Hartman --- Documentation/kernel-parameters.txt | 13 -- Documentation/magic-number.txt | 12 -- Documentation/serial/00-INDEX | 8 - Documentation/serial/digiepca.txt | 98 --------- Documentation/serial/riscom8.txt | 36 ---- Documentation/serial/specialix.txt | 383 ----------------------------------- Documentation/serial/sx.txt | 294 --------------------------- Documentation/zh_CN/magic-number.txt | 12 -- firmware/WHENCE | 10 - 9 files changed, 866 deletions(-) delete mode 100644 Documentation/serial/digiepca.txt delete mode 100644 Documentation/serial/riscom8.txt delete mode 100644 Documentation/serial/specialix.txt delete mode 100644 Documentation/serial/sx.txt (limited to 'Documentation') diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 03e50b4883a8..43842177b771 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -804,13 +804,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. dhash_entries= [KNL] Set number of hash buckets for dentry cache. - digi= [HW,SERIAL] - IO parameters + enable/disable command. - - digiepca= [HW,SERIAL] - See drivers/char/README.epca and - Documentation/serial/digiepca.txt. - disable= [IPV6] See Documentation/networking/ipv6.txt. @@ -2939,9 +2932,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. rhash_entries= [KNL,NET] Set number of hash buckets for route cache - riscom8= [HW,SERIAL] - Format: [,[,...]] - ro [KNL] Mount root device read-only on boot root= [KNL] Root filesystem @@ -3083,9 +3073,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. sonypi.*= [HW] Sony Programmable I/O Control Device driver See Documentation/laptops/sonypi.txt - specialix= [HW,SERIAL] Specialix multi-serial port adapter - See Documentation/serial/specialix.txt. - spia_io_base= [HW,MTD] spia_fio_base= spia_pedr= diff --git a/Documentation/magic-number.txt b/Documentation/magic-number.txt index 76d80a64bbe1..4c8e142db2ef 100644 --- a/Documentation/magic-number.txt +++ b/Documentation/magic-number.txt @@ -63,8 +63,6 @@ Magic Name Number Structure File PG_MAGIC 'P' pg_{read,write}_hdr include/linux/pg.h CMAGIC 0x0111 user include/linux/a.out.h MKISS_DRIVER_MAGIC 0x04bf mkiss_channel drivers/net/mkiss.h -RISCOM8_MAGIC 0x0907 riscom_port drivers/char/riscom8.h -SPECIALIX_MAGIC 0x0907 specialix_port drivers/char/specialix_io8.h HDLC_MAGIC 0x239e n_hdlc drivers/char/n_hdlc.c APM_BIOS_MAGIC 0x4101 apm_user arch/x86/kernel/apm_32.c CYCLADES_MAGIC 0x4359 cyclades_port include/linux/cyclades.h @@ -82,7 +80,6 @@ STRIP_MAGIC 0x5303 strip drivers/net/strip.c X25_ASY_MAGIC 0x5303 x25_asy drivers/net/x25_asy.h SIXPACK_MAGIC 0x5304 sixpack drivers/net/hamradio/6pack.h AX25_MAGIC 0x5316 ax_disp drivers/net/mkiss.h -ESP_MAGIC 0x53ee esp_struct drivers/char/esp.h TTY_MAGIC 0x5401 tty_struct include/linux/tty.h MGSL_MAGIC 0x5401 mgsl_info drivers/char/synclink.c TTY_DRIVER_MAGIC 0x5402 tty_driver include/linux/tty_driver.h @@ -94,13 +91,10 @@ USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth drivers/usb/class/bluetty.c RFCOMM_TTY_MAGIC 0x6d02 net/bluetooth/rfcomm/tty.c USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port drivers/usb/serial/usb-serial.h CG_MAGIC 0x00090255 ufs_cylinder_group include/linux/ufs_fs.h -A2232_MAGIC 0x000a2232 gs_port drivers/char/ser_a2232.h RPORT_MAGIC 0x00525001 r_port drivers/char/rocket_int.h LSEMAGIC 0x05091998 lse drivers/fc4/fc.c GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str drivers/scsi/gdth_ioctl.h RIEBL_MAGIC 0x09051990 drivers/net/atarilance.c -RIO_MAGIC 0x12345678 gs_port drivers/char/rio/rio_linux.c -SX_MAGIC 0x12345678 gs_port drivers/char/sx.h NBD_REQUEST_MAGIC 0x12560953 nbd_request include/linux/nbd.h RED_MAGIC2 0x170fc2a5 (any) mm/slab.c BAYCOM_MAGIC 0x19730510 baycom_state drivers/net/baycom_epp.c @@ -116,7 +110,6 @@ ISDN_ASYNC_MAGIC 0x49344C01 modem_info include/linux/isdn.h CTC_ASYNC_MAGIC 0x49344C01 ctc_tty_info drivers/s390/net/ctctty.c ISDN_NET_MAGIC 0x49344C02 isdn_net_local_s drivers/isdn/i4l/isdn_net_lib.h SAVEKMSG_MAGIC2 0x4B4D5347 savekmsg arch/*/amiga/config.c -STLI_BOARDMAGIC 0x4bc6c825 stlibrd include/linux/istallion.h CS_STATE_MAGIC 0x4c4f4749 cs_state sound/oss/cs46xx.c SLAB_C_MAGIC 0x4f17a36d kmem_cache mm/slab.c COW_MAGIC 0x4f4f4f4d cow_header_v1 arch/um/drivers/ubd_user.c @@ -127,10 +120,8 @@ SCC_MAGIC 0x52696368 gs_port drivers/char/scc.h SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c GDA_MAGIC 0x58464552 gda arch/mips/include/asm/sn/gda.h RED_MAGIC1 0x5a2cf071 (any) mm/slab.c -STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h -EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h KV_MAGIC 0x5f4b565f kernel_vars_s arch/mips/include/asm/sn/klkernvars.h I810_STATE_MAGIC 0x63657373 i810_state sound/oss/i810_audio.c @@ -142,17 +133,14 @@ SLOT_MAGIC 0x67267322 slot drivers/hotplug/acpiphp.h LO_MAGIC 0x68797548 nbd_device include/linux/nbd.h OPROFILE_MAGIC 0x6f70726f super_block drivers/oprofile/oprofilefs.h M3_STATE_MAGIC 0x734d724d m3_state sound/oss/maestro3.c -STL_PANELMAGIC 0x7ef621a1 stlpanel include/linux/stallion.h VMALLOC_MAGIC 0x87654320 snd_alloc_track sound/core/memory.c KMALLOC_MAGIC 0x87654321 snd_alloc_track sound/core/memory.c PWC_MAGIC 0x89DC10AB pwc_device drivers/usb/media/pwc.h NBD_REPLY_MAGIC 0x96744668 nbd_reply include/linux/nbd.h -STL_BOARDMAGIC 0xa2267f52 stlbrd include/linux/stallion.h ENI155_MAGIC 0xa54b872d midway_eprom drivers/atm/eni.h SCI_MAGIC 0xbabeface gs_port drivers/char/sh-sci.h CODA_MAGIC 0xC0DAC0DA coda_file_info fs/coda/coda_fs_i.h DPMEM_MAGIC 0xc0ffee11 gdt_pci_sram drivers/scsi/gdth.h -STLI_PORTMAGIC 0xe671c7a1 stliport include/linux/istallion.h YAM_MAGIC 0xF10A7654 yam_port drivers/net/hamradio/yam.c CCB_MAGIC 0xf2691ad2 ccb drivers/scsi/ncr53c8xx.c QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry drivers/scsi/arm/queue.c diff --git a/Documentation/serial/00-INDEX b/Documentation/serial/00-INDEX index f9c6b5ed03e7..8021a9f29fc5 100644 --- a/Documentation/serial/00-INDEX +++ b/Documentation/serial/00-INDEX @@ -2,23 +2,15 @@ - this file. README.cycladesZ - info on Cyclades-Z firmware loading. -digiepca.txt - - info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards. driver - intro to the low level serial driver. moxa-smartio - file with info on installing/using Moxa multiport serial driver. n_gsm.txt - GSM 0710 tty multiplexer howto. -riscom8.txt - - notes on using the RISCom/8 multi-port serial driver. rocket.txt - info on the Comtrol RocketPort multiport serial driver. serial-rs485.txt - info about RS485 structures and support in the kernel. -specialix.txt - - info on hardware/driver for specialix IO8+ multiport serial card. -sx.txt - - info on the Specialix SX/SI multiport serial driver. tty.txt - guide to the locking policies of the tty layer. diff --git a/Documentation/serial/digiepca.txt b/Documentation/serial/digiepca.txt deleted file mode 100644 index f2560e22f2c9..000000000000 --- a/Documentation/serial/digiepca.txt +++ /dev/null @@ -1,98 +0,0 @@ -NOTE: This driver is obsolete. Digi provides a 2.6 driver (dgdm) at -http://www.digi.com for PCI cards. They no longer maintain this driver, -and have no 2.6 driver for ISA cards. - -This driver requires a number of user-space tools. They can be acquired from -http://www.digi.com, but only works with 2.4 kernels. - - -The Digi Intl. epca driver. ----------------------------- -The Digi Intl. epca driver for Linux supports the following boards: - -Digi PC/Xem, PC/Xr, PC/Xe, PC/Xi, PC/Xeve -Digi EISA/Xem, PCI/Xem, PCI/Xr - -Limitations: ------------- -Currently the driver only autoprobes for supported PCI boards. - -The Linux MAKEDEV command does not support generating the Digiboard -Devices. Users executing digiConfig to setup EISA and PC series cards -will have their device nodes automatically constructed (cud?? for ~CLOCAL, -and ttyD?? for CLOCAL). Users wishing to boot their board from the LILO -prompt, or those users booting PCI cards may use buildDIGI to construct -the necessary nodes. - -Notes: ------- -This driver may be configured via LILO. For users who have already configured -their driver using digiConfig, configuring from LILO will override previous -settings. Multiple boards may be configured by issuing multiple LILO command -lines. For examples see the bottom of this document. - -Device names start at 0 and continue up. Beware of this as previous Digi -drivers started device names with 1. - -PCI boards are auto-detected and configured by the driver. PCI boards will -be allocated device numbers (internally) beginning with the lowest PCI slot -first. In other words a PCI card in slot 3 will always have higher device -nodes than a PCI card in slot 1. - -LILO config examples: ---------------------- -Using LILO's APPEND command, a string of comma separated identifiers or -integers can be used to configure supported boards. The six values in order -are: - - Enable/Disable this card or Override, - Type of card: PC/Xe (AccelePort) (0), PC/Xeve (1), PC/Xem or PC/Xr (2), - EISA/Xem (3), PC/64Xe (4), PC/Xi (5), - Enable/Disable alternate pin arrangement, - Number of ports on this card, - I/O Port where card is configured (in HEX if using string identifiers), - Base of memory window (in HEX if using string identifiers), - -NOTE : PCI boards are auto-detected and configured. Do not attempt to -configure PCI boards with the LILO append command. If you wish to override -previous configuration data (As set by digiConfig), but you do not wish to -configure any specific card (Example if there are PCI cards in the system) -the following override command will accomplish this: --> append="digi=2" - -Samples: - append="digiepca=E,PC/Xe,D,16,200,D0000" - or - append="digi=1,0,0,16,512,851968" - -Supporting Tools: ------------------ -Supporting tools include digiDload, digiConfig, buildPCI, and ditty. See -drivers/char/README.epca for more details. Note, -this driver REQUIRES that digiDload be executed prior to it being used. -Failure to do this will result in an ENODEV error. - -Documentation: --------------- -Complete documentation for this product may be found in the tool package. - -Sources of information and support: ------------------------------------ -Digi Intl. support site for this product: - --> http://www.digi.com - -Acknowledgments: ----------------- -Much of this work (And even text) was derived from a similar document -supporting the original public domain DigiBoard driver Copyright (C) -1994,1995 Troy De Jongh. Many thanks to Christoph Lameter -(christoph@lameter.com) and Mike McLagan (mike.mclagan@linux.org) who authored -and contributed to the original document. - -Changelog: ----------- -10-29-04: Update status of driver, remove dead links in document - James Nelson - -2000 (?) Original Document diff --git a/Documentation/serial/riscom8.txt b/Documentation/serial/riscom8.txt deleted file mode 100644 index 14f61fdad7ca..000000000000 --- a/Documentation/serial/riscom8.txt +++ /dev/null @@ -1,36 +0,0 @@ -* NOTE - this is an unmaintained driver. The original author cannot be located. - -SDL Communications is now SBS Technologies, and does not have any -information on these ancient ISA cards on their website. - -James Nelson - 12-12-2004 - - This is the README for RISCom/8 multi-port serial driver - (C) 1994-1996 D.Gorodchanin - See file LICENSE for terms and conditions. - -NOTE: English is not my native language. - I'm sorry for any mistakes in this text. - -Misc. notes for RISCom/8 serial driver, in no particular order :) - -1) This driver can support up to 4 boards at time. - Use string "riscom8=0xXXX,0xXXX,0xXXX,0xXXX" at LILO prompt, for - setting I/O base addresses for boards. If you compile driver - as module use modprobe options "iobase=0xXXX iobase1=0xXXX iobase2=..." - -2) The driver partially supports famous 'setserial' program, you can use almost - any of its options, excluding port & irq settings. - -3) There are some misc. defines at the beginning of riscom8.c, please read the - comments and try to change some of them in case of problems. - -4) I consider the current state of the driver as BETA. - -5) SDL Communications WWW page is http://www.sdlcomm.com. - -6) You can use the MAKEDEV program to create RISCom/8 /dev/ttyL* entries. - -7) Minor numbers for first board are 0-7, for second 8-15, etc. - -22 Apr 1996. diff --git a/Documentation/serial/specialix.txt b/Documentation/serial/specialix.txt deleted file mode 100644 index 6eb6f3a3331c..000000000000 --- a/Documentation/serial/specialix.txt +++ /dev/null @@ -1,383 +0,0 @@ - - specialix.txt -- specialix IO8+ multiport serial driver readme. - - - - Copyright (C) 1997 Roger Wolff (R.E.Wolff@BitWizard.nl) - - Specialix pays for the development and support of this driver. - Please DO contact io8-linux@specialix.co.uk if you require - support. - - This driver was developed in the BitWizard linux device - driver service. If you require a linux device driver for your - product, please contact devices@BitWizard.nl for a quote. - - This code is firmly based on the riscom/8 serial driver, - written by Dmitry Gorodchanin. The specialix IO8+ card - programming information was obtained from the CL-CD1865 Data - Book, and Specialix document number 6200059: IO8+ Hardware - Functional Specification, augmented by document number 6200088: - Merak Hardware Functional Specification. (IO8+/PCI is also - called Merak) - - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - USA. - - -Intro -===== - - -This file contains some random information, that I like to have online -instead of in a manual that can get lost. Ever misplace your Linux -kernel sources? And the manual of one of the boards in your computer? - - -Addresses and interrupts -======================== - -Address dip switch settings: -The dip switch sets bits 2-9 of the IO address. - - 9 8 7 6 5 4 3 2 - +-----------------+ - 0 | X X X X X X X | - | | = IoBase = 0x100 - 1 | X | - +-----------------+ ------ RS232 connectors ----> - - | | | - edge connector - | | | - V V V - -Base address 0x100 caused a conflict in one of my computers once. I -haven't the foggiest why. My Specialix card is now at 0x180. My -other computer runs just fine with the Specialix card at 0x100.... -The card occupies 4 addresses, but actually only two are really used. - -The PCI version doesn't have any dip switches. The BIOS assigns -an IO address. - -The driver now still autoprobes at 0x100, 0x180, 0x250 and 0x260. If -that causes trouble for you, please report that. I'll remove -autoprobing then. - -The driver will tell the card what IRQ to use, so you don't have to -change any jumpers to change the IRQ. Just use a command line -argument (irq=xx) to the insmod program to set the interrupt. - -The BIOS assigns the IRQ on the PCI version. You have no say in what -IRQ to use in that case. - -If your specialix cards are not at the default locations, you can use -the kernel command line argument "specialix=io0,irq0,io1,irq1...". -Here "io0" is the io address for the first card, and "irq0" is the -irq line that the first card should use. And so on. - -Examples. - -You use the driver as a module and have three cards at 0x100, 0x250 -and 0x180. And some way or another you want them detected in that -order. Moreover irq 12 is taken (e.g. by your PS/2 mouse). - - insmod specialix.o iobase=0x100,0x250,0x180 irq=9,11,15 - -The same three cards, but now in the kernel would require you to -add - - specialix=0x100,9,0x250,11,0x180,15 - -to the command line. This would become - - append="specialix=0x100,9,0x250,11,0x180,15" - -in your /etc/lilo.conf file if you use lilo. - -The Specialix driver is slightly odd: It allows you to have the second -or third card detected without having a first card. This has -advantages and disadvantages. A slot that isn't filled by an ISA card, -might be filled if a PCI card is detected. Thus if you have an ISA -card at 0x250 and a PCI card, you would get: - -sx0: specialix IO8+ Board at 0x100 not found. -sx1: specialix IO8+ Board at 0x180 not found. -sx2: specialix IO8+ board detected at 0x250, IRQ 12, CD1865 Rev. B. -sx3: specialix IO8+ Board at 0x260 not found. -sx0: specialix IO8+ board detected at 0xd800, IRQ 9, CD1865 Rev. B. - -This would happen if you don't give any probe hints to the driver. -If you would specify: - - specialix=0x250,11 - -you'd get the following messages: - -sx0: specialix IO8+ board detected at 0x250, IRQ 11, CD1865 Rev. B. -sx1: specialix IO8+ board detected at 0xd800, IRQ 9, CD1865 Rev. B. - -ISA probing is aborted after the IO address you gave is exhausted, and -the PCI card is now detected as the second card. The ISA card is now -also forced to IRQ11.... - - -Baud rates -========== - -The rev 1.2 and below boards use a CL-CD1864. These chips can only -do 64kbit. The rev 1.3 and newer boards use a CL-CD1865. These chips -are officially capable of 115k2. - -The Specialix card uses a 25MHz crystal (in times two mode, which in -fact is a divided by two mode). This is not enough to reach the rated -115k2 on all ports at the same time. With this clock rate you can only -do 37% of this rate. This means that at 115k2 on all ports you are -going to lose characters (The chip cannot handle that many incoming -bits at this clock rate.) (Yes, you read that correctly: there is a -limit to the number of -=bits=- per second that the chip can handle.) - -If you near the "limit" you will first start to see a graceful -degradation in that the chip cannot keep the transmitter busy at all -times. However with a central clock this slow, you can also get it to -miss incoming characters. The driver will print a warning message when -you are outside the official specs. The messages usually show up in -the file /var/log/messages . - -The specialix card cannot reliably do 115k2. If you use it, you have -to do "extensive testing" (*) to verify if it actually works. - -When "mgetty" communicates with my modem at 115k2 it reports: -got: +++[0d]ATQ0V1H0[0d][0d][8a]O[cb][0d][8a] - ^^^^ ^^^^ ^^^^ - -The three characters that have the "^^^" under them have suffered a -bit error in the highest bit. In conclusion: I've tested it, and found -that it simply DOESN'T work for me. I also suspect that this is also -caused by the baud rate being just a little bit out of tune. - -I upgraded the crystal to 66Mhz on one of my Specialix cards. Works -great! Contact me for details. (Voids warranty, requires a steady hand -and more such restrictions....) - - -(*) Cirrus logic CD1864 databook, page 40. - - -Cables for the Specialix IO8+ -============================= - -The pinout of the connectors on the IO8+ is: - - pin short direction long name - name - Pin 1 DCD input Data Carrier Detect - Pin 2 RXD input Receive - Pin 3 DTR/RTS output Data Terminal Ready/Ready To Send - Pin 4 GND - Ground - Pin 5 TXD output Transmit - Pin 6 CTS input Clear To Send - - - -- 6 5 4 3 2 1 -- - | | - | | - | | - | | - +----- -----+ - |__________| - clip - - Front view of an RJ12 connector. Cable moves "into" the paper. - (the plug is ready to plug into your mouth this way...) - - - NULL cable. I don't know who is going to use these except for - testing purposes, but I tested the cards with this cable. (It - took quite a while to figure out, so I'm not going to delete - it. So there! :-) - - - This end goes This end needs - straight into the some twists in - RJ12 plug. the wiring. - IO8+ RJ12 IO8+ RJ12 - 1 DCD white - - - - 1 DCD - 2 RXD black 5 TXD - 3 DTR/RTS red 6 CTS - 4 GND green 4 GND - 5 TXD yellow 2 RXD - 6 CTS blue 3 DTR/RTS - - - Same NULL cable, but now sorted on the second column. - - 1 DCD white - - - - 1 DCD - 5 TXD yellow 2 RXD - 6 CTS blue 3 DTR/RTS - 4 GND green 4 GND - 2 RXD black 5 TXD - 3 DTR/RTS red 6 CTS - - - - This is a modem cable usable for hardware handshaking: - RJ12 DB25 DB9 - 1 DCD white 8 DCD 1 DCD - 2 RXD black 3 RXD 2 RXD - 3 DTR/RTS red 4 RTS 7 RTS - 4 GND green 7 GND 5 GND - 5 TXD yellow 2 TXD 3 TXD - 6 CTS blue 5 CTS 8 CTS - +---- 6 DSR 6 DSR - +---- 20 DTR 4 DTR - - This is a modem cable usable for software handshaking: - It allows you to reset the modem using the DTR ioctls. - I (REW) have never tested this, "but xxxxxxxxxxxxx - says that it works." If you test this, please - tell me and I'll fill in your name on the xxx's. - - RJ12 DB25 DB9 - 1 DCD white 8 DCD 1 DCD - 2 RXD black 3 RXD 2 RXD - 3 DTR/RTS red 20 DTR 4 DTR - 4 GND green 7 GND 5 GND - 5 TXD yellow 2 TXD 3 TXD - 6 CTS blue 5 CTS 8 CTS - +---- 6 DSR 6 DSR - +---- 4 RTS 7 RTS - - I bought a 6 wire flat cable. It was colored as indicated. - Check that yours is the same before you trust me on this. - - -Hardware handshaking issues. -============================ - -The driver can be told to operate in two different ways. The default -behaviour is specialix.sx_rtscts = 0 where the pin behaves as DTR when -hardware handshaking is off. It behaves as the RTS hardware -handshaking signal when hardware handshaking is selected. - -When you use this, you have to use the appropriate cable. The -cable will either be compatible with hardware handshaking or with -software handshaking. So switching on the fly is not really an -option. - -I actually prefer to use the "specialix.sx_rtscts=1" option. -This makes the DTR/RTS pin always an RTS pin, and ioctls to -change DTR are always ignored. I have a cable that is configured -for this. - - -Ports and devices -================= - -Port 0 is the one furthest from the card-edge connector. - -Devices: - -You should make the devices as follows: - -bash -cd /dev -for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 \ - 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -do - echo -n "$i " - mknod /dev/ttyW$i c 75 $i - mknod /dev/cuw$i c 76 $i -done -echo "" - -If your system doesn't come with these devices preinstalled, bug your -linux-vendor about this. They have had ample time to get this -implemented by now. - -You cannot have more than 4 boards in one computer. The card only -supports 4 different interrupts. If you really want this, contact me -about this and I'll give you a few tips (requires soldering iron).... - -If you have enough PCI slots, you can probably use more than 4 PCI -versions of the card though.... - -The PCI version of the card cannot adhere to the mechanical part of -the PCI spec because the 8 serial connectors are simply too large. If -it doesn't fit in your computer, bring back the card. - - ------------------------------------------------------------------------- - - - Fixed bugs and restrictions: - - During initialization, interrupts are blindly turned on. - Having a shadow variable would cause an extra memory - access on every IO instruction. - - The interrupt (on the card) should be disabled when we - don't allocate the Linux end of the interrupt. This allows - a different driver/card to use it while all ports are not in - use..... (a la standard serial port) - == An extra _off variant of the sx_in and sx_out macros are - now available. They don't set the interrupt enable bit. - These are used during initialization. Normal operation uses - the old variant which enables the interrupt line. - - RTS/DTR issue needs to be implemented according to - specialix' spec. - I kind of like the "determinism" of the current - implementation. Compile time flag? - == Ok. Compile time flag! Default is how Specialix likes it. - == Now a config time flag! Gets saved in your config file. Neat! - - Can you set the IO address from the lilo command line? - If you need this, bug me about it, I'll make it. - == Hah! No bugging needed. Fixed! :-) - - Cirrus logic hasn't gotten back to me yet why the CD1865 can - and the CD1864 can't do 115k2. I suspect that this is - because the CD1864 is not rated for 33MHz operation. - Therefore the CD1864 versions of the card can't do 115k2 on - all ports just like the CD1865 versions. The driver does - not block 115k2 on CD1864 cards. - == I called the Cirrus Logic representative here in Holland. - The CD1864 databook is identical to the CD1865 databook, - except for an extra warning at the end. Similar Bit errors - have been observed in testing at 115k2 on both an 1865 and - a 1864 chip. I see no reason why I would prohibit 115k2 on - 1864 chips and not do it on 1865 chips. Actually there is - reason to prohibit it on BOTH chips. I print a warning. - If you use 115k2, you're on your own. - - A spiky CD may send spurious HUPs. Also in CLOCAL??? - -- A fix for this turned out to be counter productive. - Different fix? Current behaviour is acceptable? - -- Maybe the current implementation is correct. If anybody - gets bitten by this, please report, and it will get fixed. - - -- Testing revealed that when in CLOCAL, the problem doesn't - occur. As warned for in the CD1865 manual, the chip may - send modem intr's on a spike. We could filter those out, - but that would be a cludge anyway (You'd still risk getting - a spurious HUP when two spikes occur.)..... - - - - Bugs & restrictions: - - This is a difficult card to autoprobe. - You have to WRITE to the address register to even - read-probe a CD186x register. Disable autodetection? - -- Specialix: any suggestions? - - diff --git a/Documentation/serial/sx.txt b/Documentation/serial/sx.txt deleted file mode 100644 index cb4efa0fb5cc..000000000000 --- a/Documentation/serial/sx.txt +++ /dev/null @@ -1,294 +0,0 @@ - - sx.txt -- specialix SX/SI multiport serial driver readme. - - - - Copyright (C) 1997 Roger Wolff (R.E.Wolff@BitWizard.nl) - - Specialix pays for the development and support of this driver. - Please DO contact support@specialix.co.uk if you require - support. - - This driver was developed in the BitWizard linux device - driver service. If you require a linux device driver for your - product, please contact devices@BitWizard.nl for a quote. - - (History) - There used to be an SI driver by Simon Allan. This is a complete - rewrite from scratch. Just a few lines-of-code have been snatched. - - (Sources) - Specialix document number 6210028: SX Host Card and Download Code - Software Functional Specification. - - (Copying) - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, - USA. - - (Addendum) - I'd appreciate it that if you have fixes, that you send them - to me first. - - -Introduction -============ - -This file contains some random information, that I like to have online -instead of in a manual that can get lost. Ever misplace your Linux -kernel sources? And the manual of one of the boards in your computer? - - -Theory of operation -=================== - -An important thing to know is that the driver itself doesn't have the -firmware for the card. This means that you need the separate package -"sx_firmware". For now you can get the source at - - ftp://ftp.bitwizard.nl/specialix/sx_firmware_.tgz - -The firmware load needs a "misc" device, so you'll need to enable the -"Support for user misc device modules" in your kernel configuration. -The misc device needs to be called "/dev/specialix_sxctl". It needs -misc major 10, and minor number 167 (assigned by HPA). The section -on creating device files below also creates this device. - -After loading the sx.o module into your kernel, the driver will report -the number of cards detected, but because it doesn't have any -firmware, it will not be able to determine the number of ports. Only -when you then run "sx_firmware" will the firmware be downloaded and -the rest of the driver initialized. At that time the sx_firmware -program will report the number of ports installed. - -In contrast with many other multi port serial cards, some of the data -structures are only allocated when the card knows the number of ports -that are connected. This means we won't waste memory for 120 port -descriptor structures when you only have 8 ports. If you experience -problems due to this, please report them: I haven't seen any. - - -Interrupts -========== - -A multi port serial card, would generate a horrendous amount of -interrupts if it would interrupt the CPU for every received -character. Even more than 10 years ago, the trick not to use -interrupts but to poll the serial cards was invented. - -The SX card allow us to do this two ways. First the card limits its -own interrupt rate to a rate that won't overwhelm the CPU. Secondly, -we could forget about the cards interrupt completely and use the -internal timer for this purpose. - -Polling the card can take up to a few percent of your CPU. Using the -interrupts would be better if you have most of the ports idle. Using -timer-based polling is better if your card almost always has work to -do. You save the separate interrupt in that case. - -In any case, it doesn't really matter all that much. - -The most common problem with interrupts is that for ISA cards in a PCI -system the BIOS has to be told to configure that interrupt as "legacy -ISA". Otherwise the card can pull on the interrupt line all it wants -but the CPU won't see this. - -If you can't get the interrupt to work, remember that polling mode is -more efficient (provided you actually use the card intensively). - - -Allowed Configurations -====================== - -Some configurations are disallowed. Even though at a glance they might -seem to work, they are known to lockup the bus between the host card -and the device concentrators. You should respect the drivers decision -not to support certain configurations. It's there for a reason. - -Warning: Seriously technical stuff ahead. Executive summary: Don't use -SX cards except configured at a 64k boundary. Skip the next paragraph. - -The SX cards can theoretically be placed at a 32k boundary. So for -instance you can put an SX card at 0xc8000-0xd7fff. This is not a -"recommended configuration". ISA cards have to tell the bus controller -how they like their timing. Due to timing issues they have to do this -based on which 64k window the address falls into. This means that the -32k window below and above the SX card have to use exactly the same -timing as the SX card. That reportedly works for other SX cards. But -you're still left with two useless 32k windows that should not be used -by anybody else. - - -Configuring the driver -====================== - -PCI cards are always detected. The driver auto-probes for ISA cards at -some sensible addresses. Please report if the auto-probe causes trouble -in your system, or when a card isn't detected. - -I'm afraid I haven't implemented "kernel command line parameters" yet. -This means that if the default doesn't work for you, you shouldn't use -the compiled-into-the-kernel version of the driver. Use a module -instead. If you convince me that you need this, I'll make it for -you. Deal? - -I'm afraid that the module parameters are a bit clumsy. If you have a -better idea, please tell me. - -You can specify several parameters: - - sx_poll: number of jiffies between timer-based polls. - - Set this to "0" to disable timer based polls. - Initialization of cards without a working interrupt - will fail. - - Set this to "1" if you want a polling driver. - (on Intel: 100 polls per second). If you don't use - fast baud rates, you might consider a value like "5". - (If you don't know how to do the math, use 1). - - sx_slowpoll: Number of jiffies between timer-based polls. - Set this to "100" to poll once a second. - This should get the card out of a stall if the driver - ever misses an interrupt. I've never seen this happen, - and if it does, that's a bug. Tell me. - - sx_maxints: Number of interrupts to request from the card. - The card normally limits interrupts to about 100 per - second to offload the host CPU. You can increase this - number to reduce latency on the card a little. - Note that if you give a very high number you can overload - your CPU as well as the CPU on the host card. This setting - is inaccurate and not recommended for SI cards (But it - works). - - sx_irqmask: The mask of allowable IRQs to use. I suggest you set - this to 0 (disable IRQs all together) and use polling if - the assignment of IRQs becomes problematic. This is defined - as the sum of (1 << irq) 's that you want to allow. So - sx_irqmask of 8 (1 << 3) specifies that only irq 3 may - be used by the SX driver. If you want to specify to the - driver: "Either irq 11 or 12 is ok for you to use", then - specify (1 << 11) | (1 << 12) = 0x1800 . - - sx_debug: You can enable different sorts of debug traces with this. - At "-1" all debugging traces are active. You'll get several - times more debugging output than you'll get characters - transmitted. - - -Baud rates -========== - -Theoretically new SXDCs should be capable of more than 460k -baud. However the line drivers usually give up before that. Also the -CPU on the card may not be able to handle 8 channels going at full -blast at that speed. Moreover, the buffers are not large enough to -allow operation with 100 interrupts per second. You'll have to realize -that the card has a 256 byte buffer, so you'll have to increase the -number of interrupts per second if you have more than 256*100 bytes -per second to transmit. If you do any performance testing in this -area, I'd be glad to hear from you... - -(Psst Linux users..... I think the Linux driver is more efficient than -the driver for other OSes. If you can and want to benchmark them -against each other, be my guest, and report your findings...... :-) - - -Ports and devices -================= - -Port 0 is the top connector on the module closest to the host -card. Oh, the ports on the SXDCs and TAs are labelled from 1 to 8 -instead of from 0 to 7, as they are numbered by linux. I'm stubborn in -this: I know for sure that I wouldn't be able to calculate which port -is which anymore if I would change that.... - - -Devices: - -You should make the device files as follows: - -#!/bin/sh -# (I recommend that you cut-and-paste this into a file and run that) -cd /dev -t=0 -mknod specialix_sxctl c 10 167 -while [ $t -lt 64 ] - do - echo -n "$t " - mknod ttyX$t c 32 $t - mknod cux$t c 33 $t - t=`expr $t + 1` -done -echo "" -rm /etc/psdevtab -ps > /dev/null - - -This creates 64 devices. If you have more, increase the constant on -the line with "while". The devices start at 0, as is customary on -Linux. Specialix seems to like starting the numbering at 1. - -If your system doesn't come with these devices pre-installed, bug your -linux-vendor about this. They should have these devices -"pre-installed" before the new millennium. The "ps" stuff at the end -is to "tell" ps that the new devices exist. - -Officially the maximum number of cards per computer is 4. This driver -however supports as many cards in one machine as you want. You'll run -out of interrupts after a few, but you can switch to polled operation -then. At about 256 ports (More than 8 cards), we run out of minor -device numbers. Sorry. I suggest you buy a second computer.... (Or -switch to RIO). - ------------------------------------------------------------------------- - - - Fixed bugs and restrictions: - - Hangup processing. - -- Done. - - - the write path in generic_serial (lockup / oops). - -- Done (Ugly: not the way I want it. Copied from serial.c). - - - write buffer isn't flushed at close. - -- Done. I still seem to lose a few chars at close. - Sorry. I think that this is a firmware issue. (-> Specialix) - - - drain hardware before changing termios - - Change debug on the fly. - - ISA free irq -1. (no firmware loaded). - - adding c8000 as a probe address. Added warning. - - Add a RAMtest for the RAM on the card.c - - Crash when opening a port "way" of the number of allowed ports. - (for example opening port 60 when there are only 24 ports attached) - - Sometimes the use-count strays a bit. After a few hours of - testing the use count is sometimes "3". If you are not like - me and can remember what you did to get it that way, I'd - appreciate an Email. Possibly fixed. Tell me if anyone still - sees this. - - TAs don't work right if you don't connect all the modem control - signals. SXDCs do. T225 firmware problem -> Specialix. - (Mostly fixed now, I think. Tell me if you encounter this!) - - Bugs & restrictions: - - - Arbitrary baud rates. Requires firmware update. (-> Specialix) - - - Low latency (mostly firmware, -> Specialix) - - - diff --git a/Documentation/zh_CN/magic-number.txt b/Documentation/zh_CN/magic-number.txt index 2ebe539f5450..dfb72a5c63e9 100644 --- a/Documentation/zh_CN/magic-number.txt +++ b/Documentation/zh_CN/magic-number.txt @@ -63,8 +63,6 @@ struct tty_ldisc { PG_MAGIC 'P' pg_{read,write}_hdr include/linux/pg.h CMAGIC 0x0111 user include/linux/a.out.h MKISS_DRIVER_MAGIC 0x04bf mkiss_channel drivers/net/mkiss.h -RISCOM8_MAGIC 0x0907 riscom_port drivers/char/riscom8.h -SPECIALIX_MAGIC 0x0907 specialix_port drivers/char/specialix_io8.h HDLC_MAGIC 0x239e n_hdlc drivers/char/n_hdlc.c APM_BIOS_MAGIC 0x4101 apm_user arch/x86/kernel/apm_32.c CYCLADES_MAGIC 0x4359 cyclades_port include/linux/cyclades.h @@ -82,7 +80,6 @@ STRIP_MAGIC 0x5303 strip drivers/net/strip.c X25_ASY_MAGIC 0x5303 x25_asy drivers/net/x25_asy.h SIXPACK_MAGIC 0x5304 sixpack drivers/net/hamradio/6pack.h AX25_MAGIC 0x5316 ax_disp drivers/net/mkiss.h -ESP_MAGIC 0x53ee esp_struct drivers/char/esp.h TTY_MAGIC 0x5401 tty_struct include/linux/tty.h MGSL_MAGIC 0x5401 mgsl_info drivers/char/synclink.c TTY_DRIVER_MAGIC 0x5402 tty_driver include/linux/tty_driver.h @@ -94,13 +91,10 @@ USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth drivers/usb/class/bluetty.c RFCOMM_TTY_MAGIC 0x6d02 net/bluetooth/rfcomm/tty.c USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port drivers/usb/serial/usb-serial.h CG_MAGIC 0x00090255 ufs_cylinder_group include/linux/ufs_fs.h -A2232_MAGIC 0x000a2232 gs_port drivers/char/ser_a2232.h RPORT_MAGIC 0x00525001 r_port drivers/char/rocket_int.h LSEMAGIC 0x05091998 lse drivers/fc4/fc.c GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str drivers/scsi/gdth_ioctl.h RIEBL_MAGIC 0x09051990 drivers/net/atarilance.c -RIO_MAGIC 0x12345678 gs_port drivers/char/rio/rio_linux.c -SX_MAGIC 0x12345678 gs_port drivers/char/sx.h NBD_REQUEST_MAGIC 0x12560953 nbd_request include/linux/nbd.h RED_MAGIC2 0x170fc2a5 (any) mm/slab.c BAYCOM_MAGIC 0x19730510 baycom_state drivers/net/baycom_epp.c @@ -116,7 +110,6 @@ ISDN_ASYNC_MAGIC 0x49344C01 modem_info include/linux/isdn.h CTC_ASYNC_MAGIC 0x49344C01 ctc_tty_info drivers/s390/net/ctctty.c ISDN_NET_MAGIC 0x49344C02 isdn_net_local_s drivers/isdn/i4l/isdn_net_lib.h SAVEKMSG_MAGIC2 0x4B4D5347 savekmsg arch/*/amiga/config.c -STLI_BOARDMAGIC 0x4bc6c825 stlibrd include/linux/istallion.h CS_STATE_MAGIC 0x4c4f4749 cs_state sound/oss/cs46xx.c SLAB_C_MAGIC 0x4f17a36d kmem_cache mm/slab.c COW_MAGIC 0x4f4f4f4d cow_header_v1 arch/um/drivers/ubd_user.c @@ -127,10 +120,8 @@ SCC_MAGIC 0x52696368 gs_port drivers/char/scc.h SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c GDA_MAGIC 0x58464552 gda arch/mips/include/asm/sn/gda.h RED_MAGIC1 0x5a2cf071 (any) mm/slab.c -STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h -EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h KV_MAGIC 0x5f4b565f kernel_vars_s arch/mips/include/asm/sn/klkernvars.h I810_STATE_MAGIC 0x63657373 i810_state sound/oss/i810_audio.c @@ -142,17 +133,14 @@ SLOT_MAGIC 0x67267322 slot drivers/hotplug/acpiphp.h LO_MAGIC 0x68797548 nbd_device include/linux/nbd.h OPROFILE_MAGIC 0x6f70726f super_block drivers/oprofile/oprofilefs.h M3_STATE_MAGIC 0x734d724d m3_state sound/oss/maestro3.c -STL_PANELMAGIC 0x7ef621a1 stlpanel include/linux/stallion.h VMALLOC_MAGIC 0x87654320 snd_alloc_track sound/core/memory.c KMALLOC_MAGIC 0x87654321 snd_alloc_track sound/core/memory.c PWC_MAGIC 0x89DC10AB pwc_device drivers/usb/media/pwc.h NBD_REPLY_MAGIC 0x96744668 nbd_reply include/linux/nbd.h -STL_BOARDMAGIC 0xa2267f52 stlbrd include/linux/stallion.h ENI155_MAGIC 0xa54b872d midway_eprom drivers/atm/eni.h SCI_MAGIC 0xbabeface gs_port drivers/char/sh-sci.h CODA_MAGIC 0xC0DAC0DA coda_file_info include/linux/coda_fs_i.h DPMEM_MAGIC 0xc0ffee11 gdt_pci_sram drivers/scsi/gdth.h -STLI_PORTMAGIC 0xe671c7a1 stliport include/linux/istallion.h YAM_MAGIC 0xF10A7654 yam_port drivers/net/hamradio/yam.c CCB_MAGIC 0xf2691ad2 ccb drivers/scsi/ncr53c8xx.c QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry drivers/scsi/arm/queue.c diff --git a/firmware/WHENCE b/firmware/WHENCE index 8388f02de2bd..0c4d96dee9b6 100644 --- a/firmware/WHENCE +++ b/firmware/WHENCE @@ -273,16 +273,6 @@ Converted from Intel HEX files, used in our binary representation of ihex. -------------------------------------------------------------------------- -Driver: ip2 -- Computone IntelliPort Plus serial device - -File: intelliport2.bin - -Licence: Unknown - -Found in hex form in kernel source. - --------------------------------------------------------------------------- - Driver: CPiA2 -- cameras based on Vision's CPiA2 File: cpia2/stv0672_vp4.bin -- cgit v1.2.3 From f7018c21350204c4cf628462f229d44d03545254 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 13 Feb 2014 15:31:38 +0200 Subject: video: move fbdev to drivers/video/fbdev The drivers/video directory is a mess. It contains generic video related files, directories for backlight, console, linux logo, lots of fbdev device drivers, fbdev framework files. Make some order into the chaos by creating drivers/video/fbdev directory, and move all fbdev related files there. No functionality is changed, although I guess it is possible that some subtle Makefile build order related issue could be created by this patch. Signed-off-by: Tomi Valkeinen Acked-by: Laurent Pinchart Acked-by: Geert Uytterhoeven Acked-by: Rob Clark Acked-by: Jingoo Han Acked-by: Daniel Vetter --- Documentation/DocBook/device-drivers.tmpl | 10 +- drivers/Makefile | 4 +- drivers/staging/xgifb/vb_def.h | 2 +- drivers/staging/xgifb/vb_struct.h | 2 +- drivers/staging/xgifb/vgatypes.h | 4 +- drivers/video/68328fb.c | 503 - drivers/video/Kconfig | 2476 +---- drivers/video/Makefile | 166 +- drivers/video/acornfb.c | 1143 -- drivers/video/acornfb.h | 169 - drivers/video/amba-clcd.c | 656 -- drivers/video/amifb.c | 3792 ------- drivers/video/arcfb.c | 667 -- drivers/video/arkfb.c | 1231 --- drivers/video/asiliantfb.c | 624 -- drivers/video/atafb.c | 3266 ------ drivers/video/atafb.h | 36 - drivers/video/atafb_iplan2p2.c | 293 - drivers/video/atafb_iplan2p4.c | 308 - drivers/video/atafb_iplan2p8.c | 345 - drivers/video/atafb_mfb.c | 112 - drivers/video/atafb_utils.h | 400 - drivers/video/atmel_lcdfb.c | 1453 --- drivers/video/aty/Makefile | 15 - drivers/video/aty/ati_ids.h | 214 - drivers/video/aty/aty128fb.c | 2591 ----- drivers/video/aty/atyfb.h | 369 - drivers/video/aty/atyfb_base.c | 4029 ------- drivers/video/aty/mach64_accel.c | 430 - drivers/video/aty/mach64_ct.c | 649 -- drivers/video/aty/mach64_cursor.c | 225 - drivers/video/aty/mach64_gx.c | 910 -- drivers/video/aty/radeon_accel.c | 328 - drivers/video/aty/radeon_backlight.c | 221 - drivers/video/aty/radeon_base.c | 2568 ----- drivers/video/aty/radeon_i2c.c | 167 - drivers/video/aty/radeon_monitor.c | 1052 -- drivers/video/aty/radeon_pm.c | 2906 ----- drivers/video/aty/radeonfb.h | 634 -- drivers/video/au1100fb.c | 642 -- drivers/video/au1100fb.h | 377 - drivers/video/au1200fb.c | 1859 ---- drivers/video/au1200fb.h | 572 - drivers/video/auo_k1900fb.c | 205 - drivers/video/auo_k1901fb.c | 258 - drivers/video/auo_k190x.c | 1198 -- drivers/video/auo_k190x.h | 129 - drivers/video/bf537-lq035.c | 915 -- drivers/video/bf54x-lq043fb.c | 767 -- drivers/video/bfin-lq035q1-fb.c | 864 -- drivers/video/bfin-t350mcqb-fb.c | 670 -- drivers/video/bfin_adv7393fb.c | 827 -- drivers/video/bfin_adv7393fb.h | 321 - drivers/video/broadsheetfb.c | 1223 -- drivers/video/bt431.h | 235 - drivers/video/bt455.h | 94 - drivers/video/bw2.c | 406 - drivers/video/c2p.h | 19 - drivers/video/c2p_core.h | 153 - drivers/video/c2p_iplan2.c | 153 - drivers/video/c2p_planar.c | 156 - drivers/video/carminefb.c | 788 -- drivers/video/carminefb.h | 64 - drivers/video/carminefb_regs.h | 159 - drivers/video/cfbcopyarea.c | 434 - drivers/video/cfbfillrect.c | 371 - drivers/video/cfbimgblt.c | 313 - drivers/video/cg14.c | 626 -- drivers/video/cg3.c | 492 - drivers/video/cg6.c | 885 -- drivers/video/chipsfb.c | 519 - drivers/video/cirrusfb.c | 2952 ----- drivers/video/clps711xfb.c | 315 - drivers/video/cobalt_lcdfb.c | 401 - drivers/video/console/sticon.c | 2 +- drivers/video/console/sticore.c | 2 +- drivers/video/controlfb.c | 1084 -- drivers/video/controlfb.h | 145 - drivers/video/cyber2000fb.c | 1901 ---- drivers/video/cyber2000fb.h | 497 - drivers/video/da8xx-fb.c | 1659 --- drivers/video/dnfb.c | 303 - drivers/video/edid.h | 138 - drivers/video/efifb.c | 360 - drivers/video/ep93xx-fb.c | 634 -- drivers/video/exynos/Kconfig | 32 - drivers/video/exynos/Makefile | 7 - drivers/video/exynos/exynos_mipi_dsi.c | 574 - drivers/video/exynos/exynos_mipi_dsi_common.c | 880 -- drivers/video/exynos/exynos_mipi_dsi_common.h | 46 - drivers/video/exynos/exynos_mipi_dsi_lowlevel.c | 618 -- drivers/video/exynos/exynos_mipi_dsi_lowlevel.h | 112 - drivers/video/exynos/exynos_mipi_dsi_regs.h | 149 - drivers/video/exynos/s6e8ax0.c | 898 -- drivers/video/fb-puv3.c | 838 -- drivers/video/fb_ddc.c | 119 - drivers/video/fb_defio.c | 245 - drivers/video/fb_draw.h | 186 - drivers/video/fb_notify.c | 47 - drivers/video/fb_sys_fops.c | 104 - drivers/video/fbcmap.c | 362 - drivers/video/fbcvt.c | 379 - drivers/video/fbdev/68328fb.c | 503 + drivers/video/fbdev/Kconfig | 2474 +++++ drivers/video/fbdev/Makefile | 166 + drivers/video/fbdev/acornfb.c | 1143 ++ drivers/video/fbdev/acornfb.h | 169 + drivers/video/fbdev/amba-clcd.c | 656 ++ drivers/video/fbdev/amifb.c | 3792 +++++++ drivers/video/fbdev/arcfb.c | 667 ++ drivers/video/fbdev/arkfb.c | 1231 +++ drivers/video/fbdev/asiliantfb.c | 624 ++ drivers/video/fbdev/atafb.c | 3266 ++++++ drivers/video/fbdev/atafb.h | 36 + drivers/video/fbdev/atafb_iplan2p2.c | 293 + drivers/video/fbdev/atafb_iplan2p4.c | 308 + drivers/video/fbdev/atafb_iplan2p8.c | 345 + drivers/video/fbdev/atafb_mfb.c | 112 + drivers/video/fbdev/atafb_utils.h | 400 + drivers/video/fbdev/atmel_lcdfb.c | 1453 +++ drivers/video/fbdev/aty/Makefile | 15 + drivers/video/fbdev/aty/ati_ids.h | 214 + drivers/video/fbdev/aty/aty128fb.c | 2591 +++++ drivers/video/fbdev/aty/atyfb.h | 369 + drivers/video/fbdev/aty/atyfb_base.c | 4029 +++++++ drivers/video/fbdev/aty/mach64_accel.c | 430 + drivers/video/fbdev/aty/mach64_ct.c | 649 ++ drivers/video/fbdev/aty/mach64_cursor.c | 225 + drivers/video/fbdev/aty/mach64_gx.c | 910 ++ drivers/video/fbdev/aty/radeon_accel.c | 328 + drivers/video/fbdev/aty/radeon_backlight.c | 221 + drivers/video/fbdev/aty/radeon_base.c | 2568 +++++ drivers/video/fbdev/aty/radeon_i2c.c | 167 + drivers/video/fbdev/aty/radeon_monitor.c | 1052 ++ drivers/video/fbdev/aty/radeon_pm.c | 2906 +++++ drivers/video/fbdev/aty/radeonfb.h | 634 ++ drivers/video/fbdev/au1100fb.c | 642 ++ drivers/video/fbdev/au1100fb.h | 377 + drivers/video/fbdev/au1200fb.c | 1859 ++++ drivers/video/fbdev/au1200fb.h | 572 + drivers/video/fbdev/auo_k1900fb.c | 205 + drivers/video/fbdev/auo_k1901fb.c | 258 + drivers/video/fbdev/auo_k190x.c | 1198 ++ drivers/video/fbdev/auo_k190x.h | 129 + drivers/video/fbdev/bf537-lq035.c | 915 ++ drivers/video/fbdev/bf54x-lq043fb.c | 767 ++ drivers/video/fbdev/bfin-lq035q1-fb.c | 864 ++ drivers/video/fbdev/bfin-t350mcqb-fb.c | 670 ++ drivers/video/fbdev/bfin_adv7393fb.c | 827 ++ drivers/video/fbdev/bfin_adv7393fb.h | 321 + drivers/video/fbdev/broadsheetfb.c | 1223 ++ drivers/video/fbdev/bt431.h | 235 + drivers/video/fbdev/bt455.h | 94 + drivers/video/fbdev/bw2.c | 406 + drivers/video/fbdev/c2p.h | 19 + drivers/video/fbdev/c2p_core.h | 153 + drivers/video/fbdev/c2p_iplan2.c | 153 + drivers/video/fbdev/c2p_planar.c | 156 + drivers/video/fbdev/carminefb.c | 788 ++ drivers/video/fbdev/carminefb.h | 64 + drivers/video/fbdev/carminefb_regs.h | 159 + drivers/video/fbdev/cfbcopyarea.c | 434 + drivers/video/fbdev/cfbfillrect.c | 371 + drivers/video/fbdev/cfbimgblt.c | 313 + drivers/video/fbdev/cg14.c | 626 ++ drivers/video/fbdev/cg3.c | 492 + drivers/video/fbdev/cg6.c | 885 ++ drivers/video/fbdev/chipsfb.c | 519 + drivers/video/fbdev/cirrusfb.c | 2952 +++++ drivers/video/fbdev/clps711xfb.c | 315 + drivers/video/fbdev/cobalt_lcdfb.c | 401 + drivers/video/fbdev/controlfb.c | 1084 ++ drivers/video/fbdev/controlfb.h | 145 + drivers/video/fbdev/cyber2000fb.c | 1901 ++++ drivers/video/fbdev/cyber2000fb.h | 497 + drivers/video/fbdev/da8xx-fb.c | 1659 +++ drivers/video/fbdev/dnfb.c | 303 + drivers/video/fbdev/edid.h | 138 + drivers/video/fbdev/efifb.c | 360 + drivers/video/fbdev/ep93xx-fb.c | 634 ++ drivers/video/fbdev/exynos/Kconfig | 32 + drivers/video/fbdev/exynos/Makefile | 7 + drivers/video/fbdev/exynos/exynos_mipi_dsi.c | 574 + .../video/fbdev/exynos/exynos_mipi_dsi_common.c | 880 ++ .../video/fbdev/exynos/exynos_mipi_dsi_common.h | 46 + .../video/fbdev/exynos/exynos_mipi_dsi_lowlevel.c | 618 ++ .../video/fbdev/exynos/exynos_mipi_dsi_lowlevel.h | 112 + drivers/video/fbdev/exynos/exynos_mipi_dsi_regs.h | 149 + drivers/video/fbdev/exynos/s6e8ax0.c | 898 ++ drivers/video/fbdev/fb-puv3.c | 838 ++ drivers/video/fbdev/fb_ddc.c | 119 + drivers/video/fbdev/fb_defio.c | 245 + drivers/video/fbdev/fb_draw.h | 186 + drivers/video/fbdev/fb_notify.c | 47 + drivers/video/fbdev/fb_sys_fops.c | 104 + drivers/video/fbdev/fbcmap.c | 362 + drivers/video/fbdev/fbcvt.c | 379 + drivers/video/fbdev/fbmem.c | 2002 ++++ drivers/video/fbdev/fbmon.c | 1592 +++ drivers/video/fbdev/fbsysfs.c | 586 + drivers/video/fbdev/ffb.c | 1081 ++ drivers/video/fbdev/fm2fb.c | 323 + drivers/video/fbdev/fsl-diu-fb.c | 1994 ++++ drivers/video/fbdev/g364fb.c | 255 + drivers/video/fbdev/gbefb.c | 1309 +++ drivers/video/fbdev/geode/Kconfig | 54 + drivers/video/fbdev/geode/Makefile | 9 + drivers/video/fbdev/geode/display_gx.c | 184 + drivers/video/fbdev/geode/display_gx1.c | 214 + drivers/video/fbdev/geode/display_gx1.h | 154 + drivers/video/fbdev/geode/geodefb.h | 38 + drivers/video/fbdev/geode/gx1fb_core.c | 476 + drivers/video/fbdev/geode/gxfb.h | 358 + drivers/video/fbdev/geode/gxfb_core.c | 547 + drivers/video/fbdev/geode/lxfb.h | 452 + drivers/video/fbdev/geode/lxfb_core.c | 683 ++ drivers/video/fbdev/geode/lxfb_ops.c | 845 ++ drivers/video/fbdev/geode/suspend_gx.c | 267 + drivers/video/fbdev/geode/video_cs5530.c | 193 + drivers/video/fbdev/geode/video_cs5530.h | 75 + drivers/video/fbdev/geode/video_gx.c | 349 + drivers/video/fbdev/goldfishfb.c | 318 + drivers/video/fbdev/grvga.c | 562 + drivers/video/fbdev/gxt4500.c | 783 ++ drivers/video/fbdev/hecubafb.c | 311 + drivers/video/fbdev/hgafb.c | 667 ++ drivers/video/fbdev/hitfb.c | 500 + drivers/video/fbdev/hpfb.c | 429 + drivers/video/fbdev/hyperv_fb.c | 907 ++ drivers/video/fbdev/i740_reg.h | 309 + drivers/video/fbdev/i740fb.c | 1333 +++ drivers/video/fbdev/i810/Makefile | 17 + drivers/video/fbdev/i810/i810-i2c.c | 175 + drivers/video/fbdev/i810/i810.h | 299 + drivers/video/fbdev/i810/i810_accel.c | 456 + drivers/video/fbdev/i810/i810_dvt.c | 312 + drivers/video/fbdev/i810/i810_gtf.c | 276 + drivers/video/fbdev/i810/i810_main.c | 2218 ++++ drivers/video/fbdev/i810/i810_main.h | 95 + drivers/video/fbdev/i810/i810_regs.h | 275 + drivers/video/fbdev/igafb.c | 579 + drivers/video/fbdev/imsttfb.c | 1626 +++ drivers/video/fbdev/imxfb.c | 1075 ++ drivers/video/fbdev/intelfb/Makefile | 7 + drivers/video/fbdev/intelfb/intelfb.h | 383 + drivers/video/fbdev/intelfb/intelfb_i2c.c | 209 + drivers/video/fbdev/intelfb/intelfbdrv.c | 1704 +++ drivers/video/fbdev/intelfb/intelfbhw.c | 2121 ++++ drivers/video/fbdev/intelfb/intelfbhw.h | 609 + drivers/video/fbdev/jz4740_fb.c | 806 ++ drivers/video/fbdev/kyro/Makefile | 8 + drivers/video/fbdev/kyro/STG4000InitDevice.c | 326 + drivers/video/fbdev/kyro/STG4000Interface.h | 61 + drivers/video/fbdev/kyro/STG4000OverlayDevice.c | 601 + drivers/video/fbdev/kyro/STG4000Ramdac.c | 163 + drivers/video/fbdev/kyro/STG4000Reg.h | 283 + drivers/video/fbdev/kyro/STG4000VTG.c | 170 + drivers/video/fbdev/kyro/fbdev.c | 808 ++ drivers/video/fbdev/leo.c | 691 ++ drivers/video/fbdev/macfb.c | 928 ++ drivers/video/fbdev/macmodes.c | 414 + drivers/video/fbdev/macmodes.h | 71 + drivers/video/fbdev/matrox/Makefile | 11 + drivers/video/fbdev/matrox/g450_pll.c | 539 + drivers/video/fbdev/matrox/g450_pll.h | 12 + drivers/video/fbdev/matrox/i2c-matroxfb.c | 238 + drivers/video/fbdev/matrox/matroxfb_DAC1064.c | 1107 ++ drivers/video/fbdev/matrox/matroxfb_DAC1064.h | 179 + drivers/video/fbdev/matrox/matroxfb_Ti3026.c | 745 ++ drivers/video/fbdev/matrox/matroxfb_Ti3026.h | 11 + drivers/video/fbdev/matrox/matroxfb_accel.c | 519 + drivers/video/fbdev/matrox/matroxfb_accel.h | 8 + drivers/video/fbdev/matrox/matroxfb_base.c | 2584 +++++ drivers/video/fbdev/matrox/matroxfb_base.h | 735 ++ drivers/video/fbdev/matrox/matroxfb_crtc2.c | 739 ++ drivers/video/fbdev/matrox/matroxfb_crtc2.h | 34 + drivers/video/fbdev/matrox/matroxfb_g450.c | 640 ++ drivers/video/fbdev/matrox/matroxfb_g450.h | 14 + drivers/video/fbdev/matrox/matroxfb_maven.c | 1301 +++ drivers/video/fbdev/matrox/matroxfb_maven.h | 20 + drivers/video/fbdev/matrox/matroxfb_misc.c | 815 ++ drivers/video/fbdev/matrox/matroxfb_misc.h | 21 + drivers/video/fbdev/maxinefb.c | 177 + drivers/video/fbdev/mb862xx/Makefile | 8 + drivers/video/fbdev/mb862xx/mb862xx-i2c.c | 179 + drivers/video/fbdev/mb862xx/mb862xx_reg.h | 188 + drivers/video/fbdev/mb862xx/mb862xxfb.h | 121 + drivers/video/fbdev/mb862xx/mb862xxfb_accel.c | 335 + drivers/video/fbdev/mb862xx/mb862xxfb_accel.h | 203 + drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 1206 ++ drivers/video/fbdev/mbx/Makefile | 4 + drivers/video/fbdev/mbx/mbxdebugfs.c | 251 + drivers/video/fbdev/mbx/mbxfb.c | 1053 ++ drivers/video/fbdev/mbx/reg_bits.h | 613 + drivers/video/fbdev/mbx/regs.h | 195 + drivers/video/fbdev/metronomefb.c | 780 ++ drivers/video/fbdev/mmp/Kconfig | 11 + drivers/video/fbdev/mmp/Makefile | 1 + drivers/video/fbdev/mmp/core.c | 251 + drivers/video/fbdev/mmp/fb/Kconfig | 13 + drivers/video/fbdev/mmp/fb/Makefile | 1 + drivers/video/fbdev/mmp/fb/mmpfb.c | 694 ++ drivers/video/fbdev/mmp/fb/mmpfb.h | 54 + drivers/video/fbdev/mmp/hw/Kconfig | 20 + drivers/video/fbdev/mmp/hw/Makefile | 2 + drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 588 + drivers/video/fbdev/mmp/hw/mmp_ctrl.h | 1502 +++ drivers/video/fbdev/mmp/hw/mmp_spi.c | 180 + drivers/video/fbdev/mmp/panel/Kconfig | 6 + drivers/video/fbdev/mmp/panel/Makefile | 1 + drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c | 186 + drivers/video/fbdev/modedb.c | 1137 ++ drivers/video/fbdev/msm/Makefile | 19 + drivers/video/fbdev/msm/mddi.c | 821 ++ drivers/video/fbdev/msm/mddi_client_dummy.c | 98 + drivers/video/fbdev/msm/mddi_client_nt35399.c | 252 + drivers/video/fbdev/msm/mddi_client_toshiba.c | 280 + drivers/video/fbdev/msm/mddi_hw.h | 305 + drivers/video/fbdev/msm/mdp.c | 520 + drivers/video/fbdev/msm/mdp_csc_table.h | 582 + drivers/video/fbdev/msm/mdp_hw.h | 627 ++ drivers/video/fbdev/msm/mdp_ppp.c | 731 ++ drivers/video/fbdev/msm/mdp_scale_tables.c | 766 ++ drivers/video/fbdev/msm/mdp_scale_tables.h | 38 + drivers/video/fbdev/msm/msm_fb.c | 638 ++ drivers/video/fbdev/mx3fb.c | 1630 +++ drivers/video/fbdev/mxsfb.c | 960 ++ drivers/video/fbdev/n411.c | 202 + drivers/video/fbdev/neofb.c | 2247 ++++ drivers/video/fbdev/nuc900fb.c | 765 ++ drivers/video/fbdev/nuc900fb.h | 55 + drivers/video/fbdev/nvidia/Makefile | 13 + drivers/video/fbdev/nvidia/nv_accel.c | 416 + drivers/video/fbdev/nvidia/nv_backlight.c | 148 + drivers/video/fbdev/nvidia/nv_dma.h | 188 + drivers/video/fbdev/nvidia/nv_hw.c | 1687 +++ drivers/video/fbdev/nvidia/nv_i2c.c | 171 + drivers/video/fbdev/nvidia/nv_local.h | 114 + drivers/video/fbdev/nvidia/nv_of.c | 82 + drivers/video/fbdev/nvidia/nv_proto.h | 75 + drivers/video/fbdev/nvidia/nv_setup.c | 675 ++ drivers/video/fbdev/nvidia/nv_type.h | 180 + drivers/video/fbdev/nvidia/nvidia.c | 1607 +++ drivers/video/fbdev/ocfb.c | 440 + drivers/video/fbdev/offb.c | 687 ++ drivers/video/fbdev/omap/Kconfig | 52 + drivers/video/fbdev/omap/Makefile | 26 + drivers/video/fbdev/omap/hwa742.c | 1059 ++ drivers/video/fbdev/omap/lcd_ams_delta.c | 225 + drivers/video/fbdev/omap/lcd_h3.c | 127 + drivers/video/fbdev/omap/lcd_htcherald.c | 118 + drivers/video/fbdev/omap/lcd_inn1510.c | 113 + drivers/video/fbdev/omap/lcd_inn1610.c | 134 + drivers/video/fbdev/omap/lcd_mipid.c | 615 + drivers/video/fbdev/omap/lcd_osk.c | 133 + drivers/video/fbdev/omap/lcd_palmte.c | 110 + drivers/video/fbdev/omap/lcd_palmtt.c | 116 + drivers/video/fbdev/omap/lcd_palmz71.c | 112 + drivers/video/fbdev/omap/lcdc.c | 856 ++ drivers/video/fbdev/omap/lcdc.h | 9 + drivers/video/fbdev/omap/omapfb.h | 246 + drivers/video/fbdev/omap/omapfb_main.c | 1971 ++++ drivers/video/fbdev/omap/sossi.c | 693 ++ drivers/video/fbdev/omap2/Kconfig | 10 + drivers/video/fbdev/omap2/Makefile | 5 + drivers/video/fbdev/omap2/displays-new/Kconfig | 80 + drivers/video/fbdev/omap2/displays-new/Makefile | 13 + .../fbdev/omap2/displays-new/connector-analog-tv.c | 318 + .../video/fbdev/omap2/displays-new/connector-dvi.c | 401 + .../fbdev/omap2/displays-new/connector-hdmi.c | 405 + .../fbdev/omap2/displays-new/encoder-tfp410.c | 308 + .../fbdev/omap2/displays-new/encoder-tpd12s015.c | 451 + drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 270 + .../video/fbdev/omap2/displays-new/panel-dsi-cm.c | 1388 +++ .../omap2/displays-new/panel-lgphilips-lb035q02.c | 358 + .../omap2/displays-new/panel-nec-nl8048hl11.c | 394 + .../omap2/displays-new/panel-sharp-ls037v7dw01.c | 324 + .../omap2/displays-new/panel-sony-acx565akm.c | 911 ++ .../omap2/displays-new/panel-tpo-td028ttec1.c | 480 + .../omap2/displays-new/panel-tpo-td043mtea1.c | 646 ++ drivers/video/fbdev/omap2/dss/Kconfig | 121 + drivers/video/fbdev/omap2/dss/Makefile | 15 + drivers/video/fbdev/omap2/dss/apply.c | 1700 +++ drivers/video/fbdev/omap2/dss/core.c | 360 + drivers/video/fbdev/omap2/dss/dispc-compat.c | 666 ++ drivers/video/fbdev/omap2/dss/dispc-compat.h | 30 + drivers/video/fbdev/omap2/dss/dispc.c | 3853 +++++++ drivers/video/fbdev/omap2/dss/dispc.h | 917 ++ drivers/video/fbdev/omap2/dss/dispc_coefs.c | 325 + drivers/video/fbdev/omap2/dss/display-sysfs.c | 345 + drivers/video/fbdev/omap2/dss/display.c | 338 + drivers/video/fbdev/omap2/dss/dpi.c | 774 ++ drivers/video/fbdev/omap2/dss/dsi.c | 5751 ++++++++++ drivers/video/fbdev/omap2/dss/dss-of.c | 159 + drivers/video/fbdev/omap2/dss/dss.c | 972 ++ drivers/video/fbdev/omap2/dss/dss.h | 438 + drivers/video/fbdev/omap2/dss/dss_features.c | 935 ++ drivers/video/fbdev/omap2/dss/dss_features.h | 117 + drivers/video/fbdev/omap2/dss/hdmi.h | 444 + drivers/video/fbdev/omap2/dss/hdmi4.c | 703 ++ drivers/video/fbdev/omap2/dss/hdmi4_core.c | 1036 ++ drivers/video/fbdev/omap2/dss/hdmi4_core.h | 276 + drivers/video/fbdev/omap2/dss/hdmi_common.c | 425 + drivers/video/fbdev/omap2/dss/hdmi_phy.c | 160 + drivers/video/fbdev/omap2/dss/hdmi_pll.c | 232 + drivers/video/fbdev/omap2/dss/hdmi_wp.c | 275 + drivers/video/fbdev/omap2/dss/manager-sysfs.c | 529 + drivers/video/fbdev/omap2/dss/manager.c | 263 + drivers/video/fbdev/omap2/dss/output.c | 254 + drivers/video/fbdev/omap2/dss/overlay-sysfs.c | 456 + drivers/video/fbdev/omap2/dss/overlay.c | 202 + drivers/video/fbdev/omap2/dss/rfbi.c | 1058 ++ drivers/video/fbdev/omap2/dss/sdi.c | 433 + drivers/video/fbdev/omap2/dss/venc.c | 980 ++ drivers/video/fbdev/omap2/dss/venc_panel.c | 232 + drivers/video/fbdev/omap2/omapfb/Kconfig | 27 + drivers/video/fbdev/omap2/omapfb/Makefile | 2 + drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | 922 ++ drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 2656 +++++ drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c | 605 + drivers/video/fbdev/omap2/omapfb/omapfb.h | 208 + drivers/video/fbdev/omap2/vrfb.c | 399 + drivers/video/fbdev/p9100.c | 382 + drivers/video/fbdev/platinumfb.c | 714 ++ drivers/video/fbdev/platinumfb.h | 368 + drivers/video/fbdev/pm2fb.c | 1858 ++++ drivers/video/fbdev/pm3fb.c | 1586 +++ drivers/video/fbdev/pmag-aa-fb.c | 510 + drivers/video/fbdev/pmag-ba-fb.c | 295 + drivers/video/fbdev/pmagb-b-fb.c | 413 + drivers/video/fbdev/ps3fb.c | 1307 +++ drivers/video/fbdev/pvr2fb.c | 1142 ++ drivers/video/fbdev/pxa168fb.c | 837 ++ drivers/video/fbdev/pxa168fb.h | 558 + drivers/video/fbdev/pxa3xx-gcu.c | 724 ++ drivers/video/fbdev/pxa3xx-gcu.h | 38 + drivers/video/fbdev/pxafb.c | 2332 ++++ drivers/video/fbdev/pxafb.h | 200 + drivers/video/fbdev/q40fb.c | 155 + drivers/video/fbdev/riva/Makefile | 11 + drivers/video/fbdev/riva/fbdev.c | 2230 ++++ drivers/video/fbdev/riva/nv_driver.c | 422 + drivers/video/fbdev/riva/nv_type.h | 58 + drivers/video/fbdev/riva/nvreg.h | 188 + drivers/video/fbdev/riva/riva_hw.c | 2268 ++++ drivers/video/fbdev/riva/riva_hw.h | 563 + drivers/video/fbdev/riva/riva_tbl.h | 1008 ++ drivers/video/fbdev/riva/rivafb-i2c.c | 166 + drivers/video/fbdev/riva/rivafb.h | 77 + drivers/video/fbdev/s1d13xxxfb.c | 1040 ++ drivers/video/fbdev/s3c-fb.c | 2049 ++++ drivers/video/fbdev/s3c2410fb.c | 1146 ++ drivers/video/fbdev/s3c2410fb.h | 48 + drivers/video/fbdev/s3fb.c | 1597 +++ drivers/video/fbdev/sa1100fb.c | 1340 +++ drivers/video/fbdev/sa1100fb.h | 96 + drivers/video/fbdev/savage/Makefile | 9 + drivers/video/fbdev/savage/savagefb-i2c.c | 241 + drivers/video/fbdev/savage/savagefb.h | 415 + drivers/video/fbdev/savage/savagefb_accel.c | 137 + drivers/video/fbdev/savage/savagefb_driver.c | 2571 +++++ drivers/video/fbdev/sbuslib.c | 267 + drivers/video/fbdev/sbuslib.h | 27 + drivers/video/fbdev/sh7760fb.c | 591 + drivers/video/fbdev/sh_mipi_dsi.c | 587 + drivers/video/fbdev/sh_mobile_hdmi.c | 1449 +++ drivers/video/fbdev/sh_mobile_lcdcfb.c | 2863 +++++ drivers/video/fbdev/sh_mobile_lcdcfb.h | 112 + drivers/video/fbdev/sh_mobile_meram.c | 759 ++ drivers/video/fbdev/simplefb.c | 280 + drivers/video/fbdev/sis/300vtbl.h | 1072 ++ drivers/video/fbdev/sis/310vtbl.h | 1339 +++ drivers/video/fbdev/sis/Makefile | 7 + drivers/video/fbdev/sis/init.c | 3655 ++++++ drivers/video/fbdev/sis/init.h | 1541 +++ drivers/video/fbdev/sis/init301.c | 11071 +++++++++++++++++++ drivers/video/fbdev/sis/init301.h | 456 + drivers/video/fbdev/sis/initdef.h | 708 ++ drivers/video/fbdev/sis/initextlfb.c | 231 + drivers/video/fbdev/sis/oem300.h | 840 ++ drivers/video/fbdev/sis/oem310.h | 430 + drivers/video/fbdev/sis/sis.h | 586 + drivers/video/fbdev/sis/sis_accel.c | 423 + drivers/video/fbdev/sis/sis_accel.h | 400 + drivers/video/fbdev/sis/sis_main.c | 6844 ++++++++++++ drivers/video/fbdev/sis/sis_main.h | 781 ++ drivers/video/fbdev/sis/vgatypes.h | 97 + drivers/video/fbdev/sis/vstruct.h | 551 + drivers/video/fbdev/skeletonfb.c | 1037 ++ drivers/video/fbdev/sm501fb.c | 2240 ++++ drivers/video/fbdev/smscufx.c | 1980 ++++ drivers/video/fbdev/ssd1307fb.c | 581 + drivers/video/fbdev/sstfb.c | 1532 +++ drivers/video/fbdev/sticore.h | 401 + drivers/video/fbdev/stifb.c | 1417 +++ drivers/video/fbdev/sunxvr1000.c | 229 + drivers/video/fbdev/sunxvr2500.c | 276 + drivers/video/fbdev/sunxvr500.c | 462 + drivers/video/fbdev/svgalib.c | 672 ++ drivers/video/fbdev/syscopyarea.c | 377 + drivers/video/fbdev/sysfillrect.c | 335 + drivers/video/fbdev/sysimgblt.c | 288 + drivers/video/fbdev/tcx.c | 541 + drivers/video/fbdev/tdfxfb.c | 1686 +++ drivers/video/fbdev/tgafb.c | 1611 +++ drivers/video/fbdev/tmiofb.c | 1048 ++ drivers/video/fbdev/tridentfb.c | 1659 +++ drivers/video/fbdev/udlfb.c | 1985 ++++ drivers/video/fbdev/uvesafb.c | 2028 ++++ drivers/video/fbdev/valkyriefb.c | 589 + drivers/video/fbdev/valkyriefb.h | 200 + drivers/video/fbdev/vermilion/Makefile | 5 + drivers/video/fbdev/vermilion/cr_pll.c | 208 + drivers/video/fbdev/vermilion/vermilion.c | 1175 ++ drivers/video/fbdev/vermilion/vermilion.h | 259 + drivers/video/fbdev/vesafb.c | 522 + drivers/video/fbdev/vfb.c | 610 + drivers/video/fbdev/vga16fb.c | 1464 +++ drivers/video/fbdev/via/Makefile | 12 + drivers/video/fbdev/via/accel.c | 547 + drivers/video/fbdev/via/accel.h | 211 + drivers/video/fbdev/via/chip.h | 176 + drivers/video/fbdev/via/debug.h | 41 + drivers/video/fbdev/via/dvi.c | 478 + drivers/video/fbdev/via/dvi.h | 65 + drivers/video/fbdev/via/global.c | 50 + drivers/video/fbdev/via/global.h | 80 + drivers/video/fbdev/via/hw.c | 2134 ++++ drivers/video/fbdev/via/hw.h | 676 ++ drivers/video/fbdev/via/ioctl.c | 116 + drivers/video/fbdev/via/ioctl.h | 203 + drivers/video/fbdev/via/lcd.c | 1005 ++ drivers/video/fbdev/via/lcd.h | 89 + drivers/video/fbdev/via/share.h | 332 + drivers/video/fbdev/via/tblDPASetting.c | 86 + drivers/video/fbdev/via/tblDPASetting.h | 45 + drivers/video/fbdev/via/via-core.c | 790 ++ drivers/video/fbdev/via/via-gpio.c | 316 + drivers/video/fbdev/via/via_aux.c | 88 + drivers/video/fbdev/via/via_aux.h | 93 + drivers/video/fbdev/via/via_aux_ch7301.c | 50 + drivers/video/fbdev/via/via_aux_edid.c | 100 + drivers/video/fbdev/via/via_aux_sii164.c | 54 + drivers/video/fbdev/via/via_aux_vt1621.c | 44 + drivers/video/fbdev/via/via_aux_vt1622.c | 50 + drivers/video/fbdev/via/via_aux_vt1625.c | 50 + drivers/video/fbdev/via/via_aux_vt1631.c | 46 + drivers/video/fbdev/via/via_aux_vt1632.c | 54 + drivers/video/fbdev/via/via_aux_vt1636.c | 46 + drivers/video/fbdev/via/via_clock.c | 368 + drivers/video/fbdev/via/via_clock.h | 76 + drivers/video/fbdev/via/via_i2c.c | 295 + drivers/video/fbdev/via/via_modesetting.c | 230 + drivers/video/fbdev/via/via_modesetting.h | 61 + drivers/video/fbdev/via/via_utility.c | 242 + drivers/video/fbdev/via/via_utility.h | 34 + drivers/video/fbdev/via/viafbdev.c | 2176 ++++ drivers/video/fbdev/via/viafbdev.h | 110 + drivers/video/fbdev/via/viamode.c | 383 + drivers/video/fbdev/via/viamode.h | 63 + drivers/video/fbdev/via/vt1636.c | 244 + drivers/video/fbdev/via/vt1636.h | 44 + drivers/video/fbdev/vt8500lcdfb.c | 502 + drivers/video/fbdev/vt8500lcdfb.h | 34 + drivers/video/fbdev/vt8623fb.c | 958 ++ drivers/video/fbdev/w100fb.c | 1637 +++ drivers/video/fbdev/w100fb.h | 928 ++ drivers/video/fbdev/wm8505fb.c | 421 + drivers/video/fbdev/wm8505fb_regs.h | 76 + drivers/video/fbdev/wmt_ge_rops.c | 182 + drivers/video/fbdev/wmt_ge_rops.h | 28 + drivers/video/fbdev/xen-fbfront.c | 719 ++ drivers/video/fbdev/xilinxfb.c | 509 + drivers/video/fbmem.c | 2002 ---- drivers/video/fbmon.c | 1592 --- drivers/video/fbsysfs.c | 586 - drivers/video/ffb.c | 1081 -- drivers/video/fm2fb.c | 323 - drivers/video/fsl-diu-fb.c | 1994 ---- drivers/video/g364fb.c | 255 - drivers/video/gbefb.c | 1309 --- drivers/video/geode/Kconfig | 54 - drivers/video/geode/Makefile | 9 - drivers/video/geode/display_gx.c | 184 - drivers/video/geode/display_gx1.c | 214 - drivers/video/geode/display_gx1.h | 154 - drivers/video/geode/geodefb.h | 38 - drivers/video/geode/gx1fb_core.c | 476 - drivers/video/geode/gxfb.h | 358 - drivers/video/geode/gxfb_core.c | 547 - drivers/video/geode/lxfb.h | 452 - drivers/video/geode/lxfb_core.c | 683 -- drivers/video/geode/lxfb_ops.c | 845 -- drivers/video/geode/suspend_gx.c | 267 - drivers/video/geode/video_cs5530.c | 193 - drivers/video/geode/video_cs5530.h | 75 - drivers/video/geode/video_gx.c | 349 - drivers/video/goldfishfb.c | 318 - drivers/video/grvga.c | 562 - drivers/video/gxt4500.c | 783 -- drivers/video/hecubafb.c | 311 - drivers/video/hgafb.c | 667 -- drivers/video/hitfb.c | 500 - drivers/video/hpfb.c | 429 - drivers/video/hyperv_fb.c | 907 -- drivers/video/i740_reg.h | 309 - drivers/video/i740fb.c | 1333 --- drivers/video/i810/Makefile | 17 - drivers/video/i810/i810-i2c.c | 175 - drivers/video/i810/i810.h | 299 - drivers/video/i810/i810_accel.c | 456 - drivers/video/i810/i810_dvt.c | 312 - drivers/video/i810/i810_gtf.c | 276 - drivers/video/i810/i810_main.c | 2218 ---- drivers/video/i810/i810_main.h | 95 - drivers/video/i810/i810_regs.h | 275 - drivers/video/igafb.c | 579 - drivers/video/imsttfb.c | 1626 --- drivers/video/imxfb.c | 1075 -- drivers/video/intelfb/Makefile | 7 - drivers/video/intelfb/intelfb.h | 383 - drivers/video/intelfb/intelfb_i2c.c | 209 - drivers/video/intelfb/intelfbdrv.c | 1704 --- drivers/video/intelfb/intelfbhw.c | 2121 ---- drivers/video/intelfb/intelfbhw.h | 609 - drivers/video/jz4740_fb.c | 806 -- drivers/video/kyro/Makefile | 8 - drivers/video/kyro/STG4000InitDevice.c | 326 - drivers/video/kyro/STG4000Interface.h | 61 - drivers/video/kyro/STG4000OverlayDevice.c | 601 - drivers/video/kyro/STG4000Ramdac.c | 163 - drivers/video/kyro/STG4000Reg.h | 283 - drivers/video/kyro/STG4000VTG.c | 170 - drivers/video/kyro/fbdev.c | 808 -- drivers/video/leo.c | 691 -- drivers/video/macfb.c | 928 -- drivers/video/macmodes.c | 414 - drivers/video/macmodes.h | 71 - drivers/video/matrox/Makefile | 11 - drivers/video/matrox/g450_pll.c | 539 - drivers/video/matrox/g450_pll.h | 12 - drivers/video/matrox/i2c-matroxfb.c | 238 - drivers/video/matrox/matroxfb_DAC1064.c | 1107 -- drivers/video/matrox/matroxfb_DAC1064.h | 179 - drivers/video/matrox/matroxfb_Ti3026.c | 745 -- drivers/video/matrox/matroxfb_Ti3026.h | 11 - drivers/video/matrox/matroxfb_accel.c | 519 - drivers/video/matrox/matroxfb_accel.h | 8 - drivers/video/matrox/matroxfb_base.c | 2584 ----- drivers/video/matrox/matroxfb_base.h | 735 -- drivers/video/matrox/matroxfb_crtc2.c | 739 -- drivers/video/matrox/matroxfb_crtc2.h | 34 - drivers/video/matrox/matroxfb_g450.c | 640 -- drivers/video/matrox/matroxfb_g450.h | 14 - drivers/video/matrox/matroxfb_maven.c | 1301 --- drivers/video/matrox/matroxfb_maven.h | 20 - drivers/video/matrox/matroxfb_misc.c | 815 -- drivers/video/matrox/matroxfb_misc.h | 21 - drivers/video/maxinefb.c | 177 - drivers/video/mb862xx/Makefile | 8 - drivers/video/mb862xx/mb862xx-i2c.c | 179 - drivers/video/mb862xx/mb862xx_reg.h | 188 - drivers/video/mb862xx/mb862xxfb.h | 121 - drivers/video/mb862xx/mb862xxfb_accel.c | 335 - drivers/video/mb862xx/mb862xxfb_accel.h | 203 - drivers/video/mb862xx/mb862xxfbdrv.c | 1206 -- drivers/video/mbx/Makefile | 4 - drivers/video/mbx/mbxdebugfs.c | 251 - drivers/video/mbx/mbxfb.c | 1053 -- drivers/video/mbx/reg_bits.h | 613 - drivers/video/mbx/regs.h | 195 - drivers/video/metronomefb.c | 780 -- drivers/video/mmp/Kconfig | 11 - drivers/video/mmp/Makefile | 1 - drivers/video/mmp/core.c | 251 - drivers/video/mmp/fb/Kconfig | 13 - drivers/video/mmp/fb/Makefile | 1 - drivers/video/mmp/fb/mmpfb.c | 694 -- drivers/video/mmp/fb/mmpfb.h | 54 - drivers/video/mmp/hw/Kconfig | 20 - drivers/video/mmp/hw/Makefile | 2 - drivers/video/mmp/hw/mmp_ctrl.c | 588 - drivers/video/mmp/hw/mmp_ctrl.h | 1502 --- drivers/video/mmp/hw/mmp_spi.c | 180 - drivers/video/mmp/panel/Kconfig | 6 - drivers/video/mmp/panel/Makefile | 1 - drivers/video/mmp/panel/tpo_tj032md01bw.c | 186 - drivers/video/modedb.c | 1137 -- drivers/video/msm/Makefile | 19 - drivers/video/msm/mddi.c | 821 -- drivers/video/msm/mddi_client_dummy.c | 98 - drivers/video/msm/mddi_client_nt35399.c | 252 - drivers/video/msm/mddi_client_toshiba.c | 280 - drivers/video/msm/mddi_hw.h | 305 - drivers/video/msm/mdp.c | 520 - drivers/video/msm/mdp_csc_table.h | 582 - drivers/video/msm/mdp_hw.h | 627 -- drivers/video/msm/mdp_ppp.c | 731 -- drivers/video/msm/mdp_scale_tables.c | 766 -- drivers/video/msm/mdp_scale_tables.h | 38 - drivers/video/msm/msm_fb.c | 638 -- drivers/video/mx3fb.c | 1630 --- drivers/video/mxsfb.c | 960 -- drivers/video/n411.c | 202 - drivers/video/neofb.c | 2247 ---- drivers/video/nuc900fb.c | 765 -- drivers/video/nuc900fb.h | 55 - drivers/video/nvidia/Makefile | 13 - drivers/video/nvidia/nv_accel.c | 416 - drivers/video/nvidia/nv_backlight.c | 148 - drivers/video/nvidia/nv_dma.h | 188 - drivers/video/nvidia/nv_hw.c | 1687 --- drivers/video/nvidia/nv_i2c.c | 171 - drivers/video/nvidia/nv_local.h | 114 - drivers/video/nvidia/nv_of.c | 82 - drivers/video/nvidia/nv_proto.h | 75 - drivers/video/nvidia/nv_setup.c | 675 -- drivers/video/nvidia/nv_type.h | 180 - drivers/video/nvidia/nvidia.c | 1607 --- drivers/video/ocfb.c | 440 - drivers/video/offb.c | 687 -- drivers/video/omap/Kconfig | 52 - drivers/video/omap/Makefile | 26 - drivers/video/omap/hwa742.c | 1059 -- drivers/video/omap/lcd_ams_delta.c | 225 - drivers/video/omap/lcd_h3.c | 127 - drivers/video/omap/lcd_htcherald.c | 118 - drivers/video/omap/lcd_inn1510.c | 113 - drivers/video/omap/lcd_inn1610.c | 134 - drivers/video/omap/lcd_mipid.c | 615 - drivers/video/omap/lcd_osk.c | 133 - drivers/video/omap/lcd_palmte.c | 110 - drivers/video/omap/lcd_palmtt.c | 116 - drivers/video/omap/lcd_palmz71.c | 112 - drivers/video/omap/lcdc.c | 856 -- drivers/video/omap/lcdc.h | 9 - drivers/video/omap/omapfb.h | 246 - drivers/video/omap/omapfb_main.c | 1971 ---- drivers/video/omap/sossi.c | 693 -- drivers/video/omap2/Kconfig | 10 - drivers/video/omap2/Makefile | 5 - drivers/video/omap2/displays-new/Kconfig | 80 - drivers/video/omap2/displays-new/Makefile | 13 - .../video/omap2/displays-new/connector-analog-tv.c | 318 - drivers/video/omap2/displays-new/connector-dvi.c | 401 - drivers/video/omap2/displays-new/connector-hdmi.c | 405 - drivers/video/omap2/displays-new/encoder-tfp410.c | 308 - .../video/omap2/displays-new/encoder-tpd12s015.c | 451 - drivers/video/omap2/displays-new/panel-dpi.c | 270 - drivers/video/omap2/displays-new/panel-dsi-cm.c | 1388 --- .../omap2/displays-new/panel-lgphilips-lb035q02.c | 358 - .../omap2/displays-new/panel-nec-nl8048hl11.c | 394 - .../omap2/displays-new/panel-sharp-ls037v7dw01.c | 324 - .../omap2/displays-new/panel-sony-acx565akm.c | 911 -- .../omap2/displays-new/panel-tpo-td028ttec1.c | 480 - .../omap2/displays-new/panel-tpo-td043mtea1.c | 646 -- drivers/video/omap2/dss/Kconfig | 121 - drivers/video/omap2/dss/Makefile | 15 - drivers/video/omap2/dss/apply.c | 1700 --- drivers/video/omap2/dss/core.c | 360 - drivers/video/omap2/dss/dispc-compat.c | 666 -- drivers/video/omap2/dss/dispc-compat.h | 30 - drivers/video/omap2/dss/dispc.c | 3853 ------- drivers/video/omap2/dss/dispc.h | 917 -- drivers/video/omap2/dss/dispc_coefs.c | 325 - drivers/video/omap2/dss/display-sysfs.c | 345 - drivers/video/omap2/dss/display.c | 338 - drivers/video/omap2/dss/dpi.c | 774 -- drivers/video/omap2/dss/dsi.c | 5751 ---------- drivers/video/omap2/dss/dss-of.c | 159 - drivers/video/omap2/dss/dss.c | 972 -- drivers/video/omap2/dss/dss.h | 438 - drivers/video/omap2/dss/dss_features.c | 935 -- drivers/video/omap2/dss/dss_features.h | 117 - drivers/video/omap2/dss/hdmi.h | 444 - drivers/video/omap2/dss/hdmi4.c | 703 -- drivers/video/omap2/dss/hdmi4_core.c | 1036 -- drivers/video/omap2/dss/hdmi4_core.h | 276 - drivers/video/omap2/dss/hdmi_common.c | 425 - drivers/video/omap2/dss/hdmi_phy.c | 160 - drivers/video/omap2/dss/hdmi_pll.c | 232 - drivers/video/omap2/dss/hdmi_wp.c | 275 - drivers/video/omap2/dss/manager-sysfs.c | 529 - drivers/video/omap2/dss/manager.c | 263 - drivers/video/omap2/dss/output.c | 254 - drivers/video/omap2/dss/overlay-sysfs.c | 456 - drivers/video/omap2/dss/overlay.c | 202 - drivers/video/omap2/dss/rfbi.c | 1058 -- drivers/video/omap2/dss/sdi.c | 433 - drivers/video/omap2/dss/venc.c | 980 -- drivers/video/omap2/dss/venc_panel.c | 232 - drivers/video/omap2/omapfb/Kconfig | 27 - drivers/video/omap2/omapfb/Makefile | 2 - drivers/video/omap2/omapfb/omapfb-ioctl.c | 922 -- drivers/video/omap2/omapfb/omapfb-main.c | 2656 ----- drivers/video/omap2/omapfb/omapfb-sysfs.c | 605 - drivers/video/omap2/omapfb/omapfb.h | 208 - drivers/video/omap2/vrfb.c | 399 - drivers/video/p9100.c | 382 - drivers/video/platinumfb.c | 714 -- drivers/video/platinumfb.h | 368 - drivers/video/pm2fb.c | 1858 ---- drivers/video/pm3fb.c | 1586 --- drivers/video/pmag-aa-fb.c | 510 - drivers/video/pmag-ba-fb.c | 295 - drivers/video/pmagb-b-fb.c | 413 - drivers/video/ps3fb.c | 1307 --- drivers/video/pvr2fb.c | 1142 -- drivers/video/pxa168fb.c | 837 -- drivers/video/pxa168fb.h | 558 - drivers/video/pxa3xx-gcu.c | 724 -- drivers/video/pxa3xx-gcu.h | 38 - drivers/video/pxafb.c | 2332 ---- drivers/video/pxafb.h | 200 - drivers/video/q40fb.c | 155 - drivers/video/riva/Makefile | 11 - drivers/video/riva/fbdev.c | 2230 ---- drivers/video/riva/nv_driver.c | 422 - drivers/video/riva/nv_type.h | 58 - drivers/video/riva/nvreg.h | 188 - drivers/video/riva/riva_hw.c | 2268 ---- drivers/video/riva/riva_hw.h | 563 - drivers/video/riva/riva_tbl.h | 1008 -- drivers/video/riva/rivafb-i2c.c | 166 - drivers/video/riva/rivafb.h | 77 - drivers/video/s1d13xxxfb.c | 1040 -- drivers/video/s3c-fb.c | 2049 ---- drivers/video/s3c2410fb.c | 1146 -- drivers/video/s3c2410fb.h | 48 - drivers/video/s3fb.c | 1597 --- drivers/video/sa1100fb.c | 1340 --- drivers/video/sa1100fb.h | 96 - drivers/video/savage/Makefile | 9 - drivers/video/savage/savagefb-i2c.c | 241 - drivers/video/savage/savagefb.h | 415 - drivers/video/savage/savagefb_accel.c | 137 - drivers/video/savage/savagefb_driver.c | 2571 ----- drivers/video/sbuslib.c | 267 - drivers/video/sbuslib.h | 27 - drivers/video/sh7760fb.c | 591 - drivers/video/sh_mipi_dsi.c | 587 - drivers/video/sh_mobile_hdmi.c | 1449 --- drivers/video/sh_mobile_lcdcfb.c | 2863 ----- drivers/video/sh_mobile_lcdcfb.h | 112 - drivers/video/sh_mobile_meram.c | 759 -- drivers/video/simplefb.c | 280 - drivers/video/sis/300vtbl.h | 1072 -- drivers/video/sis/310vtbl.h | 1339 --- drivers/video/sis/Makefile | 7 - drivers/video/sis/init.c | 3655 ------ drivers/video/sis/init.h | 1541 --- drivers/video/sis/init301.c | 11071 ------------------- drivers/video/sis/init301.h | 456 - drivers/video/sis/initdef.h | 708 -- drivers/video/sis/initextlfb.c | 231 - drivers/video/sis/oem300.h | 840 -- drivers/video/sis/oem310.h | 430 - drivers/video/sis/sis.h | 586 - drivers/video/sis/sis_accel.c | 423 - drivers/video/sis/sis_accel.h | 400 - drivers/video/sis/sis_main.c | 6844 ------------ drivers/video/sis/sis_main.h | 781 -- drivers/video/sis/vgatypes.h | 97 - drivers/video/sis/vstruct.h | 551 - drivers/video/skeletonfb.c | 1037 -- drivers/video/sm501fb.c | 2240 ---- drivers/video/smscufx.c | 1980 ---- drivers/video/ssd1307fb.c | 581 - drivers/video/sstfb.c | 1532 --- drivers/video/sticore.h | 401 - drivers/video/stifb.c | 1417 --- drivers/video/sunxvr1000.c | 229 - drivers/video/sunxvr2500.c | 276 - drivers/video/sunxvr500.c | 462 - drivers/video/svgalib.c | 672 -- drivers/video/syscopyarea.c | 377 - drivers/video/sysfillrect.c | 335 - drivers/video/sysimgblt.c | 288 - drivers/video/tcx.c | 541 - drivers/video/tdfxfb.c | 1686 --- drivers/video/tgafb.c | 1611 --- drivers/video/tmiofb.c | 1048 -- drivers/video/tridentfb.c | 1659 --- drivers/video/udlfb.c | 1985 ---- drivers/video/uvesafb.c | 2028 ---- drivers/video/valkyriefb.c | 589 - drivers/video/valkyriefb.h | 200 - drivers/video/vermilion/Makefile | 5 - drivers/video/vermilion/cr_pll.c | 208 - drivers/video/vermilion/vermilion.c | 1175 -- drivers/video/vermilion/vermilion.h | 259 - drivers/video/vesafb.c | 522 - drivers/video/vfb.c | 610 - drivers/video/vga16fb.c | 1464 --- drivers/video/via/Makefile | 12 - drivers/video/via/accel.c | 547 - drivers/video/via/accel.h | 211 - drivers/video/via/chip.h | 176 - drivers/video/via/debug.h | 41 - drivers/video/via/dvi.c | 478 - drivers/video/via/dvi.h | 65 - drivers/video/via/global.c | 50 - drivers/video/via/global.h | 80 - drivers/video/via/hw.c | 2134 ---- drivers/video/via/hw.h | 676 -- drivers/video/via/ioctl.c | 116 - drivers/video/via/ioctl.h | 203 - drivers/video/via/lcd.c | 1005 -- drivers/video/via/lcd.h | 89 - drivers/video/via/share.h | 332 - drivers/video/via/tblDPASetting.c | 86 - drivers/video/via/tblDPASetting.h | 45 - drivers/video/via/via-core.c | 790 -- drivers/video/via/via-gpio.c | 316 - drivers/video/via/via_aux.c | 88 - drivers/video/via/via_aux.h | 93 - drivers/video/via/via_aux_ch7301.c | 50 - drivers/video/via/via_aux_edid.c | 100 - drivers/video/via/via_aux_sii164.c | 54 - drivers/video/via/via_aux_vt1621.c | 44 - drivers/video/via/via_aux_vt1622.c | 50 - drivers/video/via/via_aux_vt1625.c | 50 - drivers/video/via/via_aux_vt1631.c | 46 - drivers/video/via/via_aux_vt1632.c | 54 - drivers/video/via/via_aux_vt1636.c | 46 - drivers/video/via/via_clock.c | 368 - drivers/video/via/via_clock.h | 76 - drivers/video/via/via_i2c.c | 295 - drivers/video/via/via_modesetting.c | 230 - drivers/video/via/via_modesetting.h | 61 - drivers/video/via/via_utility.c | 242 - drivers/video/via/via_utility.h | 34 - drivers/video/via/viafbdev.c | 2176 ---- drivers/video/via/viafbdev.h | 110 - drivers/video/via/viamode.c | 383 - drivers/video/via/viamode.h | 63 - drivers/video/via/vt1636.c | 244 - drivers/video/via/vt1636.h | 44 - drivers/video/vt8500lcdfb.c | 502 - drivers/video/vt8500lcdfb.h | 34 - drivers/video/vt8623fb.c | 958 -- drivers/video/w100fb.c | 1637 --- drivers/video/w100fb.h | 928 -- drivers/video/wm8505fb.c | 421 - drivers/video/wm8505fb_regs.h | 76 - drivers/video/wmt_ge_rops.c | 182 - drivers/video/wmt_ge_rops.h | 28 - drivers/video/xen-fbfront.c | 719 -- drivers/video/xilinxfb.c | 509 - 949 files changed, 302820 insertions(+), 302810 deletions(-) delete mode 100644 drivers/video/68328fb.c delete mode 100644 drivers/video/acornfb.c delete mode 100644 drivers/video/acornfb.h delete mode 100644 drivers/video/amba-clcd.c delete mode 100644 drivers/video/amifb.c delete mode 100644 drivers/video/arcfb.c delete mode 100644 drivers/video/arkfb.c delete mode 100644 drivers/video/asiliantfb.c delete mode 100644 drivers/video/atafb.c delete mode 100644 drivers/video/atafb.h delete mode 100644 drivers/video/atafb_iplan2p2.c delete mode 100644 drivers/video/atafb_iplan2p4.c delete mode 100644 drivers/video/atafb_iplan2p8.c delete mode 100644 drivers/video/atafb_mfb.c delete mode 100644 drivers/video/atafb_utils.h delete mode 100644 drivers/video/atmel_lcdfb.c delete mode 100644 drivers/video/aty/Makefile delete mode 100644 drivers/video/aty/ati_ids.h delete mode 100644 drivers/video/aty/aty128fb.c delete mode 100644 drivers/video/aty/atyfb.h delete mode 100644 drivers/video/aty/atyfb_base.c delete mode 100644 drivers/video/aty/mach64_accel.c delete mode 100644 drivers/video/aty/mach64_ct.c delete mode 100644 drivers/video/aty/mach64_cursor.c delete mode 100644 drivers/video/aty/mach64_gx.c delete mode 100644 drivers/video/aty/radeon_accel.c delete mode 100644 drivers/video/aty/radeon_backlight.c delete mode 100644 drivers/video/aty/radeon_base.c delete mode 100644 drivers/video/aty/radeon_i2c.c delete mode 100644 drivers/video/aty/radeon_monitor.c delete mode 100644 drivers/video/aty/radeon_pm.c delete mode 100644 drivers/video/aty/radeonfb.h delete mode 100644 drivers/video/au1100fb.c delete mode 100644 drivers/video/au1100fb.h delete mode 100644 drivers/video/au1200fb.c delete mode 100644 drivers/video/au1200fb.h delete mode 100644 drivers/video/auo_k1900fb.c delete mode 100644 drivers/video/auo_k1901fb.c delete mode 100644 drivers/video/auo_k190x.c delete mode 100644 drivers/video/auo_k190x.h delete mode 100644 drivers/video/bf537-lq035.c delete mode 100644 drivers/video/bf54x-lq043fb.c delete mode 100644 drivers/video/bfin-lq035q1-fb.c delete mode 100644 drivers/video/bfin-t350mcqb-fb.c delete mode 100644 drivers/video/bfin_adv7393fb.c delete mode 100644 drivers/video/bfin_adv7393fb.h delete mode 100644 drivers/video/broadsheetfb.c delete mode 100644 drivers/video/bt431.h delete mode 100644 drivers/video/bt455.h delete mode 100644 drivers/video/bw2.c delete mode 100644 drivers/video/c2p.h delete mode 100644 drivers/video/c2p_core.h delete mode 100644 drivers/video/c2p_iplan2.c delete mode 100644 drivers/video/c2p_planar.c delete mode 100644 drivers/video/carminefb.c delete mode 100644 drivers/video/carminefb.h delete mode 100644 drivers/video/carminefb_regs.h delete mode 100644 drivers/video/cfbcopyarea.c delete mode 100644 drivers/video/cfbfillrect.c delete mode 100644 drivers/video/cfbimgblt.c delete mode 100644 drivers/video/cg14.c delete mode 100644 drivers/video/cg3.c delete mode 100644 drivers/video/cg6.c delete mode 100644 drivers/video/chipsfb.c delete mode 100644 drivers/video/cirrusfb.c delete mode 100644 drivers/video/clps711xfb.c delete mode 100644 drivers/video/cobalt_lcdfb.c delete mode 100644 drivers/video/controlfb.c delete mode 100644 drivers/video/controlfb.h delete mode 100644 drivers/video/cyber2000fb.c delete mode 100644 drivers/video/cyber2000fb.h delete mode 100644 drivers/video/da8xx-fb.c delete mode 100644 drivers/video/dnfb.c delete mode 100644 drivers/video/edid.h delete mode 100644 drivers/video/efifb.c delete mode 100644 drivers/video/ep93xx-fb.c delete mode 100644 drivers/video/exynos/Kconfig delete mode 100644 drivers/video/exynos/Makefile delete mode 100644 drivers/video/exynos/exynos_mipi_dsi.c delete mode 100644 drivers/video/exynos/exynos_mipi_dsi_common.c delete mode 100644 drivers/video/exynos/exynos_mipi_dsi_common.h delete mode 100644 drivers/video/exynos/exynos_mipi_dsi_lowlevel.c delete mode 100644 drivers/video/exynos/exynos_mipi_dsi_lowlevel.h delete mode 100644 drivers/video/exynos/exynos_mipi_dsi_regs.h delete mode 100644 drivers/video/exynos/s6e8ax0.c delete mode 100644 drivers/video/fb-puv3.c delete mode 100644 drivers/video/fb_ddc.c delete mode 100644 drivers/video/fb_defio.c delete mode 100644 drivers/video/fb_draw.h delete mode 100644 drivers/video/fb_notify.c delete mode 100644 drivers/video/fb_sys_fops.c delete mode 100644 drivers/video/fbcmap.c delete mode 100644 drivers/video/fbcvt.c create mode 100644 drivers/video/fbdev/68328fb.c create mode 100644 drivers/video/fbdev/Kconfig create mode 100644 drivers/video/fbdev/Makefile create mode 100644 drivers/video/fbdev/acornfb.c create mode 100644 drivers/video/fbdev/acornfb.h create mode 100644 drivers/video/fbdev/amba-clcd.c create mode 100644 drivers/video/fbdev/amifb.c create mode 100644 drivers/video/fbdev/arcfb.c create mode 100644 drivers/video/fbdev/arkfb.c create mode 100644 drivers/video/fbdev/asiliantfb.c create mode 100644 drivers/video/fbdev/atafb.c create mode 100644 drivers/video/fbdev/atafb.h create mode 100644 drivers/video/fbdev/atafb_iplan2p2.c create mode 100644 drivers/video/fbdev/atafb_iplan2p4.c create mode 100644 drivers/video/fbdev/atafb_iplan2p8.c create mode 100644 drivers/video/fbdev/atafb_mfb.c create mode 100644 drivers/video/fbdev/atafb_utils.h create mode 100644 drivers/video/fbdev/atmel_lcdfb.c create mode 100644 drivers/video/fbdev/aty/Makefile create mode 100644 drivers/video/fbdev/aty/ati_ids.h create mode 100644 drivers/video/fbdev/aty/aty128fb.c create mode 100644 drivers/video/fbdev/aty/atyfb.h create mode 100644 drivers/video/fbdev/aty/atyfb_base.c create mode 100644 drivers/video/fbdev/aty/mach64_accel.c create mode 100644 drivers/video/fbdev/aty/mach64_ct.c create mode 100644 drivers/video/fbdev/aty/mach64_cursor.c create mode 100644 drivers/video/fbdev/aty/mach64_gx.c create mode 100644 drivers/video/fbdev/aty/radeon_accel.c create mode 100644 drivers/video/fbdev/aty/radeon_backlight.c create mode 100644 drivers/video/fbdev/aty/radeon_base.c create mode 100644 drivers/video/fbdev/aty/radeon_i2c.c create mode 100644 drivers/video/fbdev/aty/radeon_monitor.c create mode 100644 drivers/video/fbdev/aty/radeon_pm.c create mode 100644 drivers/video/fbdev/aty/radeonfb.h create mode 100644 drivers/video/fbdev/au1100fb.c create mode 100644 drivers/video/fbdev/au1100fb.h create mode 100644 drivers/video/fbdev/au1200fb.c create mode 100644 drivers/video/fbdev/au1200fb.h create mode 100644 drivers/video/fbdev/auo_k1900fb.c create mode 100644 drivers/video/fbdev/auo_k1901fb.c create mode 100644 drivers/video/fbdev/auo_k190x.c create mode 100644 drivers/video/fbdev/auo_k190x.h create mode 100644 drivers/video/fbdev/bf537-lq035.c create mode 100644 drivers/video/fbdev/bf54x-lq043fb.c create mode 100644 drivers/video/fbdev/bfin-lq035q1-fb.c create mode 100644 drivers/video/fbdev/bfin-t350mcqb-fb.c create mode 100644 drivers/video/fbdev/bfin_adv7393fb.c create mode 100644 drivers/video/fbdev/bfin_adv7393fb.h create mode 100644 drivers/video/fbdev/broadsheetfb.c create mode 100644 drivers/video/fbdev/bt431.h create mode 100644 drivers/video/fbdev/bt455.h create mode 100644 drivers/video/fbdev/bw2.c create mode 100644 drivers/video/fbdev/c2p.h create mode 100644 drivers/video/fbdev/c2p_core.h create mode 100644 drivers/video/fbdev/c2p_iplan2.c create mode 100644 drivers/video/fbdev/c2p_planar.c create mode 100644 drivers/video/fbdev/carminefb.c create mode 100644 drivers/video/fbdev/carminefb.h create mode 100644 drivers/video/fbdev/carminefb_regs.h create mode 100644 drivers/video/fbdev/cfbcopyarea.c create mode 100644 drivers/video/fbdev/cfbfillrect.c create mode 100644 drivers/video/fbdev/cfbimgblt.c create mode 100644 drivers/video/fbdev/cg14.c create mode 100644 drivers/video/fbdev/cg3.c create mode 100644 drivers/video/fbdev/cg6.c create mode 100644 drivers/video/fbdev/chipsfb.c create mode 100644 drivers/video/fbdev/cirrusfb.c create mode 100644 drivers/video/fbdev/clps711xfb.c create mode 100644 drivers/video/fbdev/cobalt_lcdfb.c create mode 100644 drivers/video/fbdev/controlfb.c create mode 100644 drivers/video/fbdev/controlfb.h create mode 100644 drivers/video/fbdev/cyber2000fb.c create mode 100644 drivers/video/fbdev/cyber2000fb.h create mode 100644 drivers/video/fbdev/da8xx-fb.c create mode 100644 drivers/video/fbdev/dnfb.c create mode 100644 drivers/video/fbdev/edid.h create mode 100644 drivers/video/fbdev/efifb.c create mode 100644 drivers/video/fbdev/ep93xx-fb.c create mode 100644 drivers/video/fbdev/exynos/Kconfig create mode 100644 drivers/video/fbdev/exynos/Makefile create mode 100644 drivers/video/fbdev/exynos/exynos_mipi_dsi.c create mode 100644 drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c create mode 100644 drivers/video/fbdev/exynos/exynos_mipi_dsi_common.h create mode 100644 drivers/video/fbdev/exynos/exynos_mipi_dsi_lowlevel.c create mode 100644 drivers/video/fbdev/exynos/exynos_mipi_dsi_lowlevel.h create mode 100644 drivers/video/fbdev/exynos/exynos_mipi_dsi_regs.h create mode 100644 drivers/video/fbdev/exynos/s6e8ax0.c create mode 100644 drivers/video/fbdev/fb-puv3.c create mode 100644 drivers/video/fbdev/fb_ddc.c create mode 100644 drivers/video/fbdev/fb_defio.c create mode 100644 drivers/video/fbdev/fb_draw.h create mode 100644 drivers/video/fbdev/fb_notify.c create mode 100644 drivers/video/fbdev/fb_sys_fops.c create mode 100644 drivers/video/fbdev/fbcmap.c create mode 100644 drivers/video/fbdev/fbcvt.c create mode 100644 drivers/video/fbdev/fbmem.c create mode 100644 drivers/video/fbdev/fbmon.c create mode 100644 drivers/video/fbdev/fbsysfs.c create mode 100644 drivers/video/fbdev/ffb.c create mode 100644 drivers/video/fbdev/fm2fb.c create mode 100644 drivers/video/fbdev/fsl-diu-fb.c create mode 100644 drivers/video/fbdev/g364fb.c create mode 100644 drivers/video/fbdev/gbefb.c create mode 100644 drivers/video/fbdev/geode/Kconfig create mode 100644 drivers/video/fbdev/geode/Makefile create mode 100644 drivers/video/fbdev/geode/display_gx.c create mode 100644 drivers/video/fbdev/geode/display_gx1.c create mode 100644 drivers/video/fbdev/geode/display_gx1.h create mode 100644 drivers/video/fbdev/geode/geodefb.h create mode 100644 drivers/video/fbdev/geode/gx1fb_core.c create mode 100644 drivers/video/fbdev/geode/gxfb.h create mode 100644 drivers/video/fbdev/geode/gxfb_core.c create mode 100644 drivers/video/fbdev/geode/lxfb.h create mode 100644 drivers/video/fbdev/geode/lxfb_core.c create mode 100644 drivers/video/fbdev/geode/lxfb_ops.c create mode 100644 drivers/video/fbdev/geode/suspend_gx.c create mode 100644 drivers/video/fbdev/geode/video_cs5530.c create mode 100644 drivers/video/fbdev/geode/video_cs5530.h create mode 100644 drivers/video/fbdev/geode/video_gx.c create mode 100644 drivers/video/fbdev/goldfishfb.c create mode 100644 drivers/video/fbdev/grvga.c create mode 100644 drivers/video/fbdev/gxt4500.c create mode 100644 drivers/video/fbdev/hecubafb.c create mode 100644 drivers/video/fbdev/hgafb.c create mode 100644 drivers/video/fbdev/hitfb.c create mode 100644 drivers/video/fbdev/hpfb.c create mode 100644 drivers/video/fbdev/hyperv_fb.c create mode 100644 drivers/video/fbdev/i740_reg.h create mode 100644 drivers/video/fbdev/i740fb.c create mode 100644 drivers/video/fbdev/i810/Makefile create mode 100644 drivers/video/fbdev/i810/i810-i2c.c create mode 100644 drivers/video/fbdev/i810/i810.h create mode 100644 drivers/video/fbdev/i810/i810_accel.c create mode 100644 drivers/video/fbdev/i810/i810_dvt.c create mode 100644 drivers/video/fbdev/i810/i810_gtf.c create mode 100644 drivers/video/fbdev/i810/i810_main.c create mode 100644 drivers/video/fbdev/i810/i810_main.h create mode 100644 drivers/video/fbdev/i810/i810_regs.h create mode 100644 drivers/video/fbdev/igafb.c create mode 100644 drivers/video/fbdev/imsttfb.c create mode 100644 drivers/video/fbdev/imxfb.c create mode 100644 drivers/video/fbdev/intelfb/Makefile create mode 100644 drivers/video/fbdev/intelfb/intelfb.h create mode 100644 drivers/video/fbdev/intelfb/intelfb_i2c.c create mode 100644 drivers/video/fbdev/intelfb/intelfbdrv.c create mode 100644 drivers/video/fbdev/intelfb/intelfbhw.c create mode 100644 drivers/video/fbdev/intelfb/intelfbhw.h create mode 100644 drivers/video/fbdev/jz4740_fb.c create mode 100644 drivers/video/fbdev/kyro/Makefile create mode 100644 drivers/video/fbdev/kyro/STG4000InitDevice.c create mode 100644 drivers/video/fbdev/kyro/STG4000Interface.h create mode 100644 drivers/video/fbdev/kyro/STG4000OverlayDevice.c create mode 100644 drivers/video/fbdev/kyro/STG4000Ramdac.c create mode 100644 drivers/video/fbdev/kyro/STG4000Reg.h create mode 100644 drivers/video/fbdev/kyro/STG4000VTG.c create mode 100644 drivers/video/fbdev/kyro/fbdev.c create mode 100644 drivers/video/fbdev/leo.c create mode 100644 drivers/video/fbdev/macfb.c create mode 100644 drivers/video/fbdev/macmodes.c create mode 100644 drivers/video/fbdev/macmodes.h create mode 100644 drivers/video/fbdev/matrox/Makefile create mode 100644 drivers/video/fbdev/matrox/g450_pll.c create mode 100644 drivers/video/fbdev/matrox/g450_pll.h create mode 100644 drivers/video/fbdev/matrox/i2c-matroxfb.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_DAC1064.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_DAC1064.h create mode 100644 drivers/video/fbdev/matrox/matroxfb_Ti3026.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_Ti3026.h create mode 100644 drivers/video/fbdev/matrox/matroxfb_accel.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_accel.h create mode 100644 drivers/video/fbdev/matrox/matroxfb_base.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_base.h create mode 100644 drivers/video/fbdev/matrox/matroxfb_crtc2.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_crtc2.h create mode 100644 drivers/video/fbdev/matrox/matroxfb_g450.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_g450.h create mode 100644 drivers/video/fbdev/matrox/matroxfb_maven.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_maven.h create mode 100644 drivers/video/fbdev/matrox/matroxfb_misc.c create mode 100644 drivers/video/fbdev/matrox/matroxfb_misc.h create mode 100644 drivers/video/fbdev/maxinefb.c create mode 100644 drivers/video/fbdev/mb862xx/Makefile create mode 100644 drivers/video/fbdev/mb862xx/mb862xx-i2c.c create mode 100644 drivers/video/fbdev/mb862xx/mb862xx_reg.h create mode 100644 drivers/video/fbdev/mb862xx/mb862xxfb.h create mode 100644 drivers/video/fbdev/mb862xx/mb862xxfb_accel.c create mode 100644 drivers/video/fbdev/mb862xx/mb862xxfb_accel.h create mode 100644 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c create mode 100644 drivers/video/fbdev/mbx/Makefile create mode 100644 drivers/video/fbdev/mbx/mbxdebugfs.c create mode 100644 drivers/video/fbdev/mbx/mbxfb.c create mode 100644 drivers/video/fbdev/mbx/reg_bits.h create mode 100644 drivers/video/fbdev/mbx/regs.h create mode 100644 drivers/video/fbdev/metronomefb.c create mode 100644 drivers/video/fbdev/mmp/Kconfig create mode 100644 drivers/video/fbdev/mmp/Makefile create mode 100644 drivers/video/fbdev/mmp/core.c create mode 100644 drivers/video/fbdev/mmp/fb/Kconfig create mode 100644 drivers/video/fbdev/mmp/fb/Makefile create mode 100644 drivers/video/fbdev/mmp/fb/mmpfb.c create mode 100644 drivers/video/fbdev/mmp/fb/mmpfb.h create mode 100644 drivers/video/fbdev/mmp/hw/Kconfig create mode 100644 drivers/video/fbdev/mmp/hw/Makefile create mode 100644 drivers/video/fbdev/mmp/hw/mmp_ctrl.c create mode 100644 drivers/video/fbdev/mmp/hw/mmp_ctrl.h create mode 100644 drivers/video/fbdev/mmp/hw/mmp_spi.c create mode 100644 drivers/video/fbdev/mmp/panel/Kconfig create mode 100644 drivers/video/fbdev/mmp/panel/Makefile create mode 100644 drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c create mode 100644 drivers/video/fbdev/modedb.c create mode 100644 drivers/video/fbdev/msm/Makefile create mode 100644 drivers/video/fbdev/msm/mddi.c create mode 100644 drivers/video/fbdev/msm/mddi_client_dummy.c create mode 100644 drivers/video/fbdev/msm/mddi_client_nt35399.c create mode 100644 drivers/video/fbdev/msm/mddi_client_toshiba.c create mode 100644 drivers/video/fbdev/msm/mddi_hw.h create mode 100644 drivers/video/fbdev/msm/mdp.c create mode 100644 drivers/video/fbdev/msm/mdp_csc_table.h create mode 100644 drivers/video/fbdev/msm/mdp_hw.h create mode 100644 drivers/video/fbdev/msm/mdp_ppp.c create mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.c create mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.h create mode 100644 drivers/video/fbdev/msm/msm_fb.c create mode 100644 drivers/video/fbdev/mx3fb.c create mode 100644 drivers/video/fbdev/mxsfb.c create mode 100644 drivers/video/fbdev/n411.c create mode 100644 drivers/video/fbdev/neofb.c create mode 100644 drivers/video/fbdev/nuc900fb.c create mode 100644 drivers/video/fbdev/nuc900fb.h create mode 100644 drivers/video/fbdev/nvidia/Makefile create mode 100644 drivers/video/fbdev/nvidia/nv_accel.c create mode 100644 drivers/video/fbdev/nvidia/nv_backlight.c create mode 100644 drivers/video/fbdev/nvidia/nv_dma.h create mode 100644 drivers/video/fbdev/nvidia/nv_hw.c create mode 100644 drivers/video/fbdev/nvidia/nv_i2c.c create mode 100644 drivers/video/fbdev/nvidia/nv_local.h create mode 100644 drivers/video/fbdev/nvidia/nv_of.c create mode 100644 drivers/video/fbdev/nvidia/nv_proto.h create mode 100644 drivers/video/fbdev/nvidia/nv_setup.c create mode 100644 drivers/video/fbdev/nvidia/nv_type.h create mode 100644 drivers/video/fbdev/nvidia/nvidia.c create mode 100644 drivers/video/fbdev/ocfb.c create mode 100644 drivers/video/fbdev/offb.c create mode 100644 drivers/video/fbdev/omap/Kconfig create mode 100644 drivers/video/fbdev/omap/Makefile create mode 100644 drivers/video/fbdev/omap/hwa742.c create mode 100644 drivers/video/fbdev/omap/lcd_ams_delta.c create mode 100644 drivers/video/fbdev/omap/lcd_h3.c create mode 100644 drivers/video/fbdev/omap/lcd_htcherald.c create mode 100644 drivers/video/fbdev/omap/lcd_inn1510.c create mode 100644 drivers/video/fbdev/omap/lcd_inn1610.c create mode 100644 drivers/video/fbdev/omap/lcd_mipid.c create mode 100644 drivers/video/fbdev/omap/lcd_osk.c create mode 100644 drivers/video/fbdev/omap/lcd_palmte.c create mode 100644 drivers/video/fbdev/omap/lcd_palmtt.c create mode 100644 drivers/video/fbdev/omap/lcd_palmz71.c create mode 100644 drivers/video/fbdev/omap/lcdc.c create mode 100644 drivers/video/fbdev/omap/lcdc.h create mode 100644 drivers/video/fbdev/omap/omapfb.h create mode 100644 drivers/video/fbdev/omap/omapfb_main.c create mode 100644 drivers/video/fbdev/omap/sossi.c create mode 100644 drivers/video/fbdev/omap2/Kconfig create mode 100644 drivers/video/fbdev/omap2/Makefile create mode 100644 drivers/video/fbdev/omap2/displays-new/Kconfig create mode 100644 drivers/video/fbdev/omap2/displays-new/Makefile create mode 100644 drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c create mode 100644 drivers/video/fbdev/omap2/displays-new/connector-dvi.c create mode 100644 drivers/video/fbdev/omap2/displays-new/connector-hdmi.c create mode 100644 drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c create mode 100644 drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c create mode 100644 drivers/video/fbdev/omap2/displays-new/panel-dpi.c create mode 100644 drivers/video/fbdev/omap2/displays-new/panel-dsi-cm.c create mode 100644 drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c create mode 100644 drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c create mode 100644 drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c create mode 100644 drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c create mode 100644 drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c create mode 100644 drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c create mode 100644 drivers/video/fbdev/omap2/dss/Kconfig create mode 100644 drivers/video/fbdev/omap2/dss/Makefile create mode 100644 drivers/video/fbdev/omap2/dss/apply.c create mode 100644 drivers/video/fbdev/omap2/dss/core.c create mode 100644 drivers/video/fbdev/omap2/dss/dispc-compat.c create mode 100644 drivers/video/fbdev/omap2/dss/dispc-compat.h create mode 100644 drivers/video/fbdev/omap2/dss/dispc.c create mode 100644 drivers/video/fbdev/omap2/dss/dispc.h create mode 100644 drivers/video/fbdev/omap2/dss/dispc_coefs.c create mode 100644 drivers/video/fbdev/omap2/dss/display-sysfs.c create mode 100644 drivers/video/fbdev/omap2/dss/display.c create mode 100644 drivers/video/fbdev/omap2/dss/dpi.c create mode 100644 drivers/video/fbdev/omap2/dss/dsi.c create mode 100644 drivers/video/fbdev/omap2/dss/dss-of.c create mode 100644 drivers/video/fbdev/omap2/dss/dss.c create mode 100644 drivers/video/fbdev/omap2/dss/dss.h create mode 100644 drivers/video/fbdev/omap2/dss/dss_features.c create mode 100644 drivers/video/fbdev/omap2/dss/dss_features.h create mode 100644 drivers/video/fbdev/omap2/dss/hdmi.h create mode 100644 drivers/video/fbdev/omap2/dss/hdmi4.c create mode 100644 drivers/video/fbdev/omap2/dss/hdmi4_core.c create mode 100644 drivers/video/fbdev/omap2/dss/hdmi4_core.h create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_common.c create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_phy.c create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_pll.c create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_wp.c create mode 100644 drivers/video/fbdev/omap2/dss/manager-sysfs.c create mode 100644 drivers/video/fbdev/omap2/dss/manager.c create mode 100644 drivers/video/fbdev/omap2/dss/output.c create mode 100644 drivers/video/fbdev/omap2/dss/overlay-sysfs.c create mode 100644 drivers/video/fbdev/omap2/dss/overlay.c create mode 100644 drivers/video/fbdev/omap2/dss/rfbi.c create mode 100644 drivers/video/fbdev/omap2/dss/sdi.c create mode 100644 drivers/video/fbdev/omap2/dss/venc.c create mode 100644 drivers/video/fbdev/omap2/dss/venc_panel.c create mode 100644 drivers/video/fbdev/omap2/omapfb/Kconfig create mode 100644 drivers/video/fbdev/omap2/omapfb/Makefile create mode 100644 drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c create mode 100644 drivers/video/fbdev/omap2/omapfb/omapfb-main.c create mode 100644 drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c create mode 100644 drivers/video/fbdev/omap2/omapfb/omapfb.h create mode 100644 drivers/video/fbdev/omap2/vrfb.c create mode 100644 drivers/video/fbdev/p9100.c create mode 100644 drivers/video/fbdev/platinumfb.c create mode 100644 drivers/video/fbdev/platinumfb.h create mode 100644 drivers/video/fbdev/pm2fb.c create mode 100644 drivers/video/fbdev/pm3fb.c create mode 100644 drivers/video/fbdev/pmag-aa-fb.c create mode 100644 drivers/video/fbdev/pmag-ba-fb.c create mode 100644 drivers/video/fbdev/pmagb-b-fb.c create mode 100644 drivers/video/fbdev/ps3fb.c create mode 100644 drivers/video/fbdev/pvr2fb.c create mode 100644 drivers/video/fbdev/pxa168fb.c create mode 100644 drivers/video/fbdev/pxa168fb.h create mode 100644 drivers/video/fbdev/pxa3xx-gcu.c create mode 100644 drivers/video/fbdev/pxa3xx-gcu.h create mode 100644 drivers/video/fbdev/pxafb.c create mode 100644 drivers/video/fbdev/pxafb.h create mode 100644 drivers/video/fbdev/q40fb.c create mode 100644 drivers/video/fbdev/riva/Makefile create mode 100644 drivers/video/fbdev/riva/fbdev.c create mode 100644 drivers/video/fbdev/riva/nv_driver.c create mode 100644 drivers/video/fbdev/riva/nv_type.h create mode 100644 drivers/video/fbdev/riva/nvreg.h create mode 100644 drivers/video/fbdev/riva/riva_hw.c create mode 100644 drivers/video/fbdev/riva/riva_hw.h create mode 100644 drivers/video/fbdev/riva/riva_tbl.h create mode 100644 drivers/video/fbdev/riva/rivafb-i2c.c create mode 100644 drivers/video/fbdev/riva/rivafb.h create mode 100644 drivers/video/fbdev/s1d13xxxfb.c create mode 100644 drivers/video/fbdev/s3c-fb.c create mode 100644 drivers/video/fbdev/s3c2410fb.c create mode 100644 drivers/video/fbdev/s3c2410fb.h create mode 100644 drivers/video/fbdev/s3fb.c create mode 100644 drivers/video/fbdev/sa1100fb.c create mode 100644 drivers/video/fbdev/sa1100fb.h create mode 100644 drivers/video/fbdev/savage/Makefile create mode 100644 drivers/video/fbdev/savage/savagefb-i2c.c create mode 100644 drivers/video/fbdev/savage/savagefb.h create mode 100644 drivers/video/fbdev/savage/savagefb_accel.c create mode 100644 drivers/video/fbdev/savage/savagefb_driver.c create mode 100644 drivers/video/fbdev/sbuslib.c create mode 100644 drivers/video/fbdev/sbuslib.h create mode 100644 drivers/video/fbdev/sh7760fb.c create mode 100644 drivers/video/fbdev/sh_mipi_dsi.c create mode 100644 drivers/video/fbdev/sh_mobile_hdmi.c create mode 100644 drivers/video/fbdev/sh_mobile_lcdcfb.c create mode 100644 drivers/video/fbdev/sh_mobile_lcdcfb.h create mode 100644 drivers/video/fbdev/sh_mobile_meram.c create mode 100644 drivers/video/fbdev/simplefb.c create mode 100644 drivers/video/fbdev/sis/300vtbl.h create mode 100644 drivers/video/fbdev/sis/310vtbl.h create mode 100644 drivers/video/fbdev/sis/Makefile create mode 100644 drivers/video/fbdev/sis/init.c create mode 100644 drivers/video/fbdev/sis/init.h create mode 100644 drivers/video/fbdev/sis/init301.c create mode 100644 drivers/video/fbdev/sis/init301.h create mode 100644 drivers/video/fbdev/sis/initdef.h create mode 100644 drivers/video/fbdev/sis/initextlfb.c create mode 100644 drivers/video/fbdev/sis/oem300.h create mode 100644 drivers/video/fbdev/sis/oem310.h create mode 100644 drivers/video/fbdev/sis/sis.h create mode 100644 drivers/video/fbdev/sis/sis_accel.c create mode 100644 drivers/video/fbdev/sis/sis_accel.h create mode 100644 drivers/video/fbdev/sis/sis_main.c create mode 100644 drivers/video/fbdev/sis/sis_main.h create mode 100644 drivers/video/fbdev/sis/vgatypes.h create mode 100644 drivers/video/fbdev/sis/vstruct.h create mode 100644 drivers/video/fbdev/skeletonfb.c create mode 100644 drivers/video/fbdev/sm501fb.c create mode 100644 drivers/video/fbdev/smscufx.c create mode 100644 drivers/video/fbdev/ssd1307fb.c create mode 100644 drivers/video/fbdev/sstfb.c create mode 100644 drivers/video/fbdev/sticore.h create mode 100644 drivers/video/fbdev/stifb.c create mode 100644 drivers/video/fbdev/sunxvr1000.c create mode 100644 drivers/video/fbdev/sunxvr2500.c create mode 100644 drivers/video/fbdev/sunxvr500.c create mode 100644 drivers/video/fbdev/svgalib.c create mode 100644 drivers/video/fbdev/syscopyarea.c create mode 100644 drivers/video/fbdev/sysfillrect.c create mode 100644 drivers/video/fbdev/sysimgblt.c create mode 100644 drivers/video/fbdev/tcx.c create mode 100644 drivers/video/fbdev/tdfxfb.c create mode 100644 drivers/video/fbdev/tgafb.c create mode 100644 drivers/video/fbdev/tmiofb.c create mode 100644 drivers/video/fbdev/tridentfb.c create mode 100644 drivers/video/fbdev/udlfb.c create mode 100644 drivers/video/fbdev/uvesafb.c create mode 100644 drivers/video/fbdev/valkyriefb.c create mode 100644 drivers/video/fbdev/valkyriefb.h create mode 100644 drivers/video/fbdev/vermilion/Makefile create mode 100644 drivers/video/fbdev/vermilion/cr_pll.c create mode 100644 drivers/video/fbdev/vermilion/vermilion.c create mode 100644 drivers/video/fbdev/vermilion/vermilion.h create mode 100644 drivers/video/fbdev/vesafb.c create mode 100644 drivers/video/fbdev/vfb.c create mode 100644 drivers/video/fbdev/vga16fb.c create mode 100644 drivers/video/fbdev/via/Makefile create mode 100644 drivers/video/fbdev/via/accel.c create mode 100644 drivers/video/fbdev/via/accel.h create mode 100644 drivers/video/fbdev/via/chip.h create mode 100644 drivers/video/fbdev/via/debug.h create mode 100644 drivers/video/fbdev/via/dvi.c create mode 100644 drivers/video/fbdev/via/dvi.h create mode 100644 drivers/video/fbdev/via/global.c create mode 100644 drivers/video/fbdev/via/global.h create mode 100644 drivers/video/fbdev/via/hw.c create mode 100644 drivers/video/fbdev/via/hw.h create mode 100644 drivers/video/fbdev/via/ioctl.c create mode 100644 drivers/video/fbdev/via/ioctl.h create mode 100644 drivers/video/fbdev/via/lcd.c create mode 100644 drivers/video/fbdev/via/lcd.h create mode 100644 drivers/video/fbdev/via/share.h create mode 100644 drivers/video/fbdev/via/tblDPASetting.c create mode 100644 drivers/video/fbdev/via/tblDPASetting.h create mode 100644 drivers/video/fbdev/via/via-core.c create mode 100644 drivers/video/fbdev/via/via-gpio.c create mode 100644 drivers/video/fbdev/via/via_aux.c create mode 100644 drivers/video/fbdev/via/via_aux.h create mode 100644 drivers/video/fbdev/via/via_aux_ch7301.c create mode 100644 drivers/video/fbdev/via/via_aux_edid.c create mode 100644 drivers/video/fbdev/via/via_aux_sii164.c create mode 100644 drivers/video/fbdev/via/via_aux_vt1621.c create mode 100644 drivers/video/fbdev/via/via_aux_vt1622.c create mode 100644 drivers/video/fbdev/via/via_aux_vt1625.c create mode 100644 drivers/video/fbdev/via/via_aux_vt1631.c create mode 100644 drivers/video/fbdev/via/via_aux_vt1632.c create mode 100644 drivers/video/fbdev/via/via_aux_vt1636.c create mode 100644 drivers/video/fbdev/via/via_clock.c create mode 100644 drivers/video/fbdev/via/via_clock.h create mode 100644 drivers/video/fbdev/via/via_i2c.c create mode 100644 drivers/video/fbdev/via/via_modesetting.c create mode 100644 drivers/video/fbdev/via/via_modesetting.h create mode 100644 drivers/video/fbdev/via/via_utility.c create mode 100644 drivers/video/fbdev/via/via_utility.h create mode 100644 drivers/video/fbdev/via/viafbdev.c create mode 100644 drivers/video/fbdev/via/viafbdev.h create mode 100644 drivers/video/fbdev/via/viamode.c create mode 100644 drivers/video/fbdev/via/viamode.h create mode 100644 drivers/video/fbdev/via/vt1636.c create mode 100644 drivers/video/fbdev/via/vt1636.h create mode 100644 drivers/video/fbdev/vt8500lcdfb.c create mode 100644 drivers/video/fbdev/vt8500lcdfb.h create mode 100644 drivers/video/fbdev/vt8623fb.c create mode 100644 drivers/video/fbdev/w100fb.c create mode 100644 drivers/video/fbdev/w100fb.h create mode 100644 drivers/video/fbdev/wm8505fb.c create mode 100644 drivers/video/fbdev/wm8505fb_regs.h create mode 100644 drivers/video/fbdev/wmt_ge_rops.c create mode 100644 drivers/video/fbdev/wmt_ge_rops.h create mode 100644 drivers/video/fbdev/xen-fbfront.c create mode 100644 drivers/video/fbdev/xilinxfb.c delete mode 100644 drivers/video/fbmem.c delete mode 100644 drivers/video/fbmon.c delete mode 100644 drivers/video/fbsysfs.c delete mode 100644 drivers/video/ffb.c delete mode 100644 drivers/video/fm2fb.c delete mode 100644 drivers/video/fsl-diu-fb.c delete mode 100644 drivers/video/g364fb.c delete mode 100644 drivers/video/gbefb.c delete mode 100644 drivers/video/geode/Kconfig delete mode 100644 drivers/video/geode/Makefile delete mode 100644 drivers/video/geode/display_gx.c delete mode 100644 drivers/video/geode/display_gx1.c delete mode 100644 drivers/video/geode/display_gx1.h delete mode 100644 drivers/video/geode/geodefb.h delete mode 100644 drivers/video/geode/gx1fb_core.c delete mode 100644 drivers/video/geode/gxfb.h delete mode 100644 drivers/video/geode/gxfb_core.c delete mode 100644 drivers/video/geode/lxfb.h delete mode 100644 drivers/video/geode/lxfb_core.c delete mode 100644 drivers/video/geode/lxfb_ops.c delete mode 100644 drivers/video/geode/suspend_gx.c delete mode 100644 drivers/video/geode/video_cs5530.c delete mode 100644 drivers/video/geode/video_cs5530.h delete mode 100644 drivers/video/geode/video_gx.c delete mode 100644 drivers/video/goldfishfb.c delete mode 100644 drivers/video/grvga.c delete mode 100644 drivers/video/gxt4500.c delete mode 100644 drivers/video/hecubafb.c delete mode 100644 drivers/video/hgafb.c delete mode 100644 drivers/video/hitfb.c delete mode 100644 drivers/video/hpfb.c delete mode 100644 drivers/video/hyperv_fb.c delete mode 100644 drivers/video/i740_reg.h delete mode 100644 drivers/video/i740fb.c delete mode 100644 drivers/video/i810/Makefile delete mode 100644 drivers/video/i810/i810-i2c.c delete mode 100644 drivers/video/i810/i810.h delete mode 100644 drivers/video/i810/i810_accel.c delete mode 100644 drivers/video/i810/i810_dvt.c delete mode 100644 drivers/video/i810/i810_gtf.c delete mode 100644 drivers/video/i810/i810_main.c delete mode 100644 drivers/video/i810/i810_main.h delete mode 100644 drivers/video/i810/i810_regs.h delete mode 100644 drivers/video/igafb.c delete mode 100644 drivers/video/imsttfb.c delete mode 100644 drivers/video/imxfb.c delete mode 100644 drivers/video/intelfb/Makefile delete mode 100644 drivers/video/intelfb/intelfb.h delete mode 100644 drivers/video/intelfb/intelfb_i2c.c delete mode 100644 drivers/video/intelfb/intelfbdrv.c delete mode 100644 drivers/video/intelfb/intelfbhw.c delete mode 100644 drivers/video/intelfb/intelfbhw.h delete mode 100644 drivers/video/jz4740_fb.c delete mode 100644 drivers/video/kyro/Makefile delete mode 100644 drivers/video/kyro/STG4000InitDevice.c delete mode 100644 drivers/video/kyro/STG4000Interface.h delete mode 100644 drivers/video/kyro/STG4000OverlayDevice.c delete mode 100644 drivers/video/kyro/STG4000Ramdac.c delete mode 100644 drivers/video/kyro/STG4000Reg.h delete mode 100644 drivers/video/kyro/STG4000VTG.c delete mode 100644 drivers/video/kyro/fbdev.c delete mode 100644 drivers/video/leo.c delete mode 100644 drivers/video/macfb.c delete mode 100644 drivers/video/macmodes.c delete mode 100644 drivers/video/macmodes.h delete mode 100644 drivers/video/matrox/Makefile delete mode 100644 drivers/video/matrox/g450_pll.c delete mode 100644 drivers/video/matrox/g450_pll.h delete mode 100644 drivers/video/matrox/i2c-matroxfb.c delete mode 100644 drivers/video/matrox/matroxfb_DAC1064.c delete mode 100644 drivers/video/matrox/matroxfb_DAC1064.h delete mode 100644 drivers/video/matrox/matroxfb_Ti3026.c delete mode 100644 drivers/video/matrox/matroxfb_Ti3026.h delete mode 100644 drivers/video/matrox/matroxfb_accel.c delete mode 100644 drivers/video/matrox/matroxfb_accel.h delete mode 100644 drivers/video/matrox/matroxfb_base.c delete mode 100644 drivers/video/matrox/matroxfb_base.h delete mode 100644 drivers/video/matrox/matroxfb_crtc2.c delete mode 100644 drivers/video/matrox/matroxfb_crtc2.h delete mode 100644 drivers/video/matrox/matroxfb_g450.c delete mode 100644 drivers/video/matrox/matroxfb_g450.h delete mode 100644 drivers/video/matrox/matroxfb_maven.c delete mode 100644 drivers/video/matrox/matroxfb_maven.h delete mode 100644 drivers/video/matrox/matroxfb_misc.c delete mode 100644 drivers/video/matrox/matroxfb_misc.h delete mode 100644 drivers/video/maxinefb.c delete mode 100644 drivers/video/mb862xx/Makefile delete mode 100644 drivers/video/mb862xx/mb862xx-i2c.c delete mode 100644 drivers/video/mb862xx/mb862xx_reg.h delete mode 100644 drivers/video/mb862xx/mb862xxfb.h delete mode 100644 drivers/video/mb862xx/mb862xxfb_accel.c delete mode 100644 drivers/video/mb862xx/mb862xxfb_accel.h delete mode 100644 drivers/video/mb862xx/mb862xxfbdrv.c delete mode 100644 drivers/video/mbx/Makefile delete mode 100644 drivers/video/mbx/mbxdebugfs.c delete mode 100644 drivers/video/mbx/mbxfb.c delete mode 100644 drivers/video/mbx/reg_bits.h delete mode 100644 drivers/video/mbx/regs.h delete mode 100644 drivers/video/metronomefb.c delete mode 100644 drivers/video/mmp/Kconfig delete mode 100644 drivers/video/mmp/Makefile delete mode 100644 drivers/video/mmp/core.c delete mode 100644 drivers/video/mmp/fb/Kconfig delete mode 100644 drivers/video/mmp/fb/Makefile delete mode 100644 drivers/video/mmp/fb/mmpfb.c delete mode 100644 drivers/video/mmp/fb/mmpfb.h delete mode 100644 drivers/video/mmp/hw/Kconfig delete mode 100644 drivers/video/mmp/hw/Makefile delete mode 100644 drivers/video/mmp/hw/mmp_ctrl.c delete mode 100644 drivers/video/mmp/hw/mmp_ctrl.h delete mode 100644 drivers/video/mmp/hw/mmp_spi.c delete mode 100644 drivers/video/mmp/panel/Kconfig delete mode 100644 drivers/video/mmp/panel/Makefile delete mode 100644 drivers/video/mmp/panel/tpo_tj032md01bw.c delete mode 100644 drivers/video/modedb.c delete mode 100644 drivers/video/msm/Makefile delete mode 100644 drivers/video/msm/mddi.c delete mode 100644 drivers/video/msm/mddi_client_dummy.c delete mode 100644 drivers/video/msm/mddi_client_nt35399.c delete mode 100644 drivers/video/msm/mddi_client_toshiba.c delete mode 100644 drivers/video/msm/mddi_hw.h delete mode 100644 drivers/video/msm/mdp.c delete mode 100644 drivers/video/msm/mdp_csc_table.h delete mode 100644 drivers/video/msm/mdp_hw.h delete mode 100644 drivers/video/msm/mdp_ppp.c delete mode 100644 drivers/video/msm/mdp_scale_tables.c delete mode 100644 drivers/video/msm/mdp_scale_tables.h delete mode 100644 drivers/video/msm/msm_fb.c delete mode 100644 drivers/video/mx3fb.c delete mode 100644 drivers/video/mxsfb.c delete mode 100644 drivers/video/n411.c delete mode 100644 drivers/video/neofb.c delete mode 100644 drivers/video/nuc900fb.c delete mode 100644 drivers/video/nuc900fb.h delete mode 100644 drivers/video/nvidia/Makefile delete mode 100644 drivers/video/nvidia/nv_accel.c delete mode 100644 drivers/video/nvidia/nv_backlight.c delete mode 100644 drivers/video/nvidia/nv_dma.h delete mode 100644 drivers/video/nvidia/nv_hw.c delete mode 100644 drivers/video/nvidia/nv_i2c.c delete mode 100644 drivers/video/nvidia/nv_local.h delete mode 100644 drivers/video/nvidia/nv_of.c delete mode 100644 drivers/video/nvidia/nv_proto.h delete mode 100644 drivers/video/nvidia/nv_setup.c delete mode 100644 drivers/video/nvidia/nv_type.h delete mode 100644 drivers/video/nvidia/nvidia.c delete mode 100644 drivers/video/ocfb.c delete mode 100644 drivers/video/offb.c delete mode 100644 drivers/video/omap/Kconfig delete mode 100644 drivers/video/omap/Makefile delete mode 100644 drivers/video/omap/hwa742.c delete mode 100644 drivers/video/omap/lcd_ams_delta.c delete mode 100644 drivers/video/omap/lcd_h3.c delete mode 100644 drivers/video/omap/lcd_htcherald.c delete mode 100644 drivers/video/omap/lcd_inn1510.c delete mode 100644 drivers/video/omap/lcd_inn1610.c delete mode 100644 drivers/video/omap/lcd_mipid.c delete mode 100644 drivers/video/omap/lcd_osk.c delete mode 100644 drivers/video/omap/lcd_palmte.c delete mode 100644 drivers/video/omap/lcd_palmtt.c delete mode 100644 drivers/video/omap/lcd_palmz71.c delete mode 100644 drivers/video/omap/lcdc.c delete mode 100644 drivers/video/omap/lcdc.h delete mode 100644 drivers/video/omap/omapfb.h delete mode 100644 drivers/video/omap/omapfb_main.c delete mode 100644 drivers/video/omap/sossi.c delete mode 100644 drivers/video/omap2/Kconfig delete mode 100644 drivers/video/omap2/Makefile delete mode 100644 drivers/video/omap2/displays-new/Kconfig delete mode 100644 drivers/video/omap2/displays-new/Makefile delete mode 100644 drivers/video/omap2/displays-new/connector-analog-tv.c delete mode 100644 drivers/video/omap2/displays-new/connector-dvi.c delete mode 100644 drivers/video/omap2/displays-new/connector-hdmi.c delete mode 100644 drivers/video/omap2/displays-new/encoder-tfp410.c delete mode 100644 drivers/video/omap2/displays-new/encoder-tpd12s015.c delete mode 100644 drivers/video/omap2/displays-new/panel-dpi.c delete mode 100644 drivers/video/omap2/displays-new/panel-dsi-cm.c delete mode 100644 drivers/video/omap2/displays-new/panel-lgphilips-lb035q02.c delete mode 100644 drivers/video/omap2/displays-new/panel-nec-nl8048hl11.c delete mode 100644 drivers/video/omap2/displays-new/panel-sharp-ls037v7dw01.c delete mode 100644 drivers/video/omap2/displays-new/panel-sony-acx565akm.c delete mode 100644 drivers/video/omap2/displays-new/panel-tpo-td028ttec1.c delete mode 100644 drivers/video/omap2/displays-new/panel-tpo-td043mtea1.c delete mode 100644 drivers/video/omap2/dss/Kconfig delete mode 100644 drivers/video/omap2/dss/Makefile delete mode 100644 drivers/video/omap2/dss/apply.c delete mode 100644 drivers/video/omap2/dss/core.c delete mode 100644 drivers/video/omap2/dss/dispc-compat.c delete mode 100644 drivers/video/omap2/dss/dispc-compat.h delete mode 100644 drivers/video/omap2/dss/dispc.c delete mode 100644 drivers/video/omap2/dss/dispc.h delete mode 100644 drivers/video/omap2/dss/dispc_coefs.c delete mode 100644 drivers/video/omap2/dss/display-sysfs.c delete mode 100644 drivers/video/omap2/dss/display.c delete mode 100644 drivers/video/omap2/dss/dpi.c delete mode 100644 drivers/video/omap2/dss/dsi.c delete mode 100644 drivers/video/omap2/dss/dss-of.c delete mode 100644 drivers/video/omap2/dss/dss.c delete mode 100644 drivers/video/omap2/dss/dss.h delete mode 100644 drivers/video/omap2/dss/dss_features.c delete mode 100644 drivers/video/omap2/dss/dss_features.h delete mode 100644 drivers/video/omap2/dss/hdmi.h delete mode 100644 drivers/video/omap2/dss/hdmi4.c delete mode 100644 drivers/video/omap2/dss/hdmi4_core.c delete mode 100644 drivers/video/omap2/dss/hdmi4_core.h delete mode 100644 drivers/video/omap2/dss/hdmi_common.c delete mode 100644 drivers/video/omap2/dss/hdmi_phy.c delete mode 100644 drivers/video/omap2/dss/hdmi_pll.c delete mode 100644 drivers/video/omap2/dss/hdmi_wp.c delete mode 100644 drivers/video/omap2/dss/manager-sysfs.c delete mode 100644 drivers/video/omap2/dss/manager.c delete mode 100644 drivers/video/omap2/dss/output.c delete mode 100644 drivers/video/omap2/dss/overlay-sysfs.c delete mode 100644 drivers/video/omap2/dss/overlay.c delete mode 100644 drivers/video/omap2/dss/rfbi.c delete mode 100644 drivers/video/omap2/dss/sdi.c delete mode 100644 drivers/video/omap2/dss/venc.c delete mode 100644 drivers/video/omap2/dss/venc_panel.c delete mode 100644 drivers/video/omap2/omapfb/Kconfig delete mode 100644 drivers/video/omap2/omapfb/Makefile delete mode 100644 drivers/video/omap2/omapfb/omapfb-ioctl.c delete mode 100644 drivers/video/omap2/omapfb/omapfb-main.c delete mode 100644 drivers/video/omap2/omapfb/omapfb-sysfs.c delete mode 100644 drivers/video/omap2/omapfb/omapfb.h delete mode 100644 drivers/video/omap2/vrfb.c delete mode 100644 drivers/video/p9100.c delete mode 100644 drivers/video/platinumfb.c delete mode 100644 drivers/video/platinumfb.h delete mode 100644 drivers/video/pm2fb.c delete mode 100644 drivers/video/pm3fb.c delete mode 100644 drivers/video/pmag-aa-fb.c delete mode 100644 drivers/video/pmag-ba-fb.c delete mode 100644 drivers/video/pmagb-b-fb.c delete mode 100644 drivers/video/ps3fb.c delete mode 100644 drivers/video/pvr2fb.c delete mode 100644 drivers/video/pxa168fb.c delete mode 100644 drivers/video/pxa168fb.h delete mode 100644 drivers/video/pxa3xx-gcu.c delete mode 100644 drivers/video/pxa3xx-gcu.h delete mode 100644 drivers/video/pxafb.c delete mode 100644 drivers/video/pxafb.h delete mode 100644 drivers/video/q40fb.c delete mode 100644 drivers/video/riva/Makefile delete mode 100644 drivers/video/riva/fbdev.c delete mode 100644 drivers/video/riva/nv_driver.c delete mode 100644 drivers/video/riva/nv_type.h delete mode 100644 drivers/video/riva/nvreg.h delete mode 100644 drivers/video/riva/riva_hw.c delete mode 100644 drivers/video/riva/riva_hw.h delete mode 100644 drivers/video/riva/riva_tbl.h delete mode 100644 drivers/video/riva/rivafb-i2c.c delete mode 100644 drivers/video/riva/rivafb.h delete mode 100644 drivers/video/s1d13xxxfb.c delete mode 100644 drivers/video/s3c-fb.c delete mode 100644 drivers/video/s3c2410fb.c delete mode 100644 drivers/video/s3c2410fb.h delete mode 100644 drivers/video/s3fb.c delete mode 100644 drivers/video/sa1100fb.c delete mode 100644 drivers/video/sa1100fb.h delete mode 100644 drivers/video/savage/Makefile delete mode 100644 drivers/video/savage/savagefb-i2c.c delete mode 100644 drivers/video/savage/savagefb.h delete mode 100644 drivers/video/savage/savagefb_accel.c delete mode 100644 drivers/video/savage/savagefb_driver.c delete mode 100644 drivers/video/sbuslib.c delete mode 100644 drivers/video/sbuslib.h delete mode 100644 drivers/video/sh7760fb.c delete mode 100644 drivers/video/sh_mipi_dsi.c delete mode 100644 drivers/video/sh_mobile_hdmi.c delete mode 100644 drivers/video/sh_mobile_lcdcfb.c delete mode 100644 drivers/video/sh_mobile_lcdcfb.h delete mode 100644 drivers/video/sh_mobile_meram.c delete mode 100644 drivers/video/simplefb.c delete mode 100644 drivers/video/sis/300vtbl.h delete mode 100644 drivers/video/sis/310vtbl.h delete mode 100644 drivers/video/sis/Makefile delete mode 100644 drivers/video/sis/init.c delete mode 100644 drivers/video/sis/init.h delete mode 100644 drivers/video/sis/init301.c delete mode 100644 drivers/video/sis/init301.h delete mode 100644 drivers/video/sis/initdef.h delete mode 100644 drivers/video/sis/initextlfb.c delete mode 100644 drivers/video/sis/oem300.h delete mode 100644 drivers/video/sis/oem310.h delete mode 100644 drivers/video/sis/sis.h delete mode 100644 drivers/video/sis/sis_accel.c delete mode 100644 drivers/video/sis/sis_accel.h delete mode 100644 drivers/video/sis/sis_main.c delete mode 100644 drivers/video/sis/sis_main.h delete mode 100644 drivers/video/sis/vgatypes.h delete mode 100644 drivers/video/sis/vstruct.h delete mode 100644 drivers/video/skeletonfb.c delete mode 100644 drivers/video/sm501fb.c delete mode 100644 drivers/video/smscufx.c delete mode 100644 drivers/video/ssd1307fb.c delete mode 100644 drivers/video/sstfb.c delete mode 100644 drivers/video/sticore.h delete mode 100644 drivers/video/stifb.c delete mode 100644 drivers/video/sunxvr1000.c delete mode 100644 drivers/video/sunxvr2500.c delete mode 100644 drivers/video/sunxvr500.c delete mode 100644 drivers/video/svgalib.c delete mode 100644 drivers/video/syscopyarea.c delete mode 100644 drivers/video/sysfillrect.c delete mode 100644 drivers/video/sysimgblt.c delete mode 100644 drivers/video/tcx.c delete mode 100644 drivers/video/tdfxfb.c delete mode 100644 drivers/video/tgafb.c delete mode 100644 drivers/video/tmiofb.c delete mode 100644 drivers/video/tridentfb.c delete mode 100644 drivers/video/udlfb.c delete mode 100644 drivers/video/uvesafb.c delete mode 100644 drivers/video/valkyriefb.c delete mode 100644 drivers/video/valkyriefb.h delete mode 100644 drivers/video/vermilion/Makefile delete mode 100644 drivers/video/vermilion/cr_pll.c delete mode 100644 drivers/video/vermilion/vermilion.c delete mode 100644 drivers/video/vermilion/vermilion.h delete mode 100644 drivers/video/vesafb.c delete mode 100644 drivers/video/vfb.c delete mode 100644 drivers/video/vga16fb.c delete mode 100644 drivers/video/via/Makefile delete mode 100644 drivers/video/via/accel.c delete mode 100644 drivers/video/via/accel.h delete mode 100644 drivers/video/via/chip.h delete mode 100644 drivers/video/via/debug.h delete mode 100644 drivers/video/via/dvi.c delete mode 100644 drivers/video/via/dvi.h delete mode 100644 drivers/video/via/global.c delete mode 100644 drivers/video/via/global.h delete mode 100644 drivers/video/via/hw.c delete mode 100644 drivers/video/via/hw.h delete mode 100644 drivers/video/via/ioctl.c delete mode 100644 drivers/video/via/ioctl.h delete mode 100644 drivers/video/via/lcd.c delete mode 100644 drivers/video/via/lcd.h delete mode 100644 drivers/video/via/share.h delete mode 100644 drivers/video/via/tblDPASetting.c delete mode 100644 drivers/video/via/tblDPASetting.h delete mode 100644 drivers/video/via/via-core.c delete mode 100644 drivers/video/via/via-gpio.c delete mode 100644 drivers/video/via/via_aux.c delete mode 100644 drivers/video/via/via_aux.h delete mode 100644 drivers/video/via/via_aux_ch7301.c delete mode 100644 drivers/video/via/via_aux_edid.c delete mode 100644 drivers/video/via/via_aux_sii164.c delete mode 100644 drivers/video/via/via_aux_vt1621.c delete mode 100644 drivers/video/via/via_aux_vt1622.c delete mode 100644 drivers/video/via/via_aux_vt1625.c delete mode 100644 drivers/video/via/via_aux_vt1631.c delete mode 100644 drivers/video/via/via_aux_vt1632.c delete mode 100644 drivers/video/via/via_aux_vt1636.c delete mode 100644 drivers/video/via/via_clock.c delete mode 100644 drivers/video/via/via_clock.h delete mode 100644 drivers/video/via/via_i2c.c delete mode 100644 drivers/video/via/via_modesetting.c delete mode 100644 drivers/video/via/via_modesetting.h delete mode 100644 drivers/video/via/via_utility.c delete mode 100644 drivers/video/via/via_utility.h delete mode 100644 drivers/video/via/viafbdev.c delete mode 100644 drivers/video/via/viafbdev.h delete mode 100644 drivers/video/via/viamode.c delete mode 100644 drivers/video/via/viamode.h delete mode 100644 drivers/video/via/vt1636.c delete mode 100644 drivers/video/via/vt1636.h delete mode 100644 drivers/video/vt8500lcdfb.c delete mode 100644 drivers/video/vt8500lcdfb.h delete mode 100644 drivers/video/vt8623fb.c delete mode 100644 drivers/video/w100fb.c delete mode 100644 drivers/video/w100fb.h delete mode 100644 drivers/video/wm8505fb.c delete mode 100644 drivers/video/wm8505fb_regs.h delete mode 100644 drivers/video/wmt_ge_rops.c delete mode 100644 drivers/video/wmt_ge_rops.h delete mode 100644 drivers/video/xen-fbfront.c delete mode 100644 drivers/video/xilinxfb.c (limited to 'Documentation') diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl index f5170082bdb3..4d1aa8b44be7 100644 --- a/Documentation/DocBook/device-drivers.tmpl +++ b/Documentation/DocBook/device-drivers.tmpl @@ -276,7 +276,7 @@ X!Isound/sound_firmware.c Frame Buffer Memory -!Edrivers/video/fbmem.c +!Edrivers/video/fbdev/fbmem.c Frame Buffer Colormap -!Edrivers/video/fbcmap.c +!Edrivers/video/fbdev/fbcmap.c Frame Buffer Video Mode Database -!Idrivers/video/modedb.c -!Edrivers/video/modedb.c +!Idrivers/video/fbdev/modedb.c +!Edrivers/video/fbdev/modedb.c Frame Buffer Macintosh Video Mode Database -!Edrivers/video/macmodes.c +!Edrivers/video/fbdev/macmodes.c Frame Buffer Fonts diff --git a/drivers/Makefile b/drivers/Makefile index e3ced91b1784..d05d81b19b50 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -53,8 +53,8 @@ obj-y += gpu/ obj-$(CONFIG_CONNECTOR) += connector/ # i810fb and intelfb depend on char/agp/ -obj-$(CONFIG_FB_I810) += video/i810/ -obj-$(CONFIG_FB_INTEL) += video/intelfb/ +obj-$(CONFIG_FB_I810) += video/fbdev/i810/ +obj-$(CONFIG_FB_INTEL) += video/fbdev/intelfb/ obj-$(CONFIG_PARPORT) += parport/ obj-y += base/ block/ misc/ mfd/ nfc/ diff --git a/drivers/staging/xgifb/vb_def.h b/drivers/staging/xgifb/vb_def.h index 5c739bebd8a5..949f0e5eed8d 100644 --- a/drivers/staging/xgifb/vb_def.h +++ b/drivers/staging/xgifb/vb_def.h @@ -1,6 +1,6 @@ #ifndef _VB_DEF_ #define _VB_DEF_ -#include "../../video/sis/initdef.h" +#include "../../video/fbdev/sis/initdef.h" #define VB_XGI301C 0x0020 /* for 301C */ diff --git a/drivers/staging/xgifb/vb_struct.h b/drivers/staging/xgifb/vb_struct.h index c08ff5b2d6ee..0d27594554ca 100644 --- a/drivers/staging/xgifb/vb_struct.h +++ b/drivers/staging/xgifb/vb_struct.h @@ -1,6 +1,6 @@ #ifndef _VB_STRUCT_ #define _VB_STRUCT_ -#include "../../video/sis/vstruct.h" +#include "../../video/fbdev/sis/vstruct.h" struct XGI_LVDSCRT1HDataStruct { unsigned char Reg[8]; diff --git a/drivers/staging/xgifb/vgatypes.h b/drivers/staging/xgifb/vgatypes.h index ddf7776c295b..264351441f99 100644 --- a/drivers/staging/xgifb/vgatypes.h +++ b/drivers/staging/xgifb/vgatypes.h @@ -2,8 +2,8 @@ #define _VGATYPES_ #include /* for struct fb_var_screeninfo for sis.h */ -#include "../../video/sis/vgatypes.h" -#include "../../video/sis/sis.h" /* for LCD_TYPE */ +#include "../../video/fbdev/sis/vgatypes.h" +#include "../../video/fbdev/sis/sis.h" /* for LCD_TYPE */ #ifndef XGI_VB_CHIP_TYPE enum XGI_VB_CHIP_TYPE { diff --git a/drivers/video/68328fb.c b/drivers/video/68328fb.c deleted file mode 100644 index 552258c8f99d..000000000000 --- a/drivers/video/68328fb.c +++ /dev/null @@ -1,503 +0,0 @@ -/* - * linux/drivers/video/68328fb.c -- Low level implementation of the - * mc68x328 LCD frame buffer device - * - * Copyright (C) 2003 Georges Menie - * - * This driver assumes an already configured controller (e.g. from config.c) - * Keep the code clean of board specific initialization. - * - * This code has not been tested with colors, colormap management functions - * are minimal (no colormap data written to the 68328 registers...) - * - * initial version of this driver: - * Copyright (C) 1998,1999 Kenneth Albanowski , - * The Silver Hammer Group, Ltd. - * - * this version is based on : - * - * linux/drivers/video/vfb.c -- Virtual frame buffer device - * - * Copyright (C) 2002 James Simmons - * - * Copyright (C) 1997 Geert Uytterhoeven - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(CONFIG_M68VZ328) -#include -#elif defined(CONFIG_M68EZ328) -#include -#elif defined(CONFIG_M68328) -#include -#else -#error wrong architecture for the MC68x328 frame buffer device -#endif - -#if defined(CONFIG_FB_68328_INVERT) -#define MC68X328FB_MONO_VISUAL FB_VISUAL_MONO01 -#else -#define MC68X328FB_MONO_VISUAL FB_VISUAL_MONO10 -#endif - -static u_long videomemory; -static u_long videomemorysize; - -static struct fb_info fb_info; -static u32 mc68x328fb_pseudo_palette[16]; - -static struct fb_var_screeninfo mc68x328fb_default __initdata = { - .red = { 0, 8, 0 }, - .green = { 0, 8, 0 }, - .blue = { 0, 8, 0 }, - .activate = FB_ACTIVATE_TEST, - .height = -1, - .width = -1, - .pixclock = 20000, - .left_margin = 64, - .right_margin = 64, - .upper_margin = 32, - .lower_margin = 32, - .hsync_len = 64, - .vsync_len = 2, - .vmode = FB_VMODE_NONINTERLACED, -}; - -static struct fb_fix_screeninfo mc68x328fb_fix __initdata = { - .id = "68328fb", - .type = FB_TYPE_PACKED_PIXELS, - .xpanstep = 1, - .ypanstep = 1, - .ywrapstep = 1, - .accel = FB_ACCEL_NONE, -}; - - /* - * Interface used by the world - */ -int mc68x328fb_init(void); -int mc68x328fb_setup(char *); - -static int mc68x328fb_check_var(struct fb_var_screeninfo *var, - struct fb_info *info); -static int mc68x328fb_set_par(struct fb_info *info); -static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info); -static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info); -static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma); - -static struct fb_ops mc68x328fb_ops = { - .fb_check_var = mc68x328fb_check_var, - .fb_set_par = mc68x328fb_set_par, - .fb_setcolreg = mc68x328fb_setcolreg, - .fb_pan_display = mc68x328fb_pan_display, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, - .fb_mmap = mc68x328fb_mmap, -}; - - /* - * Internal routines - */ - -static u_long get_line_length(int xres_virtual, int bpp) -{ - u_long length; - - length = xres_virtual * bpp; - length = (length + 31) & ~31; - length >>= 3; - return (length); -} - - /* - * Setting the video mode has been split into two parts. - * First part, xxxfb_check_var, must not write anything - * to hardware, it should only verify and adjust var. - * This means it doesn't alter par but it does use hardware - * data from it to check this var. - */ - -static int mc68x328fb_check_var(struct fb_var_screeninfo *var, - struct fb_info *info) -{ - u_long line_length; - - /* - * FB_VMODE_CONUPDATE and FB_VMODE_SMOOTH_XPAN are equal! - * as FB_VMODE_SMOOTH_XPAN is only used internally - */ - - if (var->vmode & FB_VMODE_CONUPDATE) { - var->vmode |= FB_VMODE_YWRAP; - var->xoffset = info->var.xoffset; - var->yoffset = info->var.yoffset; - } - - /* - * Some very basic checks - */ - if (!var->xres) - var->xres = 1; - if (!var->yres) - var->yres = 1; - if (var->xres > var->xres_virtual) - var->xres_virtual = var->xres; - if (var->yres > var->yres_virtual) - var->yres_virtual = var->yres; - if (var->bits_per_pixel <= 1) - var->bits_per_pixel = 1; - else if (var->bits_per_pixel <= 8) - var->bits_per_pixel = 8; - else if (var->bits_per_pixel <= 16) - var->bits_per_pixel = 16; - else if (var->bits_per_pixel <= 24) - var->bits_per_pixel = 24; - else if (var->bits_per_pixel <= 32) - var->bits_per_pixel = 32; - else - return -EINVAL; - - if (var->xres_virtual < var->xoffset + var->xres) - var->xres_virtual = var->xoffset + var->xres; - if (var->yres_virtual < var->yoffset + var->yres) - var->yres_virtual = var->yoffset + var->yres; - - /* - * Memory limit - */ - line_length = - get_line_length(var->xres_virtual, var->bits_per_pixel); - if (line_length * var->yres_virtual > videomemorysize) - return -ENOMEM; - - /* - * Now that we checked it we alter var. The reason being is that the video - * mode passed in might not work but slight changes to it might make it - * work. This way we let the user know what is acceptable. - */ - switch (var->bits_per_pixel) { - case 1: - var->red.offset = 0; - var->red.length = 1; - var->green.offset = 0; - var->green.length = 1; - var->blue.offset = 0; - var->blue.length = 1; - var->transp.offset = 0; - var->transp.length = 0; - break; - case 8: - var->red.offset = 0; - var->red.length = 8; - var->green.offset = 0; - var->green.length = 8; - var->blue.offset = 0; - var->blue.length = 8; - var->transp.offset = 0; - var->transp.length = 0; - break; - case 16: /* RGBA 5551 */ - if (var->transp.length) { - var->red.offset = 0; - var->red.length = 5; - var->green.offset = 5; - var->green.length = 5; - var->blue.offset = 10; - var->blue.length = 5; - var->transp.offset = 15; - var->transp.length = 1; - } else { /* RGB 565 */ - var->red.offset = 0; - var->red.length = 5; - var->green.offset = 5; - var->green.length = 6; - var->blue.offset = 11; - var->blue.length = 5; - var->transp.offset = 0; - var->transp.length = 0; - } - break; - case 24: /* RGB 888 */ - var->red.offset = 0; - var->red.length = 8; - var->green.offset = 8; - var->green.length = 8; - var->blue.offset = 16; - var->blue.length = 8; - var->transp.offset = 0; - var->transp.length = 0; - break; - case 32: /* RGBA 8888 */ - var->red.offset = 0; - var->red.length = 8; - var->green.offset = 8; - var->green.length = 8; - var->blue.offset = 16; - var->blue.length = 8; - var->transp.offset = 24; - var->transp.length = 8; - break; - } - var->red.msb_right = 0; - var->green.msb_right = 0; - var->blue.msb_right = 0; - var->transp.msb_right = 0; - - return 0; -} - -/* This routine actually sets the video mode. It's in here where we - * the hardware state info->par and fix which can be affected by the - * change in par. For this driver it doesn't do much. - */ -static int mc68x328fb_set_par(struct fb_info *info) -{ - info->fix.line_length = get_line_length(info->var.xres_virtual, - info->var.bits_per_pixel); - return 0; -} - - /* - * Set a single color register. The values supplied are already - * rounded down to the hardware's capabilities (according to the - * entries in the var structure). Return != 0 for invalid regno. - */ - -static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info) -{ - if (regno >= 256) /* no. of hw registers */ - return 1; - /* - * Program hardware... do anything you want with transp - */ - - /* grayscale works only partially under directcolor */ - if (info->var.grayscale) { - /* grayscale = 0.30*R + 0.59*G + 0.11*B */ - red = green = blue = - (red * 77 + green * 151 + blue * 28) >> 8; - } - - /* Directcolor: - * var->{color}.offset contains start of bitfield - * var->{color}.length contains length of bitfield - * {hardwarespecific} contains width of RAMDAC - * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset) - * RAMDAC[X] is programmed to (red, green, blue) - * - * Pseudocolor: - * uses offset = 0 && length = RAMDAC register width. - * var->{color}.offset is 0 - * var->{color}.length contains width of DAC - * cmap is not used - * RAMDAC[X] is programmed to (red, green, blue) - * Truecolor: - * does not use DAC. Usually 3 are present. - * var->{color}.offset contains start of bitfield - * var->{color}.length contains length of bitfield - * cmap is programmed to (red << red.offset) | (green << green.offset) | - * (blue << blue.offset) | (transp << transp.offset) - * RAMDAC does not exist - */ -#define CNVT_TOHW(val,width) ((((val)<<(width))+0x7FFF-(val))>>16) - switch (info->fix.visual) { - case FB_VISUAL_TRUECOLOR: - case FB_VISUAL_PSEUDOCOLOR: - red = CNVT_TOHW(red, info->var.red.length); - green = CNVT_TOHW(green, info->var.green.length); - blue = CNVT_TOHW(blue, info->var.blue.length); - transp = CNVT_TOHW(transp, info->var.transp.length); - break; - case FB_VISUAL_DIRECTCOLOR: - red = CNVT_TOHW(red, 8); /* expect 8 bit DAC */ - green = CNVT_TOHW(green, 8); - blue = CNVT_TOHW(blue, 8); - /* hey, there is bug in transp handling... */ - transp = CNVT_TOHW(transp, 8); - break; - } -#undef CNVT_TOHW - /* Truecolor has hardware independent palette */ - if (info->fix.visual == FB_VISUAL_TRUECOLOR) { - u32 v; - - if (regno >= 16) - return 1; - - v = (red << info->var.red.offset) | - (green << info->var.green.offset) | - (blue << info->var.blue.offset) | - (transp << info->var.transp.offset); - switch (info->var.bits_per_pixel) { - case 8: - break; - case 16: - ((u32 *) (info->pseudo_palette))[regno] = v; - break; - case 24: - case 32: - ((u32 *) (info->pseudo_palette))[regno] = v; - break; - } - return 0; - } - return 0; -} - - /* - * Pan or Wrap the Display - * - * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag - */ - -static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info) -{ - if (var->vmode & FB_VMODE_YWRAP) { - if (var->yoffset < 0 - || var->yoffset >= info->var.yres_virtual - || var->xoffset) - return -EINVAL; - } else { - if (var->xoffset + info->var.xres > info->var.xres_virtual || - var->yoffset + info->var.yres > info->var.yres_virtual) - return -EINVAL; - } - info->var.xoffset = var->xoffset; - info->var.yoffset = var->yoffset; - if (var->vmode & FB_VMODE_YWRAP) - info->var.vmode |= FB_VMODE_YWRAP; - else - info->var.vmode &= ~FB_VMODE_YWRAP; - return 0; -} - - /* - * Most drivers don't need their own mmap function - */ - -static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma) -{ -#ifndef MMU - /* this is uClinux (no MMU) specific code */ - - vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; - vma->vm_start = videomemory; - - return 0; -#else - return -EINVAL; -#endif -} - -int __init mc68x328fb_setup(char *options) -{ -#if 0 - char *this_opt; -#endif - - if (!options || !*options) - return 1; -#if 0 - while ((this_opt = strsep(&options, ",")) != NULL) { - if (!*this_opt) - continue; - if (!strncmp(this_opt, "disable", 7)) - mc68x328fb_enable = 0; - } -#endif - return 1; -} - - /* - * Initialisation - */ - -int __init mc68x328fb_init(void) -{ -#ifndef MODULE - char *option = NULL; - - if (fb_get_options("68328fb", &option)) - return -ENODEV; - mc68x328fb_setup(option); -#endif - /* - * initialize the default mode from the LCD controller registers - */ - mc68x328fb_default.xres = LXMAX; - mc68x328fb_default.yres = LYMAX+1; - mc68x328fb_default.xres_virtual = mc68x328fb_default.xres; - mc68x328fb_default.yres_virtual = mc68x328fb_default.yres; - mc68x328fb_default.bits_per_pixel = 1 + (LPICF & 0x01); - videomemory = LSSA; - videomemorysize = (mc68x328fb_default.xres_virtual+7) / 8 * - mc68x328fb_default.yres_virtual * mc68x328fb_default.bits_per_pixel; - - fb_info.screen_base = (void *)videomemory; - fb_info.fbops = &mc68x328fb_ops; - fb_info.var = mc68x328fb_default; - fb_info.fix = mc68x328fb_fix; - fb_info.fix.smem_start = videomemory; - fb_info.fix.smem_len = videomemorysize; - fb_info.fix.line_length = - get_line_length(mc68x328fb_default.xres_virtual, mc68x328fb_default.bits_per_pixel); - fb_info.fix.visual = (mc68x328fb_default.bits_per_pixel) == 1 ? - MC68X328FB_MONO_VISUAL : FB_VISUAL_PSEUDOCOLOR; - if (fb_info.var.bits_per_pixel == 1) { - fb_info.var.red.length = fb_info.var.green.length = fb_info.var.blue.length = 1; - fb_info.var.red.offset = fb_info.var.green.offset = fb_info.var.blue.offset = 0; - } - fb_info.pseudo_palette = &mc68x328fb_pseudo_palette; - fb_info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; - - if (fb_alloc_cmap(&fb_info.cmap, 256, 0)) - return -ENOMEM; - - if (register_framebuffer(&fb_info) < 0) { - fb_dealloc_cmap(&fb_info.cmap); - return -EINVAL; - } - - fb_info(&fb_info, "%s frame buffer device\n", fb_info.fix.id); - fb_info(&fb_info, "%dx%dx%d at 0x%08lx\n", - mc68x328fb_default.xres_virtual, - mc68x328fb_default.yres_virtual, - 1 << mc68x328fb_default.bits_per_pixel, videomemory); - - return 0; -} - -module_init(mc68x328fb_init); - -#ifdef MODULE - -static void __exit mc68x328fb_cleanup(void) -{ - unregister_framebuffer(&fb_info); - fb_dealloc_cmap(&fb_info.cmap); -} - -module_exit(mc68x328fb_cleanup); - -MODULE_LICENSE("GPL"); -#endif /* MODULE */ diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 3ad7ebe2a96d..ab05d6cb0796 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -23,6 +23,10 @@ source "drivers/gpu/host1x/Kconfig" source "drivers/gpu/drm/Kconfig" +source "drivers/video/fbdev/Kconfig" + +source "drivers/video/backlight/Kconfig" + config VGASTATE tristate default n @@ -33,2484 +37,14 @@ config VIDEOMODE_HELPERS config HDMI bool -menuconfig FB - tristate "Support for frame buffer devices" - ---help--- - The frame buffer device provides an abstraction for the graphics - hardware. It represents the frame buffer of some video hardware and - allows application software to access the graphics hardware through - a well-defined interface, so the software doesn't need to know - anything about the low-level (hardware register) stuff. - - Frame buffer devices work identically across the different - architectures supported by Linux and make the implementation of - application programs easier and more portable; at this point, an X - server exists which uses the frame buffer device exclusively. - On several non-X86 architectures, the frame buffer device is the - only way to use the graphics hardware. - - The device is accessed through special device nodes, usually located - in the /dev directory, i.e. /dev/fb*. - - You need an utility program called fbset to make full use of frame - buffer devices. Please read - and the Framebuffer-HOWTO at - for more - information. - - Say Y here and to the driver for your graphics board below if you - are compiling a kernel for a non-x86 architecture. - - If you are compiling for the x86 architecture, you can say Y if you - want to play with it, but it is not essential. Please note that - running graphical applications that directly touch the hardware - (e.g. an accelerated X server) and that are not frame buffer - device-aware may cause unexpected results. If unsure, say N. - -config FIRMWARE_EDID - bool "Enable firmware EDID" - depends on FB - default n - ---help--- - This enables access to the EDID transferred from the firmware. - On the i386, this is from the Video BIOS. Enable this if DDC/I2C - transfers do not work for your driver and if you are using - nvidiafb, i810fb or savagefb. - - In general, choosing Y for this option is safe. If you - experience extremely long delays while booting before you get - something on your display, try setting this to N. Matrox cards in - combination with certain motherboards and monitors are known to - suffer from this problem. - -config FB_DDC - tristate - depends on FB - select I2C_ALGOBIT - select I2C - default n - -config FB_BOOT_VESA_SUPPORT - bool - depends on FB - default n - ---help--- - If true, at least one selected framebuffer driver can take advantage - of VESA video modes set at an early boot stage via the vga= parameter. - -config FB_CFB_FILLRECT - tristate - depends on FB - default n - ---help--- - Include the cfb_fillrect function for generic software rectangle - filling. This is used by drivers that don't provide their own - (accelerated) version. - -config FB_CFB_COPYAREA - tristate - depends on FB - default n - ---help--- - Include the cfb_copyarea function for generic software area copying. - This is used by drivers that don't provide their own (accelerated) - version. - -config FB_CFB_IMAGEBLIT - tristate - depends on FB - default n - ---help--- - Include the cfb_imageblit function for generic software image - blitting. This is used by drivers that don't provide their own - (accelerated) version. - -config FB_CFB_REV_PIXELS_IN_BYTE - bool - depends on FB - default n - ---help--- - Allow generic frame-buffer functions to work on displays with 1, 2 - and 4 bits per pixel depths which has opposite order of pixels in - byte order to bytes in long order. - -config FB_SYS_FILLRECT - tristate - depends on FB - default n - ---help--- - Include the sys_fillrect function for generic software rectangle - filling. This is used by drivers that don't provide their own - (accelerated) version and the framebuffer is in system RAM. - -config FB_SYS_COPYAREA - tristate - depends on FB - default n - ---help--- - Include the sys_copyarea function for generic software area copying. - This is used by drivers that don't provide their own (accelerated) - version and the framebuffer is in system RAM. - -config FB_SYS_IMAGEBLIT - tristate - depends on FB - default n - ---help--- - Include the sys_imageblit function for generic software image - blitting. This is used by drivers that don't provide their own - (accelerated) version and the framebuffer is in system RAM. - -menuconfig FB_FOREIGN_ENDIAN - bool "Framebuffer foreign endianness support" - depends on FB - ---help--- - This menu will let you enable support for the framebuffers with - non-native endianness (e.g. Little-Endian framebuffer on a - Big-Endian machine). Most probably you don't have such hardware, - so it's safe to say "n" here. - -choice - prompt "Choice endianness support" - depends on FB_FOREIGN_ENDIAN - -config FB_BOTH_ENDIAN - bool "Support for Big- and Little-Endian framebuffers" - -config FB_BIG_ENDIAN - bool "Support for Big-Endian framebuffers only" - -config FB_LITTLE_ENDIAN - bool "Support for Little-Endian framebuffers only" - -endchoice - -config FB_SYS_FOPS - tristate - depends on FB - default n - -config FB_DEFERRED_IO - bool - depends on FB - -config FB_HECUBA - tristate - depends on FB - depends on FB_DEFERRED_IO - -config FB_SVGALIB - tristate - depends on FB - default n - ---help--- - Common utility functions useful to fbdev drivers of VGA-based - cards. - -config FB_MACMODES - tristate - depends on FB - default n - -config FB_BACKLIGHT - bool - depends on FB - select BACKLIGHT_LCD_SUPPORT - select BACKLIGHT_CLASS_DEVICE - default n - -config FB_MODE_HELPERS - bool "Enable Video Mode Handling Helpers" - depends on FB - default n - ---help--- - This enables functions for handling video modes using the - Generalized Timing Formula and the EDID parser. A few drivers rely - on this feature such as the radeonfb, rivafb, and the i810fb. If - your driver does not take advantage of this feature, choosing Y will - just increase the kernel size by about 5K. - -config FB_TILEBLITTING - bool "Enable Tile Blitting Support" - depends on FB - default n - ---help--- - This enables tile blitting. Tile blitting is a drawing technique - where the screen is divided into rectangular sections (tiles), whereas - the standard blitting divides the screen into pixels. Because the - default drawing element is a tile, drawing functions will be passed - parameters in terms of number of tiles instead of number of pixels. - For example, to draw a single character, instead of using bitmaps, - an index to an array of bitmaps will be used. To clear or move a - rectangular section of a screen, the rectangle will be described in - terms of number of tiles in the x- and y-axis. - - This is particularly important to one driver, matroxfb. If - unsure, say N. - -comment "Frame buffer hardware drivers" - depends on FB - -config FB_GRVGA - tristate "Aeroflex Gaisler framebuffer support" - depends on FB && SPARC - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - This enables support for the SVGACTRL framebuffer in the GRLIB IP library from Aeroflex Gaisler. - -config FB_CIRRUS - tristate "Cirrus Logic support" - depends on FB && (ZORRO || PCI) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - This enables support for Cirrus Logic GD542x/543x based boards on - Amiga: SD64, Piccolo, Picasso II/II+, Picasso IV, or EGS Spectrum. - - If you have a PCI-based system, this enables support for these - chips: GD-543x, GD-544x, GD-5480. - - Please read the file . - - Say N unless you have such a graphics board or plan to get one - before you next recompile the kernel. - -config FB_PM2 - tristate "Permedia2 support" - depends on FB && ((AMIGA && BROKEN) || PCI) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for cards based on - the 3D Labs Permedia, Permedia 2 and Permedia 2V chips. - The driver was tested on the following cards: - Diamond FireGL 1000 PRO AGP - ELSA Gloria Synergy PCI - Appian Jeronimo PRO (both heads) PCI - 3DLabs Oxygen ACX aka EONtronics Picasso P2 PCI - Techsource Raptor GFX-8P (aka Sun PGX-32) on SPARC - ASK Graphic Blaster Exxtreme AGP - - To compile this driver as a module, choose M here: the - module will be called pm2fb. - -config FB_PM2_FIFO_DISCONNECT - bool "enable FIFO disconnect feature" - depends on FB_PM2 && PCI - help - Support the Permedia2 FIFO disconnect feature. - -config FB_ARMCLCD - tristate "ARM PrimeCell PL110 support" - depends on ARM || ARM64 || COMPILE_TEST - depends on FB && ARM_AMBA - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This framebuffer device driver is for the ARM PrimeCell PL110 - Colour LCD controller. ARM PrimeCells provide the building - blocks for System on a Chip devices. - - If you want to compile this as a module (=code which can be - inserted into and removed from the running kernel), say M - here and read . The module - will be called amba-clcd. - -config FB_ACORN - bool "Acorn VIDC support" - depends on (FB = y) && ARM && ARCH_ACORN - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the Acorn VIDC graphics - hardware found in Acorn RISC PCs and other ARM-based machines. If - unsure, say N. - -config FB_CLPS711X - bool "CLPS711X LCD support" - depends on (FB = y) && ARM && ARCH_CLPS711X - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Say Y to enable the Framebuffer driver for the CLPS7111 and - EP7212 processors. - -config FB_SA1100 - bool "SA-1100 LCD support" - depends on (FB = y) && ARM && ARCH_SA1100 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is a framebuffer device for the SA-1100 LCD Controller. - See for information on framebuffer - devices. - - If you plan to use the LCD display with your SA-1100 system, say - Y here. - -config FB_IMX - tristate "Freescale i.MX1/21/25/27 LCD support" - depends on FB && ARCH_MXC - select BACKLIGHT_LCD_SUPPORT - select LCD_CLASS_DEVICE - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MODE_HELPERS - select VIDEOMODE_HELPERS - -config FB_CYBER2000 - tristate "CyberPro 2000/2010/5000 support" - depends on FB && PCI && (BROKEN || !SPARC64) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This enables support for the Integraphics CyberPro 20x0 and 5000 - VGA chips used in the Rebel.com Netwinder and other machines. - Say Y if you have a NetWinder or a graphics card containing this - device, otherwise say N. - -config FB_CYBER2000_DDC - bool "DDC for CyberPro support" - depends on FB_CYBER2000 - select FB_DDC - default y - help - Say Y here if you want DDC support for your CyberPro graphics - card. This is only I2C bus support, driver does not use EDID. - -config FB_CYBER2000_I2C - bool "CyberPro 2000/2010/5000 I2C support" - depends on FB_CYBER2000 && I2C && ARCH_NETWINDER - select I2C_ALGOBIT - help - Enable support for the I2C video decoder interface on the - Integraphics CyberPro 20x0 and 5000 VGA chips. This is used - on the Netwinder machines for the SAA7111 video capture. - -config FB_APOLLO - bool - depends on (FB = y) && APOLLO - default y - select FB_CFB_FILLRECT - select FB_CFB_IMAGEBLIT - -config FB_Q40 - bool - depends on (FB = y) && Q40 - default y - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - -config FB_AMIGA - tristate "Amiga native chipset support" - depends on FB && AMIGA - help - This is the frame buffer device driver for the builtin graphics - chipset found in Amigas. - - To compile this driver as a module, choose M here: the - module will be called amifb. - -config FB_AMIGA_OCS - bool "Amiga OCS chipset support" - depends on FB_AMIGA - help - This enables support for the original Agnus and Denise video chips, - found in the Amiga 1000 and most A500's and A2000's. If you intend - to run Linux on any of these systems, say Y; otherwise say N. - -config FB_AMIGA_ECS - bool "Amiga ECS chipset support" - depends on FB_AMIGA - help - This enables support for the Enhanced Chip Set, found in later - A500's, later A2000's, the A600, the A3000, the A3000T and CDTV. If - you intend to run Linux on any of these systems, say Y; otherwise - say N. - -config FB_AMIGA_AGA - bool "Amiga AGA chipset support" - depends on FB_AMIGA - help - This enables support for the Advanced Graphics Architecture (also - known as the AGA or AA) Chip Set, found in the A1200, A4000, A4000T - and CD32. If you intend to run Linux on any of these systems, say Y; - otherwise say N. - -config FB_FM2 - bool "Amiga FrameMaster II/Rainbow II support" - depends on (FB = y) && ZORRO - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the Amiga FrameMaster - card from BSC (exhibited 1992 but not shipped as a CBM product). - -config FB_ARC - tristate "Arc Monochrome LCD board support" - depends on FB && X86 - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - help - This enables support for the Arc Monochrome LCD board. The board - is based on the KS-108 lcd controller and is typically a matrix - of 2*n chips. This driver was tested with a 128x64 panel. This - driver supports it for use with x86 SBCs through a 16 bit GPIO - interface (8 bit data, 8 bit control). If you anticipate using - this driver, say Y or M; otherwise say N. You must specify the - GPIO IO address to be used for setting control and data. - -config FB_ATARI - bool "Atari native chipset support" - depends on (FB = y) && ATARI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the builtin graphics - chipset found in Ataris. - -config FB_OF - bool "Open Firmware frame buffer device support" - depends on (FB = y) && (PPC64 || PPC_OF) && (!PPC_PSERIES || PCI) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MACMODES - help - Say Y if you want support with Open Firmware for your graphics - board. - -config FB_CONTROL - bool "Apple \"control\" display support" - depends on (FB = y) && PPC_PMAC && PPC32 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MACMODES - help - This driver supports a frame buffer for the graphics adapter in the - Power Macintosh 7300 and others. - -config FB_PLATINUM - bool "Apple \"platinum\" display support" - depends on (FB = y) && PPC_PMAC && PPC32 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MACMODES - help - This driver supports a frame buffer for the "platinum" graphics - adapter in some Power Macintoshes. - -config FB_VALKYRIE - bool "Apple \"valkyrie\" display support" - depends on (FB = y) && (MAC || (PPC_PMAC && PPC32)) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MACMODES - help - This driver supports a frame buffer for the "valkyrie" graphics - adapter in some Power Macintoshes. - -config FB_CT65550 - bool "Chips 65550 display support" - depends on (FB = y) && PPC32 && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the Chips & Technologies - 65550 graphics chip in PowerBooks. - -config FB_ASILIANT - bool "Asiliant (Chips) 69000 display support" - depends on (FB = y) && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the Asiliant 69030 chipset - -config FB_IMSTT - bool "IMS Twin Turbo display support" - depends on (FB = y) && PCI - select FB_CFB_IMAGEBLIT - select FB_MACMODES if PPC - help - The IMS Twin Turbo is a PCI-based frame buffer card bundled with - many Macintosh and compatible computers. - -config FB_VGA16 - tristate "VGA 16-color graphics support" - depends on FB && (X86 || PPC) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select VGASTATE - select FONT_8x16 if FRAMEBUFFER_CONSOLE - help - This is the frame buffer device driver for VGA 16 color graphic - cards. Say Y if you have such a card. - - To compile this driver as a module, choose M here: the - module will be called vga16fb. - -config FB_BF54X_LQ043 - tristate "SHARP LQ043 TFT LCD (BF548 EZKIT)" - depends on FB && (BF54x) && !BF542 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the framebuffer device driver for a SHARP LQ043T1DG01 TFT LCD - -config FB_BFIN_T350MCQB - tristate "Varitronix COG-T350MCQB TFT LCD display (BF527 EZKIT)" - depends on FB && BLACKFIN - select BFIN_GPTIMERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the framebuffer device driver for a Varitronix VL-PS-COG-T350MCQB-01 display TFT LCD - This display is a QVGA 320x240 24-bit RGB display interfaced by an 8-bit wide PPI - It uses PPI[0..7] PPI_FS1, PPI_FS2 and PPI_CLK. - -config FB_BFIN_LQ035Q1 - tristate "SHARP LQ035Q1DH02 TFT LCD" - depends on FB && BLACKFIN && SPI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select BFIN_GPTIMERS - help - This is the framebuffer device driver for a SHARP LQ035Q1DH02 TFT display found on - the Blackfin Landscape LCD EZ-Extender Card. - This display is a QVGA 320x240 18-bit RGB display interfaced by an 16-bit wide PPI - It uses PPI[0..15] PPI_FS1, PPI_FS2 and PPI_CLK. - - To compile this driver as a module, choose M here: the - module will be called bfin-lq035q1-fb. - -config FB_BF537_LQ035 - tristate "SHARP LQ035 TFT LCD (BF537 STAMP)" - depends on FB && (BF534 || BF536 || BF537) && I2C_BLACKFIN_TWI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select BFIN_GPTIMERS - help - This is the framebuffer device for a SHARP LQ035Q7DB03 TFT LCD - attached to a BF537. - - To compile this driver as a module, choose M here: the - module will be called bf537-lq035. - -config FB_BFIN_7393 - tristate "Blackfin ADV7393 Video encoder" - depends on FB && BLACKFIN - select I2C - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the framebuffer device for a ADV7393 video encoder - attached to a Blackfin on the PPI port. - If your Blackfin board has a ADV7393 select Y. - - To compile this driver as a module, choose M here: the - module will be called bfin_adv7393fb. - -choice - prompt "Video mode support" - depends on FB_BFIN_7393 - default NTSC - -config NTSC - bool 'NTSC 720x480' - -config PAL - bool 'PAL 720x576' - -config NTSC_640x480 - bool 'NTSC 640x480 (Experimental)' - -config PAL_640x480 - bool 'PAL 640x480 (Experimental)' - -config NTSC_YCBCR - bool 'NTSC 720x480 YCbCR input' - -config PAL_YCBCR - bool 'PAL 720x576 YCbCR input' - -endchoice - -choice - prompt "Size of ADV7393 frame buffer memory Single/Double Size" - depends on (FB_BFIN_7393) - default ADV7393_1XMEM - -config ADV7393_1XMEM - bool 'Single' - -config ADV7393_2XMEM - bool 'Double' -endchoice - -config FB_STI - tristate "HP STI frame buffer device support" - depends on FB && PARISC - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select STI_CONSOLE - select VT - default y - ---help--- - STI refers to the HP "Standard Text Interface" which is a set of - BIOS routines contained in a ROM chip in HP PA-RISC based machines. - Enabling this option will implement the linux framebuffer device - using calls to the STI BIOS routines for initialisation. - - If you enable this option, you will get a planar framebuffer device - /dev/fb which will work on the most common HP graphic cards of the - NGLE family, including the artist chips (in the 7xx and Bxxx series), - HCRX, HCRX24, CRX, CRX24 and VisEG series. - - It is safe to enable this option, so you should probably say "Y". - -config FB_MAC - bool "Generic Macintosh display support" - depends on (FB = y) && MAC - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MACMODES - -config FB_HP300 - bool - depends on (FB = y) && DIO - select FB_CFB_IMAGEBLIT - default y - -config FB_TGA - tristate "TGA/SFB+ framebuffer support" - depends on FB && (ALPHA || TC) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select BITREVERSE - ---help--- - This is the frame buffer device driver for generic TGA and SFB+ - graphic cards. These include DEC ZLXp-E1, -E2 and -E3 PCI cards, - also known as PBXGA-A, -B and -C, and DEC ZLX-E1, -E2 and -E3 - TURBOchannel cards, also known as PMAGD-A, -B and -C. - - Due to hardware limitations ZLX-E2 and E3 cards are not supported - for DECstation 5000/200 systems. Additionally due to firmware - limitations these cards may cause troubles with booting DECstation - 5000/240 and /260 systems, but are fully supported under Linux if - you manage to get it going. ;-) - - Say Y if you have one of those. - -config FB_UVESA - tristate "Userspace VESA VGA graphics support" - depends on FB && CONNECTOR - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MODE_HELPERS - help - This is the frame buffer driver for generic VBE 2.0 compliant - graphic cards. It can also take advantage of VBE 3.0 features, - such as refresh rate adjustment. - - This driver generally provides more features than vesafb but - requires a userspace helper application called 'v86d'. See - for more information. - - If unsure, say N. - -config FB_VESA - bool "VESA VGA graphics support" - depends on (FB = y) && X86 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_BOOT_VESA_SUPPORT - help - This is the frame buffer device driver for generic VESA 2.0 - compliant graphic cards. The older VESA 1.2 cards are not supported. - You will get a boot time penguin logo at no additional cost. Please - read . If unsure, say Y. - -config FB_EFI - bool "EFI-based Framebuffer Support" - depends on (FB = y) && X86 && EFI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the EFI frame buffer device driver. If the firmware on - your platform is EFI 1.10 or UEFI 2.0, select Y to add support for - using the EFI framebuffer as your console. - -config FB_N411 - tristate "N411 Apollo/Hecuba devkit support" - depends on FB && X86 && MMU - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - select FB_HECUBA - help - This enables support for the Apollo display controller in its - Hecuba form using the n411 devkit. - -config FB_HGA - tristate "Hercules mono graphics support" - depends on FB && X86 - help - Say Y here if you have a Hercules mono graphics card. - - To compile this driver as a module, choose M here: the - module will be called hgafb. - - As this card technology is at least 25 years old, - most people will answer N here. - -config FB_GBE - bool "SGI Graphics Backend frame buffer support" - depends on (FB = y) && SGI_IP32 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for SGI Graphics Backend. - This chip is used in SGI O2 and Visual Workstation 320/540. - -config FB_GBE_MEM - int "Video memory size in MB" - depends on FB_GBE - default 4 - help - This is the amount of memory reserved for the framebuffer, - which can be any value between 1MB and 8MB. - -config FB_SBUS - bool "SBUS and UPA framebuffers" - depends on (FB = y) && SPARC - help - Say Y if you want support for SBUS or UPA based frame buffer device. - -config FB_BW2 - bool "BWtwo support" - depends on (FB = y) && (SPARC && FB_SBUS) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the BWtwo frame buffer. - -config FB_CG3 - bool "CGthree support" - depends on (FB = y) && (SPARC && FB_SBUS) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the CGthree frame buffer. - -config FB_CG6 - bool "CGsix (GX,TurboGX) support" - depends on (FB = y) && (SPARC && FB_SBUS) - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the CGsix (GX, TurboGX) - frame buffer. - -config FB_FFB - bool "Creator/Creator3D/Elite3D support" - depends on FB_SBUS && SPARC64 - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the Creator, Creator3D, - and Elite3D graphics boards. - -config FB_TCX - bool "TCX (SS4/SS5 only) support" - depends on FB_SBUS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the TCX 24/8bit frame - buffer. - -config FB_CG14 - bool "CGfourteen (SX) support" - depends on FB_SBUS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the CGfourteen frame - buffer on Desktop SPARCsystems with the SX graphics option. - -config FB_P9100 - bool "P9100 (Sparcbook 3 only) support" - depends on FB_SBUS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the P9100 card - supported on Sparcbook 3 machines. - -config FB_LEO - bool "Leo (ZX) support" - depends on FB_SBUS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the SBUS-based Sun ZX - (leo) frame buffer cards. - -config FB_IGA - bool "IGA 168x display support" - depends on (FB = y) && SPARC32 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the framebuffer device for the INTERGRAPHICS 1680 and - successor frame buffer cards. - -config FB_XVR500 - bool "Sun XVR-500 3DLABS Wildcat support" - depends on (FB = y) && PCI && SPARC64 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the framebuffer device for the Sun XVR-500 and similar - graphics cards based upon the 3DLABS Wildcat chipset. The driver - only works on sparc64 systems where the system firmware has - mostly initialized the card already. It is treated as a - completely dumb framebuffer device. - -config FB_XVR2500 - bool "Sun XVR-2500 3DLABS Wildcat support" - depends on (FB = y) && PCI && SPARC64 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the framebuffer device for the Sun XVR-2500 and similar - graphics cards based upon the 3DLABS Wildcat chipset. The driver - only works on sparc64 systems where the system firmware has - mostly initialized the card already. It is treated as a - completely dumb framebuffer device. - -config FB_XVR1000 - bool "Sun XVR-1000 support" - depends on (FB = y) && SPARC64 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the framebuffer device for the Sun XVR-1000 and similar - graphics cards. The driver only works on sparc64 systems where - the system firmware has mostly initialized the card already. It - is treated as a completely dumb framebuffer device. - -config FB_PVR2 - tristate "NEC PowerVR 2 display support" - depends on FB && SH_DREAMCAST - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Say Y here if you have a PowerVR 2 card in your box. If you plan to - run linux on your Dreamcast, you will have to say Y here. - This driver may or may not work on other PowerVR 2 cards, but is - totally untested. Use at your own risk. If unsure, say N. - - To compile this driver as a module, choose M here: the - module will be called pvr2fb. - - You can pass several parameters to the driver at boot time or at - module load time. The parameters look like "video=pvr2:XXX", where - the meaning of XXX can be found at the end of the main source file - (). Please see the file - . - -config FB_OPENCORES - tristate "OpenCores VGA/LCD core 2.0 framebuffer support" - depends on FB && HAS_DMA - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This enables support for the OpenCores VGA/LCD core. - - The OpenCores VGA/LCD core is typically used together with - softcore CPUs (e.g. OpenRISC or Microblaze) or hard processor - systems (e.g. Altera socfpga or Xilinx Zynq) on FPGAs. - - The source code and specification for the core is available at - - -config FB_S1D13XXX - tristate "Epson S1D13XXX framebuffer support" - depends on FB - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Support for S1D13XXX framebuffer device family (currently only - working with S1D13806). Product specs at - - -config FB_ATMEL - tristate "AT91/AT32 LCD Controller support" - depends on FB && HAVE_FB_ATMEL - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MODE_HELPERS - select VIDEOMODE_HELPERS - help - This enables support for the AT91/AT32 LCD Controller. - -config FB_INTSRAM - bool "Frame Buffer in internal SRAM" - depends on FB_ATMEL && ARCH_AT91SAM9261 - help - Say Y if you want to map Frame Buffer in internal SRAM. Say N if you want - to let frame buffer in external SDRAM. - -config FB_ATMEL_STN - bool "Use a STN display with AT91/AT32 LCD Controller" - depends on FB_ATMEL && (MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK) - default n - help - Say Y if you want to connect a STN LCD display to the AT91/AT32 LCD - Controller. Say N if you want to connect a TFT. - - If unsure, say N. - -config FB_NVIDIA - tristate "nVidia Framebuffer Support" - depends on FB && PCI - select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select BITREVERSE - select VGASTATE - help - This driver supports graphics boards with the nVidia chips, TNT - and newer. For very old chipsets, such as the RIVA128, then use - the rivafb. - Say Y if you have such a graphics board. - - To compile this driver as a module, choose M here: the - module will be called nvidiafb. - -config FB_NVIDIA_I2C - bool "Enable DDC Support" - depends on FB_NVIDIA - select FB_DDC - help - This enables I2C support for nVidia Chipsets. This is used - only for getting EDID information from the attached display - allowing for robust video mode handling and switching. - - Because fbdev-2.6 requires that drivers must be able to - independently validate video mode parameters, you should say Y - here. - -config FB_NVIDIA_DEBUG - bool "Lots of debug output" - depends on FB_NVIDIA - default n - help - Say Y here if you want the nVidia driver to output all sorts - of debugging information to provide to the maintainer when - something goes wrong. - -config FB_NVIDIA_BACKLIGHT - bool "Support for backlight control" - depends on FB_NVIDIA - default y - help - Say Y here if you want to control the backlight of your display. - -config FB_RIVA - tristate "nVidia Riva support" - depends on FB && PCI - select FB_BACKLIGHT if FB_RIVA_BACKLIGHT - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select BITREVERSE - select VGASTATE - help - This driver supports graphics boards with the nVidia Riva/Geforce - chips. - Say Y if you have such a graphics board. - - To compile this driver as a module, choose M here: the - module will be called rivafb. - -config FB_RIVA_I2C - bool "Enable DDC Support" - depends on FB_RIVA - select FB_DDC - help - This enables I2C support for nVidia Chipsets. This is used - only for getting EDID information from the attached display - allowing for robust video mode handling and switching. - - Because fbdev-2.6 requires that drivers must be able to - independently validate video mode parameters, you should say Y - here. - -config FB_RIVA_DEBUG - bool "Lots of debug output" - depends on FB_RIVA - default n - help - Say Y here if you want the Riva driver to output all sorts - of debugging information to provide to the maintainer when - something goes wrong. - -config FB_RIVA_BACKLIGHT - bool "Support for backlight control" - depends on FB_RIVA - default y - help - Say Y here if you want to control the backlight of your display. - -config FB_I740 - tristate "Intel740 support" - depends on FB && PCI - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select VGASTATE - select FB_DDC - help - This driver supports graphics cards based on Intel740 chip. - -config FB_I810 - tristate "Intel 810/815 support" - depends on FB && PCI && X86_32 && AGP_INTEL - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select VGASTATE - help - This driver supports the on-board graphics built in to the Intel 810 - and 815 chipsets. Say Y if you have and plan to use such a board. - - To compile this driver as a module, choose M here: the - module will be called i810fb. - - For more information, please read - - -config FB_I810_GTF - bool "use VESA Generalized Timing Formula" - depends on FB_I810 - help - If you say Y, then the VESA standard, Generalized Timing Formula - or GTF, will be used to calculate the required video timing values - per video mode. Since the GTF allows nondiscrete timings - (nondiscrete being a range of values as opposed to discrete being a - set of values), you'll be able to use any combination of horizontal - and vertical resolutions, and vertical refresh rates without having - to specify your own timing parameters. This is especially useful - to maximize the performance of an aging display, or if you just - have a display with nonstandard dimensions. A VESA compliant - monitor is recommended, but can still work with non-compliant ones. - If you need or want this, then select this option. The timings may - not be compliant with Intel's recommended values. Use at your own - risk. - - If you say N, the driver will revert to discrete video timings - using a set recommended by Intel in their documentation. - - If unsure, say N. - -config FB_I810_I2C - bool "Enable DDC Support" - depends on FB_I810 && FB_I810_GTF - select FB_DDC - help - -config FB_LE80578 - tristate "Intel LE80578 (Vermilion) support" - depends on FB && PCI && X86 - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This driver supports the LE80578 (Vermilion Range) chipset - -config FB_CARILLO_RANCH - tristate "Intel Carillo Ranch support" - depends on FB_LE80578 && FB && PCI && X86 - help - This driver supports the LE80578 (Carillo Ranch) board - -config FB_INTEL - tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support" - depends on FB && PCI && X86 && AGP_INTEL && EXPERT - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_BOOT_VESA_SUPPORT if FB_INTEL = y - depends on !DRM_I915 - help - This driver supports the on-board graphics built in to the Intel - 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. - Say Y if you have and plan to use such a board. - - To make FB_INTELFB=Y work you need to say AGP_INTEL=y too. - - To compile this driver as a module, choose M here: the - module will be called intelfb. - - For more information, please read - -config FB_INTEL_DEBUG - bool "Intel driver Debug Messages" - depends on FB_INTEL - ---help--- - Say Y here if you want the Intel driver to output all sorts - of debugging information to provide to the maintainer when - something goes wrong. - -config FB_INTEL_I2C - bool "DDC/I2C for Intel framebuffer support" - depends on FB_INTEL - select FB_DDC - default y - help - Say Y here if you want DDC/I2C support for your on-board Intel graphics. - -config FB_MATROX - tristate "Matrox acceleration" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_TILEBLITTING - select FB_MACMODES if PPC_PMAC - ---help--- - Say Y here if you have a Matrox Millennium, Matrox Millennium II, - Matrox Mystique, Matrox Mystique 220, Matrox Productiva G100, Matrox - Mystique G200, Matrox Millennium G200, Matrox Marvel G200 video, - Matrox G400, G450 or G550 card in your box. - - To compile this driver as a module, choose M here: the - module will be called matroxfb. - - You can pass several parameters to the driver at boot time or at - module load time. The parameters look like "video=matroxfb:XXX", and - are described in . - -config FB_MATROX_MILLENIUM - bool "Millennium I/II support" - depends on FB_MATROX - help - Say Y here if you have a Matrox Millennium or Matrox Millennium II - video card. If you select "Advanced lowlevel driver options" below, - you should check 4 bpp packed pixel, 8 bpp packed pixel, 16 bpp - packed pixel, 24 bpp packed pixel and 32 bpp packed pixel. You can - also use font widths different from 8. - -config FB_MATROX_MYSTIQUE - bool "Mystique support" - depends on FB_MATROX - help - Say Y here if you have a Matrox Mystique or Matrox Mystique 220 - video card. If you select "Advanced lowlevel driver options" below, - you should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp - packed pixel and 32 bpp packed pixel. You can also use font widths - different from 8. - -config FB_MATROX_G - bool "G100/G200/G400/G450/G550 support" - depends on FB_MATROX - ---help--- - Say Y here if you have a Matrox G100, G200, G400, G450 or G550 based - video card. If you select "Advanced lowlevel driver options", you - should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed - pixel and 32 bpp packed pixel. You can also use font widths - different from 8. - - If you need support for G400 secondary head, you must say Y to - "Matrox I2C support" and "G400 second head support" right below. - G450/G550 secondary head and digital output are supported without - additional modules. - - The driver starts in monitor mode. You must use the matroxset tool - (available at ) to - swap primary and secondary head outputs, or to change output mode. - Secondary head driver always start in 640x480 resolution and you - must use fbset to change it. - - Do not forget that second head supports only 16 and 32 bpp - packed pixels, so it is a good idea to compile them into the kernel - too. You can use only some font widths, as the driver uses generic - painting procedures (the secondary head does not use acceleration - engine). - - G450/G550 hardware can display TV picture only from secondary CRTC, - and it performs no scaling, so picture must have 525 or 625 lines. - -config FB_MATROX_I2C - tristate "Matrox I2C support" - depends on FB_MATROX - select FB_DDC - ---help--- - This drivers creates I2C buses which are needed for accessing the - DDC (I2C) bus present on all Matroxes, an I2C bus which - interconnects Matrox optional devices, like MGA-TVO on G200 and - G400, and the secondary head DDC bus, present on G400 only. - - You can say Y or M here if you want to experiment with monitor - detection code. You must say Y or M here if you want to use either - second head of G400 or MGA-TVO on G200 or G400. - - If you compile it as module, it will create a module named - i2c-matroxfb. - -config FB_MATROX_MAVEN - tristate "G400 second head support" - depends on FB_MATROX_G && FB_MATROX_I2C - ---help--- - WARNING !!! This support does not work with G450 !!! - - Say Y or M here if you want to use a secondary head (meaning two - monitors in parallel) on G400 or MGA-TVO add-on on G200. Secondary - head is not compatible with accelerated XFree 3.3.x SVGA servers - - secondary head output is blanked while you are in X. With XFree - 3.9.17 preview you can use both heads if you use SVGA over fbdev or - the fbdev driver on first head and the fbdev driver on second head. - - If you compile it as module, two modules are created, - matroxfb_crtc2 and matroxfb_maven. Matroxfb_maven is needed for - both G200 and G400, matroxfb_crtc2 is needed only by G400. You must - also load i2c-matroxfb to get it to run. - - The driver starts in monitor mode and you must use the matroxset - tool (available at - ) to switch it to - PAL or NTSC or to swap primary and secondary head outputs. - Secondary head driver also always start in 640x480 resolution, you - must use fbset to change it. - - Also do not forget that second head supports only 16 and 32 bpp - packed pixels, so it is a good idea to compile them into the kernel - too. You can use only some font widths, as the driver uses generic - painting procedures (the secondary head does not use acceleration - engine). - -config FB_RADEON - tristate "ATI Radeon display support" - depends on FB && PCI - select FB_BACKLIGHT if FB_RADEON_BACKLIGHT - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MACMODES if PPC_OF - help - Choose this option if you want to use an ATI Radeon graphics card as - a framebuffer device. There are both PCI and AGP versions. You - don't need to choose this to run the Radeon in plain VGA mode. - - There is a product page at - http://products.amd.com/en-us/GraphicCardResult.aspx - -config FB_RADEON_I2C - bool "DDC/I2C for ATI Radeon support" - depends on FB_RADEON - select FB_DDC - default y - help - Say Y here if you want DDC/I2C support for your Radeon board. - -config FB_RADEON_BACKLIGHT - bool "Support for backlight control" - depends on FB_RADEON - default y - help - Say Y here if you want to control the backlight of your display. - -config FB_RADEON_DEBUG - bool "Lots of debug output from Radeon driver" - depends on FB_RADEON - default n - help - Say Y here if you want the Radeon driver to output all sorts - of debugging information to provide to the maintainer when - something goes wrong. - -config FB_ATY128 - tristate "ATI Rage128 display support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_BACKLIGHT if FB_ATY128_BACKLIGHT - select FB_MACMODES if PPC_PMAC - help - This driver supports graphics boards with the ATI Rage128 chips. - Say Y if you have such a graphics board and read - . - - To compile this driver as a module, choose M here: the - module will be called aty128fb. - -config FB_ATY128_BACKLIGHT - bool "Support for backlight control" - depends on FB_ATY128 - default y - help - Say Y here if you want to control the backlight of your display. - -config FB_ATY - tristate "ATI Mach64 display support" if PCI || ATARI - depends on FB && !SPARC32 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_BACKLIGHT if FB_ATY_BACKLIGHT - select FB_MACMODES if PPC - help - This driver supports graphics boards with the ATI Mach64 chips. - Say Y if you have such a graphics board. - - To compile this driver as a module, choose M here: the - module will be called atyfb. - -config FB_ATY_CT - bool "Mach64 CT/VT/GT/LT (incl. 3D RAGE) support" - depends on PCI && FB_ATY - default y if SPARC64 && PCI - help - Say Y here to support use of ATI's 64-bit Rage boards (or other - boards based on the Mach64 CT, VT, GT, and LT chipsets) as a - framebuffer device. The ATI product support page for these boards - is at . - -config FB_ATY_GENERIC_LCD - bool "Mach64 generic LCD support" - depends on FB_ATY_CT - help - Say Y if you have a laptop with an ATI Rage LT PRO, Rage Mobility, - Rage XC, or Rage XL chipset. - -config FB_ATY_GX - bool "Mach64 GX support" if PCI - depends on FB_ATY - default y if ATARI - help - Say Y here to support use of the ATI Mach64 Graphics Expression - board (or other boards based on the Mach64 GX chipset) as a - framebuffer device. The ATI product support page for these boards - is at - . - -config FB_ATY_BACKLIGHT - bool "Support for backlight control" - depends on FB_ATY - default y - help - Say Y here if you want to control the backlight of your display. - -config FB_S3 - tristate "S3 Trio/Virge support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_TILEBLITTING - select FB_SVGALIB - select VGASTATE - select FONT_8x16 if FRAMEBUFFER_CONSOLE - ---help--- - Driver for graphics boards with S3 Trio / S3 Virge chip. - -config FB_S3_DDC - bool "DDC for S3 support" - depends on FB_S3 - select FB_DDC - default y - help - Say Y here if you want DDC support for your S3 graphics card. - -config FB_SAVAGE - tristate "S3 Savage support" - depends on FB && PCI - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select VGASTATE - help - This driver supports notebooks and computers with S3 Savage PCI/AGP - chips. - - Say Y if you have such a graphics card. - - To compile this driver as a module, choose M here; the module - will be called savagefb. - -config FB_SAVAGE_I2C - bool "Enable DDC2 Support" - depends on FB_SAVAGE - select FB_DDC - help - This enables I2C support for S3 Savage Chipsets. This is used - only for getting EDID information from the attached display - allowing for robust video mode handling and switching. - - Because fbdev-2.6 requires that drivers must be able to - independently validate video mode parameters, you should say Y - here. - -config FB_SAVAGE_ACCEL - bool "Enable Console Acceleration" - depends on FB_SAVAGE - default n - help - This option will compile in console acceleration support. If - the resulting framebuffer console has bothersome glitches, then - choose N here. - -config FB_SIS - tristate "SiS/XGI display support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_BOOT_VESA_SUPPORT if FB_SIS = y - help - This is the frame buffer device driver for the SiS 300, 315, 330 - and 340 series as well as XGI V3XT, V5, V8, Z7 graphics chipsets. - Specs available at and . - - To compile this driver as a module, choose M here; the module - will be called sisfb. - -config FB_SIS_300 - bool "SiS 300 series support" - depends on FB_SIS - help - Say Y here to support use of the SiS 300/305, 540, 630 and 730. - -config FB_SIS_315 - bool "SiS 315/330/340 series and XGI support" - depends on FB_SIS - help - Say Y here to support use of the SiS 315, 330 and 340 series - (315/H/PRO, 55x, 650, 651, 740, 330, 661, 741, 760, 761) as well - as XGI V3XT, V5, V8 and Z7. - -config FB_VIA - tristate "VIA UniChrome (Pro) and Chrome9 display support" - depends on FB && PCI && X86 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select I2C_ALGOBIT - select I2C - select GPIOLIB - help - This is the frame buffer device driver for Graphics chips of VIA - UniChrome (Pro) Family (CLE266,PM800/CN400,P4M800CE/P4M800Pro/ - CN700/VN800,CX700/VX700,P4M890) and Chrome9 Family (K8M890,CN896 - /P4M900,VX800) - Say Y if you have a VIA UniChrome graphics board. - - To compile this driver as a module, choose M here: the - module will be called viafb. - -if FB_VIA - -config FB_VIA_DIRECT_PROCFS - bool "direct hardware access via procfs (DEPRECATED)(DANGEROUS)" - depends on FB_VIA - default n - help - Allow direct hardware access to some output registers via procfs. - This is dangerous but may provide the only chance to get the - correct output device configuration. - Its use is strongly discouraged. - -config FB_VIA_X_COMPATIBILITY - bool "X server compatibility" - depends on FB_VIA - default n - help - This option reduces the functionality (power saving, ...) of the - framebuffer to avoid negative impact on the OpenChrome X server. - If you use any X server other than fbdev you should enable this - otherwise it should be safe to disable it and allow using all - features. - -endif - -config FB_NEOMAGIC - tristate "NeoMagic display support" - depends on FB && PCI - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select VGASTATE - help - This driver supports notebooks with NeoMagic PCI chips. - Say Y if you have such a graphics card. - - To compile this driver as a module, choose M here: the - module will be called neofb. - -config FB_KYRO - tristate "IMG Kyro support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Say Y here if you have a STG4000 / Kyro / PowerVR 3 based - graphics board. - - To compile this driver as a module, choose M here: the - module will be called kyrofb. - -config FB_3DFX - tristate "3Dfx Banshee/Voodoo3/Voodoo5 display support" - depends on FB && PCI - select FB_CFB_IMAGEBLIT - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_MODE_HELPERS - help - This driver supports graphics boards with the 3Dfx Banshee, - Voodoo3 or VSA-100 (aka Voodoo4/5) chips. Say Y if you have - such a graphics board. - - To compile this driver as a module, choose M here: the - module will be called tdfxfb. - -config FB_3DFX_ACCEL - bool "3Dfx Acceleration functions" - depends on FB_3DFX - ---help--- - This will compile the 3Dfx Banshee/Voodoo3/VSA-100 frame buffer - device driver with acceleration functions. - -config FB_3DFX_I2C - bool "Enable DDC/I2C support" - depends on FB_3DFX - select FB_DDC - default y - help - Say Y here if you want DDC/I2C support for your 3dfx Voodoo3. - -config FB_VOODOO1 - tristate "3Dfx Voodoo Graphics (sst1) support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Say Y here if you have a 3Dfx Voodoo Graphics (Voodoo1/sst1) or - Voodoo2 (cvg) based graphics card. - - To compile this driver as a module, choose M here: the - module will be called sstfb. - - WARNING: Do not use any application that uses the 3D engine - (namely glide) while using this driver. - Please read the for supported - options and other important info support. - -config FB_VT8623 - tristate "VIA VT8623 support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_TILEBLITTING - select FB_SVGALIB - select VGASTATE - select FONT_8x16 if FRAMEBUFFER_CONSOLE - ---help--- - Driver for CastleRock integrated graphics core in the - VIA VT8623 [Apollo CLE266] chipset. - -config FB_TRIDENT - tristate "Trident/CyberXXX/CyberBlade support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - This is the frame buffer device driver for Trident PCI/AGP chipsets. - Supported chipset families are TGUI 9440/96XX, 3DImage, Blade3D - and Blade XP. - There are also integrated versions of these chips called CyberXXXX, - CyberImage or CyberBlade. These chips are mostly found in laptops - but also on some motherboards including early VIA EPIA motherboards. - For more information, read - - Say Y if you have such a graphics board. - - To compile this driver as a module, choose M here: the - module will be called tridentfb. - -config FB_ARK - tristate "ARK 2000PV support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_TILEBLITTING - select FB_SVGALIB - select VGASTATE - select FONT_8x16 if FRAMEBUFFER_CONSOLE - ---help--- - Driver for PCI graphics boards with ARK 2000PV chip - and ICS 5342 RAMDAC. - -config FB_PM3 - tristate "Permedia3 support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the 3DLabs Permedia3 - chipset, used in Formac ProFormance III, 3DLabs Oxygen VX1 & - similar boards, 3DLabs Permedia3 Create!, Appian Jeronimo 2000 - and maybe other boards. - -config FB_CARMINE - tristate "Fujitsu carmine frame buffer support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the Fujitsu Carmine chip. - The driver provides two independent frame buffer devices. - -choice - depends on FB_CARMINE - prompt "DRAM timing" - default FB_CARMINE_DRAM_EVAL - -config FB_CARMINE_DRAM_EVAL - bool "Eval board timings" - help - Use timings which work on the eval card. - -config CARMINE_DRAM_CUSTOM - bool "Custom board timings" - help - Use custom board timings. -endchoice - -config FB_AU1100 - bool "Au1100 LCD Driver" - depends on (FB = y) && MIPS_ALCHEMY - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the framebuffer driver for the AMD Au1100 SOC. It can drive - various panels and CRTs by passing in kernel cmd line option - au1100fb:panel=. - -config FB_AU1200 - bool "Au1200/Au1300 LCD Driver" - depends on (FB = y) && MIPS_ALCHEMY - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - help - This is the framebuffer driver for the Au1200/Au1300 SOCs. - It can drive various panels and CRTs by passing in kernel cmd line - option au1200fb:panel=. - -config FB_VT8500 - bool "VIA VT8500 framebuffer support" - depends on (FB = y) && ARM && ARCH_VT8500 - select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS) - select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS) - select FB_SYS_IMAGEBLIT - select FB_MODE_HELPERS - select VIDEOMODE_HELPERS - help - This is the framebuffer driver for VIA VT8500 integrated LCD - controller. - -config FB_WM8505 - bool "Wondermedia WM8xxx-series frame buffer support" - depends on (FB = y) && ARM && ARCH_VT8500 - select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS) - select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS) - select FB_SYS_IMAGEBLIT - select FB_MODE_HELPERS - select VIDEOMODE_HELPERS - help - This is the framebuffer driver for WonderMedia WM8xxx-series - integrated LCD controller. This driver covers the WM8505, WM8650 - and WM8850 SoCs. - -config FB_WMT_GE_ROPS - bool "VT8500/WM8xxx accelerated raster ops support" - depends on (FB = y) && (FB_VT8500 || FB_WM8505) - default n - help - This adds support for accelerated raster operations on the - VIA VT8500 and Wondermedia 85xx series SoCs. - -source "drivers/video/geode/Kconfig" - -config FB_HIT - tristate "HD64461 Frame Buffer support" - depends on FB && HD64461 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the frame buffer device driver for the Hitachi HD64461 LCD - frame buffer card. - -config FB_PMAG_AA - bool "PMAG-AA TURBOchannel framebuffer support" - depends on (FB = y) && TC - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Support for the PMAG-AA TURBOchannel framebuffer card (1280x1024x1) - used mainly in the MIPS-based DECstation series. - -config FB_PMAG_BA - tristate "PMAG-BA TURBOchannel framebuffer support" - depends on FB && TC - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Support for the PMAG-BA TURBOchannel framebuffer card (1024x864x8) - used mainly in the MIPS-based DECstation series. - -config FB_PMAGB_B - tristate "PMAGB-B TURBOchannel framebuffer support" - depends on FB && TC - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Support for the PMAGB-B TURBOchannel framebuffer card used mainly - in the MIPS-based DECstation series. The card is currently only - supported in 1280x1024x8 mode. - -config FB_MAXINE - bool "Maxine (Personal DECstation) onboard framebuffer support" - depends on (FB = y) && MACH_DECSTATION - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Support for the onboard framebuffer (1024x768x8) in the Personal - DECstation series (Personal DECstation 5000/20, /25, /33, /50, - Codename "Maxine"). - -config FB_G364 - bool "G364 frame buffer support" - depends on (FB = y) && (MIPS_MAGNUM_4000 || OLIVETTI_M700) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - The G364 driver is the framebuffer used in MIPS Magnum 4000 and - Olivetti M700-10 systems. - -config FB_68328 - bool "Motorola 68328 native frame buffer support" - depends on (FB = y) && (M68328 || M68EZ328 || M68VZ328) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Say Y here if you want to support the built-in frame buffer of - the Motorola 68328 CPU family. - -config FB_PXA168 - tristate "PXA168/910 LCD framebuffer support" - depends on FB && (CPU_PXA168 || CPU_PXA910) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for the built-in LCD controller in the Marvell - MMP processor. - -config FB_PXA - tristate "PXA LCD framebuffer support" - depends on FB && ARCH_PXA - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for the built-in LCD controller in the Intel - PXA2x0 processor. - - This driver is also available as a module ( = code which can be - inserted and removed from the running kernel whenever you want). The - module will be called pxafb. If you want to compile it as a module, - say M here and read . - - If unsure, say N. - -config FB_PXA_OVERLAY - bool "Support PXA27x/PXA3xx Overlay(s) as framebuffer" - default n - depends on FB_PXA && (PXA27x || PXA3xx) - -config FB_PXA_SMARTPANEL - bool "PXA Smartpanel LCD support" - default n - depends on FB_PXA - -config FB_PXA_PARAMETERS - bool "PXA LCD command line parameters" - default n - depends on FB_PXA - ---help--- - Enable the use of kernel command line or module parameters - to configure the physical properties of the LCD panel when - using the PXA LCD driver. - - This option allows you to override the panel parameters - supplied by the platform in order to support multiple - different models of flatpanel. If you will only be using a - single model of flatpanel then you can safely leave this - option disabled. - - describes the available parameters. - -config PXA3XX_GCU - tristate "PXA3xx 2D graphics accelerator driver" - depends on FB_PXA - help - Kernelspace driver for the 2D graphics controller unit (GCU) - found on PXA3xx processors. There is a counterpart driver in the - DirectFB suite, see http://www.directfb.org/ - - If you compile this as a module, it will be called pxa3xx_gcu. - -config FB_MBX - tristate "2700G LCD framebuffer support" - depends on FB && ARCH_PXA - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Framebuffer driver for the Intel 2700G (Marathon) Graphics - Accelerator - -config FB_MBX_DEBUG - bool "Enable debugging info via debugfs" - depends on FB_MBX && DEBUG_FS - default n - ---help--- - Enable this if you want debugging information using the debug - filesystem (debugfs) - - If unsure, say N. - -config FB_FSL_DIU - tristate "Freescale DIU framebuffer support" - depends on FB && FSL_SOC - select FB_MODE_HELPERS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select PPC_LIB_RHEAP - ---help--- - Framebuffer driver for the Freescale SoC DIU - -config FB_W100 - tristate "W100 frame buffer support" - depends on FB && ARCH_PXA - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for the w100 as found on the Sharp SL-Cxx series. - It can also drive the w3220 chip found on iPAQ hx4700. - - This driver is also available as a module ( = code which can be - inserted and removed from the running kernel whenever you want). The - module will be called w100fb. If you want to compile it as a module, - say M here and read . - - If unsure, say N. - -config FB_SH_MOBILE_LCDC - tristate "SuperH Mobile LCDC framebuffer support" - depends on FB && (SUPERH || ARCH_SHMOBILE) && HAVE_CLK - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - select FB_BACKLIGHT - select SH_MIPI_DSI if SH_LCD_MIPI_DSI - ---help--- - Frame buffer driver for the on-chip SH-Mobile LCD controller. - -config FB_SH_MOBILE_HDMI - tristate "SuperH Mobile HDMI controller support" - depends on FB_SH_MOBILE_LCDC - select FB_MODE_HELPERS - select SOUND - select SND - select SND_SOC - ---help--- - Driver for the on-chip SH-Mobile HDMI controller. - -config FB_TMIO - tristate "Toshiba Mobile IO FrameBuffer support" - depends on FB && MFD_CORE - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for the Toshiba Mobile IO integrated as found - on the Sharp SL-6000 series - - This driver is also available as a module ( = code which can be - inserted and removed from the running kernel whenever you want). The - module will be called tmiofb. If you want to compile it as a module, - say M here and read . - - If unsure, say N. - -config FB_TMIO_ACCELL - bool "tmiofb acceleration" - depends on FB_TMIO - default y - -config FB_S3C - tristate "Samsung S3C framebuffer support" - depends on FB && (CPU_S3C2416 || ARCH_S3C64XX || ARCH_S5P64X0 || \ - ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for the built-in FB controller in the Samsung - SoC line from the S3C2443 onwards, including the S3C2416, S3C2450, - and the S3C64XX series such as the S3C6400 and S3C6410. - - These chips all have the same basic framebuffer design with the - actual capabilities depending on the chip. For instance the S3C6400 - and S3C6410 support 4 hardware windows whereas the S3C24XX series - currently only have two. - - Currently the support is only for the S3C6400 and S3C6410 SoCs. - -config FB_S3C_DEBUG_REGWRITE - bool "Debug register writes" - depends on FB_S3C - ---help--- - Show all register writes via pr_debug() - -config FB_S3C2410 - tristate "S3C2410 LCD framebuffer support" - depends on FB && ARCH_S3C24XX - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for the built-in LCD controller in the Samsung - S3C2410 processor. - - This driver is also available as a module ( = code which can be - inserted and removed from the running kernel whenever you want). The - module will be called s3c2410fb. If you want to compile it as a module, - say M here and read . - - If unsure, say N. -config FB_S3C2410_DEBUG - bool "S3C2410 lcd debug messages" - depends on FB_S3C2410 - help - Turn on debugging messages. Note that you can set/unset at run time - through sysfs - -config FB_NUC900 - bool "NUC900 LCD framebuffer support" - depends on FB && ARCH_W90X900 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for the built-in LCD controller in the Nuvoton - NUC900 processor - -config GPM1040A0_320X240 - bool "Giantplus Technology GPM1040A0 320x240 Color TFT LCD" - depends on FB_NUC900 - -config FB_SM501 - tristate "Silicon Motion SM501 framebuffer support" - depends on FB && MFD_SM501 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for the CRT and LCD controllers in the Silicon - Motion SM501. - - This driver is also available as a module ( = code which can be - inserted and removed from the running kernel whenever you want). The - module will be called sm501fb. If you want to compile it as a module, - say M here and read . - - If unsure, say N. - -config FB_SMSCUFX - tristate "SMSC UFX6000/7000 USB Framebuffer support" - depends on FB && USB - select FB_MODE_HELPERS - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - ---help--- - This is a kernel framebuffer driver for SMSC UFX USB devices. - Supports fbdev clients like xf86-video-fbdev, kdrive, fbi, and - mplayer -vo fbdev. Supports both UFX6000 (USB 2.0) and UFX7000 - (USB 3.0) devices. - To compile as a module, choose M here: the module name is smscufx. - -config FB_UDL - tristate "Displaylink USB Framebuffer support" - depends on FB && USB - select FB_MODE_HELPERS - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - ---help--- - This is a kernel framebuffer driver for DisplayLink USB devices. - Supports fbdev clients like xf86-video-fbdev, kdrive, fbi, and - mplayer -vo fbdev. Supports all USB 2.0 era DisplayLink devices. - To compile as a module, choose M here: the module name is udlfb. - -config FB_IBM_GXT4500 - tristate "Framebuffer support for IBM GXT4000P/4500P/6000P/6500P adaptors" - depends on FB && PPC - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Say Y here to enable support for the IBM GXT4000P/6000P and - GXT4500P/6500P display adaptor based on Raster Engine RC1000, - found on some IBM System P (pSeries) machines. This driver - doesn't use Geometry Engine GT1000. - -config FB_PS3 - tristate "PS3 GPU framebuffer driver" - depends on FB && PS3_PS3AV - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE - ---help--- - Include support for the virtual frame buffer in the PS3 platform. - -config FB_PS3_DEFAULT_SIZE_M - int "PS3 default frame buffer size (in MiB)" - depends on FB_PS3 - default 9 - ---help--- - This is the default size (in MiB) of the virtual frame buffer in - the PS3. - The default value can be overridden on the kernel command line - using the "ps3fb" option (e.g. "ps3fb=9M"); - -config FB_XILINX - tristate "Xilinx frame buffer support" - depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Include support for the Xilinx ML300/ML403 reference design - framebuffer. ML300 carries a 640*480 LCD display on the board, - ML403 uses a standard DB15 VGA connector. - -config FB_GOLDFISH - tristate "Goldfish Framebuffer" - depends on FB && HAS_DMA - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Framebuffer driver for Goldfish Virtual Platform - -config FB_COBALT - tristate "Cobalt server LCD frame buffer support" - depends on FB && (MIPS_COBALT || MIPS_SEAD3) - -config FB_SH7760 - bool "SH7760/SH7763/SH7720/SH7721 LCDC support" - depends on FB && (CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7763 \ - || CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Support for the SH7760/SH7763/SH7720/SH7721 integrated - (D)STN/TFT LCD Controller. - Supports display resolutions up to 1024x1024 pixel, grayscale and - color operation, with depths ranging from 1 bpp to 8 bpp monochrome - and 8, 15 or 16 bpp color; 90 degrees clockwise display rotation for - panels <= 320 pixel horizontal resolution. - -config FB_DA8XX - tristate "DA8xx/OMAP-L1xx/AM335x Framebuffer support" - depends on FB && (ARCH_DAVINCI_DA8XX || SOC_AM33XX) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_CFB_REV_PIXELS_IN_BYTE - select FB_MODE_HELPERS - select VIDEOMODE_HELPERS - ---help--- - This is the frame buffer device driver for the TI LCD controller - found on DA8xx/OMAP-L1xx/AM335x SoCs. - If unsure, say N. - -config FB_VIRTUAL - tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)" - depends on FB - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - ---help--- - This is a `virtual' frame buffer device. It operates on a chunk of - unswappable kernel memory instead of on the memory of a graphics - board. This means you cannot see any output sent to this frame - buffer device, while it does consume precious memory. The main use - of this frame buffer device is testing and debugging the frame - buffer subsystem. Do NOT enable it for normal systems! To protect - the innocent, it has to be enabled explicitly at boot time using the - kernel option `video=vfb:'. - - To compile this driver as a module, choose M here: the - module will be called vfb. In order to load it, you must use - the vfb_enable=1 option. - - If unsure, say N. - -config XEN_FBDEV_FRONTEND - tristate "Xen virtual frame buffer support" - depends on FB && XEN - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - select INPUT_XEN_KBDDEV_FRONTEND if INPUT_MISC - select XEN_XENBUS_FRONTEND - default y - help - This driver implements the front-end of the Xen virtual - frame buffer driver. It communicates with a back-end - in another domain. - -config FB_METRONOME - tristate "E-Ink Metronome/8track controller support" - depends on FB - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - help - This driver implements support for the E-Ink Metronome - controller. The pre-release name for this device was 8track - and could also have been called by some vendors as PVI-nnnn. - -config FB_MB862XX - tristate "Fujitsu MB862xx GDC support" - depends on FB - depends on PCI || (OF && PPC) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Frame buffer driver for Fujitsu Carmine/Coral-P(A)/Lime controllers. - -choice - prompt "GDC variant" - depends on FB_MB862XX - -config FB_MB862XX_PCI_GDC - bool "Carmine/Coral-P(A) GDC" - depends on PCI - ---help--- - This enables framebuffer support for Fujitsu Carmine/Coral-P(A) - PCI graphics controller devices. - -config FB_MB862XX_LIME - bool "Lime GDC" - depends on OF && PPC - select FB_FOREIGN_ENDIAN - select FB_LITTLE_ENDIAN - ---help--- - Framebuffer support for Fujitsu Lime GDC on host CPU bus. - -endchoice - -config FB_MB862XX_I2C - bool "Support I2C bus on MB862XX GDC" - depends on FB_MB862XX && I2C - default y - help - Selecting this option adds Coral-P(A)/Lime GDC I2C bus adapter - driver to support accessing I2C devices on controller's I2C bus. - These are usually some video decoder chips. - -config FB_EP93XX - tristate "EP93XX frame buffer support" - depends on FB && ARCH_EP93XX - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Framebuffer driver for the Cirrus Logic EP93XX series of processors. - This driver is also available as a module. The module will be called - ep93xx-fb. - -config FB_PRE_INIT_FB - bool "Don't reinitialize, use bootloader's GDC/Display configuration" - depends on FB && FB_MB862XX_LIME - ---help--- - Select this option if display contents should be inherited as set by - the bootloader. - -config FB_MSM - tristate "MSM Framebuffer support" - depends on FB && ARCH_MSM - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - -config FB_MX3 - tristate "MX3 Framebuffer support" - depends on FB && MX3_IPU - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - default y - help - This is a framebuffer device for the i.MX31 LCD Controller. So - far only synchronous displays are supported. If you plan to use - an LCD display with your i.MX31 system, say Y here. - -config FB_BROADSHEET - tristate "E-Ink Broadsheet/Epson S1D13521 controller support" - depends on FB - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - help - This driver implements support for the E-Ink Broadsheet - controller. The release name for this device was Epson S1D13521 - and could also have been called by other names when coupled with - a bridge adapter. - -config FB_AUO_K190X - tristate "AUO-K190X EPD controller support" - depends on FB - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - help - Provides support for epaper controllers from the K190X series - of AUO. These controllers can be used to drive epaper displays - from Sipix. - - This option enables the common support, shared by the individual - controller drivers. You will also have to enable the driver - for the controller type used in your device. - -config FB_AUO_K1900 - tristate "AUO-K1900 EPD controller support" - depends on FB && FB_AUO_K190X - help - This driver implements support for the AUO K1900 epd-controller. - This controller can drive Sipix epaper displays but can only do - serial updates, reducing the number of possible frames per second. - -config FB_AUO_K1901 - tristate "AUO-K1901 EPD controller support" - depends on FB && FB_AUO_K190X - help - This driver implements support for the AUO K1901 epd-controller. - This controller can drive Sipix epaper displays and supports - concurrent updates, making higher frames per second possible. - -config FB_JZ4740 - tristate "JZ4740 LCD framebuffer support" - depends on FB && MACH_JZ4740 - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - help - Framebuffer support for the JZ4740 SoC. - -config FB_MXS - tristate "MXS LCD framebuffer support" - depends on FB && ARCH_MXS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_MODE_HELPERS - select VIDEOMODE_HELPERS - help - Framebuffer support for the MXS SoC. - -config FB_PUV3_UNIGFX - tristate "PKUnity v3 Unigfx framebuffer support" - depends on FB && UNICORE32 && ARCH_PUV3 - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - help - Choose this option if you want to use the Unigfx device as a - framebuffer device. Without the support of PCI & AGP. - -config FB_HYPERV - tristate "Microsoft Hyper-V Synthetic Video support" - depends on FB && HYPERV - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This framebuffer driver supports Microsoft Hyper-V Synthetic Video. - -config FB_SIMPLE - bool "Simple framebuffer support" - depends on (FB = y) - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Say Y if you want support for a simple frame-buffer. - - This driver assumes that the display hardware has been initialized - before the kernel boots, and the kernel will simply render to the - pre-allocated frame buffer surface. - - Configuration re: surface address, size, and format must be provided - through device tree, or plain old platform data. - -source "drivers/video/omap/Kconfig" -source "drivers/video/omap2/Kconfig" -source "drivers/video/exynos/Kconfig" -source "drivers/video/mmp/Kconfig" -source "drivers/video/backlight/Kconfig" - if VT source "drivers/video/console/Kconfig" endif if FB || SGI_NEWPORT_CONSOLE source "drivers/video/logo/Kconfig" -endif -config FB_SH_MOBILE_MERAM - tristate "SuperH Mobile MERAM read ahead support" - depends on (SUPERH || ARCH_SHMOBILE) - select GENERIC_ALLOCATOR - ---help--- - Enable MERAM support for the SuperH controller. - - This will allow for caching of the framebuffer to provide more - reliable access under heavy main memory bus traffic situations. - Up to 4 memory channels can be configured, allowing 4 RGB or - 2 YCbCr framebuffers to be configured. +endif -config FB_SSD1307 - tristate "Solomon SSD1307 framebuffer support" - depends on FB && I2C - depends on OF - depends on GPIOLIB - select FB_SYS_FOPS - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_DEFERRED_IO - select PWM - help - This driver implements support for the Solomon SSD1307 - OLED controller over I2C. endmenu diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 1be26fe10592..9ad3c17d6456 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -1,175 +1,11 @@ -# Makefile for the Linux video drivers. -# 5 Aug 1999, James Simmons, -# Rewritten to use lists instead of if-statements. - -# Each configuration option enables a list of files. - obj-$(CONFIG_VGASTATE) += vgastate.o obj-$(CONFIG_HDMI) += hdmi.o -obj-y += fb_notify.o -obj-$(CONFIG_FB) += fb.o -fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ - modedb.o fbcvt.o -fb-objs := $(fb-y) obj-$(CONFIG_VT) += console/ obj-$(CONFIG_LOGO) += logo/ obj-y += backlight/ -obj-$(CONFIG_EXYNOS_VIDEO) += exynos/ - -obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o -obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o -obj-$(CONFIG_FB_CFB_IMAGEBLIT) += cfbimgblt.o -obj-$(CONFIG_FB_SYS_FILLRECT) += sysfillrect.o -obj-$(CONFIG_FB_SYS_COPYAREA) += syscopyarea.o -obj-$(CONFIG_FB_SYS_IMAGEBLIT) += sysimgblt.o -obj-$(CONFIG_FB_SYS_FOPS) += fb_sys_fops.o -obj-$(CONFIG_FB_SVGALIB) += svgalib.o -obj-$(CONFIG_FB_MACMODES) += macmodes.o -obj-$(CONFIG_FB_DDC) += fb_ddc.o -obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o -obj-$(CONFIG_FB_WMT_GE_ROPS) += wmt_ge_rops.o - -# Hardware specific drivers go first -obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o -obj-$(CONFIG_FB_ARC) += arcfb.o -obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o -obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o -obj-$(CONFIG_FB_GRVGA) += grvga.o -obj-$(CONFIG_FB_PM2) += pm2fb.o -obj-$(CONFIG_FB_PM3) += pm3fb.o - -obj-$(CONFIG_FB_I740) += i740fb.o -obj-$(CONFIG_FB_MATROX) += matrox/ -obj-$(CONFIG_FB_RIVA) += riva/ -obj-$(CONFIG_FB_NVIDIA) += nvidia/ -obj-$(CONFIG_FB_ATY) += aty/ macmodes.o -obj-$(CONFIG_FB_ATY128) += aty/ macmodes.o -obj-$(CONFIG_FB_RADEON) += aty/ -obj-$(CONFIG_FB_SIS) += sis/ -obj-$(CONFIG_FB_VIA) += via/ -obj-$(CONFIG_FB_KYRO) += kyro/ -obj-$(CONFIG_FB_SAVAGE) += savage/ -obj-$(CONFIG_FB_GEODE) += geode/ -obj-$(CONFIG_FB_MBX) += mbx/ -obj-$(CONFIG_FB_NEOMAGIC) += neofb.o -obj-$(CONFIG_FB_3DFX) += tdfxfb.o -obj-$(CONFIG_FB_CONTROL) += controlfb.o -obj-$(CONFIG_FB_PLATINUM) += platinumfb.o -obj-$(CONFIG_FB_VALKYRIE) += valkyriefb.o -obj-$(CONFIG_FB_CT65550) += chipsfb.o -obj-$(CONFIG_FB_IMSTT) += imsttfb.o -obj-$(CONFIG_FB_FM2) += fm2fb.o -obj-$(CONFIG_FB_VT8623) += vt8623fb.o -obj-$(CONFIG_FB_TRIDENT) += tridentfb.o -obj-$(CONFIG_FB_LE80578) += vermilion/ -obj-$(CONFIG_FB_S3) += s3fb.o -obj-$(CONFIG_FB_ARK) += arkfb.o -obj-$(CONFIG_FB_STI) += stifb.o -obj-$(CONFIG_FB_FFB) += ffb.o sbuslib.o -obj-$(CONFIG_FB_CG6) += cg6.o sbuslib.o -obj-$(CONFIG_FB_CG3) += cg3.o sbuslib.o -obj-$(CONFIG_FB_BW2) += bw2.o sbuslib.o -obj-$(CONFIG_FB_CG14) += cg14.o sbuslib.o -obj-$(CONFIG_FB_P9100) += p9100.o sbuslib.o -obj-$(CONFIG_FB_TCX) += tcx.o sbuslib.o -obj-$(CONFIG_FB_LEO) += leo.o sbuslib.o -obj-$(CONFIG_FB_ACORN) += acornfb.o -obj-$(CONFIG_FB_ATARI) += atafb.o c2p_iplan2.o atafb_mfb.o \ - atafb_iplan2p2.o atafb_iplan2p4.o atafb_iplan2p8.o -obj-$(CONFIG_FB_MAC) += macfb.o -obj-$(CONFIG_FB_HECUBA) += hecubafb.o -obj-$(CONFIG_FB_N411) += n411.o -obj-$(CONFIG_FB_HGA) += hgafb.o -obj-$(CONFIG_FB_XVR500) += sunxvr500.o -obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o -obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o -obj-$(CONFIG_FB_IGA) += igafb.o -obj-$(CONFIG_FB_APOLLO) += dnfb.o -obj-$(CONFIG_FB_Q40) += q40fb.o -obj-$(CONFIG_FB_TGA) += tgafb.o -obj-$(CONFIG_FB_HP300) += hpfb.o -obj-$(CONFIG_FB_G364) += g364fb.o -obj-$(CONFIG_FB_EP93XX) += ep93xx-fb.o -obj-$(CONFIG_FB_SA1100) += sa1100fb.o -obj-$(CONFIG_FB_HIT) += hitfb.o -obj-$(CONFIG_FB_ATMEL) += atmel_lcdfb.o -obj-$(CONFIG_FB_PVR2) += pvr2fb.o -obj-$(CONFIG_FB_VOODOO1) += sstfb.o -obj-$(CONFIG_FB_ARMCLCD) += amba-clcd.o -obj-$(CONFIG_FB_GOLDFISH) += goldfishfb.o -obj-$(CONFIG_FB_68328) += 68328fb.o -obj-$(CONFIG_FB_GBE) += gbefb.o -obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o -obj-$(CONFIG_FB_ASILIANT) += asiliantfb.o -obj-$(CONFIG_FB_PXA) += pxafb.o -obj-$(CONFIG_FB_PXA168) += pxa168fb.o -obj-$(CONFIG_PXA3XX_GCU) += pxa3xx-gcu.o -obj-$(CONFIG_MMP_DISP) += mmp/ -obj-$(CONFIG_FB_W100) += w100fb.o -obj-$(CONFIG_FB_TMIO) += tmiofb.o -obj-$(CONFIG_FB_AU1100) += au1100fb.o -obj-$(CONFIG_FB_AU1200) += au1200fb.o -obj-$(CONFIG_FB_VT8500) += vt8500lcdfb.o -obj-$(CONFIG_FB_WM8505) += wm8505fb.o -obj-$(CONFIG_FB_PMAG_AA) += pmag-aa-fb.o -obj-$(CONFIG_FB_PMAG_BA) += pmag-ba-fb.o -obj-$(CONFIG_FB_PMAGB_B) += pmagb-b-fb.o -obj-$(CONFIG_FB_MAXINE) += maxinefb.o -obj-$(CONFIG_FB_METRONOME) += metronomefb.o -obj-$(CONFIG_FB_BROADSHEET) += broadsheetfb.o -obj-$(CONFIG_FB_AUO_K190X) += auo_k190x.o -obj-$(CONFIG_FB_AUO_K1900) += auo_k1900fb.o -obj-$(CONFIG_FB_AUO_K1901) += auo_k1901fb.o -obj-$(CONFIG_FB_S1D13XXX) += s1d13xxxfb.o -obj-$(CONFIG_FB_SH7760) += sh7760fb.o -obj-$(CONFIG_FB_IMX) += imxfb.o -obj-$(CONFIG_FB_S3C) += s3c-fb.o -obj-$(CONFIG_FB_S3C2410) += s3c2410fb.o -obj-$(CONFIG_FB_FSL_DIU) += fsl-diu-fb.o -obj-$(CONFIG_FB_COBALT) += cobalt_lcdfb.o -obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o -obj-$(CONFIG_FB_PS3) += ps3fb.o -obj-$(CONFIG_FB_SM501) += sm501fb.o -obj-$(CONFIG_FB_UDL) += udlfb.o -obj-$(CONFIG_FB_SMSCUFX) += smscufx.o -obj-$(CONFIG_FB_XILINX) += xilinxfb.o -obj-$(CONFIG_SH_MIPI_DSI) += sh_mipi_dsi.o -obj-$(CONFIG_FB_SH_MOBILE_HDMI) += sh_mobile_hdmi.o -obj-$(CONFIG_FB_SH_MOBILE_MERAM) += sh_mobile_meram.o -obj-$(CONFIG_FB_SH_MOBILE_LCDC) += sh_mobile_lcdcfb.o -obj-$(CONFIG_FB_OMAP) += omap/ -obj-y += omap2/ -obj-$(CONFIG_XEN_FBDEV_FRONTEND) += xen-fbfront.o -obj-$(CONFIG_FB_CARMINE) += carminefb.o -obj-$(CONFIG_FB_MB862XX) += mb862xx/ -obj-$(CONFIG_FB_MSM) += msm/ -obj-$(CONFIG_FB_NUC900) += nuc900fb.o -obj-$(CONFIG_FB_JZ4740) += jz4740_fb.o -obj-$(CONFIG_FB_PUV3_UNIGFX) += fb-puv3.o -obj-$(CONFIG_FB_HYPERV) += hyperv_fb.o -obj-$(CONFIG_FB_OPENCORES) += ocfb.o - -# Platform or fallback drivers go here -obj-$(CONFIG_FB_UVESA) += uvesafb.o -obj-$(CONFIG_FB_VESA) += vesafb.o -obj-$(CONFIG_FB_EFI) += efifb.o -obj-$(CONFIG_FB_VGA16) += vga16fb.o -obj-$(CONFIG_FB_OF) += offb.o -obj-$(CONFIG_FB_BF537_LQ035) += bf537-lq035.o -obj-$(CONFIG_FB_BF54X_LQ043) += bf54x-lq043fb.o -obj-$(CONFIG_FB_BFIN_LQ035Q1) += bfin-lq035q1-fb.o -obj-$(CONFIG_FB_BFIN_T350MCQB) += bfin-t350mcqb-fb.o -obj-$(CONFIG_FB_BFIN_7393) += bfin_adv7393fb.o -obj-$(CONFIG_FB_MX3) += mx3fb.o -obj-$(CONFIG_FB_DA8XX) += da8xx-fb.o -obj-$(CONFIG_FB_MXS) += mxsfb.o -obj-$(CONFIG_FB_SSD1307) += ssd1307fb.o -obj-$(CONFIG_FB_SIMPLE) += simplefb.o - -# the test framebuffer is last -obj-$(CONFIG_FB_VIRTUAL) += vfb.o +obj-y += fbdev/ obj-$(CONFIG_VIDEOMODE_HELPERS) += display_timing.o videomode.o ifeq ($(CONFIG_OF),y) diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c deleted file mode 100644 index a305caea58ee..000000000000 --- a/drivers/video/acornfb.c +++ /dev/null @@ -1,1143 +0,0 @@ -/* - * linux/drivers/video/acornfb.c - * - * Copyright (C) 1998-2001 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Frame buffer code for Acorn platforms - * - * NOTE: Most of the modes with X!=640 will disappear shortly. - * NOTE: Startup setting of HS & VS polarity not supported. - * (do we need to support it if we're coming up in 640x480?) - * - * FIXME: (things broken by the "new improved" FBCON API) - * - Blanking 8bpp displays with VIDC - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "acornfb.h" - -/* - * Default resolution. - * NOTE that it has to be supported in the table towards - * the end of this file. - */ -#define DEFAULT_XRES 640 -#define DEFAULT_YRES 480 -#define DEFAULT_BPP 4 - -/* - * define this to debug the video mode selection - */ -#undef DEBUG_MODE_SELECTION - -/* - * Translation from RISC OS monitor types to actual - * HSYNC and VSYNC frequency ranges. These are - * probably not right, but they're the best info I - * have. Allow 1% either way on the nominal for TVs. - */ -#define NR_MONTYPES 6 -static struct fb_monspecs monspecs[NR_MONTYPES] = { - { /* TV */ - .hfmin = 15469, - .hfmax = 15781, - .vfmin = 49, - .vfmax = 51, - }, { /* Multi Freq */ - .hfmin = 0, - .hfmax = 99999, - .vfmin = 0, - .vfmax = 199, - }, { /* Hi-res mono */ - .hfmin = 58608, - .hfmax = 58608, - .vfmin = 64, - .vfmax = 64, - }, { /* VGA */ - .hfmin = 30000, - .hfmax = 70000, - .vfmin = 60, - .vfmax = 60, - }, { /* SVGA */ - .hfmin = 30000, - .hfmax = 70000, - .vfmin = 56, - .vfmax = 75, - }, { - .hfmin = 30000, - .hfmax = 70000, - .vfmin = 60, - .vfmax = 60, - } -}; - -static struct fb_info fb_info; -static struct acornfb_par current_par; -static struct vidc_timing current_vidc; - -extern unsigned int vram_size; /* set by setup.c */ - -#ifdef HAS_VIDC20 -#include - -#define MAX_SIZE 2*1024*1024 - -/* VIDC20 has a different set of rules from the VIDC: - * hcr : must be multiple of 4 - * hswr : must be even - * hdsr : must be even - * hder : must be even - * vcr : >= 2, (interlace, must be odd) - * vswr : >= 1 - * vdsr : >= 1 - * vder : >= vdsr - */ -static void acornfb_set_timing(struct fb_info *info) -{ - struct fb_var_screeninfo *var = &info->var; - struct vidc_timing vidc; - u_int vcr, fsize; - u_int ext_ctl, dat_ctl; - u_int words_per_line; - - memset(&vidc, 0, sizeof(vidc)); - - vidc.h_sync_width = var->hsync_len - 8; - vidc.h_border_start = vidc.h_sync_width + var->left_margin + 8 - 12; - vidc.h_display_start = vidc.h_border_start + 12 - 18; - vidc.h_display_end = vidc.h_display_start + var->xres; - vidc.h_border_end = vidc.h_display_end + 18 - 12; - vidc.h_cycle = vidc.h_border_end + var->right_margin + 12 - 8; - vidc.h_interlace = vidc.h_cycle / 2; - vidc.v_sync_width = var->vsync_len - 1; - vidc.v_border_start = vidc.v_sync_width + var->upper_margin; - vidc.v_display_start = vidc.v_border_start; - vidc.v_display_end = vidc.v_display_start + var->yres; - vidc.v_border_end = vidc.v_display_end; - vidc.control = acornfb_default_control(); - - vcr = var->vsync_len + var->upper_margin + var->yres + - var->lower_margin; - - if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) { - vidc.v_cycle = (vcr - 3) / 2; - vidc.control |= VIDC20_CTRL_INT; - } else - vidc.v_cycle = vcr - 2; - - switch (var->bits_per_pixel) { - case 1: vidc.control |= VIDC20_CTRL_1BPP; break; - case 2: vidc.control |= VIDC20_CTRL_2BPP; break; - case 4: vidc.control |= VIDC20_CTRL_4BPP; break; - default: - case 8: vidc.control |= VIDC20_CTRL_8BPP; break; - case 16: vidc.control |= VIDC20_CTRL_16BPP; break; - case 32: vidc.control |= VIDC20_CTRL_32BPP; break; - } - - acornfb_vidc20_find_rates(&vidc, var); - fsize = var->vsync_len + var->upper_margin + var->lower_margin - 1; - - if (memcmp(¤t_vidc, &vidc, sizeof(vidc))) { - current_vidc = vidc; - - vidc_writel(VIDC20_CTRL| vidc.control); - vidc_writel(0xd0000000 | vidc.pll_ctl); - vidc_writel(0x80000000 | vidc.h_cycle); - vidc_writel(0x81000000 | vidc.h_sync_width); - vidc_writel(0x82000000 | vidc.h_border_start); - vidc_writel(0x83000000 | vidc.h_display_start); - vidc_writel(0x84000000 | vidc.h_display_end); - vidc_writel(0x85000000 | vidc.h_border_end); - vidc_writel(0x86000000); - vidc_writel(0x87000000 | vidc.h_interlace); - vidc_writel(0x90000000 | vidc.v_cycle); - vidc_writel(0x91000000 | vidc.v_sync_width); - vidc_writel(0x92000000 | vidc.v_border_start); - vidc_writel(0x93000000 | vidc.v_display_start); - vidc_writel(0x94000000 | vidc.v_display_end); - vidc_writel(0x95000000 | vidc.v_border_end); - vidc_writel(0x96000000); - vidc_writel(0x97000000); - } - - iomd_writel(fsize, IOMD_FSIZE); - - ext_ctl = acornfb_default_econtrol(); - - if (var->sync & FB_SYNC_COMP_HIGH_ACT) /* should be FB_SYNC_COMP */ - ext_ctl |= VIDC20_ECTL_HS_NCSYNC | VIDC20_ECTL_VS_NCSYNC; - else { - if (var->sync & FB_SYNC_HOR_HIGH_ACT) - ext_ctl |= VIDC20_ECTL_HS_HSYNC; - else - ext_ctl |= VIDC20_ECTL_HS_NHSYNC; - - if (var->sync & FB_SYNC_VERT_HIGH_ACT) - ext_ctl |= VIDC20_ECTL_VS_VSYNC; - else - ext_ctl |= VIDC20_ECTL_VS_NVSYNC; - } - - vidc_writel(VIDC20_ECTL | ext_ctl); - - words_per_line = var->xres * var->bits_per_pixel / 32; - - if (current_par.using_vram && info->fix.smem_len == 2048*1024) - words_per_line /= 2; - - /* RiscPC doesn't use the VIDC's VRAM control. */ - dat_ctl = VIDC20_DCTL_VRAM_DIS | VIDC20_DCTL_SNA | words_per_line; - - /* The data bus width is dependent on both the type - * and amount of video memory. - * DRAM 32bit low - * 1MB VRAM 32bit - * 2MB VRAM 64bit - */ - if (current_par.using_vram && current_par.vram_half_sam == 2048) - dat_ctl |= VIDC20_DCTL_BUS_D63_0; - else - dat_ctl |= VIDC20_DCTL_BUS_D31_0; - - vidc_writel(VIDC20_DCTL | dat_ctl); - -#ifdef DEBUG_MODE_SELECTION - printk(KERN_DEBUG "VIDC registers for %dx%dx%d:\n", var->xres, - var->yres, var->bits_per_pixel); - printk(KERN_DEBUG " H-cycle : %d\n", vidc.h_cycle); - printk(KERN_DEBUG " H-sync-width : %d\n", vidc.h_sync_width); - printk(KERN_DEBUG " H-border-start : %d\n", vidc.h_border_start); - printk(KERN_DEBUG " H-display-start : %d\n", vidc.h_display_start); - printk(KERN_DEBUG " H-display-end : %d\n", vidc.h_display_end); - printk(KERN_DEBUG " H-border-end : %d\n", vidc.h_border_end); - printk(KERN_DEBUG " H-interlace : %d\n", vidc.h_interlace); - printk(KERN_DEBUG " V-cycle : %d\n", vidc.v_cycle); - printk(KERN_DEBUG " V-sync-width : %d\n", vidc.v_sync_width); - printk(KERN_DEBUG " V-border-start : %d\n", vidc.v_border_start); - printk(KERN_DEBUG " V-display-start : %d\n", vidc.v_display_start); - printk(KERN_DEBUG " V-display-end : %d\n", vidc.v_display_end); - printk(KERN_DEBUG " V-border-end : %d\n", vidc.v_border_end); - printk(KERN_DEBUG " Ext Ctrl (C) : 0x%08X\n", ext_ctl); - printk(KERN_DEBUG " PLL Ctrl (D) : 0x%08X\n", vidc.pll_ctl); - printk(KERN_DEBUG " Ctrl (E) : 0x%08X\n", vidc.control); - printk(KERN_DEBUG " Data Ctrl (F) : 0x%08X\n", dat_ctl); - printk(KERN_DEBUG " Fsize : 0x%08X\n", fsize); -#endif -} - -/* - * We have to take note of the VIDC20's 16-bit palette here. - * The VIDC20 looks up a 16 bit pixel as follows: - * - * bits 111111 - * 5432109876543210 - * red ++++++++ (8 bits, 7 to 0) - * green ++++++++ (8 bits, 11 to 4) - * blue ++++++++ (8 bits, 15 to 8) - * - * We use a pixel which looks like: - * - * bits 111111 - * 5432109876543210 - * red +++++ (5 bits, 4 to 0) - * green +++++ (5 bits, 9 to 5) - * blue +++++ (5 bits, 14 to 10) - */ -static int -acornfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int trans, struct fb_info *info) -{ - union palette pal; - - if (regno >= current_par.palette_size) - return 1; - - if (regno < 16 && info->fix.visual == FB_VISUAL_DIRECTCOLOR) { - u32 pseudo_val; - - pseudo_val = regno << info->var.red.offset; - pseudo_val |= regno << info->var.green.offset; - pseudo_val |= regno << info->var.blue.offset; - - ((u32 *)info->pseudo_palette)[regno] = pseudo_val; - } - - pal.p = 0; - pal.vidc20.red = red >> 8; - pal.vidc20.green = green >> 8; - pal.vidc20.blue = blue >> 8; - - current_par.palette[regno] = pal; - - if (info->var.bits_per_pixel == 16) { - int i; - - pal.p = 0; - vidc_writel(0x10000000); - for (i = 0; i < 256; i += 1) { - pal.vidc20.red = current_par.palette[ i & 31].vidc20.red; - pal.vidc20.green = current_par.palette[(i >> 1) & 31].vidc20.green; - pal.vidc20.blue = current_par.palette[(i >> 2) & 31].vidc20.blue; - vidc_writel(pal.p); - /* Palette register pointer auto-increments */ - } - } else { - vidc_writel(0x10000000 | regno); - vidc_writel(pal.p); - } - - return 0; -} -#endif - -/* - * Before selecting the timing parameters, adjust - * the resolution to fit the rules. - */ -static int -acornfb_adjust_timing(struct fb_info *info, struct fb_var_screeninfo *var, u_int fontht) -{ - u_int font_line_len, sam_size, min_size, size, nr_y; - - /* xres must be even */ - var->xres = (var->xres + 1) & ~1; - - /* - * We don't allow xres_virtual to differ from xres - */ - var->xres_virtual = var->xres; - var->xoffset = 0; - - if (current_par.using_vram) - sam_size = current_par.vram_half_sam * 2; - else - sam_size = 16; - - /* - * Now, find a value for yres_virtual which allows - * us to do ywrap scrolling. The value of - * yres_virtual must be such that the end of the - * displayable frame buffer must be aligned with - * the start of a font line. - */ - font_line_len = var->xres * var->bits_per_pixel * fontht / 8; - min_size = var->xres * var->yres * var->bits_per_pixel / 8; - - /* - * If minimum screen size is greater than that we have - * available, reject it. - */ - if (min_size > info->fix.smem_len) - return -EINVAL; - - /* Find int 'y', such that y * fll == s * sam < maxsize - * y = s * sam / fll; s = maxsize / sam - */ - for (size = info->fix.smem_len; - nr_y = size / font_line_len, min_size <= size; - size -= sam_size) { - if (nr_y * font_line_len == size) - break; - } - nr_y *= fontht; - - if (var->accel_flags & FB_ACCELF_TEXT) { - if (min_size > size) { - /* - * failed, use ypan - */ - size = info->fix.smem_len; - var->yres_virtual = size / (font_line_len / fontht); - } else - var->yres_virtual = nr_y; - } else if (var->yres_virtual > nr_y) - var->yres_virtual = nr_y; - - current_par.screen_end = info->fix.smem_start + size; - - /* - * Fix yres & yoffset if needed. - */ - if (var->yres > var->yres_virtual) - var->yres = var->yres_virtual; - - if (var->vmode & FB_VMODE_YWRAP) { - if (var->yoffset > var->yres_virtual) - var->yoffset = var->yres_virtual; - } else { - if (var->yoffset + var->yres > var->yres_virtual) - var->yoffset = var->yres_virtual - var->yres; - } - - /* hsync_len must be even */ - var->hsync_len = (var->hsync_len + 1) & ~1; - -#if defined(HAS_VIDC20) - /* left_margin must be even */ - if (var->left_margin & 1) { - var->left_margin += 1; - var->right_margin -= 1; - } - - /* right_margin must be even */ - if (var->right_margin & 1) - var->right_margin += 1; -#endif - - if (var->vsync_len < 1) - var->vsync_len = 1; - - return 0; -} - -static int -acornfb_validate_timing(struct fb_var_screeninfo *var, - struct fb_monspecs *monspecs) -{ - unsigned long hs, vs; - - /* - * hs(Hz) = 10^12 / (pixclock * xtotal) - * vs(Hz) = hs(Hz) / ytotal - * - * No need to do long long divisions or anything - * like that if you factor it correctly - */ - hs = 1953125000 / var->pixclock; - hs = hs * 512 / - (var->xres + var->left_margin + var->right_margin + var->hsync_len); - vs = hs / - (var->yres + var->upper_margin + var->lower_margin + var->vsync_len); - - return (vs >= monspecs->vfmin && vs <= monspecs->vfmax && - hs >= monspecs->hfmin && hs <= monspecs->hfmax) ? 0 : -EINVAL; -} - -static inline void -acornfb_update_dma(struct fb_info *info, struct fb_var_screeninfo *var) -{ - u_int off = var->yoffset * info->fix.line_length; - -#if defined(HAS_MEMC) - memc_write(VDMA_INIT, off >> 2); -#elif defined(HAS_IOMD) - iomd_writel(info->fix.smem_start + off, IOMD_VIDINIT); -#endif -} - -static int -acornfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) -{ - u_int fontht; - int err; - - /* - * FIXME: Find the font height - */ - fontht = 8; - - var->red.msb_right = 0; - var->green.msb_right = 0; - var->blue.msb_right = 0; - var->transp.msb_right = 0; - - switch (var->bits_per_pixel) { - case 1: case 2: case 4: case 8: - var->red.offset = 0; - var->red.length = var->bits_per_pixel; - var->green = var->red; - var->blue = var->red; - var->transp.offset = 0; - var->transp.length = 0; - break; - -#ifdef HAS_VIDC20 - case 16: - var->red.offset = 0; - var->red.length = 5; - var->green.offset = 5; - var->green.length = 5; - var->blue.offset = 10; - var->blue.length = 5; - var->transp.offset = 15; - var->transp.length = 1; - break; - - case 32: - var->red.offset = 0; - var->red.length = 8; - var->green.offset = 8; - var->green.length = 8; - var->blue.offset = 16; - var->blue.length = 8; - var->transp.offset = 24; - var->transp.length = 4; - break; -#endif - default: - return -EINVAL; - } - - /* - * Check to see if the pixel rate is valid. - */ - if (!acornfb_valid_pixrate(var)) - return -EINVAL; - - /* - * Validate and adjust the resolution to - * match the video generator hardware. - */ - err = acornfb_adjust_timing(info, var, fontht); - if (err) - return err; - - /* - * Validate the timing against the - * monitor hardware. - */ - return acornfb_validate_timing(var, &info->monspecs); -} - -static int acornfb_set_par(struct fb_info *info) -{ - switch (info->var.bits_per_pixel) { - case 1: - current_par.palette_size = 2; - info->fix.visual = FB_VISUAL_MONO10; - break; - case 2: - current_par.palette_size = 4; - info->fix.visual = FB_VISUAL_PSEUDOCOLOR; - break; - case 4: - current_par.palette_size = 16; - info->fix.visual = FB_VISUAL_PSEUDOCOLOR; - break; - case 8: - current_par.palette_size = VIDC_PALETTE_SIZE; - info->fix.visual = FB_VISUAL_PSEUDOCOLOR; - break; -#ifdef HAS_VIDC20 - case 16: - current_par.palette_size = 32; - info->fix.visual = FB_VISUAL_DIRECTCOLOR; - break; - case 32: - current_par.palette_size = VIDC_PALETTE_SIZE; - info->fix.visual = FB_VISUAL_DIRECTCOLOR; - break; -#endif - default: - BUG(); - } - - info->fix.line_length = (info->var.xres * info->var.bits_per_pixel) / 8; - -#if defined(HAS_MEMC) - { - unsigned long size = info->fix.smem_len - VDMA_XFERSIZE; - - memc_write(VDMA_START, 0); - memc_write(VDMA_END, size >> 2); - } -#elif defined(HAS_IOMD) - { - unsigned long start, size; - u_int control; - - start = info->fix.smem_start; - size = current_par.screen_end; - - if (current_par.using_vram) { - size -= current_par.vram_half_sam; - control = DMA_CR_E | (current_par.vram_half_sam / 256); - } else { - size -= 16; - control = DMA_CR_E | DMA_CR_D | 16; - } - - iomd_writel(start, IOMD_VIDSTART); - iomd_writel(size, IOMD_VIDEND); - iomd_writel(control, IOMD_VIDCR); - } -#endif - - acornfb_update_dma(info, &info->var); - acornfb_set_timing(info); - - return 0; -} - -static int -acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) -{ - u_int y_bottom = var->yoffset; - - if (!(var->vmode & FB_VMODE_YWRAP)) - y_bottom += info->var.yres; - - if (y_bottom > info->var.yres_virtual) - return -EINVAL; - - acornfb_update_dma(info, var); - - return 0; -} - -static struct fb_ops acornfb_ops = { - .owner = THIS_MODULE, - .fb_check_var = acornfb_check_var, - .fb_set_par = acornfb_set_par, - .fb_setcolreg = acornfb_setcolreg, - .fb_pan_display = acornfb_pan_display, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, -}; - -/* - * Everything after here is initialisation!!! - */ -static struct fb_videomode modedb[] = { - { /* 320x256 @ 50Hz */ - NULL, 50, 320, 256, 125000, 92, 62, 35, 19, 38, 2, - FB_SYNC_COMP_HIGH_ACT, - FB_VMODE_NONINTERLACED - }, { /* 640x250 @ 50Hz, 15.6 kHz hsync */ - NULL, 50, 640, 250, 62500, 185, 123, 38, 21, 76, 3, - 0, - FB_VMODE_NONINTERLACED - }, { /* 640x256 @ 50Hz, 15.6 kHz hsync */ - NULL, 50, 640, 256, 62500, 185, 123, 35, 18, 76, 3, - 0, - FB_VMODE_NONINTERLACED - }, { /* 640x512 @ 50Hz, 26.8 kHz hsync */ - NULL, 50, 640, 512, 41667, 113, 87, 18, 1, 56, 3, - 0, - FB_VMODE_NONINTERLACED - }, { /* 640x250 @ 70Hz, 31.5 kHz hsync */ - NULL, 70, 640, 250, 39722, 48, 16, 109, 88, 96, 2, - 0, - FB_VMODE_NONINTERLACED - }, { /* 640x256 @ 70Hz, 31.5 kHz hsync */ - NULL, 70, 640, 256, 39722, 48, 16, 106, 85, 96, 2, - 0, - FB_VMODE_NONINTERLACED - }, { /* 640x352 @ 70Hz, 31.5 kHz hsync */ - NULL, 70, 640, 352, 39722, 48, 16, 58, 37, 96, 2, - 0, - FB_VMODE_NONINTERLACED - }, { /* 640x480 @ 60Hz, 31.5 kHz hsync */ - NULL, 60, 640, 480, 39722, 48, 16, 32, 11, 96, 2, - 0, - FB_VMODE_NONINTERLACED - }, { /* 800x600 @ 56Hz, 35.2 kHz hsync */ - NULL, 56, 800, 600, 27778, 101, 23, 22, 1, 100, 2, - 0, - FB_VMODE_NONINTERLACED - }, { /* 896x352 @ 60Hz, 21.8 kHz hsync */ - NULL, 60, 896, 352, 41667, 59, 27, 9, 0, 118, 3, - 0, - FB_VMODE_NONINTERLACED - }, { /* 1024x 768 @ 60Hz, 48.4 kHz hsync */ - NULL, 60, 1024, 768, 15385, 160, 24, 29, 3, 136, 6, - 0, - FB_VMODE_NONINTERLACED - }, { /* 1280x1024 @ 60Hz, 63.8 kHz hsync */ - NULL, 60, 1280, 1024, 9090, 186, 96, 38, 1, 160, 3, - 0, - FB_VMODE_NONINTERLACED - } -}; - -static struct fb_videomode acornfb_default_mode = { - .name = NULL, - .refresh = 60, - .xres = 640, - .yres = 480, - .pixclock = 39722, - .left_margin = 56, - .right_margin = 16, - .upper_margin = 34, - .lower_margin = 9, - .hsync_len = 88, - .vsync_len = 2, - .sync = 0, - .vmode = FB_VMODE_NONINTERLACED -}; - -static void acornfb_init_fbinfo(void) -{ - static int first = 1; - - if (!first) - return; - first = 0; - - fb_info.fbops = &acornfb_ops; - fb_info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; - fb_info.pseudo_palette = current_par.pseudo_palette; - - strcpy(fb_info.fix.id, "Acorn"); - fb_info.fix.type = FB_TYPE_PACKED_PIXELS; - fb_info.fix.type_aux = 0; - fb_info.fix.xpanstep = 0; - fb_info.fix.ypanstep = 1; - fb_info.fix.ywrapstep = 1; - fb_info.fix.line_length = 0; - fb_info.fix.accel = FB_ACCEL_NONE; - - /* - * setup initial parameters - */ - memset(&fb_info.var, 0, sizeof(fb_info.var)); - -#if defined(HAS_VIDC20) - fb_info.var.red.length = 8; - fb_info.var.transp.length = 4; -#endif - fb_info.var.green = fb_info.var.red; - fb_info.var.blue = fb_info.var.red; - fb_info.var.nonstd = 0; - fb_info.var.activate = FB_ACTIVATE_NOW; - fb_info.var.height = -1; - fb_info.var.width = -1; - fb_info.var.vmode = FB_VMODE_NONINTERLACED; - fb_info.var.accel_flags = FB_ACCELF_TEXT; - - current_par.dram_size = 0; - current_par.montype = -1; - current_par.dpms = 0; -} - -/* - * setup acornfb options: - * - * mon:hmin-hmax:vmin-vmax:dpms:width:height - * Set monitor parameters: - * hmin = horizontal minimum frequency (Hz) - * hmax = horizontal maximum frequency (Hz) (optional) - * vmin = vertical minimum frequency (Hz) - * vmax = vertical maximum frequency (Hz) (optional) - * dpms = DPMS supported? (optional) - * width = width of picture in mm. (optional) - * height = height of picture in mm. (optional) - * - * montype:type - * Set RISC-OS style monitor type: - * 0 (or tv) - TV frequency - * 1 (or multi) - Multi frequency - * 2 (or hires) - Hi-res monochrome - * 3 (or vga) - VGA - * 4 (or svga) - SVGA - * auto, or option missing - * - try hardware detect - * - * dram:size - * Set the amount of DRAM to use for the frame buffer - * (even if you have VRAM). - * size can optionally be followed by 'M' or 'K' for - * MB or KB respectively. - */ -static void acornfb_parse_mon(char *opt) -{ - char *p = opt; - - current_par.montype = -2; - - fb_info.monspecs.hfmin = simple_strtoul(p, &p, 0); - if (*p == '-') - fb_info.monspecs.hfmax = simple_strtoul(p + 1, &p, 0); - else - fb_info.monspecs.hfmax = fb_info.monspecs.hfmin; - - if (*p != ':') - goto bad; - - fb_info.monspecs.vfmin = simple_strtoul(p + 1, &p, 0); - if (*p == '-') - fb_info.monspecs.vfmax = simple_strtoul(p + 1, &p, 0); - else - fb_info.monspecs.vfmax = fb_info.monspecs.vfmin; - - if (*p != ':') - goto check_values; - - fb_info.monspecs.dpms = simple_strtoul(p + 1, &p, 0); - - if (*p != ':') - goto check_values; - - fb_info.var.width = simple_strtoul(p + 1, &p, 0); - - if (*p != ':') - goto check_values; - - fb_info.var.height = simple_strtoul(p + 1, NULL, 0); - -check_values: - if (fb_info.monspecs.hfmax < fb_info.monspecs.hfmin || - fb_info.monspecs.vfmax < fb_info.monspecs.vfmin) - goto bad; - return; - -bad: - printk(KERN_ERR "Acornfb: bad monitor settings: %s\n", opt); - current_par.montype = -1; -} - -static void acornfb_parse_montype(char *opt) -{ - current_par.montype = -2; - - if (strncmp(opt, "tv", 2) == 0) { - opt += 2; - current_par.montype = 0; - } else if (strncmp(opt, "multi", 5) == 0) { - opt += 5; - current_par.montype = 1; - } else if (strncmp(opt, "hires", 5) == 0) { - opt += 5; - current_par.montype = 2; - } else if (strncmp(opt, "vga", 3) == 0) { - opt += 3; - current_par.montype = 3; - } else if (strncmp(opt, "svga", 4) == 0) { - opt += 4; - current_par.montype = 4; - } else if (strncmp(opt, "auto", 4) == 0) { - opt += 4; - current_par.montype = -1; - } else if (isdigit(*opt)) - current_par.montype = simple_strtoul(opt, &opt, 0); - - if (current_par.montype == -2 || - current_par.montype > NR_MONTYPES) { - printk(KERN_ERR "acornfb: unknown monitor type: %s\n", - opt); - current_par.montype = -1; - } else - if (opt && *opt) { - if (strcmp(opt, ",dpms") == 0) - current_par.dpms = 1; - else - printk(KERN_ERR - "acornfb: unknown monitor option: %s\n", - opt); - } -} - -static void acornfb_parse_dram(char *opt) -{ - unsigned int size; - - size = simple_strtoul(opt, &opt, 0); - - if (opt) { - switch (*opt) { - case 'M': - case 'm': - size *= 1024; - case 'K': - case 'k': - size *= 1024; - default: - break; - } - } - - current_par.dram_size = size; -} - -static struct options { - char *name; - void (*parse)(char *opt); -} opt_table[] = { - { "mon", acornfb_parse_mon }, - { "montype", acornfb_parse_montype }, - { "dram", acornfb_parse_dram }, - { NULL, NULL } -}; - -static int acornfb_setup(char *options) -{ - struct options *optp; - char *opt; - - if (!options || !*options) - return 0; - - acornfb_init_fbinfo(); - - while ((opt = strsep(&options, ",")) != NULL) { - if (!*opt) - continue; - - for (optp = opt_table; optp->name; optp++) { - int optlen; - - optlen = strlen(optp->name); - - if (strncmp(opt, optp->name, optlen) == 0 && - opt[optlen] == ':') { - optp->parse(opt + optlen + 1); - break; - } - } - - if (!optp->name) - printk(KERN_ERR "acornfb: unknown parameter: %s\n", - opt); - } - return 0; -} - -/* - * Detect type of monitor connected - * For now, we just assume SVGA - */ -static int acornfb_detect_monitortype(void) -{ - return 4; -} - -/* - * This enables the unused memory to be freed on older Acorn machines. - * We are freeing memory on behalf of the architecture initialisation - * code here. - */ -static inline void -free_unused_pages(unsigned int virtual_start, unsigned int virtual_end) -{ - int mb_freed = 0; - - /* - * Align addresses - */ - virtual_start = PAGE_ALIGN(virtual_start); - virtual_end = PAGE_ALIGN(virtual_end); - - while (virtual_start < virtual_end) { - struct page *page; - - /* - * Clear page reserved bit, - * set count to 1, and free - * the page. - */ - page = virt_to_page(virtual_start); - __free_reserved_page(page); - - virtual_start += PAGE_SIZE; - mb_freed += PAGE_SIZE / 1024; - } - - printk("acornfb: freed %dK memory\n", mb_freed); -} - -static int acornfb_probe(struct platform_device *dev) -{ - unsigned long size; - u_int h_sync, v_sync; - int rc, i; - char *option = NULL; - - if (fb_get_options("acornfb", &option)) - return -ENODEV; - acornfb_setup(option); - - acornfb_init_fbinfo(); - - current_par.dev = &dev->dev; - - if (current_par.montype == -1) - current_par.montype = acornfb_detect_monitortype(); - - if (current_par.montype == -1 || current_par.montype > NR_MONTYPES) - current_par.montype = 4; - - if (current_par.montype >= 0) { - fb_info.monspecs = monspecs[current_par.montype]; - fb_info.monspecs.dpms = current_par.dpms; - } - - /* - * Try to select a suitable default mode - */ - for (i = 0; i < ARRAY_SIZE(modedb); i++) { - unsigned long hs; - - hs = modedb[i].refresh * - (modedb[i].yres + modedb[i].upper_margin + - modedb[i].lower_margin + modedb[i].vsync_len); - if (modedb[i].xres == DEFAULT_XRES && - modedb[i].yres == DEFAULT_YRES && - modedb[i].refresh >= fb_info.monspecs.vfmin && - modedb[i].refresh <= fb_info.monspecs.vfmax && - hs >= fb_info.monspecs.hfmin && - hs <= fb_info.monspecs.hfmax) { - acornfb_default_mode = modedb[i]; - break; - } - } - - fb_info.screen_base = (char *)SCREEN_BASE; - fb_info.fix.smem_start = SCREEN_START; - current_par.using_vram = 0; - - /* - * If vram_size is set, we are using VRAM in - * a Risc PC. However, if the user has specified - * an amount of DRAM then use that instead. - */ - if (vram_size && !current_par.dram_size) { - size = vram_size; - current_par.vram_half_sam = vram_size / 1024; - current_par.using_vram = 1; - } else if (current_par.dram_size) - size = current_par.dram_size; - else - size = MAX_SIZE; - - /* - * Limit maximum screen size. - */ - if (size > MAX_SIZE) - size = MAX_SIZE; - - size = PAGE_ALIGN(size); - -#if defined(HAS_VIDC20) - if (!current_par.using_vram) { - dma_addr_t handle; - void *base; - - /* - * RiscPC needs to allocate the DRAM memory - * for the framebuffer if we are not using - * VRAM. - */ - base = dma_alloc_writecombine(current_par.dev, size, &handle, - GFP_KERNEL); - if (base == NULL) { - printk(KERN_ERR "acornfb: unable to allocate screen " - "memory\n"); - return -ENOMEM; - } - - fb_info.screen_base = base; - fb_info.fix.smem_start = handle; - } -#endif - fb_info.fix.smem_len = size; - current_par.palette_size = VIDC_PALETTE_SIZE; - - /* - * Lookup the timing for this resolution. If we can't - * find it, then we can't restore it if we change - * the resolution, so we disable this feature. - */ - do { - rc = fb_find_mode(&fb_info.var, &fb_info, NULL, modedb, - ARRAY_SIZE(modedb), - &acornfb_default_mode, DEFAULT_BPP); - /* - * If we found an exact match, all ok. - */ - if (rc == 1) - break; - - rc = fb_find_mode(&fb_info.var, &fb_info, NULL, NULL, 0, - &acornfb_default_mode, DEFAULT_BPP); - /* - * If we found an exact match, all ok. - */ - if (rc == 1) - break; - - rc = fb_find_mode(&fb_info.var, &fb_info, NULL, modedb, - ARRAY_SIZE(modedb), - &acornfb_default_mode, DEFAULT_BPP); - if (rc) - break; - - rc = fb_find_mode(&fb_info.var, &fb_info, NULL, NULL, 0, - &acornfb_default_mode, DEFAULT_BPP); - } while (0); - - /* - * If we didn't find an exact match, try the - * generic database. - */ - if (rc == 0) { - printk("Acornfb: no valid mode found\n"); - return -EINVAL; - } - - h_sync = 1953125000 / fb_info.var.pixclock; - h_sync = h_sync * 512 / (fb_info.var.xres + fb_info.var.left_margin + - fb_info.var.right_margin + fb_info.var.hsync_len); - v_sync = h_sync / (fb_info.var.yres + fb_info.var.upper_margin + - fb_info.var.lower_margin + fb_info.var.vsync_len); - - printk(KERN_INFO "Acornfb: %dkB %cRAM, %s, using %dx%d, " - "%d.%03dkHz, %dHz\n", - fb_info.fix.smem_len / 1024, - current_par.using_vram ? 'V' : 'D', - VIDC_NAME, fb_info.var.xres, fb_info.var.yres, - h_sync / 1000, h_sync % 1000, v_sync); - - printk(KERN_INFO "Acornfb: Monitor: %d.%03d-%d.%03dkHz, %d-%dHz%s\n", - fb_info.monspecs.hfmin / 1000, fb_info.monspecs.hfmin % 1000, - fb_info.monspecs.hfmax / 1000, fb_info.monspecs.hfmax % 1000, - fb_info.monspecs.vfmin, fb_info.monspecs.vfmax, - fb_info.monspecs.dpms ? ", DPMS" : ""); - - if (fb_set_var(&fb_info, &fb_info.var)) - printk(KERN_ERR "Acornfb: unable to set display parameters\n"); - - if (register_framebuffer(&fb_info) < 0) - return -EINVAL; - return 0; -} - -static struct platform_driver acornfb_driver = { - .probe = acornfb_probe, - .driver = { - .name = "acornfb", - }, -}; - -static int __init acornfb_init(void) -{ - return platform_driver_register(&acornfb_driver); -} - -module_init(acornfb_init); - -MODULE_AUTHOR("Russell King"); -MODULE_DESCRIPTION("VIDC 1/1a/20 framebuffer driver"); -MODULE_LICENSE("GPL"); diff --git a/drivers/video/acornfb.h b/drivers/video/acornfb.h deleted file mode 100644 index 175c8ff3367c..000000000000 --- a/drivers/video/acornfb.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * linux/drivers/video/acornfb.h - * - * Copyright (C) 1998,1999 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Frame buffer code for Acorn platforms - */ -#if defined(HAS_VIDC20) -#include -#define VIDC_PALETTE_SIZE 256 -#define VIDC_NAME "VIDC20" -#endif - -#define EXTEND8(x) ((x)|(x)<<8) -#define EXTEND4(x) ((x)|(x)<<4|(x)<<8|(x)<<12) - -struct vidc20_palette { - u_int red:8; - u_int green:8; - u_int blue:8; - u_int ext:4; - u_int unused:4; -}; - -struct vidc_palette { - u_int red:4; - u_int green:4; - u_int blue:4; - u_int trans:1; - u_int sbz1:13; - u_int reg:4; - u_int sbz2:2; -}; - -union palette { - struct vidc20_palette vidc20; - struct vidc_palette vidc; - u_int p; -}; - -struct acornfb_par { - struct device *dev; - unsigned long screen_end; - unsigned int dram_size; - unsigned int vram_half_sam; - unsigned int palette_size; - signed int montype; - unsigned int using_vram : 1; - unsigned int dpms : 1; - - union palette palette[VIDC_PALETTE_SIZE]; - - u32 pseudo_palette[16]; -}; - -struct vidc_timing { - u_int h_cycle; - u_int h_sync_width; - u_int h_border_start; - u_int h_display_start; - u_int h_display_end; - u_int h_border_end; - u_int h_interlace; - - u_int v_cycle; - u_int v_sync_width; - u_int v_border_start; - u_int v_display_start; - u_int v_display_end; - u_int v_border_end; - - u_int control; - - /* VIDC20 only */ - u_int pll_ctl; -}; - -struct modey_params { - u_int y_res; - u_int u_margin; - u_int b_margin; - u_int vsync_len; - u_int vf; -}; - -struct modex_params { - u_int x_res; - u_int l_margin; - u_int r_margin; - u_int hsync_len; - u_int clock; - u_int hf; - const struct modey_params *modey; -}; - -#ifdef HAS_VIDC20 -/* - * VIDC20 registers - */ -#define VIDC20_CTRL 0xe0000000 -#define VIDC20_CTRL_PIX_VCLK (0 << 0) -#define VIDC20_CTRL_PIX_HCLK (1 << 0) -#define VIDC20_CTRL_PIX_RCLK (2 << 0) -#define VIDC20_CTRL_PIX_CK (0 << 2) -#define VIDC20_CTRL_PIX_CK2 (1 << 2) -#define VIDC20_CTRL_PIX_CK3 (2 << 2) -#define VIDC20_CTRL_PIX_CK4 (3 << 2) -#define VIDC20_CTRL_PIX_CK5 (4 << 2) -#define VIDC20_CTRL_PIX_CK6 (5 << 2) -#define VIDC20_CTRL_PIX_CK7 (6 << 2) -#define VIDC20_CTRL_PIX_CK8 (7 << 2) -#define VIDC20_CTRL_1BPP (0 << 5) -#define VIDC20_CTRL_2BPP (1 << 5) -#define VIDC20_CTRL_4BPP (2 << 5) -#define VIDC20_CTRL_8BPP (3 << 5) -#define VIDC20_CTRL_16BPP (4 << 5) -#define VIDC20_CTRL_32BPP (6 << 5) -#define VIDC20_CTRL_FIFO_NS (0 << 8) -#define VIDC20_CTRL_FIFO_4 (1 << 8) -#define VIDC20_CTRL_FIFO_8 (2 << 8) -#define VIDC20_CTRL_FIFO_12 (3 << 8) -#define VIDC20_CTRL_FIFO_16 (4 << 8) -#define VIDC20_CTRL_FIFO_20 (5 << 8) -#define VIDC20_CTRL_FIFO_24 (6 << 8) -#define VIDC20_CTRL_FIFO_28 (7 << 8) -#define VIDC20_CTRL_INT (1 << 12) -#define VIDC20_CTRL_DUP (1 << 13) -#define VIDC20_CTRL_PDOWN (1 << 14) - -#define VIDC20_ECTL 0xc0000000 -#define VIDC20_ECTL_REG(x) ((x) & 0xf3) -#define VIDC20_ECTL_ECK (1 << 2) -#define VIDC20_ECTL_REDPED (1 << 8) -#define VIDC20_ECTL_GREENPED (1 << 9) -#define VIDC20_ECTL_BLUEPED (1 << 10) -#define VIDC20_ECTL_DAC (1 << 12) -#define VIDC20_ECTL_LCDGS (1 << 13) -#define VIDC20_ECTL_HRM (1 << 14) - -#define VIDC20_ECTL_HS_MASK (3 << 16) -#define VIDC20_ECTL_HS_HSYNC (0 << 16) -#define VIDC20_ECTL_HS_NHSYNC (1 << 16) -#define VIDC20_ECTL_HS_CSYNC (2 << 16) -#define VIDC20_ECTL_HS_NCSYNC (3 << 16) - -#define VIDC20_ECTL_VS_MASK (3 << 18) -#define VIDC20_ECTL_VS_VSYNC (0 << 18) -#define VIDC20_ECTL_VS_NVSYNC (1 << 18) -#define VIDC20_ECTL_VS_CSYNC (2 << 18) -#define VIDC20_ECTL_VS_NCSYNC (3 << 18) - -#define VIDC20_DCTL 0xf0000000 -/* 0-9 = number of words in scanline */ -#define VIDC20_DCTL_SNA (1 << 12) -#define VIDC20_DCTL_HDIS (1 << 13) -#define VIDC20_DCTL_BUS_NS (0 << 16) -#define VIDC20_DCTL_BUS_D31_0 (1 << 16) -#define VIDC20_DCTL_BUS_D63_32 (2 << 16) -#define VIDC20_DCTL_BUS_D63_0 (3 << 16) -#define VIDC20_DCTL_VRAM_DIS (0 << 18) -#define VIDC20_DCTL_VRAM_PXCLK (1 << 18) -#define VIDC20_DCTL_VRAM_PXCLK2 (2 << 18) -#define VIDC20_DCTL_VRAM_PXCLK4 (3 << 18) - -#endif diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c deleted file mode 100644 index 14d6b3793e0a..000000000000 --- a/drivers/video/amba-clcd.c +++ /dev/null @@ -1,656 +0,0 @@ -/* - * linux/drivers/video/amba-clcd.c - * - * Copyright (C) 2001 ARM Limited, by David A Rusling - * Updated to 2.5, Deep Blue Solutions Ltd. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * - * ARM PrimeCell PL110 Color LCD Controller - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define to_clcd(info) container_of(info, struct clcd_fb, fb) - -/* This is limited to 16 characters when displayed by X startup */ -static const char *clcd_name = "CLCD FB"; - -/* - * Unfortunately, the enable/disable functions may be called either from - * process or IRQ context, and we _need_ to delay. This is _not_ good. - */ -static inline void clcdfb_sleep(unsigned int ms) -{ - if (in_atomic()) { - mdelay(ms); - } else { - msleep(ms); - } -} - -static inline void clcdfb_set_start(struct clcd_fb *fb) -{ - unsigned long ustart = fb->fb.fix.smem_start; - unsigned long lstart; - - ustart += fb->fb.var.yoffset * fb->fb.fix.line_length; - lstart = ustart + fb->fb.var.yres * fb->fb.fix.line_length / 2; - - writel(ustart, fb->regs + CLCD_UBAS); - writel(lstart, fb->regs + CLCD_LBAS); -} - -static void clcdfb_disable(struct clcd_fb *fb) -{ - u32 val; - - if (fb->board->disable) - fb->board->disable(fb); - - val = readl(fb->regs + fb->off_cntl); - if (val & CNTL_LCDPWR) { - val &= ~CNTL_LCDPWR; - writel(val, fb->regs + fb->off_cntl); - - clcdfb_sleep(20); - } - if (val & CNTL_LCDEN) { - val &= ~CNTL_LCDEN; - writel(val, fb->regs + fb->off_cntl); - } - - /* - * Disable CLCD clock source. - */ - if (fb->clk_enabled) { - fb->clk_enabled = false; - clk_disable(fb->clk); - } -} - -static void clcdfb_enable(struct clcd_fb *fb, u32 cntl) -{ - /* - * Enable the CLCD clock source. - */ - if (!fb->clk_enabled) { - fb->clk_enabled = true; - clk_enable(fb->clk); - } - - /* - * Bring up by first enabling.. - */ - cntl |= CNTL_LCDEN; - writel(cntl, fb->regs + fb->off_cntl); - - clcdfb_sleep(20); - - /* - * and now apply power. - */ - cntl |= CNTL_LCDPWR; - writel(cntl, fb->regs + fb->off_cntl); - - /* - * finally, enable the interface. - */ - if (fb->board->enable) - fb->board->enable(fb); -} - -static int -clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) -{ - u32 caps; - int ret = 0; - - if (fb->panel->caps && fb->board->caps) - caps = fb->panel->caps & fb->board->caps; - else { - /* Old way of specifying what can be used */ - caps = fb->panel->cntl & CNTL_BGR ? - CLCD_CAP_BGR : CLCD_CAP_RGB; - /* But mask out 444 modes as they weren't supported */ - caps &= ~CLCD_CAP_444; - } - - /* Only TFT panels can do RGB888/BGR888 */ - if (!(fb->panel->cntl & CNTL_LCDTFT)) - caps &= ~CLCD_CAP_888; - - memset(&var->transp, 0, sizeof(var->transp)); - - var->red.msb_right = 0; - var->green.msb_right = 0; - var->blue.msb_right = 0; - - switch (var->bits_per_pixel) { - case 1: - case 2: - case 4: - case 8: - /* If we can't do 5551, reject */ - caps &= CLCD_CAP_5551; - if (!caps) { - ret = -EINVAL; - break; - } - - var->red.length = var->bits_per_pixel; - var->red.offset = 0; - var->green.length = var->bits_per_pixel; - var->green.offset = 0; - var->blue.length = var->bits_per_pixel; - var->blue.offset = 0; - break; - - case 16: - /* If we can't do 444, 5551 or 565, reject */ - if (!(caps & (CLCD_CAP_444 | CLCD_CAP_5551 | CLCD_CAP_565))) { - ret = -EINVAL; - break; - } - - /* - * Green length can be 4, 5 or 6 depending whether - * we're operating in 444, 5551 or 565 mode. - */ - if (var->green.length == 4 && caps & CLCD_CAP_444) - caps &= CLCD_CAP_444; - if (var->green.length == 5 && caps & CLCD_CAP_5551) - caps &= CLCD_CAP_5551; - else if (var->green.length == 6 && caps & CLCD_CAP_565) - caps &= CLCD_CAP_565; - else { - /* - * PL110 officially only supports RGB555, - * but may be wired up to allow RGB565. - */ - if (caps & CLCD_CAP_565) { - var->green.length = 6; - caps &= CLCD_CAP_565; - } else if (caps & CLCD_CAP_5551) { - var->green.length = 5; - caps &= CLCD_CAP_5551; - } else { - var->green.length = 4; - caps &= CLCD_CAP_444; - } - } - - if (var->green.length >= 5) { - var->red.length = 5; - var->blue.length = 5; - } else { - var->red.length = 4; - var->blue.length = 4; - } - break; - case 32: - /* If we can't do 888, reject */ - caps &= CLCD_CAP_888; - if (!caps) { - ret = -EINVAL; - break; - } - - var->red.length = 8; - var->green.length = 8; - var->blue.length = 8; - break; - default: - ret = -EINVAL; - break; - } - - /* - * >= 16bpp displays have separate colour component bitfields - * encoded in the pixel data. Calculate their position from - * the bitfield length defined above. - */ - if (ret == 0 && var->bits_per_pixel >= 16) { - bool bgr, rgb; - - bgr = caps & CLCD_CAP_BGR && var->blue.offset == 0; - rgb = caps & CLCD_CAP_RGB && var->red.offset == 0; - - if (!bgr && !rgb) - /* - * The requested format was not possible, try just - * our capabilities. One of BGR or RGB must be - * supported. - */ - bgr = caps & CLCD_CAP_BGR; - - if (bgr) { - var->blue.offset = 0; - var->green.offset = var->blue.offset + var->blue.length; - var->red.offset = var->green.offset + var->green.length; - } else { - var->red.offset = 0; - var->green.offset = var->red.offset + var->red.length; - var->blue.offset = var->green.offset + var->green.length; - } - } - - return ret; -} - -static int clcdfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) -{ - struct clcd_fb *fb = to_clcd(info); - int ret = -EINVAL; - - if (fb->board->check) - ret = fb->board->check(fb, var); - - if (ret == 0 && - var->xres_virtual * var->bits_per_pixel / 8 * - var->yres_virtual > fb->fb.fix.smem_len) - ret = -EINVAL; - - if (ret == 0) - ret = clcdfb_set_bitfields(fb, var); - - return ret; -} - -static int clcdfb_set_par(struct fb_info *info) -{ - struct clcd_fb *fb = to_clcd(info); - struct clcd_regs regs; - - fb->fb.fix.line_length = fb->fb.var.xres_virtual * - fb->fb.var.bits_per_pixel / 8; - - if (fb->fb.var.bits_per_pixel <= 8) - fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR; - else - fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; - - fb->board->decode(fb, ®s); - - clcdfb_disable(fb); - - writel(regs.tim0, fb->regs + CLCD_TIM0); - writel(regs.tim1, fb->regs + CLCD_TIM1); - writel(regs.tim2, fb->regs + CLCD_TIM2); - writel(regs.tim3, fb->regs + CLCD_TIM3); - - clcdfb_set_start(fb); - - clk_set_rate(fb->clk, (1000000000 / regs.pixclock) * 1000); - - fb->clcd_cntl = regs.cntl; - - clcdfb_enable(fb, regs.cntl); - -#ifdef DEBUG - printk(KERN_INFO - "CLCD: Registers set to\n" - " %08x %08x %08x %08x\n" - " %08x %08x %08x %08x\n", - readl(fb->regs + CLCD_TIM0), readl(fb->regs + CLCD_TIM1), - readl(fb->regs + CLCD_TIM2), readl(fb->regs + CLCD_TIM3), - readl(fb->regs + CLCD_UBAS), readl(fb->regs + CLCD_LBAS), - readl(fb->regs + fb->off_ienb), readl(fb->regs + fb->off_cntl)); -#endif - - return 0; -} - -static inline u32 convert_bitfield(int val, struct fb_bitfield *bf) -{ - unsigned int mask = (1 << bf->length) - 1; - - return (val >> (16 - bf->length) & mask) << bf->offset; -} - -/* - * Set a single color register. The values supplied have a 16 bit - * magnitude. Return != 0 for invalid regno. - */ -static int -clcdfb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, - unsigned int blue, unsigned int transp, struct fb_info *info) -{ - struct clcd_fb *fb = to_clcd(info); - - if (regno < 16) - fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) | - convert_bitfield(blue, &fb->fb.var.blue) | - convert_bitfield(green, &fb->fb.var.green) | - convert_bitfield(red, &fb->fb.var.red); - - if (fb->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR && regno < 256) { - int hw_reg = CLCD_PALETTE + ((regno * 2) & ~3); - u32 val, mask, newval; - - newval = (red >> 11) & 0x001f; - newval |= (green >> 6) & 0x03e0; - newval |= (blue >> 1) & 0x7c00; - - /* - * 3.2.11: if we're configured for big endian - * byte order, the palette entries are swapped. - */ - if (fb->clcd_cntl & CNTL_BEBO) - regno ^= 1; - - if (regno & 1) { - newval <<= 16; - mask = 0x0000ffff; - } else { - mask = 0xffff0000; - } - - val = readl(fb->regs + hw_reg) & mask; - writel(val | newval, fb->regs + hw_reg); - } - - return regno > 255; -} - -/* - * Blank the screen if blank_mode != 0, else unblank. If blank == NULL - * then the caller blanks by setting the CLUT (Color Look Up Table) to all - * black. Return 0 if blanking succeeded, != 0 if un-/blanking failed due - * to e.g. a video mode which doesn't support it. Implements VESA suspend - * and powerdown modes on hardware that supports disabling hsync/vsync: - * blank_mode == 2: suspend vsync - * blank_mode == 3: suspend hsync - * blank_mode == 4: powerdown - */ -static int clcdfb_blank(int blank_mode, struct fb_info *info) -{ - struct clcd_fb *fb = to_clcd(info); - - if (blank_mode != 0) { - clcdfb_disable(fb); - } else { - clcdfb_enable(fb, fb->clcd_cntl); - } - return 0; -} - -static int clcdfb_mmap(struct fb_info *info, - struct vm_area_struct *vma) -{ - struct clcd_fb *fb = to_clcd(info); - unsigned long len, off = vma->vm_pgoff << PAGE_SHIFT; - int ret = -EINVAL; - - len = info->fix.smem_len; - - if (off <= len && vma->vm_end - vma->vm_start <= len - off && - fb->board->mmap) - ret = fb->board->mmap(fb, vma); - - return ret; -} - -static struct fb_ops clcdfb_ops = { - .owner = THIS_MODULE, - .fb_check_var = clcdfb_check_var, - .fb_set_par = clcdfb_set_par, - .fb_setcolreg = clcdfb_setcolreg, - .fb_blank = clcdfb_blank, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, - .fb_mmap = clcdfb_mmap, -}; - -static int clcdfb_register(struct clcd_fb *fb) -{ - int ret; - - /* - * ARM PL111 always has IENB at 0x1c; it's only PL110 - * which is reversed on some platforms. - */ - if (amba_manf(fb->dev) == 0x41 && amba_part(fb->dev) == 0x111) { - fb->off_ienb = CLCD_PL111_IENB; - fb->off_cntl = CLCD_PL111_CNTL; - } else { -#ifdef CONFIG_ARCH_VERSATILE - fb->off_ienb = CLCD_PL111_IENB; - fb->off_cntl = CLCD_PL111_CNTL; -#else - fb->off_ienb = CLCD_PL110_IENB; - fb->off_cntl = CLCD_PL110_CNTL; -#endif - } - - fb->clk = clk_get(&fb->dev->dev, NULL); - if (IS_ERR(fb->clk)) { - ret = PTR_ERR(fb->clk); - goto out; - } - - ret = clk_prepare(fb->clk); - if (ret) - goto free_clk; - - fb->fb.device = &fb->dev->dev; - - fb->fb.fix.mmio_start = fb->dev->res.start; - fb->fb.fix.mmio_len = resource_size(&fb->dev->res); - - fb->regs = ioremap(fb->fb.fix.mmio_start, fb->fb.fix.mmio_len); - if (!fb->regs) { - printk(KERN_ERR "CLCD: unable to remap registers\n"); - ret = -ENOMEM; - goto clk_unprep; - } - - fb->fb.fbops = &clcdfb_ops; - fb->fb.flags = FBINFO_FLAG_DEFAULT; - fb->fb.pseudo_palette = fb->cmap; - - strncpy(fb->fb.fix.id, clcd_name, sizeof(fb->fb.fix.id)); - fb->fb.fix.type = FB_TYPE_PACKED_PIXELS; - fb->fb.fix.type_aux = 0; - fb->fb.fix.xpanstep = 0; - fb->fb.fix.ypanstep = 0; - fb->fb.fix.ywrapstep = 0; - fb->fb.fix.accel = FB_ACCEL_NONE; - - fb->fb.var.xres = fb->panel->mode.xres; - fb->fb.var.yres = fb->panel->mode.yres; - fb->fb.var.xres_virtual = fb->panel->mode.xres; - fb->fb.var.yres_virtual = fb->panel->mode.yres; - fb->fb.var.bits_per_pixel = fb->panel->bpp; - fb->fb.var.grayscale = fb->panel->grayscale; - fb->fb.var.pixclock = fb->panel->mode.pixclock; - fb->fb.var.left_margin = fb->panel->mode.left_margin; - fb->fb.var.right_margin = fb->panel->mode.right_margin; - fb->fb.var.upper_margin = fb->panel->mode.upper_margin; - fb->fb.var.lower_margin = fb->panel->mode.lower_margin; - fb->fb.var.hsync_len = fb->panel->mode.hsync_len; - fb->fb.var.vsync_len = fb->panel->mode.vsync_len; - fb->fb.var.sync = fb->panel->mode.sync; - fb->fb.var.vmode = fb->panel->mode.vmode; - fb->fb.var.activate = FB_ACTIVATE_NOW; - fb->fb.var.nonstd = 0; - fb->fb.var.height = fb->panel->height; - fb->fb.var.width = fb->panel->width; - fb->fb.var.accel_flags = 0; - - fb->fb.monspecs.hfmin = 0; - fb->fb.monspecs.hfmax = 100000; - fb->fb.monspecs.vfmin = 0; - fb->fb.monspecs.vfmax = 400; - fb->fb.monspecs.dclkmin = 1000000; - fb->fb.monspecs.dclkmax = 100000000; - - /* - * Make sure that the bitfields are set appropriately. - */ - clcdfb_set_bitfields(fb, &fb->fb.var); - - /* - * Allocate colourmap. - */ - ret = fb_alloc_cmap(&fb->fb.cmap, 256, 0); - if (ret) - goto unmap; - - /* - * Ensure interrupts are disabled. - */ - writel(0, fb->regs + fb->off_ienb); - - fb_set_var(&fb->fb, &fb->fb.var); - - dev_info(&fb->dev->dev, "%s hardware, %s display\n", - fb->board->name, fb->panel->mode.name); - - ret = register_framebuffer(&fb->fb); - if (ret == 0) - goto out; - - printk(KERN_ERR "CLCD: cannot register framebuffer (%d)\n", ret); - - fb_dealloc_cmap(&fb->fb.cmap); - unmap: - iounmap(fb->regs); - clk_unprep: - clk_unprepare(fb->clk); - free_clk: - clk_put(fb->clk); - out: - return ret; -} - -static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id) -{ - struct clcd_board *board = dev_get_platdata(&dev->dev); - struct clcd_fb *fb; - int ret; - - if (!board) - return -EINVAL; - - ret = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32)); - if (ret) - goto out; - - ret = amba_request_regions(dev, NULL); - if (ret) { - printk(KERN_ERR "CLCD: unable to reserve regs region\n"); - goto out; - } - - fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL); - if (!fb) { - printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n"); - ret = -ENOMEM; - goto free_region; - } - - fb->dev = dev; - fb->board = board; - - dev_info(&fb->dev->dev, "PL%03x rev%u at 0x%08llx\n", - amba_part(dev), amba_rev(dev), - (unsigned long long)dev->res.start); - - ret = fb->board->setup(fb); - if (ret) - goto free_fb; - - ret = clcdfb_register(fb); - if (ret == 0) { - amba_set_drvdata(dev, fb); - goto out; - } - - fb->board->remove(fb); - free_fb: - kfree(fb); - free_region: - amba_release_regions(dev); - out: - return ret; -} - -static int clcdfb_remove(struct amba_device *dev) -{ - struct clcd_fb *fb = amba_get_drvdata(dev); - - clcdfb_disable(fb); - unregister_framebuffer(&fb->fb); - if (fb->fb.cmap.len) - fb_dealloc_cmap(&fb->fb.cmap); - iounmap(fb->regs); - clk_unprepare(fb->clk); - clk_put(fb->clk); - - fb->board->remove(fb); - - kfree(fb); - - amba_release_regions(dev); - - return 0; -} - -static struct amba_id clcdfb_id_table[] = { - { - .id = 0x00041110, - .mask = 0x000ffffe, - }, - { 0, 0 }, -}; - -MODULE_DEVICE_TABLE(amba, clcdfb_id_table); - -static struct amba_driver clcd_driver = { - .drv = { - .name = "clcd-pl11x", - }, - .probe = clcdfb_probe, - .remove = clcdfb_remove, - .id_table = clcdfb_id_table, -}; - -static int __init amba_clcdfb_init(void) -{ - if (fb_get_options("ambafb", NULL)) - return -ENODEV; - - return amba_driver_register(&clcd_driver); -} - -module_init(amba_clcdfb_init); - -static void __exit amba_clcdfb_exit(void) -{ - amba_driver_unregister(&clcd_driver); -} - -module_exit(amba_clcdfb_exit); - -MODULE_DESCRIPTION("ARM PrimeCell PL110 CLCD core driver"); -MODULE_LICENSE("GPL"); diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c deleted file mode 100644 index 518f790ef88a..000000000000 --- a/drivers/video/amifb.c +++ /dev/null @@ -1,3792 +0,0 @@ -/* - * linux/drivers/video/amifb.c -- Amiga builtin chipset frame buffer device - * - * Copyright (C) 1995-2003 Geert Uytterhoeven - * - * with work by Roman Zippel - * - * - * This file is based on the Atari frame buffer device (atafb.c): - * - * Copyright (C) 1994 Martin Schaller - * Roman Hodek - * - * with work by Andreas Schwab - * Guenther Kelleter - * - * and on the original Amiga console driver (amicon.c): - * - * Copyright (C) 1993 Hamish Macdonald - * Greg Harp - * Copyright (C) 1994 David Carter [carter@compsci.bristol.ac.uk] - * - * with work by William Rucklidge (wjr@cs.cornell.edu) - * Geert Uytterhoeven - * Jes Sorensen (jds@kom.auc.dk) - * - * - * History: - * - * - 24 Jul 96: Copper generates now vblank interrupt and - * VESA Power Saving Protocol is fully implemented - * - 14 Jul 96: Rework and hopefully last ECS bugs fixed - * - 7 Mar 96: Hardware sprite support by Roman Zippel - * - 18 Feb 96: OCS and ECS support by Roman Zippel - * Hardware functions completely rewritten - * - 2 Dec 95: AGA version by Geert Uytterhoeven - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "c2p.h" - - -#define DEBUG - -#if !defined(CONFIG_FB_AMIGA_OCS) && !defined(CONFIG_FB_AMIGA_ECS) && !defined(CONFIG_FB_AMIGA_AGA) -#define CONFIG_FB_AMIGA_OCS /* define at least one fb driver, this will change later */ -#endif - -#if !defined(CONFIG_FB_AMIGA_OCS) -# define IS_OCS (0) -#elif defined(CONFIG_FB_AMIGA_ECS) || defined(CONFIG_FB_AMIGA_AGA) -# define IS_OCS (chipset == TAG_OCS) -#else -# define CONFIG_FB_AMIGA_OCS_ONLY -# define IS_OCS (1) -#endif - -#if !defined(CONFIG_FB_AMIGA_ECS) -# define IS_ECS (0) -#elif defined(CONFIG_FB_AMIGA_OCS) || defined(CONFIG_FB_AMIGA_AGA) -# define IS_ECS (chipset == TAG_ECS) -#else -# define CONFIG_FB_AMIGA_ECS_ONLY -# define IS_ECS (1) -#endif - -#if !defined(CONFIG_FB_AMIGA_AGA) -# define IS_AGA (0) -#elif defined(CONFIG_FB_AMIGA_OCS) || defined(CONFIG_FB_AMIGA_ECS) -# define IS_AGA (chipset == TAG_AGA) -#else -# define CONFIG_FB_AMIGA_AGA_ONLY -# define IS_AGA (1) -#endif - -#ifdef DEBUG -# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) -#else -# define DPRINTK(fmt, args...) -#endif - -/******************************************************************************* - - - Generic video timings - --------------------- - - Timings used by the frame buffer interface: - - +----------+---------------------------------------------+----------+-------+ - | | ^ | | | - | | |upper_margin | | | - | | v | | | - +----------###############################################----------+-------+ - | # ^ # | | - | # | # | | - | # | # | | - | # | # | | - | left # | # right | hsync | - | margin # | xres # margin | len | - |<-------->#<---------------+--------------------------->#<-------->|<----->| - | # | # | | - | # | # | | - | # | # | | - | # |yres # | | - | # | # | | - | # | # | | - | # | # | | - | # | # | | - | # | # | | - | # | # | | - | # | # | | - | # | # | | - | # v # | | - +----------###############################################----------+-------+ - | | ^ | | | - | | |lower_margin | | | - | | v | | | - +----------+---------------------------------------------+----------+-------+ - | | ^ | | | - | | |vsync_len | | | - | | v | | | - +----------+---------------------------------------------+----------+-------+ - - - Amiga video timings - ------------------- - - The Amiga native chipsets uses another timing scheme: - - - hsstrt: Start of horizontal synchronization pulse - - hsstop: End of horizontal synchronization pulse - - htotal: Last value on the line (i.e. line length = htotal + 1) - - vsstrt: Start of vertical synchronization pulse - - vsstop: End of vertical synchronization pulse - - vtotal: Last line value (i.e. number of lines = vtotal + 1) - - hcenter: Start of vertical retrace for interlace - - You can specify the blanking timings independently. Currently I just set - them equal to the respective synchronization values: - - - hbstrt: Start of horizontal blank - - hbstop: End of horizontal blank - - vbstrt: Start of vertical blank - - vbstop: End of vertical blank - - Horizontal values are in color clock cycles (280 ns), vertical values are in - scanlines. - - (0, 0) is somewhere in the upper-left corner :-) - - - Amiga visible window definitions - -------------------------------- - - Currently I only have values for AGA, SHRES (28 MHz dotclock). Feel free to - make corrections and/or additions. - - Within the above synchronization specifications, the visible window is - defined by the following parameters (actual register resolutions may be - different; all horizontal values are normalized with respect to the pixel - clock): - - - diwstrt_h: Horizontal start of the visible window - - diwstop_h: Horizontal stop + 1(*) of the visible window - - diwstrt_v: Vertical start of the visible window - - diwstop_v: Vertical stop of the visible window - - ddfstrt: Horizontal start of display DMA - - ddfstop: Horizontal stop of display DMA - - hscroll: Horizontal display output delay - - Sprite positioning: - - - sprstrt_h: Horizontal start - 4 of sprite - - sprstrt_v: Vertical start of sprite - - (*) Even Commodore did it wrong in the AGA monitor drivers by not adding 1. - - Horizontal values are in dotclock cycles (35 ns), vertical values are in - scanlines. - - (0, 0) is somewhere in the upper-left corner :-) - - - Dependencies (AGA, SHRES (35 ns dotclock)) - ------------------------------------------- - - Since there are much more parameters for the Amiga display than for the - frame buffer interface, there must be some dependencies among the Amiga - display parameters. Here's what I found out: - - - ddfstrt and ddfstop are best aligned to 64 pixels. - - the chipset needs 64 + 4 horizontal pixels after the DMA start before - the first pixel is output, so diwstrt_h = ddfstrt + 64 + 4 if you want - to display the first pixel on the line too. Increase diwstrt_h for - virtual screen panning. - - the display DMA always fetches 64 pixels at a time (fmode = 3). - - ddfstop is ddfstrt+#pixels - 64. - - diwstop_h = diwstrt_h + xres + 1. Because of the additional 1 this can - be 1 more than htotal. - - hscroll simply adds a delay to the display output. Smooth horizontal - panning needs an extra 64 pixels on the left to prefetch the pixels that - `fall off' on the left. - - if ddfstrt < 192, the sprite DMA cycles are all stolen by the bitplane - DMA, so it's best to make the DMA start as late as possible. - - you really don't want to make ddfstrt < 128, since this will steal DMA - cycles from the other DMA channels (audio, floppy and Chip RAM refresh). - - I make diwstop_h and diwstop_v as large as possible. - - General dependencies - -------------------- - - - all values are SHRES pixel (35ns) - - table 1:fetchstart table 2:prefetch table 3:fetchsize - ------------------ ---------------- ----------------- - Pixclock # SHRES|HIRES|LORES # SHRES|HIRES|LORES # SHRES|HIRES|LORES - -------------#------+-----+------#------+-----+------#------+-----+------ - Bus width 1x # 16 | 32 | 64 # 16 | 32 | 64 # 64 | 64 | 64 - Bus width 2x # 32 | 64 | 128 # 32 | 64 | 64 # 64 | 64 | 128 - Bus width 4x # 64 | 128 | 256 # 64 | 64 | 64 # 64 | 128 | 256 - - - chipset needs 4 pixels before the first pixel is output - - ddfstrt must be aligned to fetchstart (table 1) - - chipset needs also prefetch (table 2) to get first pixel data, so - ddfstrt = ((diwstrt_h - 4) & -fetchstart) - prefetch - - for horizontal panning decrease diwstrt_h - - the length of a fetchline must be aligned to fetchsize (table 3) - - if fetchstart is smaller than fetchsize, then ddfstrt can a little bit - moved to optimize use of dma (useful for OCS/ECS overscan displays) - - ddfstop is ddfstrt + ddfsize - fetchsize - - If C= didn't change anything for AGA, then at following positions the - dma bus is already used: - ddfstrt < 48 -> memory refresh - < 96 -> disk dma - < 160 -> audio dma - < 192 -> sprite 0 dma - < 416 -> sprite dma (32 per sprite) - - in accordance with the hardware reference manual a hardware stop is at - 192, but AGA (ECS?) can go below this. - - DMA priorities - -------------- - - Since there are limits on the earliest start value for display DMA and the - display of sprites, I use the following policy on horizontal panning and - the hardware cursor: - - - if you want to start display DMA too early, you lose the ability to - do smooth horizontal panning (xpanstep 1 -> 64). - - if you want to go even further, you lose the hardware cursor too. - - IMHO a hardware cursor is more important for X than horizontal scrolling, - so that's my motivation. - - - Implementation - -------------- - - ami_decode_var() converts the frame buffer values to the Amiga values. It's - just a `straightforward' implementation of the above rules. - - - Standard VGA timings - -------------------- - - xres yres left right upper lower hsync vsync - ---- ---- ---- ----- ----- ----- ----- ----- - 80x25 720 400 27 45 35 12 108 2 - 80x30 720 480 27 45 30 9 108 2 - - These were taken from a XFree86 configuration file, recalculated for a 28 MHz - dotclock (Amigas don't have a 25 MHz dotclock) and converted to frame buffer - generic timings. - - As a comparison, graphics/monitor.h suggests the following: - - xres yres left right upper lower hsync vsync - ---- ---- ---- ----- ----- ----- ----- ----- - - VGA 640 480 52 112 24 19 112 - 2 + - VGA70 640 400 52 112 27 21 112 - 2 - - - - Sync polarities - --------------- - - VSYNC HSYNC Vertical size Vertical total - ----- ----- ------------- -------------- - + + Reserved Reserved - + - 400 414 - - + 350 362 - - - 480 496 - - Source: CL-GD542X Technical Reference Manual, Cirrus Logic, Oct 1992 - - - Broadcast video timings - ----------------------- - - According to the CCIR and RETMA specifications, we have the following values: - - CCIR -> PAL - ----------- - - - a scanline is 64 µs long, of which 52.48 µs are visible. This is about - 736 visible 70 ns pixels per line. - - we have 625 scanlines, of which 575 are visible (interlaced); after - rounding this becomes 576. - - RETMA -> NTSC - ------------- - - - a scanline is 63.5 µs long, of which 53.5 µs are visible. This is about - 736 visible 70 ns pixels per line. - - we have 525 scanlines, of which 485 are visible (interlaced); after - rounding this becomes 484. - - Thus if you want a PAL compatible display, you have to do the following: - - - set the FB_SYNC_BROADCAST flag to indicate that standard broadcast - timings are to be used. - - make sure upper_margin + yres + lower_margin + vsync_len = 625 for an - interlaced, 312 for a non-interlaced and 156 for a doublescanned - display. - - make sure left_margin + xres + right_margin + hsync_len = 1816 for a - SHRES, 908 for a HIRES and 454 for a LORES display. - - the left visible part begins at 360 (SHRES; HIRES:180, LORES:90), - left_margin + 2 * hsync_len must be greater or equal. - - the upper visible part begins at 48 (interlaced; non-interlaced:24, - doublescanned:12), upper_margin + 2 * vsync_len must be greater or - equal. - - ami_encode_var() calculates margins with a hsync of 5320 ns and a vsync - of 4 scanlines - - The settings for a NTSC compatible display are straightforward. - - Note that in a strict sense the PAL and NTSC standards only define the - encoding of the color part (chrominance) of the video signal and don't say - anything about horizontal/vertical synchronization nor refresh rates. - - - -- Geert -- - -*******************************************************************************/ - - - /* - * Custom Chipset Definitions - */ - -#define CUSTOM_OFS(fld) ((long)&((struct CUSTOM*)0)->fld) - - /* - * BPLCON0 -- Bitplane Control Register 0 - */ - -#define BPC0_HIRES (0x8000) -#define BPC0_BPU2 (0x4000) /* Bit plane used count */ -#define BPC0_BPU1 (0x2000) -#define BPC0_BPU0 (0x1000) -#define BPC0_HAM (0x0800) /* HAM mode */ -#define BPC0_DPF (0x0400) /* Double playfield */ -#define BPC0_COLOR (0x0200) /* Enable colorburst */ -#define BPC0_GAUD (0x0100) /* Genlock audio enable */ -#define BPC0_UHRES (0x0080) /* Ultrahi res enable */ -#define BPC0_SHRES (0x0040) /* Super hi res mode */ -#define BPC0_BYPASS (0x0020) /* Bypass LUT - AGA */ -#define BPC0_BPU3 (0x0010) /* AGA */ -#define BPC0_LPEN (0x0008) /* Light pen enable */ -#define BPC0_LACE (0x0004) /* Interlace */ -#define BPC0_ERSY (0x0002) /* External resync */ -#define BPC0_ECSENA (0x0001) /* ECS enable */ - - /* - * BPLCON2 -- Bitplane Control Register 2 - */ - -#define BPC2_ZDBPSEL2 (0x4000) /* Bitplane to be used for ZD - AGA */ -#define BPC2_ZDBPSEL1 (0x2000) -#define BPC2_ZDBPSEL0 (0x1000) -#define BPC2_ZDBPEN (0x0800) /* Enable ZD with ZDBPSELx - AGA */ -#define BPC2_ZDCTEN (0x0400) /* Enable ZD with palette bit #31 - AGA */ -#define BPC2_KILLEHB (0x0200) /* Kill EHB mode - AGA */ -#define BPC2_RDRAM (0x0100) /* Color table accesses read, not write - AGA */ -#define BPC2_SOGEN (0x0080) /* SOG output pin high - AGA */ -#define BPC2_PF2PRI (0x0040) /* PF2 priority over PF1 */ -#define BPC2_PF2P2 (0x0020) /* PF2 priority wrt sprites */ -#define BPC2_PF2P1 (0x0010) -#define BPC2_PF2P0 (0x0008) -#define BPC2_PF1P2 (0x0004) /* ditto PF1 */ -#define BPC2_PF1P1 (0x0002) -#define BPC2_PF1P0 (0x0001) - - /* - * BPLCON3 -- Bitplane Control Register 3 (AGA) - */ - -#define BPC3_BANK2 (0x8000) /* Bits to select color register bank */ -#define BPC3_BANK1 (0x4000) -#define BPC3_BANK0 (0x2000) -#define BPC3_PF2OF2 (0x1000) /* Bits for color table offset when PF2 */ -#define BPC3_PF2OF1 (0x0800) -#define BPC3_PF2OF0 (0x0400) -#define BPC3_LOCT (0x0200) /* Color register writes go to low bits */ -#define BPC3_SPRES1 (0x0080) /* Sprite resolution bits */ -#define BPC3_SPRES0 (0x0040) -#define BPC3_BRDRBLNK (0x0020) /* Border blanked? */ -#define BPC3_BRDRTRAN (0x0010) /* Border transparent? */ -#define BPC3_ZDCLKEN (0x0004) /* ZD pin is 14 MHz (HIRES) clock output */ -#define BPC3_BRDRSPRT (0x0002) /* Sprites in border? */ -#define BPC3_EXTBLKEN (0x0001) /* BLANK programmable */ - - /* - * BPLCON4 -- Bitplane Control Register 4 (AGA) - */ - -#define BPC4_BPLAM7 (0x8000) /* bitplane color XOR field */ -#define BPC4_BPLAM6 (0x4000) -#define BPC4_BPLAM5 (0x2000) -#define BPC4_BPLAM4 (0x1000) -#define BPC4_BPLAM3 (0x0800) -#define BPC4_BPLAM2 (0x0400) -#define BPC4_BPLAM1 (0x0200) -#define BPC4_BPLAM0 (0x0100) -#define BPC4_ESPRM7 (0x0080) /* 4 high bits for even sprite colors */ -#define BPC4_ESPRM6 (0x0040) -#define BPC4_ESPRM5 (0x0020) -#define BPC4_ESPRM4 (0x0010) -#define BPC4_OSPRM7 (0x0008) /* 4 high bits for odd sprite colors */ -#define BPC4_OSPRM6 (0x0004) -#define BPC4_OSPRM5 (0x0002) -#define BPC4_OSPRM4 (0x0001) - - /* - * BEAMCON0 -- Beam Control Register - */ - -#define BMC0_HARDDIS (0x4000) /* Disable hardware limits */ -#define BMC0_LPENDIS (0x2000) /* Disable light pen latch */ -#define BMC0_VARVBEN (0x1000) /* Enable variable vertical blank */ -#define BMC0_LOLDIS (0x0800) /* Disable long/short line toggle */ -#define BMC0_CSCBEN (0x0400) /* Composite sync/blank */ -#define BMC0_VARVSYEN (0x0200) /* Enable variable vertical sync */ -#define BMC0_VARHSYEN (0x0100) /* Enable variable horizontal sync */ -#define BMC0_VARBEAMEN (0x0080) /* Enable variable beam counters */ -#define BMC0_DUAL (0x0040) /* Enable alternate horizontal beam counter */ -#define BMC0_PAL (0x0020) /* Set decodes for PAL */ -#define BMC0_VARCSYEN (0x0010) /* Enable variable composite sync */ -#define BMC0_BLANKEN (0x0008) /* Blank enable (no longer used on AGA) */ -#define BMC0_CSYTRUE (0x0004) /* CSY polarity */ -#define BMC0_VSYTRUE (0x0002) /* VSY polarity */ -#define BMC0_HSYTRUE (0x0001) /* HSY polarity */ - - - /* - * FMODE -- Fetch Mode Control Register (AGA) - */ - -#define FMODE_SSCAN2 (0x8000) /* Sprite scan-doubling */ -#define FMODE_BSCAN2 (0x4000) /* Use PF2 modulus every other line */ -#define FMODE_SPAGEM (0x0008) /* Sprite page mode */ -#define FMODE_SPR32 (0x0004) /* Sprite 32 bit fetch */ -#define FMODE_BPAGEM (0x0002) /* Bitplane page mode */ -#define FMODE_BPL32 (0x0001) /* Bitplane 32 bit fetch */ - - /* - * Tags used to indicate a specific Pixel Clock - * - * clk_shift is the shift value to get the timings in 35 ns units - */ - -enum { TAG_SHRES, TAG_HIRES, TAG_LORES }; - - /* - * Tags used to indicate the specific chipset - */ - -enum { TAG_OCS, TAG_ECS, TAG_AGA }; - - /* - * Tags used to indicate the memory bandwidth - */ - -enum { TAG_FMODE_1, TAG_FMODE_2, TAG_FMODE_4 }; - - - /* - * Clock Definitions, Maximum Display Depth - * - * These depend on the E-Clock or the Chipset, so they are filled in - * dynamically - */ - -static u_long pixclock[3]; /* SHRES/HIRES/LORES: index = clk_shift */ -static u_short maxdepth[3]; /* SHRES/HIRES/LORES: index = clk_shift */ -static u_short maxfmode, chipset; - - - /* - * Broadcast Video Timings - * - * Horizontal values are in 35 ns (SHRES) units - * Vertical values are in interlaced scanlines - */ - -#define PAL_DIWSTRT_H (360) /* PAL Window Limits */ -#define PAL_DIWSTRT_V (48) -#define PAL_HTOTAL (1816) -#define PAL_VTOTAL (625) - -#define NTSC_DIWSTRT_H (360) /* NTSC Window Limits */ -#define NTSC_DIWSTRT_V (40) -#define NTSC_HTOTAL (1816) -#define NTSC_VTOTAL (525) - - - /* - * Various macros - */ - -#define up2(v) (((v) + 1) & -2) -#define down2(v) ((v) & -2) -#define div2(v) ((v)>>1) -#define mod2(v) ((v) & 1) - -#define up4(v) (((v) + 3) & -4) -#define down4(v) ((v) & -4) -#define mul4(v) ((v) << 2) -#define div4(v) ((v)>>2) -#define mod4(v) ((v) & 3) - -#define up8(v) (((v) + 7) & -8) -#define down8(v) ((v) & -8) -#define div8(v) ((v)>>3) -#define mod8(v) ((v) & 7) - -#define up16(v) (((v) + 15) & -16) -#define down16(v) ((v) & -16) -#define div16(v) ((v)>>4) -#define mod16(v) ((v) & 15) - -#define up32(v) (((v) + 31) & -32) -#define down32(v) ((v) & -32) -#define div32(v) ((v)>>5) -#define mod32(v) ((v) & 31) - -#define up64(v) (((v) + 63) & -64) -#define down64(v) ((v) & -64) -#define div64(v) ((v)>>6) -#define mod64(v) ((v) & 63) - -#define upx(x, v) (((v) + (x) - 1) & -(x)) -#define downx(x, v) ((v) & -(x)) -#define modx(x, v) ((v) & ((x) - 1)) - -/* if x1 is not a constant, this macro won't make real sense :-) */ -#ifdef __mc68000__ -#define DIVUL(x1, x2) ({int res; asm("divul %1,%2,%3": "=d" (res): \ - "d" (x2), "d" ((long)((x1) / 0x100000000ULL)), "0" ((long)(x1))); res;}) -#else -/* We know a bit about the numbers, so we can do it this way */ -#define DIVUL(x1, x2) ((((long)((unsigned long long)x1 >> 8) / x2) << 8) + \ - ((((long)((unsigned long long)x1 >> 8) % x2) << 8) / x2)) -#endif - -#define highw(x) ((u_long)(x)>>16 & 0xffff) -#define loww(x) ((u_long)(x) & 0xffff) - -#define custom amiga_custom - -#define VBlankOn() custom.intena = IF_SETCLR|IF_COPER -#define VBlankOff() custom.intena = IF_COPER - - - /* - * Chip RAM we reserve for the Frame Buffer - * - * This defines the Maximum Virtual Screen Size - * (Setable per kernel options?) - */ - -#define VIDEOMEMSIZE_AGA_2M (1310720) /* AGA (2MB) : max 1280*1024*256 */ -#define VIDEOMEMSIZE_AGA_1M (786432) /* AGA (1MB) : max 1024*768*256 */ -#define VIDEOMEMSIZE_ECS_2M (655360) /* ECS (2MB) : max 1280*1024*16 */ -#define VIDEOMEMSIZE_ECS_1M (393216) /* ECS (1MB) : max 1024*768*16 */ -#define VIDEOMEMSIZE_OCS (262144) /* OCS : max ca. 800*600*16 */ - -#define SPRITEMEMSIZE (64 * 64 / 4) /* max 64*64*4 */ -#define DUMMYSPRITEMEMSIZE (8) -static u_long spritememory; - -#define CHIPRAM_SAFETY_LIMIT (16384) - -static u_long videomemory; - - /* - * This is the earliest allowed start of fetching display data. - * Only if you really want no hardware cursor and audio, - * set this to 128, but let it better at 192 - */ - -static u_long min_fstrt = 192; - -#define assignchunk(name, type, ptr, size) \ -{ \ - (name) = (type)(ptr); \ - ptr += size; \ -} - - - /* - * Copper Instructions - */ - -#define CMOVE(val, reg) (CUSTOM_OFS(reg) << 16 | (val)) -#define CMOVE2(val, reg) ((CUSTOM_OFS(reg) + 2) << 16 | (val)) -#define CWAIT(x, y) (((y) & 0x1fe) << 23 | ((x) & 0x7f0) << 13 | 0x0001fffe) -#define CEND (0xfffffffe) - - -typedef union { - u_long l; - u_short w[2]; -} copins; - -static struct copdisplay { - copins *init; - copins *wait; - copins *list[2][2]; - copins *rebuild[2]; -} copdisplay; - -static u_short currentcop = 0; - - /* - * Hardware Cursor API Definitions - * These used to be in linux/fb.h, but were preliminary and used by - * amifb only anyway - */ - -#define FBIOGET_FCURSORINFO 0x4607 -#define FBIOGET_VCURSORINFO 0x4608 -#define FBIOPUT_VCURSORINFO 0x4609 -#define FBIOGET_CURSORSTATE 0x460A -#define FBIOPUT_CURSORSTATE 0x460B - - -struct fb_fix_cursorinfo { - __u16 crsr_width; /* width and height of the cursor in */ - __u16 crsr_height; /* pixels (zero if no cursor) */ - __u16 crsr_xsize; /* cursor size in display pixels */ - __u16 crsr_ysize; - __u16 crsr_color1; /* colormap entry for cursor color1 */ - __u16 crsr_color2; /* colormap entry for cursor color2 */ -}; - -struct fb_var_cursorinfo { - __u16 width; - __u16 height; - __u16 xspot; - __u16 yspot; - __u8 data[1]; /* field with [height][width] */ -}; - -struct fb_cursorstate { - __s16 xoffset; - __s16 yoffset; - __u16 mode; -}; - -#define FB_CURSOR_OFF 0 -#define FB_CURSOR_ON 1 -#define FB_CURSOR_FLASH 2 - - - /* - * Hardware Cursor - */ - -static int cursorrate = 20; /* Number of frames/flash toggle */ -static u_short cursorstate = -1; -static u_short cursormode = FB_CURSOR_OFF; - -static u_short *lofsprite, *shfsprite, *dummysprite; - - /* - * Current Video Mode - */ - -struct amifb_par { - - /* General Values */ - - int xres; /* vmode */ - int yres; /* vmode */ - int vxres; /* vmode */ - int vyres; /* vmode */ - int xoffset; /* vmode */ - int yoffset; /* vmode */ - u_short bpp; /* vmode */ - u_short clk_shift; /* vmode */ - u_short line_shift; /* vmode */ - int vmode; /* vmode */ - u_short diwstrt_h; /* vmode */ - u_short diwstop_h; /* vmode */ - u_short diwstrt_v; /* vmode */ - u_short diwstop_v; /* vmode */ - u_long next_line; /* modulo for next line */ - u_long next_plane; /* modulo for next plane */ - - /* Cursor Values */ - - struct { - short crsr_x; /* movecursor */ - short crsr_y; /* movecursor */ - short spot_x; - short spot_y; - u_short height; - u_short width; - u_short fmode; - } crsr; - - /* OCS Hardware Registers */ - - u_long bplpt0; /* vmode, pan (Note: physical address) */ - u_long bplpt0wrap; /* vmode, pan (Note: physical address) */ - u_short ddfstrt; - u_short ddfstop; - u_short bpl1mod; - u_short bpl2mod; - u_short bplcon0; /* vmode */ - u_short bplcon1; /* vmode */ - u_short htotal; /* vmode */ - u_short vtotal; /* vmode */ - - /* Additional ECS Hardware Registers */ - - u_short bplcon3; /* vmode */ - u_short beamcon0; /* vmode */ - u_short hsstrt; /* vmode */ - u_short hsstop; /* vmode */ - u_short hbstrt; /* vmode */ - u_short hbstop; /* vmode */ - u_short vsstrt; /* vmode */ - u_short vsstop; /* vmode */ - u_short vbstrt; /* vmode */ - u_short vbstop; /* vmode */ - u_short hcenter; /* vmode */ - - /* Additional AGA Hardware Registers */ - - u_short fmode; /* vmode */ -}; - - - /* - * Saved color entry 0 so we can restore it when unblanking - */ - -static u_char red0, green0, blue0; - - -#if defined(CONFIG_FB_AMIGA_ECS) -static u_short ecs_palette[32]; -#endif - - - /* - * Latches for Display Changes during VBlank - */ - -static u_short do_vmode_full = 0; /* Change the Video Mode */ -static u_short do_vmode_pan = 0; /* Update the Video Mode */ -static short do_blank = 0; /* (Un)Blank the Screen (±1) */ -static u_short do_cursor = 0; /* Move the Cursor */ - - - /* - * Various Flags - */ - -static u_short is_blanked = 0; /* Screen is Blanked */ -static u_short is_lace = 0; /* Screen is laced */ - - /* - * Predefined Video Modes - * - */ - -static struct fb_videomode ami_modedb[] __initdata = { - - /* - * AmigaOS Video Modes - * - * If you change these, make sure to update DEFMODE_* as well! - */ - - { - /* 640x200, 15 kHz, 60 Hz (NTSC) */ - "ntsc", 60, 640, 200, TAG_HIRES, 106, 86, 44, 16, 76, 2, - FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 640x400, 15 kHz, 60 Hz interlaced (NTSC) */ - "ntsc-lace", 60, 640, 400, TAG_HIRES, 106, 86, 88, 33, 76, 4, - FB_SYNC_BROADCAST, FB_VMODE_INTERLACED | FB_VMODE_YWRAP - }, { - /* 640x256, 15 kHz, 50 Hz (PAL) */ - "pal", 50, 640, 256, TAG_HIRES, 106, 86, 40, 14, 76, 2, - FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 640x512, 15 kHz, 50 Hz interlaced (PAL) */ - "pal-lace", 50, 640, 512, TAG_HIRES, 106, 86, 80, 29, 76, 4, - FB_SYNC_BROADCAST, FB_VMODE_INTERLACED | FB_VMODE_YWRAP - }, { - /* 640x480, 29 kHz, 57 Hz */ - "multiscan", 57, 640, 480, TAG_SHRES, 96, 112, 29, 8, 72, 8, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 640x960, 29 kHz, 57 Hz interlaced */ - "multiscan-lace", 57, 640, 960, TAG_SHRES, 96, 112, 58, 16, 72, - 16, - 0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP - }, { - /* 640x200, 15 kHz, 72 Hz */ - "euro36", 72, 640, 200, TAG_HIRES, 92, 124, 6, 6, 52, 5, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 640x400, 15 kHz, 72 Hz interlaced */ - "euro36-lace", 72, 640, 400, TAG_HIRES, 92, 124, 12, 12, 52, - 10, - 0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP - }, { - /* 640x400, 29 kHz, 68 Hz */ - "euro72", 68, 640, 400, TAG_SHRES, 164, 92, 9, 9, 80, 8, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 640x800, 29 kHz, 68 Hz interlaced */ - "euro72-lace", 68, 640, 800, TAG_SHRES, 164, 92, 18, 18, 80, - 16, - 0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP - }, { - /* 800x300, 23 kHz, 70 Hz */ - "super72", 70, 800, 300, TAG_SHRES, 212, 140, 10, 11, 80, 7, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 800x600, 23 kHz, 70 Hz interlaced */ - "super72-lace", 70, 800, 600, TAG_SHRES, 212, 140, 20, 22, 80, - 14, - 0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP - }, { - /* 640x200, 27 kHz, 57 Hz doublescan */ - "dblntsc", 57, 640, 200, TAG_SHRES, 196, 124, 18, 17, 80, 4, - 0, FB_VMODE_DOUBLE | FB_VMODE_YWRAP - }, { - /* 640x400, 27 kHz, 57 Hz */ - "dblntsc-ff", 57, 640, 400, TAG_SHRES, 196, 124, 36, 35, 80, 7, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 640x800, 27 kHz, 57 Hz interlaced */ - "dblntsc-lace", 57, 640, 800, TAG_SHRES, 196, 124, 72, 70, 80, - 14, - 0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP - }, { - /* 640x256, 27 kHz, 47 Hz doublescan */ - "dblpal", 47, 640, 256, TAG_SHRES, 196, 124, 14, 13, 80, 4, - 0, FB_VMODE_DOUBLE | FB_VMODE_YWRAP - }, { - /* 640x512, 27 kHz, 47 Hz */ - "dblpal-ff", 47, 640, 512, TAG_SHRES, 196, 124, 28, 27, 80, 7, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 640x1024, 27 kHz, 47 Hz interlaced */ - "dblpal-lace", 47, 640, 1024, TAG_SHRES, 196, 124, 56, 54, 80, - 14, - 0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP - }, - - /* - * VGA Video Modes - */ - - { - /* 640x480, 31 kHz, 60 Hz (VGA) */ - "vga", 60, 640, 480, TAG_SHRES, 64, 96, 30, 9, 112, 2, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 640x400, 31 kHz, 70 Hz (VGA) */ - "vga70", 70, 640, 400, TAG_SHRES, 64, 96, 35, 12, 112, 2, - FB_SYNC_VERT_HIGH_ACT | FB_SYNC_COMP_HIGH_ACT, - FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, - -#if 0 - - /* - * A2024 video modes - * These modes don't work yet because there's no A2024 driver. - */ - - { - /* 1024x800, 10 Hz */ - "a2024-10", 10, 1024, 800, TAG_HIRES, 0, 0, 0, 0, 0, 0, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - }, { - /* 1024x800, 15 Hz */ - "a2024-15", 15, 1024, 800, TAG_HIRES, 0, 0, 0, 0, 0, 0, - 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP - } -#endif -}; - -#define NUM_TOTAL_MODES ARRAY_SIZE(ami_modedb) - -static char *mode_option __initdata = NULL; -static int round_down_bpp = 1; /* for mode probing */ - - /* - * Some default modes - */ - - -#define DEFMODE_PAL 2 /* "pal" for PAL OCS/ECS */ -#define DEFMODE_NTSC 0 /* "ntsc" for NTSC OCS/ECS */ -#define DEFMODE_AMBER_PAL 3 /* "pal-lace" for flicker fixed PAL (A3000) */ -#define DEFMODE_AMBER_NTSC 1 /* "ntsc-lace" for flicker fixed NTSC (A3000) */ -#define DEFMODE_AGA 19 /* "vga70" for AGA */ - - -static int amifb_ilbm = 0; /* interleaved or normal bitplanes */ - -static u32 amifb_hfmin __initdata; /* monitor hfreq lower limit (Hz) */ -static u32 amifb_hfmax __initdata; /* monitor hfreq upper limit (Hz) */ -static u16 amifb_vfmin __initdata; /* monitor vfreq lower limit (Hz) */ -static u16 amifb_vfmax __initdata; /* monitor vfreq upper limit (Hz) */ - - - /* - * Macros for the conversion from real world values to hardware register - * values - * - * This helps us to keep our attention on the real stuff... - * - * Hardware limits for AGA: - * - * parameter min max step - * --------- --- ---- ---- - * diwstrt_h 0 2047 1 - * diwstrt_v 0 2047 1 - * diwstop_h 0 4095 1 - * diwstop_v 0 4095 1 - * - * ddfstrt 0 2032 16 - * ddfstop 0 2032 16 - * - * htotal 8 2048 8 - * hsstrt 0 2040 8 - * hsstop 0 2040 8 - * vtotal 1 4096 1 - * vsstrt 0 4095 1 - * vsstop 0 4095 1 - * hcenter 0 2040 8 - * - * hbstrt 0 2047 1 - * hbstop 0 2047 1 - * vbstrt 0 4095 1 - * vbstop 0 4095 1 - * - * Horizontal values are in 35 ns (SHRES) pixels - * Vertical values are in half scanlines - */ - -/* bplcon1 (smooth scrolling) */ - -#define hscroll2hw(hscroll) \ - (((hscroll) << 12 & 0x3000) | ((hscroll) << 8 & 0xc300) | \ - ((hscroll) << 4 & 0x0c00) | ((hscroll) << 2 & 0x00f0) | \ - ((hscroll)>>2 & 0x000f)) - -/* diwstrt/diwstop/diwhigh (visible display window) */ - -#define diwstrt2hw(diwstrt_h, diwstrt_v) \ - (((diwstrt_v) << 7 & 0xff00) | ((diwstrt_h)>>2 & 0x00ff)) -#define diwstop2hw(diwstop_h, diwstop_v) \ - (((diwstop_v) << 7 & 0xff00) | ((diwstop_h)>>2 & 0x00ff)) -#define diwhigh2hw(diwstrt_h, diwstrt_v, diwstop_h, diwstop_v) \ - (((diwstop_h) << 3 & 0x2000) | ((diwstop_h) << 11 & 0x1800) | \ - ((diwstop_v)>>1 & 0x0700) | ((diwstrt_h)>>5 & 0x0020) | \ - ((diwstrt_h) << 3 & 0x0018) | ((diwstrt_v)>>9 & 0x0007)) - -/* ddfstrt/ddfstop (display DMA) */ - -#define ddfstrt2hw(ddfstrt) div8(ddfstrt) -#define ddfstop2hw(ddfstop) div8(ddfstop) - -/* hsstrt/hsstop/htotal/vsstrt/vsstop/vtotal/hcenter (sync timings) */ - -#define hsstrt2hw(hsstrt) (div8(hsstrt)) -#define hsstop2hw(hsstop) (div8(hsstop)) -#define htotal2hw(htotal) (div8(htotal) - 1) -#define vsstrt2hw(vsstrt) (div2(vsstrt)) -#define vsstop2hw(vsstop) (div2(vsstop)) -#define vtotal2hw(vtotal) (div2(vtotal) - 1) -#define hcenter2hw(htotal) (div8(htotal)) - -/* hbstrt/hbstop/vbstrt/vbstop (blanking timings) */ - -#define hbstrt2hw(hbstrt) (((hbstrt) << 8 & 0x0700) | ((hbstrt)>>3 & 0x00ff)) -#define hbstop2hw(hbstop) (((hbstop) << 8 & 0x0700) | ((hbstop)>>3 & 0x00ff)) -#define vbstrt2hw(vbstrt) (div2(vbstrt)) -#define vbstop2hw(vbstop) (div2(vbstop)) - -/* colour */ - -#define rgb2hw8_high(red, green, blue) \ - (((red & 0xf0) << 4) | (green & 0xf0) | ((blue & 0xf0)>>4)) -#define rgb2hw8_low(red, green, blue) \ - (((red & 0x0f) << 8) | ((green & 0x0f) << 4) | (blue & 0x0f)) -#define rgb2hw4(red, green, blue) \ - (((red & 0xf0) << 4) | (green & 0xf0) | ((blue & 0xf0)>>4)) -#define rgb2hw2(red, green, blue) \ - (((red & 0xc0) << 4) | (green & 0xc0) | ((blue & 0xc0)>>4)) - -/* sprpos/sprctl (sprite positioning) */ - -#define spr2hw_pos(start_v, start_h) \ - (((start_v) << 7 & 0xff00) | ((start_h)>>3 & 0x00ff)) -#define spr2hw_ctl(start_v, start_h, stop_v) \ - (((stop_v) << 7 & 0xff00) | ((start_v)>>4 & 0x0040) | \ - ((stop_v)>>5 & 0x0020) | ((start_h) << 3 & 0x0018) | \ - ((start_v)>>7 & 0x0004) | ((stop_v)>>8 & 0x0002) | \ - ((start_h)>>2 & 0x0001)) - -/* get current vertical position of beam */ -#define get_vbpos() ((u_short)((*(u_long volatile *)&custom.vposr >> 7) & 0xffe)) - - /* - * Copper Initialisation List - */ - -#define COPINITSIZE (sizeof(copins) * 40) - -enum { - cip_bplcon0 -}; - - /* - * Long Frame/Short Frame Copper List - * Don't change the order, build_copper()/rebuild_copper() rely on this - */ - -#define COPLISTSIZE (sizeof(copins) * 64) - -enum { - cop_wait, cop_bplcon0, - cop_spr0ptrh, cop_spr0ptrl, - cop_diwstrt, cop_diwstop, - cop_diwhigh, -}; - - /* - * Pixel modes for Bitplanes and Sprites - */ - -static u_short bplpixmode[3] = { - BPC0_SHRES, /* 35 ns */ - BPC0_HIRES, /* 70 ns */ - 0 /* 140 ns */ -}; - -static u_short sprpixmode[3] = { - BPC3_SPRES1 | BPC3_SPRES0, /* 35 ns */ - BPC3_SPRES1, /* 70 ns */ - BPC3_SPRES0 /* 140 ns */ -}; - - /* - * Fetch modes for Bitplanes and Sprites - */ - -static u_short bplfetchmode[3] = { - 0, /* 1x */ - FMODE_BPL32, /* 2x */ - FMODE_BPAGEM | FMODE_BPL32 /* 4x */ -}; - -static u_short sprfetchmode[3] = { - 0, /* 1x */ - FMODE_SPR32, /* 2x */ - FMODE_SPAGEM | FMODE_SPR32 /* 4x */ -}; - - -/* --------------------------- Hardware routines --------------------------- */ - - /* - * Get the video params out of `var'. If a value doesn't fit, round - * it up, if it's too big, return -EINVAL. - */ - -static int ami_decode_var(struct fb_var_screeninfo *var, struct amifb_par *par, - const struct fb_info *info) -{ - u_short clk_shift, line_shift; - u_long maxfetchstop, fstrt, fsize, fconst, xres_n, yres_n; - u_int htotal, vtotal; - - /* - * Find a matching Pixel Clock - */ - - for (clk_shift = TAG_SHRES; clk_shift <= TAG_LORES; clk_shift++) - if (var->pixclock <= pixclock[clk_shift]) - break; - if (clk_shift > TAG_LORES) { - DPRINTK("pixclock too high\n"); - return -EINVAL; - } - par->clk_shift = clk_shift; - - /* - * Check the Geometry Values - */ - - if ((par->xres = var->xres) < 64) - par->xres = 64; - if ((par->yres = var->yres) < 64) - par->yres = 64; - if ((par->vxres = var->xres_virtual) < par->xres) - par->vxres = par->xres; - if ((par->vyres = var->yres_virtual) < par->yres) - par->vyres = par->yres; - - par->bpp = var->bits_per_pixel; - if (!var->nonstd) { - if (par->bpp < 1) - par->bpp = 1; - if (par->bpp > maxdepth[clk_shift]) { - if (round_down_bpp && maxdepth[clk_shift]) - par->bpp = maxdepth[clk_shift]; - else { - DPRINTK("invalid bpp\n"); - return -EINVAL; - } - } - } else if (var->nonstd == FB_NONSTD_HAM) { - if (par->bpp < 6) - par->bpp = 6; - if (par->bpp != 6) { - if (par->bpp < 8) - par->bpp = 8; - if (par->bpp != 8 || !IS_AGA) { - DPRINTK("invalid bpp for ham mode\n"); - return -EINVAL; - } - } - } else { - DPRINTK("unknown nonstd mode\n"); - return -EINVAL; - } - - /* - * FB_VMODE_SMOOTH_XPAN will be cleared, if one of the following - * checks failed and smooth scrolling is not possible - */ - - par->vmode = var->vmode | FB_VMODE_SMOOTH_XPAN; - switch (par->vmode & FB_VMODE_MASK) { - case FB_VMODE_INTERLACED: - line_shift = 0; - break; - case FB_VMODE_NONINTERLACED: - line_shift = 1; - break; - case FB_VMODE_DOUBLE: - if (!IS_AGA) { - DPRINTK("double mode only possible with aga\n"); - return -EINVAL; - } - line_shift = 2; - break; - default: - DPRINTK("unknown video mode\n"); - return -EINVAL; - break; - } - par->line_shift = line_shift; - - /* - * Vertical and Horizontal Timings - */ - - xres_n = par->xres << clk_shift; - yres_n = par->yres << line_shift; - par->htotal = down8((var->left_margin + par->xres + var->right_margin + - var->hsync_len) << clk_shift); - par->vtotal = - down2(((var->upper_margin + par->yres + var->lower_margin + - var->vsync_len) << line_shift) + 1); - - if (IS_AGA) - par->bplcon3 = sprpixmode[clk_shift]; - else - par->bplcon3 = 0; - if (var->sync & FB_SYNC_BROADCAST) { - par->diwstop_h = par->htotal - - ((var->right_margin - var->hsync_len) << clk_shift); - if (IS_AGA) - par->diwstop_h += mod4(var->hsync_len); - else - par->diwstop_h = down4(par->diwstop_h); - - par->diwstrt_h = par->diwstop_h - xres_n; - par->diwstop_v = par->vtotal - - ((var->lower_margin - var->vsync_len) << line_shift); - par->diwstrt_v = par->diwstop_v - yres_n; - if (par->diwstop_h >= par->htotal + 8) { - DPRINTK("invalid diwstop_h\n"); - return -EINVAL; - } - if (par->diwstop_v > par->vtotal) { - DPRINTK("invalid diwstop_v\n"); - return -EINVAL; - } - - if (!IS_OCS) { - /* Initialize sync with some reasonable values for pwrsave */ - par->hsstrt = 160; - par->hsstop = 320; - par->vsstrt = 30; - par->vsstop = 34; - } else { - par->hsstrt = 0; - par->hsstop = 0; - par->vsstrt = 0; - par->vsstop = 0; - } - if (par->vtotal > (PAL_VTOTAL + NTSC_VTOTAL) / 2) { - /* PAL video mode */ - if (par->htotal != PAL_HTOTAL) { - DPRINTK("htotal invalid for pal\n"); - return -EINVAL; - } - if (par->diwstrt_h < PAL_DIWSTRT_H) { - DPRINTK("diwstrt_h too low for pal\n"); - return -EINVAL; - } - if (par->diwstrt_v < PAL_DIWSTRT_V) { - DPRINTK("diwstrt_v too low for pal\n"); - return -EINVAL; - } - htotal = PAL_HTOTAL>>clk_shift; - vtotal = PAL_VTOTAL>>1; - if (!IS_OCS) { - par->beamcon0 = BMC0_PAL; - par->bplcon3 |= BPC3_BRDRBLNK; - } else if (AMIGAHW_PRESENT(AGNUS_HR_PAL) || - AMIGAHW_PRESENT(AGNUS_HR_NTSC)) { - par->beamcon0 = BMC0_PAL; - par->hsstop = 1; - } else if (amiga_vblank != 50) { - DPRINTK("pal not supported by this chipset\n"); - return -EINVAL; - } - } else { - /* NTSC video mode - * In the AGA chipset seems to be hardware bug with BPC3_BRDRBLNK - * and NTSC activated, so than better let diwstop_h <= 1812 - */ - if (par->htotal != NTSC_HTOTAL) { - DPRINTK("htotal invalid for ntsc\n"); - return -EINVAL; - } - if (par->diwstrt_h < NTSC_DIWSTRT_H) { - DPRINTK("diwstrt_h too low for ntsc\n"); - return -EINVAL; - } - if (par->diwstrt_v < NTSC_DIWSTRT_V) { - DPRINTK("diwstrt_v too low for ntsc\n"); - return -EINVAL; - } - htotal = NTSC_HTOTAL>>clk_shift; - vtotal = NTSC_VTOTAL>>1; - if (!IS_OCS) { - par->beamcon0 = 0; - par->bplcon3 |= BPC3_BRDRBLNK; - } else if (AMIGAHW_PRESENT(AGNUS_HR_PAL) || - AMIGAHW_PRESENT(AGNUS_HR_NTSC)) { - par->beamcon0 = 0; - par->hsstop = 1; - } else if (amiga_vblank != 60) { - DPRINTK("ntsc not supported by this chipset\n"); - return -EINVAL; - } - } - if (IS_OCS) { - if (par->diwstrt_h >= 1024 || par->diwstop_h < 1024 || - par->diwstrt_v >= 512 || par->diwstop_v < 256) { - DPRINTK("invalid position for display on ocs\n"); - return -EINVAL; - } - } - } else if (!IS_OCS) { - /* Programmable video mode */ - par->hsstrt = var->right_margin << clk_shift; - par->hsstop = (var->right_margin + var->hsync_len) << clk_shift; - par->diwstop_h = par->htotal - mod8(par->hsstrt) + 8 - (1 << clk_shift); - if (!IS_AGA) - par->diwstop_h = down4(par->diwstop_h) - 16; - par->diwstrt_h = par->diwstop_h - xres_n; - par->hbstop = par->diwstrt_h + 4; - par->hbstrt = par->diwstop_h + 4; - if (par->hbstrt >= par->htotal + 8) - par->hbstrt -= par->htotal; - par->hcenter = par->hsstrt + (par->htotal >> 1); - par->vsstrt = var->lower_margin << line_shift; - par->vsstop = (var->lower_margin + var->vsync_len) << line_shift; - par->diwstop_v = par->vtotal; - if ((par->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) - par->diwstop_v -= 2; - par->diwstrt_v = par->diwstop_v - yres_n; - par->vbstop = par->diwstrt_v - 2; - par->vbstrt = par->diwstop_v - 2; - if (par->vtotal > 2048) { - DPRINTK("vtotal too high\n"); - return -EINVAL; - } - if (par->htotal > 2048) { - DPRINTK("htotal too high\n"); - return -EINVAL; - } - par->bplcon3 |= BPC3_EXTBLKEN; - par->beamcon0 = BMC0_HARDDIS | BMC0_VARVBEN | BMC0_LOLDIS | - BMC0_VARVSYEN | BMC0_VARHSYEN | BMC0_VARBEAMEN | - BMC0_PAL | BMC0_VARCSYEN; - if (var->sync & FB_SYNC_HOR_HIGH_ACT) - par->beamcon0 |= BMC0_HSYTRUE; - if (var->sync & FB_SYNC_VERT_HIGH_ACT) - par->beamcon0 |= BMC0_VSYTRUE; - if (var->sync & FB_SYNC_COMP_HIGH_ACT) - par->beamcon0 |= BMC0_CSYTRUE; - htotal = par->htotal>>clk_shift; - vtotal = par->vtotal>>1; - } else { - DPRINTK("only broadcast modes possible for ocs\n"); - return -EINVAL; - } - - /* - * Checking the DMA timing - */ - - fconst = 16 << maxfmode << clk_shift; - - /* - * smallest window start value without turn off other dma cycles - * than sprite1-7, unless you change min_fstrt - */ - - - fsize = ((maxfmode + clk_shift <= 1) ? fconst : 64); - fstrt = downx(fconst, par->diwstrt_h - 4) - fsize; - if (fstrt < min_fstrt) { - DPRINTK("fetch start too low\n"); - return -EINVAL; - } - - /* - * smallest window start value where smooth scrolling is possible - */ - - fstrt = downx(fconst, par->diwstrt_h - fconst + (1 << clk_shift) - 4) - - fsize; - if (fstrt < min_fstrt) - par->vmode &= ~FB_VMODE_SMOOTH_XPAN; - - maxfetchstop = down16(par->htotal - 80); - - fstrt = downx(fconst, par->diwstrt_h - 4) - 64 - fconst; - fsize = upx(fconst, xres_n + - modx(fconst, downx(1 << clk_shift, par->diwstrt_h - 4))); - if (fstrt + fsize > maxfetchstop) - par->vmode &= ~FB_VMODE_SMOOTH_XPAN; - - fsize = upx(fconst, xres_n); - if (fstrt + fsize > maxfetchstop) { - DPRINTK("fetch stop too high\n"); - return -EINVAL; - } - - if (maxfmode + clk_shift <= 1) { - fsize = up64(xres_n + fconst - 1); - if (min_fstrt + fsize - 64 > maxfetchstop) - par->vmode &= ~FB_VMODE_SMOOTH_XPAN; - - fsize = up64(xres_n); - if (min_fstrt + fsize - 64 > maxfetchstop) { - DPRINTK("fetch size too high\n"); - return -EINVAL; - } - - fsize -= 64; - } else - fsize -= fconst; - - /* - * Check if there is enough time to update the bitplane pointers for ywrap - */ - - if (par->htotal - fsize - 64 < par->bpp * 64) - par->vmode &= ~FB_VMODE_YWRAP; - - /* - * Bitplane calculations and check the Memory Requirements - */ - - if (amifb_ilbm) { - par->next_plane = div8(upx(16 << maxfmode, par->vxres)); - par->next_line = par->bpp * par->next_plane; - if (par->next_line * par->vyres > info->fix.smem_len) { - DPRINTK("too few video mem\n"); - return -EINVAL; - } - } else { - par->next_line = div8(upx(16 << maxfmode, par->vxres)); - par->next_plane = par->vyres * par->next_line; - if (par->next_plane * par->bpp > info->fix.smem_len) { - DPRINTK("too few video mem\n"); - return -EINVAL; - } - } - - /* - * Hardware Register Values - */ - - par->bplcon0 = BPC0_COLOR | bplpixmode[clk_shift]; - if (!IS_OCS) - par->bplcon0 |= BPC0_ECSENA; - if (par->bpp == 8) - par->bplcon0 |= BPC0_BPU3; - else - par->bplcon0 |= par->bpp << 12; - if (var->nonstd == FB_NONSTD_HAM) - par->bplcon0 |= BPC0_HAM; - if (var->sync & FB_SYNC_EXT) - par->bplcon0 |= BPC0_ERSY; - - if (IS_AGA) - par->fmode = bplfetchmode[maxfmode]; - - switch (par->vmode & FB_VMODE_MASK) { - case FB_VMODE_INTERLACED: - par->bplcon0 |= BPC0_LACE; - break; - case FB_VMODE_DOUBLE: - if (IS_AGA) - par->fmode |= FMODE_SSCAN2 | FMODE_BSCAN2; - break; - } - - if (!((par->vmode ^ var->vmode) & FB_VMODE_YWRAP)) { - par->xoffset = var->xoffset; - par->yoffset = var->yoffset; - if (par->vmode & FB_VMODE_YWRAP) { - if (par->xoffset || par->yoffset < 0 || - par->yoffset >= par->vyres) - par->xoffset = par->yoffset = 0; - } else { - if (par->xoffset < 0 || - par->xoffset > upx(16 << maxfmode, par->vxres - par->xres) || - par->yoffset < 0 || par->yoffset > par->vyres - par->yres) - par->xoffset = par->yoffset = 0; - } - } else - par->xoffset = par->yoffset = 0; - - par->crsr.crsr_x = par->crsr.crsr_y = 0; - par->crsr.spot_x = par->crsr.spot_y = 0; - par->crsr.height = par->crsr.width = 0; - - return 0; -} - - /* - * Fill the `var' structure based on the values in `par' and maybe - * other values read out of the hardware. - */ - -static void ami_encode_var(struct fb_var_screeninfo *var, - struct amifb_par *par) -{ - u_short clk_shift, line_shift; - - memset(var, 0, sizeof(struct fb_var_screeninfo)); - - clk_shift = par->clk_shift; - line_shift = par->line_shift; - - var->xres = par->xres; - var->yres = par->yres; - var->xres_virtual = par->vxres; - var->yres_virtual = par->vyres; - var->xoffset = par->xoffset; - var->yoffset = par->yoffset; - - var->bits_per_pixel = par->bpp; - var->grayscale = 0; - - var->red.offset = 0; - var->red.msb_right = 0; - var->red.length = par->bpp; - if (par->bplcon0 & BPC0_HAM) - var->red.length -= 2; - var->blue = var->green = var->red; - var->transp.offset = 0; - var->transp.length = 0; - var->transp.msb_right = 0; - - if (par->bplcon0 & BPC0_HAM) - var->nonstd = FB_NONSTD_HAM; - else - var->nonstd = 0; - var->activate = 0; - - var->height = -1; - var->width = -1; - - var->pixclock = pixclock[clk_shift]; - - if (IS_AGA && par->fmode & FMODE_BSCAN2) - var->vmode = FB_VMODE_DOUBLE; - else if (par->bplcon0 & BPC0_LACE) - var->vmode = FB_VMODE_INTERLACED; - else - var->vmode = FB_VMODE_NONINTERLACED; - - if (!IS_OCS && par->beamcon0 & BMC0_VARBEAMEN) { - var->hsync_len = (par->hsstop - par->hsstrt)>>clk_shift; - var->right_margin = par->hsstrt>>clk_shift; - var->left_margin = (par->htotal>>clk_shift) - var->xres - var->right_margin - var->hsync_len; - var->vsync_len = (par->vsstop - par->vsstrt)>>line_shift; - var->lower_margin = par->vsstrt>>line_shift; - var->upper_margin = (par->vtotal>>line_shift) - var->yres - var->lower_margin - var->vsync_len; - var->sync = 0; - if (par->beamcon0 & BMC0_HSYTRUE) - var->sync |= FB_SYNC_HOR_HIGH_ACT; - if (par->beamcon0 & BMC0_VSYTRUE) - var->sync |= FB_SYNC_VERT_HIGH_ACT; - if (par->beamcon0 & BMC0_CSYTRUE) - var->sync |= FB_SYNC_COMP_HIGH_ACT; - } else { - var->sync = FB_SYNC_BROADCAST; - var->hsync_len = (152>>clk_shift) + mod4(par->diwstop_h); - var->right_margin = ((par->htotal - down4(par->diwstop_h))>>clk_shift) + var->hsync_len; - var->left_margin = (par->htotal>>clk_shift) - var->xres - var->right_margin - var->hsync_len; - var->vsync_len = 4>>line_shift; - var->lower_margin = ((par->vtotal - par->diwstop_v)>>line_shift) + var->vsync_len; - var->upper_margin = (((par->vtotal - 2)>>line_shift) + 1) - var->yres - - var->lower_margin - var->vsync_len; - } - - if (par->bplcon0 & BPC0_ERSY) - var->sync |= FB_SYNC_EXT; - if (par->vmode & FB_VMODE_YWRAP) - var->vmode |= FB_VMODE_YWRAP; -} - - - /* - * Update hardware - */ - -static void ami_update_par(struct fb_info *info) -{ - struct amifb_par *par = info->par; - short clk_shift, vshift, fstrt, fsize, fstop, fconst, shift, move, mod; - - clk_shift = par->clk_shift; - - if (!(par->vmode & FB_VMODE_SMOOTH_XPAN)) - par->xoffset = upx(16 << maxfmode, par->xoffset); - - fconst = 16 << maxfmode << clk_shift; - vshift = modx(16 << maxfmode, par->xoffset); - fstrt = par->diwstrt_h - (vshift << clk_shift) - 4; - fsize = (par->xres + vshift) << clk_shift; - shift = modx(fconst, fstrt); - move = downx(2 << maxfmode, div8(par->xoffset)); - if (maxfmode + clk_shift > 1) { - fstrt = downx(fconst, fstrt) - 64; - fsize = upx(fconst, fsize); - fstop = fstrt + fsize - fconst; - } else { - mod = fstrt = downx(fconst, fstrt) - fconst; - fstop = fstrt + upx(fconst, fsize) - 64; - fsize = up64(fsize); - fstrt = fstop - fsize + 64; - if (fstrt < min_fstrt) { - fstop += min_fstrt - fstrt; - fstrt = min_fstrt; - } - move = move - div8((mod - fstrt)>>clk_shift); - } - mod = par->next_line - div8(fsize>>clk_shift); - par->ddfstrt = fstrt; - par->ddfstop = fstop; - par->bplcon1 = hscroll2hw(shift); - par->bpl2mod = mod; - if (par->bplcon0 & BPC0_LACE) - par->bpl2mod += par->next_line; - if (IS_AGA && (par->fmode & FMODE_BSCAN2)) - par->bpl1mod = -div8(fsize>>clk_shift); - else - par->bpl1mod = par->bpl2mod; - - if (par->yoffset) { - par->bplpt0 = info->fix.smem_start + - par->next_line * par->yoffset + move; - if (par->vmode & FB_VMODE_YWRAP) { - if (par->yoffset > par->vyres - par->yres) { - par->bplpt0wrap = info->fix.smem_start + move; - if (par->bplcon0 & BPC0_LACE && - mod2(par->diwstrt_v + par->vyres - - par->yoffset)) - par->bplpt0wrap += par->next_line; - } - } - } else - par->bplpt0 = info->fix.smem_start + move; - - if (par->bplcon0 & BPC0_LACE && mod2(par->diwstrt_v)) - par->bplpt0 += par->next_line; -} - - - /* - * Pan or Wrap the Display - * - * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag - * in `var'. - */ - -static void ami_pan_var(struct fb_var_screeninfo *var, struct fb_info *info) -{ - struct amifb_par *par = info->par; - - par->xoffset = var->xoffset; - par->yoffset = var->yoffset; - if (var->vmode & FB_VMODE_YWRAP) - par->vmode |= FB_VMODE_YWRAP; - else - par->vmode &= ~FB_VMODE_YWRAP; - - do_vmode_pan = 0; - ami_update_par(info); - do_vmode_pan = 1; -} - - -static void ami_update_display(const struct amifb_par *par) -{ - custom.bplcon1 = par->bplcon1; - custom.bpl1mod = par->bpl1mod; - custom.bpl2mod = par->bpl2mod; - custom.ddfstrt = ddfstrt2hw(par->ddfstrt); - custom.ddfstop = ddfstop2hw(par->ddfstop); -} - - /* - * Change the video mode (called by VBlank interrupt) - */ - -static void ami_init_display(const struct amifb_par *par) -{ - int i; - - custom.bplcon0 = par->bplcon0 & ~BPC0_LACE; - custom.bplcon2 = (IS_OCS ? 0 : BPC2_KILLEHB) | BPC2_PF2P2 | BPC2_PF1P2; - if (!IS_OCS) { - custom.bplcon3 = par->bplcon3; - if (IS_AGA) - custom.bplcon4 = BPC4_ESPRM4 | BPC4_OSPRM4; - if (par->beamcon0 & BMC0_VARBEAMEN) { - custom.htotal = htotal2hw(par->htotal); - custom.hbstrt = hbstrt2hw(par->hbstrt); - custom.hbstop = hbstop2hw(par->hbstop); - custom.hsstrt = hsstrt2hw(par->hsstrt); - custom.hsstop = hsstop2hw(par->hsstop); - custom.hcenter = hcenter2hw(par->hcenter); - custom.vtotal = vtotal2hw(par->vtotal); - custom.vbstrt = vbstrt2hw(par->vbstrt); - custom.vbstop = vbstop2hw(par->vbstop); - custom.vsstrt = vsstrt2hw(par->vsstrt); - custom.vsstop = vsstop2hw(par->vsstop); - } - } - if (!IS_OCS || par->hsstop) - custom.beamcon0 = par->beamcon0; - if (IS_AGA) - custom.fmode = par->fmode; - - /* - * The minimum period for audio depends on htotal - */ - - amiga_audio_min_period = div16(par->htotal); - - is_lace = par->bplcon0 & BPC0_LACE ? 1 : 0; -#if 1 - if (is_lace) { - i = custom.vposr >> 15; - } else { - custom.vposw = custom.vposr | 0x8000; - i = 1; - } -#else - i = 1; - custom.vposw = custom.vposr | 0x8000; -#endif - custom.cop2lc = (u_short *)ZTWO_PADDR(copdisplay.list[currentcop][i]); -} - - /* - * (Un)Blank the screen (called by VBlank interrupt) - */ - -static void ami_do_blank(const struct amifb_par *par) -{ -#if defined(CONFIG_FB_AMIGA_AGA) - u_short bplcon3 = par->bplcon3; -#endif - u_char red, green, blue; - - if (do_blank > 0) { - custom.dmacon = DMAF_RASTER | DMAF_SPRITE; - red = green = blue = 0; - if (!IS_OCS && do_blank > 1) { - switch (do_blank) { - case FB_BLANK_VSYNC_SUSPEND: - custom.hsstrt = hsstrt2hw(par->hsstrt); - custom.hsstop = hsstop2hw(par->hsstop); - custom.vsstrt = vsstrt2hw(par->vtotal + 4); - custom.vsstop = vsstop2hw(par->vtotal + 4); - break; - case FB_BLANK_HSYNC_SUSPEND: - custom.hsstrt = hsstrt2hw(par->htotal + 16); - custom.hsstop = hsstop2hw(par->htotal + 16); - custom.vsstrt = vsstrt2hw(par->vsstrt); - custom.vsstop = vsstrt2hw(par->vsstop); - break; - case FB_BLANK_POWERDOWN: - custom.hsstrt = hsstrt2hw(par->htotal + 16); - custom.hsstop = hsstop2hw(par->htotal + 16); - custom.vsstrt = vsstrt2hw(par->vtotal + 4); - custom.vsstop = vsstop2hw(par->vtotal + 4); - break; - } - if (!(par->beamcon0 & BMC0_VARBEAMEN)) { - custom.htotal = htotal2hw(par->htotal); - custom.vtotal = vtotal2hw(par->vtotal); - custom.beamcon0 = BMC0_HARDDIS | BMC0_VARBEAMEN | - BMC0_VARVSYEN | BMC0_VARHSYEN | BMC0_VARCSYEN; - } - } - } else { - custom.dmacon = DMAF_SETCLR | DMAF_RASTER | DMAF_SPRITE; - red = red0; - green = green0; - blue = blue0; - if (!IS_OCS) { - custom.hsstrt = hsstrt2hw(par->hsstrt); - custom.hsstop = hsstop2hw(par->hsstop); - custom.vsstrt = vsstrt2hw(par->vsstrt); - custom.vsstop = vsstop2hw(par->vsstop); - custom.beamcon0 = par->beamcon0; - } - } -#if defined(CONFIG_FB_AMIGA_AGA) - if (IS_AGA) { - custom.bplcon3 = bplcon3; - custom.color[0] = rgb2hw8_high(red, green, blue); - custom.bplcon3 = bplcon3 | BPC3_LOCT; - custom.color[0] = rgb2hw8_low(red, green, blue); - custom.bplcon3 = bplcon3; - } else -#endif -#if defined(CONFIG_FB_AMIGA_ECS) - if (par->bplcon0 & BPC0_SHRES) { - u_short color, mask; - int i; - - mask = 0x3333; - color = rgb2hw2(red, green, blue); - for (i = 12; i >= 0; i -= 4) - custom.color[i] = ecs_palette[i] = (ecs_palette[i] & mask) | color; - mask <<= 2; color >>= 2; - for (i = 3; i >= 0; i--) - custom.color[i] = ecs_palette[i] = (ecs_palette[i] & mask) | color; - } else -#endif - custom.color[0] = rgb2hw4(red, green, blue); - is_blanked = do_blank > 0 ? do_blank : 0; -} - -static int ami_get_fix_cursorinfo(struct fb_fix_cursorinfo *fix, - const struct amifb_par *par) -{ - fix->crsr_width = fix->crsr_xsize = par->crsr.width; - fix->crsr_height = fix->crsr_ysize = par->crsr.height; - fix->crsr_color1 = 17; - fix->crsr_color2 = 18; - return 0; -} - -static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, - u_char __user *data, - const struct amifb_par *par) -{ - register u_short *lspr, *sspr; -#ifdef __mc68000__ - register u_long datawords asm ("d2"); -#else - register u_long datawords; -#endif - register short delta; - register u_char color; - short height, width, bits, words; - int size, alloc; - - size = par->crsr.height * par->crsr.width; - alloc = var->height * var->width; - var->height = par->crsr.height; - var->width = par->crsr.width; - var->xspot = par->crsr.spot_x; - var->yspot = par->crsr.spot_y; - if (size > var->height * var->width) - return -ENAMETOOLONG; - if (!access_ok(VERIFY_WRITE, data, size)) - return -EFAULT; - delta = 1 << par->crsr.fmode; - lspr = lofsprite + (delta << 1); - if (par->bplcon0 & BPC0_LACE) - sspr = shfsprite + (delta << 1); - else - sspr = NULL; - for (height = (short)var->height - 1; height >= 0; height--) { - bits = 0; words = delta; datawords = 0; - for (width = (short)var->width - 1; width >= 0; width--) { - if (bits == 0) { - bits = 16; --words; -#ifdef __mc68000__ - asm volatile ("movew %1@(%3:w:2),%0 ; swap %0 ; movew %1@+,%0" - : "=d" (datawords), "=a" (lspr) : "1" (lspr), "d" (delta)); -#else - datawords = (*(lspr + delta) << 16) | (*lspr++); -#endif - } - --bits; -#ifdef __mc68000__ - asm volatile ( - "clrb %0 ; swap %1 ; lslw #1,%1 ; roxlb #1,%0 ; " - "swap %1 ; lslw #1,%1 ; roxlb #1,%0" - : "=d" (color), "=d" (datawords) : "1" (datawords)); -#else - color = (((datawords >> 30) & 2) - | ((datawords >> 15) & 1)); - datawords <<= 1; -#endif - put_user(color, data++); - } - if (bits > 0) { - --words; ++lspr; - } - while (--words >= 0) - ++lspr; -#ifdef __mc68000__ - asm volatile ("lea %0@(%4:w:2),%0 ; tstl %1 ; jeq 1f ; exg %0,%1\n1:" - : "=a" (lspr), "=a" (sspr) : "0" (lspr), "1" (sspr), "d" (delta)); -#else - lspr += delta; - if (sspr) { - u_short *tmp = lspr; - lspr = sspr; - sspr = tmp; - } -#endif - } - return 0; -} - -static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, - u_char __user *data, struct amifb_par *par) -{ - register u_short *lspr, *sspr; -#ifdef __mc68000__ - register u_long datawords asm ("d2"); -#else - register u_long datawords; -#endif - register short delta; - u_short fmode; - short height, width, bits, words; - - if (!var->width) - return -EINVAL; - else if (var->width <= 16) - fmode = TAG_FMODE_1; - else if (var->width <= 32) - fmode = TAG_FMODE_2; - else if (var->width <= 64) - fmode = TAG_FMODE_4; - else - return -EINVAL; - if (fmode > maxfmode) - return -EINVAL; - if (!var->height) - return -EINVAL; - if (!access_ok(VERIFY_READ, data, var->width * var->height)) - return -EFAULT; - delta = 1 << fmode; - lofsprite = shfsprite = (u_short *)spritememory; - lspr = lofsprite + (delta << 1); - if (par->bplcon0 & BPC0_LACE) { - if (((var->height + 4) << fmode << 2) > SPRITEMEMSIZE) - return -EINVAL; - memset(lspr, 0, (var->height + 4) << fmode << 2); - shfsprite += ((var->height + 5)&-2) << fmode; - sspr = shfsprite + (delta << 1); - } else { - if (((var->height + 2) << fmode << 2) > SPRITEMEMSIZE) - return -EINVAL; - memset(lspr, 0, (var->height + 2) << fmode << 2); - sspr = NULL; - } - for (height = (short)var->height - 1; height >= 0; height--) { - bits = 16; words = delta; datawords = 0; - for (width = (short)var->width - 1; width >= 0; width--) { - unsigned long tdata = 0; - get_user(tdata, data); - data++; -#ifdef __mc68000__ - asm volatile ( - "lsrb #1,%2 ; roxlw #1,%0 ; swap %0 ; " - "lsrb #1,%2 ; roxlw #1,%0 ; swap %0" - : "=d" (datawords) - : "0" (datawords), "d" (tdata)); -#else - datawords = ((datawords << 1) & 0xfffefffe); - datawords |= tdata & 1; - datawords |= (tdata & 2) << (16 - 1); -#endif - if (--bits == 0) { - bits = 16; --words; -#ifdef __mc68000__ - asm volatile ("swap %2 ; movew %2,%0@(%3:w:2) ; swap %2 ; movew %2,%0@+" - : "=a" (lspr) : "0" (lspr), "d" (datawords), "d" (delta)); -#else - *(lspr + delta) = (u_short) (datawords >> 16); - *lspr++ = (u_short) (datawords & 0xffff); -#endif - } - } - if (bits < 16) { - --words; -#ifdef __mc68000__ - asm volatile ( - "swap %2 ; lslw %4,%2 ; movew %2,%0@(%3:w:2) ; " - "swap %2 ; lslw %4,%2 ; movew %2,%0@+" - : "=a" (lspr) : "0" (lspr), "d" (datawords), "d" (delta), "d" (bits)); -#else - *(lspr + delta) = (u_short) (datawords >> (16 + bits)); - *lspr++ = (u_short) ((datawords & 0x0000ffff) >> bits); -#endif - } - while (--words >= 0) { -#ifdef __mc68000__ - asm volatile ("moveql #0,%%d0 ; movew %%d0,%0@(%2:w:2) ; movew %%d0,%0@+" - : "=a" (lspr) : "0" (lspr), "d" (delta) : "d0"); -#else - *(lspr + delta) = 0; - *lspr++ = 0; -#endif - } -#ifdef __mc68000__ - asm volatile ("lea %0@(%4:w:2),%0 ; tstl %1 ; jeq 1f ; exg %0,%1\n1:" - : "=a" (lspr), "=a" (sspr) : "0" (lspr), "1" (sspr), "d" (delta)); -#else - lspr += delta; - if (sspr) { - u_short *tmp = lspr; - lspr = sspr; - sspr = tmp; - } -#endif - } - par->crsr.height = var->height; - par->crsr.width = var->width; - par->crsr.spot_x = var->xspot; - par->crsr.spot_y = var->yspot; - par->crsr.fmode = fmode; - if (IS_AGA) { - par->fmode &= ~(FMODE_SPAGEM | FMODE_SPR32); - par->fmode |= sprfetchmode[fmode]; - custom.fmode = par->fmode; - } - return 0; -} - -static int ami_get_cursorstate(struct fb_cursorstate *state, - const struct amifb_par *par) -{ - state->xoffset = par->crsr.crsr_x; - state->yoffset = par->crsr.crsr_y; - state->mode = cursormode; - return 0; -} - -static int ami_set_cursorstate(struct fb_cursorstate *state, - struct amifb_par *par) -{ - par->crsr.crsr_x = state->xoffset; - par->crsr.crsr_y = state->yoffset; - if ((cursormode = state->mode) == FB_CURSOR_OFF) - cursorstate = -1; - do_cursor = 1; - return 0; -} - -static void ami_set_sprite(const struct amifb_par *par) -{ - copins *copl, *cops; - u_short hs, vs, ve; - u_long pl, ps, pt; - short mx, my; - - cops = copdisplay.list[currentcop][0]; - copl = copdisplay.list[currentcop][1]; - ps = pl = ZTWO_PADDR(dummysprite); - mx = par->crsr.crsr_x - par->crsr.spot_x; - my = par->crsr.crsr_y - par->crsr.spot_y; - if (!(par->vmode & FB_VMODE_YWRAP)) { - mx -= par->xoffset; - my -= par->yoffset; - } - if (!is_blanked && cursorstate > 0 && par->crsr.height > 0 && - mx > -(short)par->crsr.width && mx < par->xres && - my > -(short)par->crsr.height && my < par->yres) { - pl = ZTWO_PADDR(lofsprite); - hs = par->diwstrt_h + (mx << par->clk_shift) - 4; - vs = par->diwstrt_v + (my << par->line_shift); - ve = vs + (par->crsr.height << par->line_shift); - if (par->bplcon0 & BPC0_LACE) { - ps = ZTWO_PADDR(shfsprite); - lofsprite[0] = spr2hw_pos(vs, hs); - shfsprite[0] = spr2hw_pos(vs + 1, hs); - if (mod2(vs)) { - lofsprite[1 << par->crsr.fmode] = spr2hw_ctl(vs, hs, ve); - shfsprite[1 << par->crsr.fmode] = spr2hw_ctl(vs + 1, hs, ve + 1); - pt = pl; pl = ps; ps = pt; - } else { - lofsprite[1 << par->crsr.fmode] = spr2hw_ctl(vs, hs, ve + 1); - shfsprite[1 << par->crsr.fmode] = spr2hw_ctl(vs + 1, hs, ve); - } - } else { - lofsprite[0] = spr2hw_pos(vs, hs) | (IS_AGA && (par->fmode & FMODE_BSCAN2) ? 0x80 : 0); - lofsprite[1 << par->crsr.fmode] = spr2hw_ctl(vs, hs, ve); - } - } - copl[cop_spr0ptrh].w[1] = highw(pl); - copl[cop_spr0ptrl].w[1] = loww(pl); - if (par->bplcon0 & BPC0_LACE) { - cops[cop_spr0ptrh].w[1] = highw(ps); - cops[cop_spr0ptrl].w[1] = loww(ps); - } -} - - - /* - * Initialise the Copper Initialisation List - */ - -static void __init ami_init_copper(void) -{ - copins *cop = copdisplay.init; - u_long p; - int i; - - if (!IS_OCS) { - (cop++)->l = CMOVE(BPC0_COLOR | BPC0_SHRES | BPC0_ECSENA, bplcon0); - (cop++)->l = CMOVE(0x0181, diwstrt); - (cop++)->l = CMOVE(0x0281, diwstop); - (cop++)->l = CMOVE(0x0000, diwhigh); - } else - (cop++)->l = CMOVE(BPC0_COLOR, bplcon0); - p = ZTWO_PADDR(dummysprite); - for (i = 0; i < 8; i++) { - (cop++)->l = CMOVE(0, spr[i].pos); - (cop++)->l = CMOVE(highw(p), sprpt[i]); - (cop++)->l = CMOVE2(loww(p), sprpt[i]); - } - - (cop++)->l = CMOVE(IF_SETCLR | IF_COPER, intreq); - copdisplay.wait = cop; - (cop++)->l = CEND; - (cop++)->l = CMOVE(0, copjmp2); - cop->l = CEND; - - custom.cop1lc = (u_short *)ZTWO_PADDR(copdisplay.init); - custom.copjmp1 = 0; -} - -static void ami_reinit_copper(const struct amifb_par *par) -{ - copdisplay.init[cip_bplcon0].w[1] = ~(BPC0_BPU3 | BPC0_BPU2 | BPC0_BPU1 | BPC0_BPU0) & par->bplcon0; - copdisplay.wait->l = CWAIT(32, par->diwstrt_v - 4); -} - - - /* - * Rebuild the Copper List - * - * We only change the things that are not static - */ - -static void ami_rebuild_copper(const struct amifb_par *par) -{ - copins *copl, *cops; - u_short line, h_end1, h_end2; - short i; - u_long p; - - if (IS_AGA && maxfmode + par->clk_shift == 0) - h_end1 = par->diwstrt_h - 64; - else - h_end1 = par->htotal - 32; - h_end2 = par->ddfstop + 64; - - ami_set_sprite(par); - - copl = copdisplay.rebuild[1]; - p = par->bplpt0; - if (par->vmode & FB_VMODE_YWRAP) { - if ((par->vyres - par->yoffset) != 1 || !mod2(par->diwstrt_v)) { - if (par->yoffset > par->vyres - par->yres) { - for (i = 0; i < (short)par->bpp; i++, p += par->next_plane) { - (copl++)->l = CMOVE(highw(p), bplpt[i]); - (copl++)->l = CMOVE2(loww(p), bplpt[i]); - } - line = par->diwstrt_v + ((par->vyres - par->yoffset) << par->line_shift) - 1; - while (line >= 512) { - (copl++)->l = CWAIT(h_end1, 510); - line -= 512; - } - if (line >= 510 && IS_AGA && maxfmode + par->clk_shift == 0) - (copl++)->l = CWAIT(h_end1, line); - else - (copl++)->l = CWAIT(h_end2, line); - p = par->bplpt0wrap; - } - } else - p = par->bplpt0wrap; - } - for (i = 0; i < (short)par->bpp; i++, p += par->next_plane) { - (copl++)->l = CMOVE(highw(p), bplpt[i]); - (copl++)->l = CMOVE2(loww(p), bplpt[i]); - } - copl->l = CEND; - - if (par->bplcon0 & BPC0_LACE) { - cops = copdisplay.rebuild[0]; - p = par->bplpt0; - if (mod2(par->diwstrt_v)) - p -= par->next_line; - else - p += par->next_line; - if (par->vmode & FB_VMODE_YWRAP) { - if ((par->vyres - par->yoffset) != 1 || mod2(par->diwstrt_v)) { - if (par->yoffset > par->vyres - par->yres + 1) { - for (i = 0; i < (short)par->bpp; i++, p += par->next_plane) { - (cops++)->l = CMOVE(highw(p), bplpt[i]); - (cops++)->l = CMOVE2(loww(p), bplpt[i]); - } - line = par->diwstrt_v + ((par->vyres - par->yoffset) << par->line_shift) - 2; - while (line >= 512) { - (cops++)->l = CWAIT(h_end1, 510); - line -= 512; - } - if (line > 510 && IS_AGA && maxfmode + par->clk_shift == 0) - (cops++)->l = CWAIT(h_end1, line); - else - (cops++)->l = CWAIT(h_end2, line); - p = par->bplpt0wrap; - if (mod2(par->diwstrt_v + par->vyres - - par->yoffset)) - p -= par->next_line; - else - p += par->next_line; - } - } else - p = par->bplpt0wrap - par->next_line; - } - for (i = 0; i < (short)par->bpp; i++, p += par->next_plane) { - (cops++)->l = CMOVE(highw(p), bplpt[i]); - (cops++)->l = CMOVE2(loww(p), bplpt[i]); - } - cops->l = CEND; - } -} - - - /* - * Build the Copper List - */ - -static void ami_build_copper(struct fb_info *info) -{ - struct amifb_par *par = info->par; - copins *copl, *cops; - u_long p; - - currentcop = 1 - currentcop; - - copl = copdisplay.list[currentcop][1]; - - (copl++)->l = CWAIT(0, 10); - (copl++)->l = CMOVE(par->bplcon0, bplcon0); - (copl++)->l = CMOVE(0, sprpt[0]); - (copl++)->l = CMOVE2(0, sprpt[0]); - - if (par->bplcon0 & BPC0_LACE) { - cops = copdisplay.list[currentcop][0]; - - (cops++)->l = CWAIT(0, 10); - (cops++)->l = CMOVE(par->bplcon0, bplcon0); - (cops++)->l = CMOVE(0, sprpt[0]); - (cops++)->l = CMOVE2(0, sprpt[0]); - - (copl++)->l = CMOVE(diwstrt2hw(par->diwstrt_h, par->diwstrt_v + 1), diwstrt); - (copl++)->l = CMOVE(diwstop2hw(par->diwstop_h, par->diwstop_v + 1), diwstop); - (cops++)->l = CMOVE(diwstrt2hw(par->diwstrt_h, par->diwstrt_v), diwstrt); - (cops++)->l = CMOVE(diwstop2hw(par->diwstop_h, par->diwstop_v), diwstop); - if (!IS_OCS) { - (copl++)->l = CMOVE(diwhigh2hw(par->diwstrt_h, par->diwstrt_v + 1, - par->diwstop_h, par->diwstop_v + 1), diwhigh); - (cops++)->l = CMOVE(diwhigh2hw(par->diwstrt_h, par->diwstrt_v, - par->diwstop_h, par->diwstop_v), diwhigh); -#if 0 - if (par->beamcon0 & BMC0_VARBEAMEN) { - (copl++)->l = CMOVE(vtotal2hw(par->vtotal), vtotal); - (copl++)->l = CMOVE(vbstrt2hw(par->vbstrt + 1), vbstrt); - (copl++)->l = CMOVE(vbstop2hw(par->vbstop + 1), vbstop); - (cops++)->l = CMOVE(vtotal2hw(par->vtotal), vtotal); - (cops++)->l = CMOVE(vbstrt2hw(par->vbstrt), vbstrt); - (cops++)->l = CMOVE(vbstop2hw(par->vbstop), vbstop); - } -#endif - } - p = ZTWO_PADDR(copdisplay.list[currentcop][0]); - (copl++)->l = CMOVE(highw(p), cop2lc); - (copl++)->l = CMOVE2(loww(p), cop2lc); - p = ZTWO_PADDR(copdisplay.list[currentcop][1]); - (cops++)->l = CMOVE(highw(p), cop2lc); - (cops++)->l = CMOVE2(loww(p), cop2lc); - copdisplay.rebuild[0] = cops; - } else { - (copl++)->l = CMOVE(diwstrt2hw(par->diwstrt_h, par->diwstrt_v), diwstrt); - (copl++)->l = CMOVE(diwstop2hw(par->diwstop_h, par->diwstop_v), diwstop); - if (!IS_OCS) { - (copl++)->l = CMOVE(diwhigh2hw(par->diwstrt_h, par->diwstrt_v, - par->diwstop_h, par->diwstop_v), diwhigh); -#if 0 - if (par->beamcon0 & BMC0_VARBEAMEN) { - (copl++)->l = CMOVE(vtotal2hw(par->vtotal), vtotal); - (copl++)->l = CMOVE(vbstrt2hw(par->vbstrt), vbstrt); - (copl++)->l = CMOVE(vbstop2hw(par->vbstop), vbstop); - } -#endif - } - } - copdisplay.rebuild[1] = copl; - - ami_update_par(info); - ami_rebuild_copper(info->par); -} - - -static void __init amifb_setup_mcap(char *spec) -{ - char *p; - int vmin, vmax, hmin, hmax; - - /* Format for monitor capabilities is: ;;; - * vertical freq. in Hz - * horizontal freq. in kHz - */ - - if (!(p = strsep(&spec, ";")) || !*p) - return; - vmin = simple_strtoul(p, NULL, 10); - if (vmin <= 0) - return; - if (!(p = strsep(&spec, ";")) || !*p) - return; - vmax = simple_strtoul(p, NULL, 10); - if (vmax <= 0 || vmax <= vmin) - return; - if (!(p = strsep(&spec, ";")) || !*p) - return; - hmin = 1000 * simple_strtoul(p, NULL, 10); - if (hmin <= 0) - return; - if (!(p = strsep(&spec, "")) || !*p) - return; - hmax = 1000 * simple_strtoul(p, NULL, 10); - if (hmax <= 0 || hmax <= hmin) - return; - - amifb_hfmin = hmin; - amifb_hfmax = hmax; - amifb_vfmin = vmin; - amifb_vfmax = vmax; -} - -static int __init amifb_setup(char *options) -{ - char *this_opt; - - if (!options || !*options) - return 0; - - while ((this_opt = strsep(&options, ",")) != NULL) { - if (!*this_opt) - continue; - if (!strcmp(this_opt, "inverse")) { - fb_invert_cmaps(); - } else if (!strcmp(this_opt, "ilbm")) - amifb_ilbm = 1; - else if (!strncmp(this_opt, "monitorcap:", 11)) - amifb_setup_mcap(this_opt + 11); - else if (!strncmp(this_opt, "fstart:", 7)) - min_fstrt = simple_strtoul(this_opt + 7, NULL, 0); - else - mode_option = this_opt; - } - - if (min_fstrt < 48) - min_fstrt = 48; - - return 0; -} - - -static int amifb_check_var(struct fb_var_screeninfo *var, - struct fb_info *info) -{ - int err; - struct amifb_par par; - - /* Validate wanted screen parameters */ - err = ami_decode_var(var, &par, info); - if (err) - return err; - - /* Encode (possibly rounded) screen parameters */ - ami_encode_var(var, &par); - return 0; -} - - -static int amifb_set_par(struct fb_info *info) -{ - struct amifb_par *par = info->par; - int error; - - do_vmode_pan = 0; - do_vmode_full = 0; - - /* Decode wanted screen parameters */ - error = ami_decode_var(&info->var, par, info); - if (error) - return error; - - /* Set new videomode */ - ami_build_copper(info); - - /* Set VBlank trigger */ - do_vmode_full = 1; - - /* Update fix for new screen parameters */ - if (par->bpp == 1) { - info->fix.type = FB_TYPE_PACKED_PIXELS; - info->fix.type_aux = 0; - } else if (amifb_ilbm) { - info->fix.type = FB_TYPE_INTERLEAVED_PLANES; - info->fix.type_aux = par->next_line; - } else { - info->fix.type = FB_TYPE_PLANES; - info->fix.type_aux = 0; - } - info->fix.line_length = div8(upx(16 << maxfmode, par->vxres)); - - if (par->vmode & FB_VMODE_YWRAP) { - info->fix.ywrapstep = 1; - info->fix.xpanstep = 0; - info->fix.ypanstep = 0; - info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YWRAP | - FBINFO_READS_FAST; /* override SCROLL_REDRAW */ - } else { - info->fix.ywrapstep = 0; - if (par->vmode & FB_VMODE_SMOOTH_XPAN) - info->fix.xpanstep = 1; - else - info->fix.xpanstep = 16 << maxfmode; - info->fix.ypanstep = 1; - info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; - } - return 0; -} - - - /* - * Set a single color register. The values supplied are already - * rounded down to the hardware's capabilities (according to the - * entries in the var structure). Return != 0 for invalid regno. - */ - -static int amifb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info) -{ - const struct amifb_par *par = info->par; - - if (IS_AGA) { - if (regno > 255) - return 1; - } else if (par->bplcon0 & BPC0_SHRES) { - if (regno > 3) - return 1; - } else { - if (regno > 31) - return 1; - } - red >>= 8; - green >>= 8; - blue >>= 8; - if (!regno) { - red0 = red; - green0 = green; - blue0 = blue; - } - - /* - * Update the corresponding Hardware Color Register, unless it's Color - * Register 0 and the screen is blanked. - * - * VBlank is switched off to protect bplcon3 or ecs_palette[] from - * being changed by ami_do_blank() during the VBlank. - */ - - if (regno || !is_blanked) { -#if defined(CONFIG_FB_AMIGA_AGA) - if (IS_AGA) { - u_short bplcon3 = par->bplcon3; - VBlankOff(); - custom.bplcon3 = bplcon3 | (regno << 8 & 0xe000); - custom.color[regno & 31] = rgb2hw8_high(red, green, - blue); - custom.bplcon3 = bplcon3 | (regno << 8 & 0xe000) | - BPC3_LOCT; - custom.color[regno & 31] = rgb2hw8_low(red, green, - blue); - custom.bplcon3 = bplcon3; - VBlankOn(); - } else -#endif -#if defined(CONFIG_FB_AMIGA_ECS) - if (par->bplcon0 & BPC0_SHRES) { - u_short color, mask; - int i; - - mask = 0x3333; - color = rgb2hw2(red, green, blue); - VBlankOff(); - for (i = regno + 12; i >= (int)regno; i -= 4) - custom.color[i] = ecs_palette[i] = (ecs_palette[i] & mask) | color; - mask <<= 2; color >>= 2; - regno = down16(regno) + mul4(mod4(regno)); - for (i = regno + 3; i >= (int)regno; i--) - custom.color[i] = ecs_palette[i] = (ecs_palette[i] & mask) | color; - VBlankOn(); - } else -#endif - custom.color[regno] = rgb2hw4(red, green, blue); - } - return 0; -} - - - /* - * Blank the display. - */ - -static int amifb_blank(int blank, struct fb_info *info) -{ - do_blank = blank ? blank : -1; - - return 0; -} - - - /* - * Pan or Wrap the Display - * - * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag - */ - -static int amifb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info) -{ - if (var->vmode & FB_VMODE_YWRAP) { - if (var->yoffset < 0 || - var->yoffset >= info->var.yres_virtual || var->xoffset) - return -EINVAL; - } else { - /* - * TODO: There will be problems when xpan!=1, so some columns - * on the right side will never be seen - */ - if (var->xoffset + info->var.xres > - upx(16 << maxfmode, info->var.xres_virtual) || - var->yoffset + info->var.yres > info->var.yres_virtual) - return -EINVAL; - } - ami_pan_var(var, info); - info->var.xoffset = var->xoffset; - info->var.yoffset = var->yoffset; - if (var->vmode & FB_VMODE_YWRAP) - info->var.vmode |= FB_VMODE_YWRAP; - else - info->var.vmode &= ~FB_VMODE_YWRAP; - return 0; -} - - -#if BITS_PER_LONG == 32 -#define BYTES_PER_LONG 4 -#define SHIFT_PER_LONG 5 -#elif BITS_PER_LONG == 64 -#define BYTES_PER_LONG 8 -#define SHIFT_PER_LONG 6 -#else -#define Please update me -#endif - - - /* - * Compose two values, using a bitmask as decision value - * This is equivalent to (a & mask) | (b & ~mask) - */ - -static inline unsigned long comp(unsigned long a, unsigned long b, - unsigned long mask) -{ - return ((a ^ b) & mask) ^ b; -} - - -static inline unsigned long xor(unsigned long a, unsigned long b, - unsigned long mask) -{ - return (a & mask) ^ b; -} - - - /* - * Unaligned forward bit copy using 32-bit or 64-bit memory accesses - */ - -static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src, - int src_idx, u32 n) -{ - unsigned long first, last; - int shift = dst_idx - src_idx, left, right; - unsigned long d0, d1; - int m; - - if (!n) - return; - - shift = dst_idx - src_idx; - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx + n) % BITS_PER_LONG)); - - if (!shift) { - // Same alignment for source and dest - - if (dst_idx + n <= BITS_PER_LONG) { - // Single word - if (last) - first &= last; - *dst = comp(*src, *dst, first); - } else { - // Multiple destination words - // Leading bits - if (first) { - *dst = comp(*src, *dst, first); - dst++; - src++; - n -= BITS_PER_LONG - dst_idx; - } - - // Main chunk - n /= BITS_PER_LONG; - while (n >= 8) { - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - n -= 8; - } - while (n--) - *dst++ = *src++; - - // Trailing bits - if (last) - *dst = comp(*src, *dst, last); - } - } else { - // Different alignment for source and dest - - right = shift & (BITS_PER_LONG - 1); - left = -shift & (BITS_PER_LONG - 1); - - if (dst_idx + n <= BITS_PER_LONG) { - // Single destination word - if (last) - first &= last; - if (shift > 0) { - // Single source word - *dst = comp(*src >> right, *dst, first); - } else if (src_idx + n <= BITS_PER_LONG) { - // Single source word - *dst = comp(*src << left, *dst, first); - } else { - // 2 source words - d0 = *src++; - d1 = *src; - *dst = comp(d0 << left | d1 >> right, *dst, - first); - } - } else { - // Multiple destination words - d0 = *src++; - // Leading bits - if (shift > 0) { - // Single source word - *dst = comp(d0 >> right, *dst, first); - dst++; - n -= BITS_PER_LONG - dst_idx; - } else { - // 2 source words - d1 = *src++; - *dst = comp(d0 << left | d1 >> right, *dst, - first); - d0 = d1; - dst++; - n -= BITS_PER_LONG - dst_idx; - } - - // Main chunk - m = n % BITS_PER_LONG; - n /= BITS_PER_LONG; - while (n >= 4) { - d1 = *src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - d1 = *src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - d1 = *src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - d1 = *src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - n -= 4; - } - while (n--) { - d1 = *src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - } - - // Trailing bits - if (last) { - if (m <= right) { - // Single source word - *dst = comp(d0 << left, *dst, last); - } else { - // 2 source words - d1 = *src; - *dst = comp(d0 << left | d1 >> right, - *dst, last); - } - } - } - } -} - - - /* - * Unaligned reverse bit copy using 32-bit or 64-bit memory accesses - */ - -static void bitcpy_rev(unsigned long *dst, int dst_idx, - const unsigned long *src, int src_idx, u32 n) -{ - unsigned long first, last; - int shift = dst_idx - src_idx, left, right; - unsigned long d0, d1; - int m; - - if (!n) - return; - - dst += (n - 1) / BITS_PER_LONG; - src += (n - 1) / BITS_PER_LONG; - if ((n - 1) % BITS_PER_LONG) { - dst_idx += (n - 1) % BITS_PER_LONG; - dst += dst_idx >> SHIFT_PER_LONG; - dst_idx &= BITS_PER_LONG - 1; - src_idx += (n - 1) % BITS_PER_LONG; - src += src_idx >> SHIFT_PER_LONG; - src_idx &= BITS_PER_LONG - 1; - } - - shift = dst_idx - src_idx; - first = ~0UL << (BITS_PER_LONG - 1 - dst_idx); - last = ~(~0UL << (BITS_PER_LONG - 1 - ((dst_idx - n) % BITS_PER_LONG))); - - if (!shift) { - // Same alignment for source and dest - - if ((unsigned long)dst_idx + 1 >= n) { - // Single word - if (last) - first &= last; - *dst = comp(*src, *dst, first); - } else { - // Multiple destination words - // Leading bits - if (first) { - *dst = comp(*src, *dst, first); - dst--; - src--; - n -= dst_idx + 1; - } - - // Main chunk - n /= BITS_PER_LONG; - while (n >= 8) { - *dst-- = *src--; - *dst-- = *src--; - *dst-- = *src--; - *dst-- = *src--; - *dst-- = *src--; - *dst-- = *src--; - *dst-- = *src--; - *dst-- = *src--; - n -= 8; - } - while (n--) - *dst-- = *src--; - - // Trailing bits - if (last) - *dst = comp(*src, *dst, last); - } - } else { - // Different alignment for source and dest - - right = shift & (BITS_PER_LONG - 1); - left = -shift & (BITS_PER_LONG - 1); - - if ((unsigned long)dst_idx + 1 >= n) { - // Single destination word - if (last) - first &= last; - if (shift < 0) { - // Single source word - *dst = comp(*src << left, *dst, first); - } else if (1 + (unsigned long)src_idx >= n) { - // Single source word - *dst = comp(*src >> right, *dst, first); - } else { - // 2 source words - d0 = *src--; - d1 = *src; - *dst = comp(d0 >> right | d1 << left, *dst, - first); - } - } else { - // Multiple destination words - d0 = *src--; - // Leading bits - if (shift < 0) { - // Single source word - *dst = comp(d0 << left, *dst, first); - dst--; - n -= dst_idx + 1; - } else { - // 2 source words - d1 = *src--; - *dst = comp(d0 >> right | d1 << left, *dst, - first); - d0 = d1; - dst--; - n -= dst_idx + 1; - } - - // Main chunk - m = n % BITS_PER_LONG; - n /= BITS_PER_LONG; - while (n >= 4) { - d1 = *src--; - *dst-- = d0 >> right | d1 << left; - d0 = d1; - d1 = *src--; - *dst-- = d0 >> right | d1 << left; - d0 = d1; - d1 = *src--; - *dst-- = d0 >> right | d1 << left; - d0 = d1; - d1 = *src--; - *dst-- = d0 >> right | d1 << left; - d0 = d1; - n -= 4; - } - while (n--) { - d1 = *src--; - *dst-- = d0 >> right | d1 << left; - d0 = d1; - } - - // Trailing bits - if (last) { - if (m <= left) { - // Single source word - *dst = comp(d0 >> right, *dst, last); - } else { - // 2 source words - d1 = *src; - *dst = comp(d0 >> right | d1 << left, - *dst, last); - } - } - } - } -} - - - /* - * Unaligned forward inverting bit copy using 32-bit or 64-bit memory - * accesses - */ - -static void bitcpy_not(unsigned long *dst, int dst_idx, - const unsigned long *src, int src_idx, u32 n) -{ - unsigned long first, last; - int shift = dst_idx - src_idx, left, right; - unsigned long d0, d1; - int m; - - if (!n) - return; - - shift = dst_idx - src_idx; - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx + n) % BITS_PER_LONG)); - - if (!shift) { - // Same alignment for source and dest - - if (dst_idx + n <= BITS_PER_LONG) { - // Single word - if (last) - first &= last; - *dst = comp(~*src, *dst, first); - } else { - // Multiple destination words - // Leading bits - if (first) { - *dst = comp(~*src, *dst, first); - dst++; - src++; - n -= BITS_PER_LONG - dst_idx; - } - - // Main chunk - n /= BITS_PER_LONG; - while (n >= 8) { - *dst++ = ~*src++; - *dst++ = ~*src++; - *dst++ = ~*src++; - *dst++ = ~*src++; - *dst++ = ~*src++; - *dst++ = ~*src++; - *dst++ = ~*src++; - *dst++ = ~*src++; - n -= 8; - } - while (n--) - *dst++ = ~*src++; - - // Trailing bits - if (last) - *dst = comp(~*src, *dst, last); - } - } else { - // Different alignment for source and dest - - right = shift & (BITS_PER_LONG - 1); - left = -shift & (BITS_PER_LONG - 1); - - if (dst_idx + n <= BITS_PER_LONG) { - // Single destination word - if (last) - first &= last; - if (shift > 0) { - // Single source word - *dst = comp(~*src >> right, *dst, first); - } else if (src_idx + n <= BITS_PER_LONG) { - // Single source word - *dst = comp(~*src << left, *dst, first); - } else { - // 2 source words - d0 = ~*src++; - d1 = ~*src; - *dst = comp(d0 << left | d1 >> right, *dst, - first); - } - } else { - // Multiple destination words - d0 = ~*src++; - // Leading bits - if (shift > 0) { - // Single source word - *dst = comp(d0 >> right, *dst, first); - dst++; - n -= BITS_PER_LONG - dst_idx; - } else { - // 2 source words - d1 = ~*src++; - *dst = comp(d0 << left | d1 >> right, *dst, - first); - d0 = d1; - dst++; - n -= BITS_PER_LONG - dst_idx; - } - - // Main chunk - m = n % BITS_PER_LONG; - n /= BITS_PER_LONG; - while (n >= 4) { - d1 = ~*src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - d1 = ~*src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - d1 = ~*src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - d1 = ~*src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - n -= 4; - } - while (n--) { - d1 = ~*src++; - *dst++ = d0 << left | d1 >> right; - d0 = d1; - } - - // Trailing bits - if (last) { - if (m <= right) { - // Single source word - *dst = comp(d0 << left, *dst, last); - } else { - // 2 source words - d1 = ~*src; - *dst = comp(d0 << left | d1 >> right, - *dst, last); - } - } - } - } -} - - - /* - * Unaligned 32-bit pattern fill using 32/64-bit memory accesses - */ - -static void bitfill32(unsigned long *dst, int dst_idx, u32 pat, u32 n) -{ - unsigned long val = pat; - unsigned long first, last; - - if (!n) - return; - -#if BITS_PER_LONG == 64 - val |= val << 32; -#endif - - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx + n) % BITS_PER_LONG)); - - if (dst_idx + n <= BITS_PER_LONG) { - // Single word - if (last) - first &= last; - *dst = comp(val, *dst, first); - } else { - // Multiple destination words - // Leading bits - if (first) { - *dst = comp(val, *dst, first); - dst++; - n -= BITS_PER_LONG - dst_idx; - } - - // Main chunk - n /= BITS_PER_LONG; - while (n >= 8) { - *dst++ = val; - *dst++ = val; - *dst++ = val; - *dst++ = val; - *dst++ = val; - *dst++ = val; - *dst++ = val; - *dst++ = val; - n -= 8; - } - while (n--) - *dst++ = val; - - // Trailing bits - if (last) - *dst = comp(val, *dst, last); - } -} - - - /* - * Unaligned 32-bit pattern xor using 32/64-bit memory accesses - */ - -static void bitxor32(unsigned long *dst, int dst_idx, u32 pat, u32 n) -{ - unsigned long val = pat; - unsigned long first, last; - - if (!n) - return; - -#if BITS_PER_LONG == 64 - val |= val << 32; -#endif - - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx + n) % BITS_PER_LONG)); - - if (dst_idx + n <= BITS_PER_LONG) { - // Single word - if (last) - first &= last; - *dst = xor(val, *dst, first); - } else { - // Multiple destination words - // Leading bits - if (first) { - *dst = xor(val, *dst, first); - dst++; - n -= BITS_PER_LONG - dst_idx; - } - - // Main chunk - n /= BITS_PER_LONG; - while (n >= 4) { - *dst++ ^= val; - *dst++ ^= val; - *dst++ ^= val; - *dst++ ^= val; - n -= 4; - } - while (n--) - *dst++ ^= val; - - // Trailing bits - if (last) - *dst = xor(val, *dst, last); - } -} - -static inline void fill_one_line(int bpp, unsigned long next_plane, - unsigned long *dst, int dst_idx, u32 n, - u32 color) -{ - while (1) { - dst += dst_idx >> SHIFT_PER_LONG; - dst_idx &= (BITS_PER_LONG - 1); - bitfill32(dst, dst_idx, color & 1 ? ~0 : 0, n); - if (!--bpp) - break; - color >>= 1; - dst_idx += next_plane * 8; - } -} - -static inline void xor_one_line(int bpp, unsigned long next_plane, - unsigned long *dst, int dst_idx, u32 n, - u32 color) -{ - while (color) { - dst += dst_idx >> SHIFT_PER_LONG; - dst_idx &= (BITS_PER_LONG - 1); - bitxor32(dst, dst_idx, color & 1 ? ~0 : 0, n); - if (!--bpp) - break; - color >>= 1; - dst_idx += next_plane * 8; - } -} - - -static void amifb_fillrect(struct fb_info *info, - const struct fb_fillrect *rect) -{ - struct amifb_par *par = info->par; - int dst_idx, x2, y2; - unsigned long *dst; - u32 width, height; - - if (!rect->width || !rect->height) - return; - - /* - * We could use hardware clipping but on many cards you get around - * hardware clipping by writing to framebuffer directly. - * */ - x2 = rect->dx + rect->width; - y2 = rect->dy + rect->height; - x2 = x2 < info->var.xres_virtual ? x2 : info->var.xres_virtual; - y2 = y2 < info->var.yres_virtual ? y2 : info->var.yres_virtual; - width = x2 - rect->dx; - height = y2 - rect->dy; - - dst = (unsigned long *) - ((unsigned long)info->screen_base & ~(BYTES_PER_LONG - 1)); - dst_idx = ((unsigned long)info->screen_base & (BYTES_PER_LONG - 1)) * 8; - dst_idx += rect->dy * par->next_line * 8 + rect->dx; - while (height--) { - switch (rect->rop) { - case ROP_COPY: - fill_one_line(info->var.bits_per_pixel, - par->next_plane, dst, dst_idx, width, - rect->color); - break; - - case ROP_XOR: - xor_one_line(info->var.bits_per_pixel, par->next_plane, - dst, dst_idx, width, rect->color); - break; - } - dst_idx += par->next_line * 8; - } -} - -static inline void copy_one_line(int bpp, unsigned long next_plane, - unsigned long *dst, int dst_idx, - unsigned long *src, int src_idx, u32 n) -{ - while (1) { - dst += dst_idx >> SHIFT_PER_LONG; - dst_idx &= (BITS_PER_LONG - 1); - src += src_idx >> SHIFT_PER_LONG; - src_idx &= (BITS_PER_LONG - 1); - bitcpy(dst, dst_idx, src, src_idx, n); - if (!--bpp) - break; - dst_idx += next_plane * 8; - src_idx += next_plane * 8; - } -} - -static inline void copy_one_line_rev(int bpp, unsigned long next_plane, - unsigned long *dst, int dst_idx, - unsigned long *src, int src_idx, u32 n) -{ - while (1) { - dst += dst_idx >> SHIFT_PER_LONG; - dst_idx &= (BITS_PER_LONG - 1); - src += src_idx >> SHIFT_PER_LONG; - src_idx &= (BITS_PER_LONG - 1); - bitcpy_rev(dst, dst_idx, src, src_idx, n); - if (!--bpp) - break; - dst_idx += next_plane * 8; - src_idx += next_plane * 8; - } -} - - -static void amifb_copyarea(struct fb_info *info, - const struct fb_copyarea *area) -{ - struct amifb_par *par = info->par; - int x2, y2; - u32 dx, dy, sx, sy, width, height; - unsigned long *dst, *src; - int dst_idx, src_idx; - int rev_copy = 0; - - /* clip the destination */ - x2 = area->dx + area->width; - y2 = area->dy + area->height; - dx = area->dx > 0 ? area->dx : 0; - dy = area->dy > 0 ? area->dy : 0; - x2 = x2 < info->var.xres_virtual ? x2 : info->var.xres_virtual; - y2 = y2 < info->var.yres_virtual ? y2 : info->var.yres_virtual; - width = x2 - dx; - height = y2 - dy; - - if (area->sx + dx < area->dx || area->sy + dy < area->dy) - return; - - /* update sx,sy */ - sx = area->sx + (dx - area->dx); - sy = area->sy + (dy - area->dy); - - /* the source must be completely inside the virtual screen */ - if (sx + width > info->var.xres_virtual || - sy + height > info->var.yres_virtual) - return; - - if (dy > sy || (dy == sy && dx > sx)) { - dy += height; - sy += height; - rev_copy = 1; - } - dst = (unsigned long *) - ((unsigned long)info->screen_base & ~(BYTES_PER_LONG - 1)); - src = dst; - dst_idx = ((unsigned long)info->screen_base & (BYTES_PER_LONG - 1)) * 8; - src_idx = dst_idx; - dst_idx += dy * par->next_line * 8 + dx; - src_idx += sy * par->next_line * 8 + sx; - if (rev_copy) { - while (height--) { - dst_idx -= par->next_line * 8; - src_idx -= par->next_line * 8; - copy_one_line_rev(info->var.bits_per_pixel, - par->next_plane, dst, dst_idx, src, - src_idx, width); - } - } else { - while (height--) { - copy_one_line(info->var.bits_per_pixel, - par->next_plane, dst, dst_idx, src, - src_idx, width); - dst_idx += par->next_line * 8; - src_idx += par->next_line * 8; - } - } -} - - -static inline void expand_one_line(int bpp, unsigned long next_plane, - unsigned long *dst, int dst_idx, u32 n, - const u8 *data, u32 bgcolor, u32 fgcolor) -{ - const unsigned long *src; - int src_idx; - - while (1) { - dst += dst_idx >> SHIFT_PER_LONG; - dst_idx &= (BITS_PER_LONG - 1); - if ((bgcolor ^ fgcolor) & 1) { - src = (unsigned long *) - ((unsigned long)data & ~(BYTES_PER_LONG - 1)); - src_idx = ((unsigned long)data & (BYTES_PER_LONG - 1)) * 8; - if (fgcolor & 1) - bitcpy(dst, dst_idx, src, src_idx, n); - else - bitcpy_not(dst, dst_idx, src, src_idx, n); - /* set or clear */ - } else - bitfill32(dst, dst_idx, fgcolor & 1 ? ~0 : 0, n); - if (!--bpp) - break; - bgcolor >>= 1; - fgcolor >>= 1; - dst_idx += next_plane * 8; - } -} - - -static void amifb_imageblit(struct fb_info *info, const struct fb_image *image) -{ - struct amifb_par *par = info->par; - int x2, y2; - unsigned long *dst; - int dst_idx; - const char *src; - u32 dx, dy, width, height, pitch; - - /* - * We could use hardware clipping but on many cards you get around - * hardware clipping by writing to framebuffer directly like we are - * doing here. - */ - x2 = image->dx + image->width; - y2 = image->dy + image->height; - dx = image->dx; - dy = image->dy; - x2 = x2 < info->var.xres_virtual ? x2 : info->var.xres_virtual; - y2 = y2 < info->var.yres_virtual ? y2 : info->var.yres_virtual; - width = x2 - dx; - height = y2 - dy; - - if (image->depth == 1) { - dst = (unsigned long *) - ((unsigned long)info->screen_base & ~(BYTES_PER_LONG - 1)); - dst_idx = ((unsigned long)info->screen_base & (BYTES_PER_LONG - 1)) * 8; - dst_idx += dy * par->next_line * 8 + dx; - src = image->data; - pitch = (image->width + 7) / 8; - while (height--) { - expand_one_line(info->var.bits_per_pixel, - par->next_plane, dst, dst_idx, width, - src, image->bg_color, - image->fg_color); - dst_idx += par->next_line * 8; - src += pitch; - } - } else { - c2p_planar(info->screen_base, image->data, dx, dy, width, - height, par->next_line, par->next_plane, - image->width, info->var.bits_per_pixel); - } -} - - - /* - * Amiga Frame Buffer Specific ioctls - */ - -static int amifb_ioctl(struct fb_info *info, - unsigned int cmd, unsigned long arg) -{ - union { - struct fb_fix_cursorinfo fix; - struct fb_var_cursorinfo var; - struct fb_cursorstate state; - } crsr; - void __user *argp = (void __user *)arg; - int i; - - switch (cmd) { - case FBIOGET_FCURSORINFO: - i = ami_get_fix_cursorinfo(&crsr.fix, info->par); - if (i) - return i; - return copy_to_user(argp, &crsr.fix, - sizeof(crsr.fix)) ? -EFAULT : 0; - - case FBIOGET_VCURSORINFO: - i = ami_get_var_cursorinfo(&crsr.var, - ((struct fb_var_cursorinfo __user *)arg)->data, - info->par); - if (i) - return i; - return copy_to_user(argp, &crsr.var, - sizeof(crsr.var)) ? -EFAULT : 0; - - case FBIOPUT_VCURSORINFO: - if (copy_from_user(&crsr.var, argp, sizeof(crsr.var))) - return -EFAULT; - return ami_set_var_cursorinfo(&crsr.var, - ((struct fb_var_cursorinfo __user *)arg)->data, - info->par); - - case FBIOGET_CURSORSTATE: - i = ami_get_cursorstate(&crsr.state, info->par); - if (i) - return i; - return copy_to_user(argp, &crsr.state, - sizeof(crsr.state)) ? -EFAULT : 0; - - case FBIOPUT_CURSORSTATE: - if (copy_from_user(&crsr.state, argp, sizeof(crsr.state))) - return -EFAULT; - return ami_set_cursorstate(&crsr.state, info->par); - } - return -EINVAL; -} - - - /* - * Flash the cursor (called by VBlank interrupt) - */ - -static int flash_cursor(void) -{ - static int cursorcount = 1; - - if (cursormode == FB_CURSOR_FLASH) { - if (!--cursorcount) { - cursorstate = -cursorstate; - cursorcount = cursorrate; - if (!is_blanked) - return 1; - } - } - return 0; -} - - /* - * VBlank Display Interrupt - */ - -static irqreturn_t amifb_interrupt(int irq, void *dev_id) -{ - struct amifb_par *par = dev_id; - - if (do_vmode_pan || do_vmode_full) - ami_update_display(par); - - if (do_vmode_full) - ami_init_display(par); - - if (do_vmode_pan) { - flash_cursor(); - ami_rebuild_copper(par); - do_cursor = do_vmode_pan = 0; - } else if (do_cursor) { - flash_cursor(); - ami_set_sprite(par); - do_cursor = 0; - } else { - if (flash_cursor()) - ami_set_sprite(par); - } - - if (do_blank) { - ami_do_blank(par); - do_blank = 0; - } - - if (do_vmode_full) { - ami_reinit_copper(par); - do_vmode_full = 0; - } - return IRQ_HANDLED; -} - - -static struct fb_ops amifb_ops = { - .owner = THIS_MODULE, - .fb_check_var = amifb_check_var, - .fb_set_par = amifb_set_par, - .fb_setcolreg = amifb_setcolreg, - .fb_blank = amifb_blank, - .fb_pan_display = amifb_pan_display, - .fb_fillrect = amifb_fillrect, - .fb_copyarea = amifb_copyarea, - .fb_imageblit = amifb_imageblit, - .fb_ioctl = amifb_ioctl, -}; - - - /* - * Allocate, Clear and Align a Block of Chip Memory - */ - -static void *aligned_chipptr; - -static inline u_long __init chipalloc(u_long size) -{ - aligned_chipptr = amiga_chip_alloc(size, "amifb [RAM]"); - if (!aligned_chipptr) { - pr_err("amifb: No Chip RAM for frame buffer"); - return 0; - } - memset(aligned_chipptr, 0, size); - return (u_long)aligned_chipptr; -} - -static inline void chipfree(void) -{ - if (aligned_chipptr) - amiga_chip_free(aligned_chipptr); -} - - - /* - * Initialisation - */ - -static int __init amifb_probe(struct platform_device *pdev) -{ - struct fb_info *info; - int tag, i, err = 0; - u_long chipptr; - u_int defmode; - -#ifndef MODULE - char *option = NULL; - - if (fb_get_options("amifb", &option)) { - amifb_video_off(); - return -ENODEV; - } - amifb_setup(option); -#endif - custom.dmacon = DMAF_ALL | DMAF_MASTER; - - info = framebuffer_alloc(sizeof(struct amifb_par), &pdev->dev); - if (!info) { - dev_err(&pdev->dev, "framebuffer_alloc failed\n"); - return -ENOMEM; - } - - strcpy(info->fix.id, "Amiga "); - info->fix.visual = FB_VISUAL_PSEUDOCOLOR; - info->fix.accel = FB_ACCEL_AMIGABLITT; - - switch (amiga_chipset) { -#ifdef CONFIG_FB_AMIGA_OCS - case CS_OCS: - strcat(info->fix.id, "OCS"); -default_chipset: - chipset = TAG_OCS; - maxdepth[TAG_SHRES] = 0; /* OCS means no SHRES */ - maxdepth[TAG_HIRES] = 4; - maxdepth[TAG_LORES] = 6; - maxfmode = TAG_FMODE_1; - defmode = amiga_vblank == 50 ? DEFMODE_PAL : DEFMODE_NTSC; - info->fix.smem_len = VIDEOMEMSIZE_OCS; - break; -#endif /* CONFIG_FB_AMIGA_OCS */ - -#ifdef CONFIG_FB_AMIGA_ECS - case CS_ECS: - strcat(info->fix.id, "ECS"); - chipset = TAG_ECS; - maxdepth[TAG_SHRES] = 2; - maxdepth[TAG_HIRES] = 4; - maxdepth[TAG_LORES] = 6; - maxfmode = TAG_FMODE_1; - if (AMIGAHW_PRESENT(AMBER_FF)) - defmode = amiga_vblank == 50 ? DEFMODE_AMBER_PAL - : DEFMODE_AMBER_NTSC; - else - defmode = amiga_vblank == 50 ? DEFMODE_PAL - : DEFMODE_NTSC; - if (amiga_chip_avail() - CHIPRAM_SAFETY_LIMIT > - VIDEOMEMSIZE_ECS_2M) - info->fix.smem_len = VIDEOMEMSIZE_ECS_2M; - else - info->fix.smem_len = VIDEOMEMSIZE_ECS_1M; - break; -#endif /* CONFIG_FB_AMIGA_ECS */ - -#ifdef CONFIG_FB_AMIGA_AGA - case CS_AGA: - strcat(info->fix.id, "AGA"); - chipset = TAG_AGA; - maxdepth[TAG_SHRES] = 8; - maxdepth[TAG_HIRES] = 8; - maxdepth[TAG_LORES] = 8; - maxfmode = TAG_FMODE_4; - defmode = DEFMODE_AGA; - if (amiga_chip_avail() - CHIPRAM_SAFETY_LIMIT > - VIDEOMEMSIZE_AGA_2M) - info->fix.smem_len = VIDEOMEMSIZE_AGA_2M; - else - info->fix.smem_len = VIDEOMEMSIZE_AGA_1M; - break; -#endif /* CONFIG_FB_AMIGA_AGA */ - - default: -#ifdef CONFIG_FB_AMIGA_OCS - printk("Unknown graphics chipset, defaulting to OCS\n"); - strcat(info->fix.id, "Unknown"); - goto default_chipset; -#else /* CONFIG_FB_AMIGA_OCS */ - err = -ENODEV; - goto release; -#endif /* CONFIG_FB_AMIGA_OCS */ - break; - } - - /* - * Calculate the Pixel Clock Values for this Machine - */ - - { - u_long tmp = DIVUL(200000000000ULL, amiga_eclock); - - pixclock[TAG_SHRES] = (tmp + 4) / 8; /* SHRES: 35 ns / 28 MHz */ - pixclock[TAG_HIRES] = (tmp + 2) / 4; /* HIRES: 70 ns / 14 MHz */ - pixclock[TAG_LORES] = (tmp + 1) / 2; /* LORES: 140 ns / 7 MHz */ - } - - /* - * Replace the Tag Values with the Real Pixel Clock Values - */ - - for (i = 0; i < NUM_TOTAL_MODES; i++) { - struct fb_videomode *mode = &ami_modedb[i]; - tag = mode->pixclock; - if (tag == TAG_SHRES || tag == TAG_HIRES || tag == TAG_LORES) { - mode->pixclock = pixclock[tag]; - } - } - - if (amifb_hfmin) { - info->monspecs.hfmin = amifb_hfmin; - info->monspecs.hfmax = amifb_hfmax; - info->monspecs.vfmin = amifb_vfmin; - info->monspecs.vfmax = amifb_vfmax; - } else { - /* - * These are for a typical Amiga monitor (e.g. A1960) - */ - info->monspecs.hfmin = 15000; - info->monspecs.hfmax = 38000; - info->monspecs.vfmin = 49; - info->monspecs.vfmax = 90; - } - - info->fbops = &amifb_ops; - info->flags = FBINFO_DEFAULT; - info->device = &pdev->dev; - - if (!fb_find_mode(&info->var, info, mode_option, ami_modedb, - NUM_TOTAL_MODES, &ami_modedb[defmode], 4)) { - err = -EINVAL; - goto release; - } - - fb_videomode_to_modelist(ami_modedb, NUM_TOTAL_MODES, - &info->modelist); - - round_down_bpp = 0; - chipptr = chipalloc(info->fix.smem_len + SPRITEMEMSIZE + - DUMMYSPRITEMEMSIZE + COPINITSIZE + - 4 * COPLISTSIZE); - if (!chipptr) { - err = -ENOMEM; - goto release; - } - - assignchunk(videomemory, u_long, chipptr, info->fix.smem_len); - assignchunk(spritememory, u_long, chipptr, SPRITEMEMSIZE); - assignchunk(dummysprite, u_short *, chipptr, DUMMYSPRITEMEMSIZE); - assignchunk(copdisplay.init, copins *, chipptr, COPINITSIZE); - assignchunk(copdisplay.list[0][0], copins *, chipptr, COPLISTSIZE); - assignchunk(copdisplay.list[0][1], copins *, chipptr, COPLISTSIZE); - assignchunk(copdisplay.list[1][0], copins *, chipptr, COPLISTSIZE); - assignchunk(copdisplay.list[1][1], copins *, chipptr, COPLISTSIZE); - - /* - * access the videomem with writethrough cache - */ - info->fix.smem_start = (u_long)ZTWO_PADDR(videomemory); - videomemory = (u_long)ioremap_writethrough(info->fix.smem_start, - info->fix.smem_len); - if (!videomemory) { - dev_warn(&pdev->dev, - "Unable to map videomem cached writethrough\n"); - info->screen_base = ZTWO_VADDR(info->fix.smem_start); - } else - info->screen_base = (char *)videomemory; - - memset(dummysprite, 0, DUMMYSPRITEMEMSIZE); - - /* - * Make sure the Copper has something to do - */ - ami_init_copper(); - - /* - * Enable Display DMA - */ - custom.dmacon = DMAF_SETCLR | DMAF_MASTER | DMAF_RASTER | DMAF_COPPER | - DMAF_BLITTER | DMAF_SPRITE; - - err = request_irq(IRQ_AMIGA_COPPER, amifb_interrupt, 0, - "fb vertb handler", info->par); - if (err) - goto disable_dma; - - err = fb_alloc_cmap(&info->cmap, 1 << info->var.bits_per_pixel, 0); - if (err) - goto free_irq; - - dev_set_drvdata(&pdev->dev, info); - - err = register_framebuffer(info); - if (err) - goto unset_drvdata; - - fb_info(info, "%s frame buffer device, using %dK of video memory\n", - info->fix.id, info->fix.smem_len>>10); - - return 0; - -unset_drvdata: - fb_dealloc_cmap(&info->cmap); -free_irq: - free_irq(IRQ_AMIGA_COPPER, info->par); -disable_dma: - custom.dmacon = DMAF_ALL | DMAF_MASTER; - if (videomemory) - iounmap((void *)videomemory); - chipfree(); -release: - framebuffer_release(info); - return err; -} - - -static int __exit amifb_remove(struct platform_device *pdev) -{ - struct fb_info *info = dev_get_drvdata(&pdev->dev); - - unregister_framebuffer(info); - fb_dealloc_cmap(&info->cmap); - free_irq(IRQ_AMIGA_COPPER, info->par); - custom.dmacon = DMAF_ALL | DMAF_MASTER; - if (videomemory) - iounmap((void *)videomemory); - chipfree(); - framebuffer_release(info); - amifb_video_off(); - return 0; -} - -static struct platform_driver amifb_driver = { - .remove = __exit_p(amifb_remove), - .driver = { - .name = "amiga-video", - .owner = THIS_MODULE, - }, -}; - -module_platform_driver_probe(amifb_driver, amifb_probe); - -MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:amiga-video"); diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c deleted file mode 100644 index 1b0b233b8b39..000000000000 --- a/drivers/video/arcfb.c +++ /dev/null @@ -1,667 +0,0 @@ -/* - * linux/drivers/video/arcfb.c -- FB driver for Arc monochrome LCD board - * - * Copyright (C) 2005, Jaya Kumar - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * Layout is based on skeletonfb.c by James Simmons and Geert Uytterhoeven. - * - * This driver was written to be used with the Arc LCD board. Arc uses a - * set of KS108 chips that control individual 64x64 LCD matrices. The board - * can be paneled in a variety of setups such as 2x1=128x64, 4x4=256x256 and - * so on. The interface between the board and the host is TTL based GPIO. The - * GPIO requirements are 8 writable data lines and 4+n lines for control. On a - * GPIO-less system, the board can be tested by connecting the respective sigs - * up to a parallel port connector. The driver requires the IO addresses for - * data and control GPIO at load time. It is unable to probe for the - * existence of the LCD so it must be told at load time whether it should - * be enabled or not. - * - * Todo: - * - testing with 4x4 - * - testing with interrupt hw - * - * General notes: - * - User must set tuhold. It's in microseconds. According to the 108 spec, - * the hold time is supposed to be at least 1 microsecond. - * - User must set num_cols=x num_rows=y, eg: x=2 means 128 - * - User must set arcfb_enable=1 to enable it - * - User must set dio_addr=0xIOADDR cio_addr=0xIOADDR - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define floor8(a) (a&(~0x07)) -#define floorXres(a,xres) (a&(~(xres - 1))) -#define iceil8(a) (((int)((a+7)/8))*8) -#define ceil64(a) (a|0x3F) -#define ceilXres(a,xres) (a|(xres - 1)) - -/* ks108 chipset specific defines and code */ - -#define KS_SET_DPY_START_LINE 0xC0 -#define KS_SET_PAGE_NUM 0xB8 -#define KS_SET_X 0x40 -#define KS_CEHI 0x01 -#define KS_CELO 0x00 -#define KS_SEL_CMD 0x08 -#define KS_SEL_DATA 0x00 -#define KS_DPY_ON 0x3F -#define KS_DPY_OFF 0x3E -#define KS_INTACK 0x40 -#define KS_CLRINT 0x02 - -struct arcfb_par { - unsigned long dio_addr; - unsigned long cio_addr; - unsigned long c2io_addr; - atomic_t ref_count; - unsigned char cslut[9]; - struct fb_info *info; - unsigned int irq; - spinlock_t lock; -}; - -static struct fb_fix_screeninfo arcfb_fix = { - .id = "arcfb", - .type = FB_TYPE_PACKED_PIXELS, - .visual = FB_VISUAL_MONO01, - .xpanstep = 0, - .ypanstep = 1, - .ywrapstep = 0, - .accel = FB_ACCEL_NONE, -}; - -static struct fb_var_screeninfo arcfb_var = { - .xres = 128, - .yres = 64, - .xres_virtual = 128, - .yres_virtual = 64, - .bits_per_pixel = 1, - .nonstd = 1, -}; - -static unsigned long num_cols; -static unsigned long num_rows; -static unsigned long dio_addr; -static unsigned long cio_addr; -static unsigned long c2io_addr; -static unsigned long splashval; -static unsigned long tuhold; -static unsigned int nosplash; -static unsigned int arcfb_enable; -static unsigned int irq; - -static DECLARE_WAIT_QUEUE_HEAD(arcfb_waitq); - -static void ks108_writeb_ctl(struct arcfb_par *par, - unsigned int chipindex, unsigned char value) -{ - unsigned char chipselval = par->cslut[chipindex]; - - outb(chipselval|KS_CEHI|KS_SEL_CMD, par->cio_addr); - outb(value, par->dio_addr); - udelay(tuhold); - outb(chipselval|KS_CELO|KS_SEL_CMD, par->cio_addr); -} - -static void ks108_writeb_mainctl(struct arcfb_par *par, unsigned char value) -{ - - outb(value, par->cio_addr); - udelay(tuhold); -} - -static unsigned char ks108_readb_ctl2(struct arcfb_par *par) -{ - return inb(par->c2io_addr); -} - -static void ks108_writeb_data(struct arcfb_par *par, - unsigned int chipindex, unsigned char value) -{ - unsigned char chipselval = par->cslut[chipindex]; - - outb(chipselval|KS_CEHI|KS_SEL_DATA, par->cio_addr); - outb(value, par->dio_addr); - udelay(tuhold); - outb(chipselval|KS_CELO|KS_SEL_DATA, par->cio_addr); -} - -static void ks108_set_start_line(struct arcfb_par *par, - unsigned int chipindex, unsigned char y) -{ - ks108_writeb_ctl(par, chipindex, KS_SET_DPY_START_LINE|y); -} - -static void ks108_set_yaddr(struct arcfb_par *par, - unsigned int chipindex, unsigned char y) -{ - ks108_writeb_ctl(par, chipindex, KS_SET_PAGE_NUM|y); -} - -static void ks108_set_xaddr(struct arcfb_par *par, - unsigned int chipindex, unsigned char x) -{ - ks108_writeb_ctl(par, chipindex, KS_SET_X|x); -} - -static void ks108_clear_lcd(struct arcfb_par *par, unsigned int chipindex) -{ - int i,j; - - for (i = 0; i <= 8; i++) { - ks108_set_yaddr(par, chipindex, i); - ks108_set_xaddr(par, chipindex, 0); - for (j = 0; j < 64; j++) { - ks108_writeb_data(par, chipindex, - (unsigned char) splashval); - } - } -} - -/* main arcfb functions */ - -static int arcfb_open(struct fb_info *info, int user) -{ - struct arcfb_par *par = info->par; - - atomic_inc(&par->ref_count); - return 0; -} - -static int arcfb_release(struct fb_info *info, int user) -{ - struct arcfb_par *par = info->par; - int count = atomic_read(&par->ref_count); - - if (!count) - return -EINVAL; - atomic_dec(&par->ref_count); - return 0; -} - -static int arcfb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info) -{ - int i; - struct arcfb_par *par = info->par; - - if ((var->vmode & FB_VMODE_YWRAP) && (var->yoffset < 64) - && (info->var.yres <= 64)) { - for (i = 0; i < num_cols; i++) { - ks108_set_start_line(par, i, var->yoffset); - } - info->var.yoffset = var->yoffset; - return 0; - } - - return -EINVAL; -} - -static irqreturn_t arcfb_interrupt(int vec, void *dev_instance) -{ - struct fb_info *info = dev_instance; - unsigned char ctl2status; - struct arcfb_par *par = info->par; - - ctl2status = ks108_readb_ctl2(par); - - if (!(ctl2status & KS_INTACK)) /* not arc generated interrupt */ - return IRQ_NONE; - - ks108_writeb_mainctl(par, KS_CLRINT); - - spin_lock(&par->lock); - if (waitqueue_active(&arcfb_waitq)) { - wake_up(&arcfb_waitq); - } - spin_unlock(&par->lock); - - return IRQ_HANDLED; -} - -/* - * here we handle a specific page on the lcd. the complexity comes from - * the fact that the fb is laidout in 8xX vertical columns. we extract - * each write of 8 vertical pixels. then we shift out as we move along - * X. That's what rightshift does. bitmask selects the desired input bit. - */ -static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper, - unsigned int left, unsigned int right, unsigned int distance) -{ - unsigned char *src; - unsigned int xindex, yindex, chipindex, linesize; - int i; - unsigned char val; - unsigned char bitmask, rightshift; - - xindex = left >> 6; - yindex = upper >> 6; - chipindex = (xindex + (yindex*num_cols)); - - ks108_set_yaddr(par, chipindex, upper/8); - - linesize = par->info->var.xres/8; - src = (unsigned char __force *) par->info->screen_base + (left/8) + - (upper * linesize); - ks108_set_xaddr(par, chipindex, left); - - bitmask=1; - rightshift=0; - while (left <= right) { - val = 0; - for (i = 0; i < 8; i++) { - if ( i > rightshift) { - val |= (*(src + (i*linesize)) & bitmask) - << (i - rightshift); - } else { - val |= (*(src + (i*linesize)) & bitmask) - >> (rightshift - i); - } - } - ks108_writeb_data(par, chipindex, val); - left++; - if (bitmask == 0x80) { - bitmask = 1; - src++; - rightshift=0; - } else { - bitmask <<= 1; - rightshift++; - } - } -} - -/* - * here we handle the entire vertical page of the update. we write across - * lcd chips. update_page uses the upper/left values to decide which - * chip to select for the right. upper is needed for setting the page - * desired for the write. - */ -static void arcfb_lcd_update_vert(struct arcfb_par *par, unsigned int top, - unsigned int bottom, unsigned int left, unsigned int right) -{ - unsigned int distance, upper, lower; - - distance = (bottom - top) + 1; - upper = top; - lower = top + 7; - - while (distance > 0) { - distance -= 8; - arcfb_lcd_update_page(par, upper, left, right, 8); - upper = lower + 1; - lower = upper + 7; - } -} - -/* - * here we handle horizontal blocks for the update. update_vert will - * handle spaning multiple pages. we break out each horizontal - * block in to individual blocks no taller than 64 pixels. - */ -static void arcfb_lcd_update_horiz(struct arcfb_par *par, unsigned int left, - unsigned int right, unsigned int top, unsigned int h) -{ - unsigned int distance, upper, lower; - - distance = h; - upper = floor8(top); - lower = min(upper + distance - 1, ceil64(upper)); - - while (distance > 0) { - distance -= ((lower - upper) + 1 ); - arcfb_lcd_update_vert(par, upper, lower, left, right); - upper = lower + 1; - lower = min(upper + distance - 1, ceil64(upper)); - } -} - -/* - * here we start the process of splitting out the fb update into - * individual blocks of pixels. we end up splitting into 64x64 blocks - * and finally down to 64x8 pages. - */ -static void arcfb_lcd_update(struct arcfb_par *par, unsigned int dx, - unsigned int dy, unsigned int w, unsigned int h) -{ - unsigned int left, right, distance, y; - - /* align the request first */ - y = floor8(dy); - h += dy - y; - h = iceil8(h); - - distance = w; - left = dx; - right = min(left + w - 1, ceil64(left)); - - while (distance > 0) { - arcfb_lcd_update_horiz(par, left, right, y, h); - distance -= ((right - left) + 1); - left = right + 1; - right = min(left + distance - 1, ceil64(left)); - } -} - -static void arcfb_fillrect(struct fb_info *info, - const struct fb_fillrect *rect) -{ - struct arcfb_par *par = info->par; - - sys_fillrect(info, rect); - - /* update the physical lcd */ - arcfb_lcd_update(par, rect->dx, rect->dy, rect->width, rect->height); -} - -static void arcfb_copyarea(struct fb_info *info, - const struct fb_copyarea *area) -{ - struct arcfb_par *par = info->par; - - sys_copyarea(info, area); - - /* update the physical lcd */ - arcfb_lcd_update(par, area->dx, area->dy, area->width, area->height); -} - -static void arcfb_imageblit(struct fb_info *info, const struct fb_image *image) -{ - struct arcfb_par *par = info->par; - - sys_imageblit(info, image); - - /* update the physical lcd */ - arcfb_lcd_update(par, image->dx, image->dy, image->width, - image->height); -} - -static int arcfb_ioctl(struct fb_info *info, - unsigned int cmd, unsigned long arg) -{ - void __user *argp = (void __user *)arg; - struct arcfb_par *par = info->par; - unsigned long flags; - - switch (cmd) { - case FBIO_WAITEVENT: - { - DEFINE_WAIT(wait); - /* illegal to wait on arc if no irq will occur */ - if (!par->irq) - return -EINVAL; - - /* wait until the Arc has generated an interrupt - * which will wake us up */ - spin_lock_irqsave(&par->lock, flags); - prepare_to_wait(&arcfb_waitq, &wait, - TASK_INTERRUPTIBLE); - spin_unlock_irqrestore(&par->lock, flags); - schedule(); - finish_wait(&arcfb_waitq, &wait); - } - case FBIO_GETCONTROL2: - { - unsigned char ctl2; - - ctl2 = ks108_readb_ctl2(info->par); - if (copy_to_user(argp, &ctl2, sizeof(ctl2))) - return -EFAULT; - return 0; - } - default: - return -EINVAL; - } -} - -/* - * this is the access path from userspace. they can seek and write to - * the fb. it's inefficient for them to do anything less than 64*8 - * writes since we update the lcd in each write() anyway. - */ -static ssize_t arcfb_write(struct fb_info *info, const char __user *buf, - size_t count, loff_t *ppos) -{ - /* modded from epson 1355 */ - - unsigned long p; - int err=-EINVAL; - unsigned int fbmemlength,x,y,w,h, bitppos, startpos, endpos, bitcount; - struct arcfb_par *par; - unsigned int xres; - - p = *ppos; - par = info->par; - xres = info->var.xres; - fbmemlength = (xres * info->var.yres)/8; - - if (p > fbmemlength) - return -ENOSPC; - - err = 0; - if ((count + p) > fbmemlength) { - count = fbmemlength - p; - err = -ENOSPC; - } - - if (count) { - char *base_addr; - - base_addr = (char __force *)info->screen_base; - count -= copy_from_user(base_addr + p, buf, count); - *ppos += count; - err = -EFAULT; - } - - - bitppos = p*8; - startpos = floorXres(bitppos, xres); - endpos = ceilXres((bitppos + (count*8)), xres); - bitcount = endpos - startpos; - - x = startpos % xres; - y = startpos / xres; - w = xres; - h = bitcount / xres; - arcfb_lcd_update(par, x, y, w, h); - - if (count) - return count; - return err; -} - -static struct fb_ops arcfb_ops = { - .owner = THIS_MODULE, - .fb_open = arcfb_open, - .fb_read = fb_sys_read, - .fb_write = arcfb_write, - .fb_release = arcfb_release, - .fb_pan_display = arcfb_pan_display, - .fb_fillrect = arcfb_fillrect, - .fb_copyarea = arcfb_copyarea, - .fb_imageblit = arcfb_imageblit, - .fb_ioctl = arcfb_ioctl, -}; - -static int arcfb_probe(struct platform_device *dev) -{ - struct fb_info *info; - int retval = -ENOMEM; - int videomemorysize; - unsigned char *videomemory; - struct arcfb_par *par; - int i; - - videomemorysize = (((64*64)*num_cols)*num_rows)/8; - - /* We need a flat backing store for the Arc's - less-flat actual paged framebuffer */ - videomemory = vzalloc(videomemorysize); - if (!videomemory) - return retval; - - info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev); - if (!info) - goto err; - - info->screen_base = (char __iomem *)videomemory; - info->fbops = &arcfb_ops; - - info->var = arcfb_var; - info->fix = arcfb_fix; - par = info->par; - par->info = info; - - if (!dio_addr || !cio_addr || !c2io_addr) { - printk(KERN_WARNING "no IO addresses supplied\n"); - goto err1; - } - par->dio_addr = dio_addr; - par->cio_addr = cio_addr; - par->c2io_addr = c2io_addr; - par->cslut[0] = 0x00; - par->cslut[1] = 0x06; - info->flags = FBINFO_FLAG_DEFAULT; - spin_lock_init(&par->lock); - retval = register_framebuffer(info); - if (retval < 0) - goto err1; - platform_set_drvdata(dev, info); - if (irq) { - par->irq = irq; - if (request_irq(par->irq, &arcfb_interrupt, IRQF_SHARED, - "arcfb", info)) { - printk(KERN_INFO - "arcfb: Failed req IRQ %d\n", par->irq); - retval = -EBUSY; - goto err1; - } - } - fb_info(info, "Arc frame buffer device, using %dK of video memory\n", - videomemorysize >> 10); - - /* this inits the lcd but doesn't clear dirty pixels */ - for (i = 0; i < num_cols * num_rows; i++) { - ks108_writeb_ctl(par, i, KS_DPY_OFF); - ks108_set_start_line(par, i, 0); - ks108_set_yaddr(par, i, 0); - ks108_set_xaddr(par, i, 0); - ks108_writeb_ctl(par, i, KS_DPY_ON); - } - - /* if we were told to splash the screen, we just clear it */ - if (!nosplash) { - for (i = 0; i < num_cols * num_rows; i++) { - fb_info(info, "splashing lcd %d\n", i); - ks108_set_start_line(par, i, 0); - ks108_clear_lcd(par, i); - } - } - - return 0; -err1: - framebuffer_release(info); -err: - vfree(videomemory); - return retval; -} - -static int arcfb_remove(struct platform_device *dev) -{ - struct fb_info *info = platform_get_drvdata(dev); - - if (info) { - unregister_framebuffer(info); - vfree((void __force *)info->screen_base); - framebuffer_release(info); - } - return 0; -} - -static struct platform_driver arcfb_driver = { - .probe = arcfb_probe, - .remove = arcfb_remove, - .driver = { - .name = "arcfb", - }, -}; - -static struct platform_device *arcfb_device; - -static int __init arcfb_init(void) -{ - int ret; - - if (!arcfb_enable) - return -ENXIO; - - ret = platform_driver_register(&arcfb_driver); - if (!ret) { - arcfb_device = platform_device_alloc("arcfb", 0); - if (arcfb_device) { - ret = platform_device_add(arcfb_device); - } else { - ret = -ENOMEM; - } - if (ret) { - platform_device_put(arcfb_device); - platform_driver_unregister(&arcfb_driver); - } - } - return ret; - -} - -static void __exit arcfb_exit(void) -{ - platform_device_unregister(arcfb_device); - platform_driver_unregister(&arcfb_driver); -} - -module_param(num_cols, ulong, 0); -MODULE_PARM_DESC(num_cols, "Num horiz panels, eg: 2 = 128 bit wide"); -module_param(num_rows, ulong, 0); -MODULE_PARM_DESC(num_rows, "Num vert panels, eg: 1 = 64 bit high"); -module_param(nosplash, uint, 0); -MODULE_PARM_DESC(nosplash, "Disable doing the splash screen"); -module_param(arcfb_enable, uint, 0); -MODULE_PARM_DESC(arcfb_enable, "Enable communication with Arc board"); -module_param(dio_addr, ulong, 0); -MODULE_PARM_DESC(dio_addr, "IO address for data, eg: 0x480"); -module_param(cio_addr, ulong, 0); -MODULE_PARM_DESC(cio_addr, "IO address for control, eg: 0x400"); -module_param(c2io_addr, ulong, 0); -MODULE_PARM_DESC(c2io_addr, "IO address for secondary control, eg: 0x408"); -module_param(splashval, ulong, 0); -MODULE_PARM_DESC(splashval, "Splash pattern: 0xFF is black, 0x00 is green"); -module_param(tuhold, ulong, 0); -MODULE_PARM_DESC(tuhold, "Time to hold between strobing data to Arc board"); -module_param(irq, uint, 0); -MODULE_PARM_DESC(irq, "IRQ for the Arc board"); - -module_init(arcfb_init); -module_exit(arcfb_exit); - -MODULE_DESCRIPTION("fbdev driver for Arc monochrome LCD board"); -MODULE_AUTHOR("Jaya Kumar"); -MODULE_LICENSE("GPL"); - diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c deleted file mode 100644 index adc4ea2cc5a0..000000000000 --- a/drivers/video/arkfb.c +++ /dev/null @@ -1,1231 +0,0 @@ -/* - * linux/drivers/video/arkfb.c -- Frame buffer device driver for ARK 2000PV - * with ICS 5342 dac (it is easy to add support for different dacs). - * - * Copyright (c) 2007 Ondrej Zajicek - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * Code is based on s3fb - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* Why should fb driver call console functions? because console_lock() */ -#include Frame Buffer Memory -!Edrivers/video/fbdev/fbmem.c +!Edrivers/video/fbdev/core/fbmem.c Frame Buffer Colormap -!Edrivers/video/fbdev/fbcmap.c +!Edrivers/video/fbdev/core/fbcmap.c Frame Buffer Video Mode Database -!Idrivers/video/fbdev/modedb.c -!Edrivers/video/fbdev/modedb.c +!Idrivers/video/fbdev/core/modedb.c +!Edrivers/video/fbdev/core/modedb.c Frame Buffer Macintosh Video Mode Database !Edrivers/video/fbdev/macmodes.c diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile index 8a79eec2113b..0284f2a12538 100644 --- a/drivers/video/fbdev/Makefile +++ b/drivers/video/fbdev/Makefile @@ -4,25 +4,11 @@ # Each configuration option enables a list of files. -obj-y += fb_notify.o -obj-$(CONFIG_FB) += fb.o -fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ - modedb.o fbcvt.o -fb-objs := $(fb-y) +obj-y += core/ obj-$(CONFIG_EXYNOS_VIDEO) += exynos/ -obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o -obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o -obj-$(CONFIG_FB_CFB_IMAGEBLIT) += cfbimgblt.o -obj-$(CONFIG_FB_SYS_FILLRECT) += sysfillrect.o -obj-$(CONFIG_FB_SYS_COPYAREA) += syscopyarea.o -obj-$(CONFIG_FB_SYS_IMAGEBLIT) += sysimgblt.o -obj-$(CONFIG_FB_SYS_FOPS) += fb_sys_fops.o -obj-$(CONFIG_FB_SVGALIB) += svgalib.o obj-$(CONFIG_FB_MACMODES) += macmodes.o -obj-$(CONFIG_FB_DDC) += fb_ddc.o -obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o obj-$(CONFIG_FB_WMT_GE_ROPS) += wmt_ge_rops.o # Hardware specific drivers go first diff --git a/drivers/video/fbdev/aty/mach64_cursor.c b/drivers/video/fbdev/aty/mach64_cursor.c index 0fe02e22d9a4..2fa0317ab3c7 100644 --- a/drivers/video/fbdev/aty/mach64_cursor.c +++ b/drivers/video/fbdev/aty/mach64_cursor.c @@ -5,7 +5,7 @@ #include #include #include -#include "../fb_draw.h" +#include "../core/fb_draw.h" #include diff --git a/drivers/video/fbdev/cfbcopyarea.c b/drivers/video/fbdev/cfbcopyarea.c deleted file mode 100644 index bcb57235fcc7..000000000000 --- a/drivers/video/fbdev/cfbcopyarea.c +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Generic function for frame buffer with packed pixels of any depth. - * - * Copyright (C) 1999-2005 James Simmons - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * NOTES: - * - * This is for cfb packed pixels. Iplan and such are incorporated in the - * drivers that need them. - * - * FIXME - * - * Also need to add code to deal with cards endians that are different than - * the native cpu endians. I also need to deal with MSB position in the word. - * - * The two functions or copying forward and backward could be split up like - * the ones for filling, i.e. in aligned and unaligned versions. This would - * help moving some redundant computations and branches out of the loop, too. - */ - -#include -#include -#include -#include -#include -#include -#include "fb_draw.h" - -#if BITS_PER_LONG == 32 -# define FB_WRITEL fb_writel -# define FB_READL fb_readl -#else -# define FB_WRITEL fb_writeq -# define FB_READL fb_readq -#endif - - /* - * Generic bitwise copy algorithm - */ - -static void -bitcpy(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, - const unsigned long __iomem *src, unsigned src_idx, int bits, - unsigned n, u32 bswapmask) -{ - unsigned long first, last; - int const shift = dst_idx-src_idx; - -#if 0 - /* - * If you suspect bug in this function, compare it with this simple - * memmove implementation. - */ - fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, - (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); - return; -#endif - - first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask); - last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask); - - if (!shift) { - // Same alignment for source and dest - - if (dst_idx+n <= bits) { - // Single word - if (last) - first &= last; - FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); - } else { - // Multiple destination words - - // Leading bits - if (first != ~0UL) { - FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); - dst++; - src++; - n -= bits - dst_idx; - } - - // Main chunk - n /= bits; - while (n >= 8) { - FB_WRITEL(FB_READL(src++), dst++); - FB_WRITEL(FB_READL(src++), dst++); - FB_WRITEL(FB_READL(src++), dst++); - FB_WRITEL(FB_READL(src++), dst++); - FB_WRITEL(FB_READL(src++), dst++); - FB_WRITEL(FB_READL(src++), dst++); - FB_WRITEL(FB_READL(src++), dst++); - FB_WRITEL(FB_READL(src++), dst++); - n -= 8; - } - while (n--) - FB_WRITEL(FB_READL(src++), dst++); - - // Trailing bits - if (last) - FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); - } - } else { - /* Different alignment for source and dest */ - unsigned long d0, d1; - int m; - - int const left = shift & (bits - 1); - int const right = -shift & (bits - 1); - - if (dst_idx+n <= bits) { - // Single destination word - if (last) - first &= last; - d0 = FB_READL(src); - d0 = fb_rev_pixels_in_long(d0, bswapmask); - if (shift > 0) { - // Single source word - d0 <<= left; - } else if (src_idx+n <= bits) { - // Single source word - d0 >>= right; - } else { - // 2 source words - d1 = FB_READL(src + 1); - d1 = fb_rev_pixels_in_long(d1, bswapmask); - d0 = d0 >> right | d1 << left; - } - d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(comp(d0, FB_READL(dst), first), dst); - } else { - // Multiple destination words - /** We must always remember the last value read, because in case - SRC and DST overlap bitwise (e.g. when moving just one pixel in - 1bpp), we always collect one full long for DST and that might - overlap with the current long from SRC. We store this value in - 'd0'. */ - d0 = FB_READL(src++); - d0 = fb_rev_pixels_in_long(d0, bswapmask); - // Leading bits - if (shift > 0) { - // Single source word - d1 = d0; - d0 <<= left; - n -= bits - dst_idx; - } else { - // 2 source words - d1 = FB_READL(src++); - d1 = fb_rev_pixels_in_long(d1, bswapmask); - - d0 = d0 >> right | d1 << left; - n -= bits - dst_idx; - } - d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(comp(d0, FB_READL(dst), first), dst); - d0 = d1; - dst++; - - // Main chunk - m = n % bits; - n /= bits; - while ((n >= 4) && !bswapmask) { - d1 = FB_READL(src++); - FB_WRITEL(d0 >> right | d1 << left, dst++); - d0 = d1; - d1 = FB_READL(src++); - FB_WRITEL(d0 >> right | d1 << left, dst++); - d0 = d1; - d1 = FB_READL(src++); - FB_WRITEL(d0 >> right | d1 << left, dst++); - d0 = d1; - d1 = FB_READL(src++); - FB_WRITEL(d0 >> right | d1 << left, dst++); - d0 = d1; - n -= 4; - } - while (n--) { - d1 = FB_READL(src++); - d1 = fb_rev_pixels_in_long(d1, bswapmask); - d0 = d0 >> right | d1 << left; - d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(d0, dst++); - d0 = d1; - } - - // Trailing bits - if (m) { - if (m <= bits - right) { - // Single source word - d0 >>= right; - } else { - // 2 source words - d1 = FB_READL(src); - d1 = fb_rev_pixels_in_long(d1, - bswapmask); - d0 = d0 >> right | d1 << left; - } - d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(comp(d0, FB_READL(dst), last), dst); - } - } - } -} - - /* - * Generic bitwise copy algorithm, operating backward - */ - -static void -bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, - const unsigned long __iomem *src, unsigned src_idx, int bits, - unsigned n, u32 bswapmask) -{ - unsigned long first, last; - int shift; - -#if 0 - /* - * If you suspect bug in this function, compare it with this simple - * memmove implementation. - */ - fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, - (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); - return; -#endif - - dst += (dst_idx + n - 1) / bits; - src += (src_idx + n - 1) / bits; - dst_idx = (dst_idx + n - 1) % bits; - src_idx = (src_idx + n - 1) % bits; - - shift = dst_idx-src_idx; - - first = ~fb_shifted_pixels_mask_long(p, (dst_idx + 1) % bits, bswapmask); - last = fb_shifted_pixels_mask_long(p, (bits + dst_idx + 1 - n) % bits, bswapmask); - - if (!shift) { - // Same alignment for source and dest - - if ((unsigned long)dst_idx+1 >= n) { - // Single word - if (first) - last &= first; - FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); - } else { - // Multiple destination words - - // Leading bits - if (first) { - FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); - dst--; - src--; - n -= dst_idx+1; - } - - // Main chunk - n /= bits; - while (n >= 8) { - FB_WRITEL(FB_READL(src--), dst--); - FB_WRITEL(FB_READL(src--), dst--); - FB_WRITEL(FB_READL(src--), dst--); - FB_WRITEL(FB_READL(src--), dst--); - FB_WRITEL(FB_READL(src--), dst--); - FB_WRITEL(FB_READL(src--), dst--); - FB_WRITEL(FB_READL(src--), dst--); - FB_WRITEL(FB_READL(src--), dst--); - n -= 8; - } - while (n--) - FB_WRITEL(FB_READL(src--), dst--); - - // Trailing bits - if (last != -1UL) - FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); - } - } else { - // Different alignment for source and dest - unsigned long d0, d1; - int m; - - int const left = shift & (bits-1); - int const right = -shift & (bits-1); - - if ((unsigned long)dst_idx+1 >= n) { - // Single destination word - if (first) - last &= first; - d0 = FB_READL(src); - if (shift < 0) { - // Single source word - d0 >>= right; - } else if (1+(unsigned long)src_idx >= n) { - // Single source word - d0 <<= left; - } else { - // 2 source words - d1 = FB_READL(src - 1); - d1 = fb_rev_pixels_in_long(d1, bswapmask); - d0 = d0 << left | d1 >> right; - } - d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(comp(d0, FB_READL(dst), last), dst); - } else { - // Multiple destination words - /** We must always remember the last value read, because in case - SRC and DST overlap bitwise (e.g. when moving just one pixel in - 1bpp), we always collect one full long for DST and that might - overlap with the current long from SRC. We store this value in - 'd0'. */ - - d0 = FB_READL(src--); - d0 = fb_rev_pixels_in_long(d0, bswapmask); - // Leading bits - if (shift < 0) { - // Single source word - d1 = d0; - d0 >>= right; - } else { - // 2 source words - d1 = FB_READL(src--); - d1 = fb_rev_pixels_in_long(d1, bswapmask); - d0 = d0 << left | d1 >> right; - } - d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(comp(d0, FB_READL(dst), first), dst); - d0 = d1; - dst--; - n -= dst_idx+1; - - // Main chunk - m = n % bits; - n /= bits; - while ((n >= 4) && !bswapmask) { - d1 = FB_READL(src--); - FB_WRITEL(d0 << left | d1 >> right, dst--); - d0 = d1; - d1 = FB_READL(src--); - FB_WRITEL(d0 << left | d1 >> right, dst--); - d0 = d1; - d1 = FB_READL(src--); - FB_WRITEL(d0 << left | d1 >> right, dst--); - d0 = d1; - d1 = FB_READL(src--); - FB_WRITEL(d0 << left | d1 >> right, dst--); - d0 = d1; - n -= 4; - } - while (n--) { - d1 = FB_READL(src--); - d1 = fb_rev_pixels_in_long(d1, bswapmask); - d0 = d0 << left | d1 >> right; - d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(d0, dst--); - d0 = d1; - } - - // Trailing bits - if (m) { - if (m <= bits - left) { - // Single source word - d0 <<= left; - } else { - // 2 source words - d1 = FB_READL(src); - d1 = fb_rev_pixels_in_long(d1, - bswapmask); - d0 = d0 << left | d1 >> right; - } - d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(comp(d0, FB_READL(dst), last), dst); - } - } - } -} - -void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) -{ - u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy; - u32 height = area->height, width = area->width; - unsigned long const bits_per_line = p->fix.line_length*8u; - unsigned long __iomem *base = NULL; - int bits = BITS_PER_LONG, bytes = bits >> 3; - unsigned dst_idx = 0, src_idx = 0, rev_copy = 0; - u32 bswapmask = fb_compute_bswapmask(p); - - if (p->state != FBINFO_STATE_RUNNING) - return; - - /* if the beginning of the target area might overlap with the end of - the source area, be have to copy the area reverse. */ - if ((dy == sy && dx > sx) || (dy > sy)) { - dy += height; - sy += height; - rev_copy = 1; - } - - // split the base of the framebuffer into a long-aligned address and the - // index of the first bit - base = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1)); - dst_idx = src_idx = 8*((unsigned long)p->screen_base & (bytes-1)); - // add offset of source and target area - dst_idx += dy*bits_per_line + dx*p->var.bits_per_pixel; - src_idx += sy*bits_per_line + sx*p->var.bits_per_pixel; - - if (p->fbops->fb_sync) - p->fbops->fb_sync(p); - - if (rev_copy) { - while (height--) { - dst_idx -= bits_per_line; - src_idx -= bits_per_line; - bitcpy_rev(p, base + (dst_idx / bits), dst_idx % bits, - base + (src_idx / bits), src_idx % bits, bits, - width*p->var.bits_per_pixel, bswapmask); - } - } else { - while (height--) { - bitcpy(p, base + (dst_idx / bits), dst_idx % bits, - base + (src_idx / bits), src_idx % bits, bits, - width*p->var.bits_per_pixel, bswapmask); - dst_idx += bits_per_line; - src_idx += bits_per_line; - } - } -} - -EXPORT_SYMBOL(cfb_copyarea); - -MODULE_AUTHOR("James Simmons "); -MODULE_DESCRIPTION("Generic software accelerated copyarea"); -MODULE_LICENSE("GPL"); - diff --git a/drivers/video/fbdev/cfbfillrect.c b/drivers/video/fbdev/cfbfillrect.c deleted file mode 100644 index ba9f58b2a5e8..000000000000 --- a/drivers/video/fbdev/cfbfillrect.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Generic fillrect for frame buffers with packed pixels of any depth. - * - * Copyright (C) 2000 James Simmons (jsimmons@linux-fbdev.org) - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * NOTES: - * - * Also need to add code to deal with cards endians that are different than - * the native cpu endians. I also need to deal with MSB position in the word. - * - */ -#include -#include -#include -#include -#include "fb_draw.h" - -#if BITS_PER_LONG == 32 -# define FB_WRITEL fb_writel -# define FB_READL fb_readl -#else -# define FB_WRITEL fb_writeq -# define FB_READL fb_readq -#endif - - /* - * Aligned pattern fill using 32/64-bit memory accesses - */ - -static void -bitfill_aligned(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, - unsigned long pat, unsigned n, int bits, u32 bswapmask) -{ - unsigned long first, last; - - if (!n) - return; - - first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask); - last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask); - - if (dst_idx+n <= bits) { - // Single word - if (last) - first &= last; - FB_WRITEL(comp(pat, FB_READL(dst), first), dst); - } else { - // Multiple destination words - - // Leading bits - if (first!= ~0UL) { - FB_WRITEL(comp(pat, FB_READL(dst), first), dst); - dst++; - n -= bits - dst_idx; - } - - // Main chunk - n /= bits; - while (n >= 8) { - FB_WRITEL(pat, dst++); - FB_WRITEL(pat, dst++); - FB_WRITEL(pat, dst++); - FB_WRITEL(pat, dst++); - FB_WRITEL(pat, dst++); - FB_WRITEL(pat, dst++); - FB_WRITEL(pat, dst++); - FB_WRITEL(pat, dst++); - n -= 8; - } - while (n--) - FB_WRITEL(pat, dst++); - - // Trailing bits - if (last) - FB_WRITEL(comp(pat, FB_READL(dst), last), dst); - } -} - - - /* - * Unaligned generic pattern fill using 32/64-bit memory accesses - * The pattern must have been expanded to a full 32/64-bit value - * Left/right are the appropriate shifts to convert to the pattern to be - * used for the next 32/64-bit word - */ - -static void -bitfill_unaligned(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, - unsigned long pat, int left, int right, unsigned n, int bits) -{ - unsigned long first, last; - - if (!n) - return; - - first = FB_SHIFT_HIGH(p, ~0UL, dst_idx); - last = ~(FB_SHIFT_HIGH(p, ~0UL, (dst_idx+n) % bits)); - - if (dst_idx+n <= bits) { - // Single word - if (last) - first &= last; - FB_WRITEL(comp(pat, FB_READL(dst), first), dst); - } else { - // Multiple destination words - // Leading bits - if (first) { - FB_WRITEL(comp(pat, FB_READL(dst), first), dst); - dst++; - pat = pat << left | pat >> right; - n -= bits - dst_idx; - } - - // Main chunk - n /= bits; - while (n >= 4) { - FB_WRITEL(pat, dst++); - pat = pat << left | pat >> right; - FB_WRITEL(pat, dst++); - pat = pat << left | pat >> right; - FB_WRITEL(pat, dst++); - pat = pat << left | pat >> right; - FB_WRITEL(pat, dst++); - pat = pat << left | pat >> right; - n -= 4; - } - while (n--) { - FB_WRITEL(pat, dst++); - pat = pat << left | pat >> right; - } - - // Trailing bits - if (last) - FB_WRITEL(comp(pat, FB_READL(dst), last), dst); - } -} - - /* - * Aligned pattern invert using 32/64-bit memory accesses - */ -static void -bitfill_aligned_rev(struct fb_info *p, unsigned long __iomem *dst, - int dst_idx, unsigned long pat, unsigned n, int bits, - u32 bswapmask) -{ - unsigned long val = pat, dat; - unsigned long first, last; - - if (!n) - return; - - first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask); - last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask); - - if (dst_idx+n <= bits) { - // Single word - if (last) - first &= last; - dat = FB_READL(dst); - FB_WRITEL(comp(dat ^ val, dat, first), dst); - } else { - // Multiple destination words - // Leading bits - if (first!=0UL) { - dat = FB_READL(dst); - FB_WRITEL(comp(dat ^ val, dat, first), dst); - dst++; - n -= bits - dst_idx; - } - - // Main chunk - n /= bits; - while (n >= 8) { - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - n -= 8; - } - while (n--) { - FB_WRITEL(FB_READL(dst) ^ val, dst); - dst++; - } - // Trailing bits - if (last) { - dat = FB_READL(dst); - FB_WRITEL(comp(dat ^ val, dat, last), dst); - } - } -} - - - /* - * Unaligned generic pattern invert using 32/64-bit memory accesses - * The pattern must have been expanded to a full 32/64-bit value - * Left/right are the appropriate shifts to convert to the pattern to be - * used for the next 32/64-bit word - */ - -static void -bitfill_unaligned_rev(struct fb_info *p, unsigned long __iomem *dst, - int dst_idx, unsigned long pat, int left, int right, - unsigned n, int bits) -{ - unsigned long first, last, dat; - - if (!n) - return; - - first = FB_SHIFT_HIGH(p, ~0UL, dst_idx); - last = ~(FB_SHIFT_HIGH(p, ~0UL, (dst_idx+n) % bits)); - - if (dst_idx+n <= bits) { - // Single word - if (last) - first &= last; - dat = FB_READL(dst); - FB_WRITEL(comp(dat ^ pat, dat, first), dst); - } else { - // Multiple destination words - - // Leading bits - if (first != 0UL) { - dat = FB_READL(dst); - FB_WRITEL(comp(dat ^ pat, dat, first), dst); - dst++; - pat = pat << left | pat >> right; - n -= bits - dst_idx; - } - - // Main chunk - n /= bits; - while (n >= 4) { - FB_WRITEL(FB_READL(dst) ^ pat, dst); - dst++; - pat = pat << left | pat >> right; - FB_WRITEL(FB_READL(dst) ^ pat, dst); - dst++; - pat = pat << left | pat >> right; - FB_WRITEL(FB_READL(dst) ^ pat, dst); - dst++; - pat = pat << left | pat >> right; - FB_WRITEL(FB_READL(dst) ^ pat, dst); - dst++; - pat = pat << left | pat >> right; - n -= 4; - } - while (n--) { - FB_WRITEL(FB_READL(dst) ^ pat, dst); - dst++; - pat = pat << left | pat >> right; - } - - // Trailing bits - if (last) { - dat = FB_READL(dst); - FB_WRITEL(comp(dat ^ pat, dat, last), dst); - } - } -} - -void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) -{ - unsigned long pat, pat2, fg; - unsigned long width = rect->width, height = rect->height; - int bits = BITS_PER_LONG, bytes = bits >> 3; - u32 bpp = p->var.bits_per_pixel; - unsigned long __iomem *dst; - int dst_idx, left; - - if (p->state != FBINFO_STATE_RUNNING) - return; - - if (p->fix.visual == FB_VISUAL_TRUECOLOR || - p->fix.visual == FB_VISUAL_DIRECTCOLOR ) - fg = ((u32 *) (p->pseudo_palette))[rect->color]; - else - fg = rect->color; - - pat = pixel_to_pat(bpp, fg); - - dst = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1)); - dst_idx = ((unsigned long)p->screen_base & (bytes - 1))*8; - dst_idx += rect->dy*p->fix.line_length*8+rect->dx*bpp; - /* FIXME For now we support 1-32 bpp only */ - left = bits % bpp; - if (p->fbops->fb_sync) - p->fbops->fb_sync(p); - if (!left) { - u32 bswapmask = fb_compute_bswapmask(p); - void (*fill_op32)(struct fb_info *p, - unsigned long __iomem *dst, int dst_idx, - unsigned long pat, unsigned n, int bits, - u32 bswapmask) = NULL; - - switch (rect->rop) { - case ROP_XOR: - fill_op32 = bitfill_aligned_rev; - break; - case ROP_COPY: - fill_op32 = bitfill_aligned; - break; - default: - printk( KERN_ERR "cfb_fillrect(): unknown rop, defaulting to ROP_COPY\n"); - fill_op32 = bitfill_aligned; - break; - } - while (height--) { - dst += dst_idx >> (ffs(bits) - 1); - dst_idx &= (bits - 1); - fill_op32(p, dst, dst_idx, pat, width*bpp, bits, - bswapmask); - dst_idx += p->fix.line_length*8; - } - } else { - int right, r; - void (*fill_op)(struct fb_info *p, unsigned long __iomem *dst, - int dst_idx, unsigned long pat, int left, - int right, unsigned n, int bits) = NULL; -#ifdef __LITTLE_ENDIAN - right = left; - left = bpp - right; -#else - right = bpp - left; -#endif - switch (rect->rop) { - case ROP_XOR: - fill_op = bitfill_unaligned_rev; - break; - case ROP_COPY: - fill_op = bitfill_unaligned; - break; - default: - printk(KERN_ERR "cfb_fillrect(): unknown rop, defaulting to ROP_COPY\n"); - fill_op = bitfill_unaligned; - break; - } - while (height--) { - dst += dst_idx / bits; - dst_idx &= (bits - 1); - r = dst_idx % bpp; - /* rotate pattern to the correct start position */ - pat2 = le_long_to_cpu(rolx(cpu_to_le_long(pat), r, bpp)); - fill_op(p, dst, dst_idx, pat2, left, right, - width*bpp, bits); - dst_idx += p->fix.line_length*8; - } - } -} - -EXPORT_SYMBOL(cfb_fillrect); - -MODULE_AUTHOR("James Simmons "); -MODULE_DESCRIPTION("Generic software accelerated fill rectangle"); -MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/cfbimgblt.c b/drivers/video/fbdev/cfbimgblt.c deleted file mode 100644 index a2bb276a8b24..000000000000 --- a/drivers/video/fbdev/cfbimgblt.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Generic BitBLT function for frame buffer with packed pixels of any depth. - * - * Copyright (C) June 1999 James Simmons - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * NOTES: - * - * This function copys a image from system memory to video memory. The - * image can be a bitmap where each 0 represents the background color and - * each 1 represents the foreground color. Great for font handling. It can - * also be a color image. This is determined by image_depth. The color image - * must be laid out exactly in the same format as the framebuffer. Yes I know - * their are cards with hardware that coverts images of various depths to the - * framebuffer depth. But not every card has this. All images must be rounded - * up to the nearest byte. For example a bitmap 12 bits wide must be two - * bytes width. - * - * Tony: - * Incorporate mask tables similar to fbcon-cfb*.c in 2.4 API. This speeds - * up the code significantly. - * - * Code for depths not multiples of BITS_PER_LONG is still kludgy, which is - * still processed a bit at a time. - * - * Also need to add code to deal with cards endians that are different than - * the native cpu endians. I also need to deal with MSB position in the word. - */ -#include -#include -#include -#include -#include "fb_draw.h" - -#define DEBUG - -#ifdef DEBUG -#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt,__func__,## args) -#else -#define DPRINTK(fmt, args...) -#endif - -static const u32 cfb_tab8_be[] = { - 0x00000000,0x000000ff,0x0000ff00,0x0000ffff, - 0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff, - 0xff000000,0xff0000ff,0xff00ff00,0xff00ffff, - 0xffff0000,0xffff00ff,0xffffff00,0xffffffff -}; - -static const u32 cfb_tab8_le[] = { - 0x00000000,0xff000000,0x00ff0000,0xffff0000, - 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00, - 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff, - 0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff -}; - -static const u32 cfb_tab16_be[] = { - 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff -}; - -static const u32 cfb_tab16_le[] = { - 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff -}; - -static const u32 cfb_tab32[] = { - 0x00000000, 0xffffffff -}; - -#define FB_WRITEL fb_writel -#define FB_READL fb_readl - -static inline void color_imageblit(const struct fb_image *image, - struct fb_info *p, u8 __iomem *dst1, - u32 start_index, - u32 pitch_index) -{ - /* Draw the penguin */ - u32 __iomem *dst, *dst2; - u32 color = 0, val, shift; - int i, n, bpp = p->var.bits_per_pixel; - u32 null_bits = 32 - bpp; - u32 *palette = (u32 *) p->pseudo_palette; - const u8 *src = image->data; - u32 bswapmask = fb_compute_bswapmask(p); - - dst2 = (u32 __iomem *) dst1; - for (i = image->height; i--; ) { - n = image->width; - dst = (u32 __iomem *) dst1; - shift = 0; - val = 0; - - if (start_index) { - u32 start_mask = ~fb_shifted_pixels_mask_u32(p, - start_index, bswapmask); - val = FB_READL(dst) & start_mask; - shift = start_index; - } - while (n--) { - if (p->fix.visual == FB_VISUAL_TRUECOLOR || - p->fix.visual == FB_VISUAL_DIRECTCOLOR ) - color = palette[*src]; - else - color = *src; - color <<= FB_LEFT_POS(p, bpp); - val |= FB_SHIFT_HIGH(p, color, shift ^ bswapmask); - if (shift >= null_bits) { - FB_WRITEL(val, dst++); - - val = (shift == null_bits) ? 0 : - FB_SHIFT_LOW(p, color, 32 - shift); - } - shift += bpp; - shift &= (32 - 1); - src++; - } - if (shift) { - u32 end_mask = fb_shifted_pixels_mask_u32(p, shift, - bswapmask); - - FB_WRITEL((FB_READL(dst) & end_mask) | val, dst); - } - dst1 += p->fix.line_length; - if (pitch_index) { - dst2 += p->fix.line_length; - dst1 = (u8 __iomem *)((long __force)dst2 & ~(sizeof(u32) - 1)); - - start_index += pitch_index; - start_index &= 32 - 1; - } - } -} - -static inline void slow_imageblit(const struct fb_image *image, struct fb_info *p, - u8 __iomem *dst1, u32 fgcolor, - u32 bgcolor, - u32 start_index, - u32 pitch_index) -{ - u32 shift, color = 0, bpp = p->var.bits_per_pixel; - u32 __iomem *dst, *dst2; - u32 val, pitch = p->fix.line_length; - u32 null_bits = 32 - bpp; - u32 spitch = (image->width+7)/8; - const u8 *src = image->data, *s; - u32 i, j, l; - u32 bswapmask = fb_compute_bswapmask(p); - - dst2 = (u32 __iomem *) dst1; - fgcolor <<= FB_LEFT_POS(p, bpp); - bgcolor <<= FB_LEFT_POS(p, bpp); - - for (i = image->height; i--; ) { - shift = val = 0; - l = 8; - j = image->width; - dst = (u32 __iomem *) dst1; - s = src; - - /* write leading bits */ - if (start_index) { - u32 start_mask = ~fb_shifted_pixels_mask_u32(p, - start_index, bswapmask); - val = FB_READL(dst) & start_mask; - shift = start_index; - } - - while (j--) { - l--; - color = (*s & (1 << l)) ? fgcolor : bgcolor; - val |= FB_SHIFT_HIGH(p, color, shift ^ bswapmask); - - /* Did the bitshift spill bits to the next long? */ - if (shift >= null_bits) { - FB_WRITEL(val, dst++); - val = (shift == null_bits) ? 0 : - FB_SHIFT_LOW(p, color, 32 - shift); - } - shift += bpp; - shift &= (32 - 1); - if (!l) { l = 8; s++; } - } - - /* write trailing bits */ - if (shift) { - u32 end_mask = fb_shifted_pixels_mask_u32(p, shift, - bswapmask); - - FB_WRITEL((FB_READL(dst) & end_mask) | val, dst); - } - - dst1 += pitch; - src += spitch; - if (pitch_index) { - dst2 += pitch; - dst1 = (u8 __iomem *)((long __force)dst2 & ~(sizeof(u32) - 1)); - start_index += pitch_index; - start_index &= 32 - 1; - } - - } -} - -/* - * fast_imageblit - optimized monochrome color expansion - * - * Only if: bits_per_pixel == 8, 16, or 32 - * image->width is divisible by pixel/dword (ppw); - * fix->line_legth is divisible by 4; - * beginning and end of a scanline is dword aligned - */ -static inline void fast_imageblit(const struct fb_image *image, struct fb_info *p, - u8 __iomem *dst1, u32 fgcolor, - u32 bgcolor) -{ - u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel; - u32 ppw = 32/bpp, spitch = (image->width + 7)/8; - u32 bit_mask, end_mask, eorx, shift; - const char *s = image->data, *src; - u32 __iomem *dst; - const u32 *tab = NULL; - int i, j, k; - - switch (bpp) { - case 8: - tab = fb_be_math(p) ? cfb_tab8_be : cfb_tab8_le; - break; - case 16: - tab = fb_be_math(p) ? cfb_tab16_be : cfb_tab16_le; - break; - case 32: - default: - tab = cfb_tab32; - break; - } - - for (i = ppw-1; i--; ) { - fgx <<= bpp; - bgx <<= bpp; - fgx |= fgcolor; - bgx |= bgcolor; - } - - bit_mask = (1 << ppw) - 1; - eorx = fgx ^ bgx; - k = image->width/ppw; - - for (i = image->height; i--; ) { - dst = (u32 __iomem *) dst1, shift = 8; src = s; - - for (j = k; j--; ) { - shift -= ppw; - end_mask = tab[(*src >> shift) & bit_mask]; - FB_WRITEL((end_mask & eorx)^bgx, dst++); - if (!shift) { shift = 8; src++; } - } - dst1 += p->fix.line_length; - s += spitch; - } -} - -void cfb_imageblit(struct fb_info *p, const struct fb_image *image) -{ - u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0; - u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel; - u32 width = image->width; - u32 dx = image->dx, dy = image->dy; - u8 __iomem *dst1; - - if (p->state != FBINFO_STATE_RUNNING) - return; - - bitstart = (dy * p->fix.line_length * 8) + (dx * bpp); - start_index = bitstart & (32 - 1); - pitch_index = (p->fix.line_length & (bpl - 1)) * 8; - - bitstart /= 8; - bitstart &= ~(bpl - 1); - dst1 = p->screen_base + bitstart; - - if (p->fbops->fb_sync) - p->fbops->fb_sync(p); - - if (image->depth == 1) { - if (p->fix.visual == FB_VISUAL_TRUECOLOR || - p->fix.visual == FB_VISUAL_DIRECTCOLOR) { - fgcolor = ((u32*)(p->pseudo_palette))[image->fg_color]; - bgcolor = ((u32*)(p->pseudo_palette))[image->bg_color]; - } else { - fgcolor = image->fg_color; - bgcolor = image->bg_color; - } - - if (32 % bpp == 0 && !start_index && !pitch_index && - ((width & (32/bpp-1)) == 0) && - bpp >= 8 && bpp <= 32) - fast_imageblit(image, p, dst1, fgcolor, bgcolor); - else - slow_imageblit(image, p, dst1, fgcolor, bgcolor, - start_index, pitch_index); - } else - color_imageblit(image, p, dst1, start_index, pitch_index); -} - -EXPORT_SYMBOL(cfb_imageblit); - -MODULE_AUTHOR("James Simmons "); -MODULE_DESCRIPTION("Generic software accelerated imaging drawing"); -MODULE_LICENSE("GPL"); - diff --git a/drivers/video/fbdev/core/Makefile b/drivers/video/fbdev/core/Makefile new file mode 100644 index 000000000000..fa306538dac2 --- /dev/null +++ b/drivers/video/fbdev/core/Makefile @@ -0,0 +1,16 @@ +obj-y += fb_notify.o +obj-$(CONFIG_FB) += fb.o +fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ + modedb.o fbcvt.o +fb-objs := $(fb-y) + +obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o +obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o +obj-$(CONFIG_FB_CFB_IMAGEBLIT) += cfbimgblt.o +obj-$(CONFIG_FB_SYS_FILLRECT) += sysfillrect.o +obj-$(CONFIG_FB_SYS_COPYAREA) += syscopyarea.o +obj-$(CONFIG_FB_SYS_IMAGEBLIT) += sysimgblt.o +obj-$(CONFIG_FB_SYS_FOPS) += fb_sys_fops.o +obj-$(CONFIG_FB_SVGALIB) += svgalib.o +obj-$(CONFIG_FB_DDC) += fb_ddc.o +obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o diff --git a/drivers/video/fbdev/core/cfbcopyarea.c b/drivers/video/fbdev/core/cfbcopyarea.c new file mode 100644 index 000000000000..bcb57235fcc7 --- /dev/null +++ b/drivers/video/fbdev/core/cfbcopyarea.c @@ -0,0 +1,434 @@ +/* + * Generic function for frame buffer with packed pixels of any depth. + * + * Copyright (C) 1999-2005 James Simmons + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * NOTES: + * + * This is for cfb packed pixels. Iplan and such are incorporated in the + * drivers that need them. + * + * FIXME + * + * Also need to add code to deal with cards endians that are different than + * the native cpu endians. I also need to deal with MSB position in the word. + * + * The two functions or copying forward and backward could be split up like + * the ones for filling, i.e. in aligned and unaligned versions. This would + * help moving some redundant computations and branches out of the loop, too. + */ + +#include +#include +#include +#include +#include +#include +#include "fb_draw.h" + +#if BITS_PER_LONG == 32 +# define FB_WRITEL fb_writel +# define FB_READL fb_readl +#else +# define FB_WRITEL fb_writeq +# define FB_READL fb_readq +#endif + + /* + * Generic bitwise copy algorithm + */ + +static void +bitcpy(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, + const unsigned long __iomem *src, unsigned src_idx, int bits, + unsigned n, u32 bswapmask) +{ + unsigned long first, last; + int const shift = dst_idx-src_idx; + +#if 0 + /* + * If you suspect bug in this function, compare it with this simple + * memmove implementation. + */ + fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, + (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); + return; +#endif + + first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask); + last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask); + + if (!shift) { + // Same alignment for source and dest + + if (dst_idx+n <= bits) { + // Single word + if (last) + first &= last; + FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); + } else { + // Multiple destination words + + // Leading bits + if (first != ~0UL) { + FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); + dst++; + src++; + n -= bits - dst_idx; + } + + // Main chunk + n /= bits; + while (n >= 8) { + FB_WRITEL(FB_READL(src++), dst++); + FB_WRITEL(FB_READL(src++), dst++); + FB_WRITEL(FB_READL(src++), dst++); + FB_WRITEL(FB_READL(src++), dst++); + FB_WRITEL(FB_READL(src++), dst++); + FB_WRITEL(FB_READL(src++), dst++); + FB_WRITEL(FB_READL(src++), dst++); + FB_WRITEL(FB_READL(src++), dst++); + n -= 8; + } + while (n--) + FB_WRITEL(FB_READL(src++), dst++); + + // Trailing bits + if (last) + FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); + } + } else { + /* Different alignment for source and dest */ + unsigned long d0, d1; + int m; + + int const left = shift & (bits - 1); + int const right = -shift & (bits - 1); + + if (dst_idx+n <= bits) { + // Single destination word + if (last) + first &= last; + d0 = FB_READL(src); + d0 = fb_rev_pixels_in_long(d0, bswapmask); + if (shift > 0) { + // Single source word + d0 <<= left; + } else if (src_idx+n <= bits) { + // Single source word + d0 >>= right; + } else { + // 2 source words + d1 = FB_READL(src + 1); + d1 = fb_rev_pixels_in_long(d1, bswapmask); + d0 = d0 >> right | d1 << left; + } + d0 = fb_rev_pixels_in_long(d0, bswapmask); + FB_WRITEL(comp(d0, FB_READL(dst), first), dst); + } else { + // Multiple destination words + /** We must always remember the last value read, because in case + SRC and DST overlap bitwise (e.g. when moving just one pixel in + 1bpp), we always collect one full long for DST and that might + overlap with the current long from SRC. We store this value in + 'd0'. */ + d0 = FB_READL(src++); + d0 = fb_rev_pixels_in_long(d0, bswapmask); + // Leading bits + if (shift > 0) { + // Single source word + d1 = d0; + d0 <<= left; + n -= bits - dst_idx; + } else { + // 2 source words + d1 = FB_READL(src++); + d1 = fb_rev_pixels_in_long(d1, bswapmask); + + d0 = d0 >> right | d1 << left; + n -= bits - dst_idx; + } + d0 = fb_rev_pixels_in_long(d0, bswapmask); + FB_WRITEL(comp(d0, FB_READL(dst), first), dst); + d0 = d1; + dst++; + + // Main chunk + m = n % bits; + n /= bits; + while ((n >= 4) && !bswapmask) { + d1 = FB_READL(src++); + FB_WRITEL(d0 >> right | d1 << left, dst++); + d0 = d1; + d1 = FB_READL(src++); + FB_WRITEL(d0 >> right | d1 << left, dst++); + d0 = d1; + d1 = FB_READL(src++); + FB_WRITEL(d0 >> right | d1 << left, dst++); + d0 = d1; + d1 = FB_READL(src++); + FB_WRITEL(d0 >> right | d1 << left, dst++); + d0 = d1; + n -= 4; + } + while (n--) { + d1 = FB_READL(src++); + d1 = fb_rev_pixels_in_long(d1, bswapmask); + d0 = d0 >> right | d1 << left; + d0 = fb_rev_pixels_in_long(d0, bswapmask); + FB_WRITEL(d0, dst++); + d0 = d1; + } + + // Trailing bits + if (m) { + if (m <= bits - right) { + // Single source word + d0 >>= right; + } else { + // 2 source words + d1 = FB_READL(src); + d1 = fb_rev_pixels_in_long(d1, + bswapmask); + d0 = d0 >> right | d1 << left; + } + d0 = fb_rev_pixels_in_long(d0, bswapmask); + FB_WRITEL(comp(d0, FB_READL(dst), last), dst); + } + } + } +} + + /* + * Generic bitwise copy algorithm, operating backward + */ + +static void +bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, + const unsigned long __iomem *src, unsigned src_idx, int bits, + unsigned n, u32 bswapmask) +{ + unsigned long first, last; + int shift; + +#if 0 + /* + * If you suspect bug in this function, compare it with this simple + * memmove implementation. + */ + fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, + (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); + return; +#endif + + dst += (dst_idx + n - 1) / bits; + src += (src_idx + n - 1) / bits; + dst_idx = (dst_idx + n - 1) % bits; + src_idx = (src_idx + n - 1) % bits; + + shift = dst_idx-src_idx; + + first = ~fb_shifted_pixels_mask_long(p, (dst_idx + 1) % bits, bswapmask); + last = fb_shifted_pixels_mask_long(p, (bits + dst_idx + 1 - n) % bits, bswapmask); + + if (!shift) { + // Same alignment for source and dest + + if ((unsigned long)dst_idx+1 >= n) { + // Single word + if (first) + last &= first; + FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); + } else { + // Multiple destination words + + // Leading bits + if (first) { + FB_WRITEL( comp( FB_READL(src), FB_READL(dst), first), dst); + dst--; + src--; + n -= dst_idx+1; + } + + // Main chunk + n /= bits; + while (n >= 8) { + FB_WRITEL(FB_READL(src--), dst--); + FB_WRITEL(FB_READL(src--), dst--); + FB_WRITEL(FB_READL(src--), dst--); + FB_WRITEL(FB_READL(src--), dst--); + FB_WRITEL(FB_READL(src--), dst--); + FB_WRITEL(FB_READL(src--), dst--); + FB_WRITEL(FB_READL(src--), dst--); + FB_WRITEL(FB_READL(src--), dst--); + n -= 8; + } + while (n--) + FB_WRITEL(FB_READL(src--), dst--); + + // Trailing bits + if (last != -1UL) + FB_WRITEL( comp( FB_READL(src), FB_READL(dst), last), dst); + } + } else { + // Different alignment for source and dest + unsigned long d0, d1; + int m; + + int const left = shift & (bits-1); + int const right = -shift & (bits-1); + + if ((unsigned long)dst_idx+1 >= n) { + // Single destination word + if (first) + last &= first; + d0 = FB_READL(src); + if (shift < 0) { + // Single source word + d0 >>= right; + } else if (1+(unsigned long)src_idx >= n) { + // Single source word + d0 <<= left; + } else { + // 2 source words + d1 = FB_READL(src - 1); + d1 = fb_rev_pixels_in_long(d1, bswapmask); + d0 = d0 << left | d1 >> right; + } + d0 = fb_rev_pixels_in_long(d0, bswapmask); + FB_WRITEL(comp(d0, FB_READL(dst), last), dst); + } else { + // Multiple destination words + /** We must always remember the last value read, because in case + SRC and DST overlap bitwise (e.g. when moving just one pixel in + 1bpp), we always collect one full long for DST and that might + overlap with the current long from SRC. We store this value in + 'd0'. */ + + d0 = FB_READL(src--); + d0 = fb_rev_pixels_in_long(d0, bswapmask); + // Leading bits + if (shift < 0) { + // Single source word + d1 = d0; + d0 >>= right; + } else { + // 2 source words + d1 = FB_READL(src--); + d1 = fb_rev_pixels_in_long(d1, bswapmask); + d0 = d0 << left | d1 >> right; + } + d0 = fb_rev_pixels_in_long(d0, bswapmask); + FB_WRITEL(comp(d0, FB_READL(dst), first), dst); + d0 = d1; + dst--; + n -= dst_idx+1; + + // Main chunk + m = n % bits; + n /= bits; + while ((n >= 4) && !bswapmask) { + d1 = FB_READL(src--); + FB_WRITEL(d0 << left | d1 >> right, dst--); + d0 = d1; + d1 = FB_READL(src--); + FB_WRITEL(d0 << left | d1 >> right, dst--); + d0 = d1; + d1 = FB_READL(src--); + FB_WRITEL(d0 << left | d1 >> right, dst--); + d0 = d1; + d1 = FB_READL(src--); + FB_WRITEL(d0 << left | d1 >> right, dst--); + d0 = d1; + n -= 4; + } + while (n--) { + d1 = FB_READL(src--); + d1 = fb_rev_pixels_in_long(d1, bswapmask); + d0 = d0 << left | d1 >> right; + d0 = fb_rev_pixels_in_long(d0, bswapmask); + FB_WRITEL(d0, dst--); + d0 = d1; + } + + // Trailing bits + if (m) { + if (m <= bits - left) { + // Single source word + d0 <<= left; + } else { + // 2 source words + d1 = FB_READL(src); + d1 = fb_rev_pixels_in_long(d1, + bswapmask); + d0 = d0 << left | d1 >> right; + } + d0 = fb_rev_pixels_in_long(d0, bswapmask); + FB_WRITEL(comp(d0, FB_READL(dst), last), dst); + } + } + } +} + +void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) +{ + u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy; + u32 height = area->height, width = area->width; + unsigned long const bits_per_line = p->fix.line_length*8u; + unsigned long __iomem *base = NULL; + int bits = BITS_PER_LONG, bytes = bits >> 3; + unsigned dst_idx = 0, src_idx = 0, rev_copy = 0; + u32 bswapmask = fb_compute_bswapmask(p); + + if (p->state != FBINFO_STATE_RUNNING) + return; + + /* if the beginning of the target area might overlap with the end of + the source area, be have to copy the area reverse. */ + if ((dy == sy && dx > sx) || (dy > sy)) { + dy += height; + sy += height; + rev_copy = 1; + } + + // split the base of the framebuffer into a long-aligned address and the + // index of the first bit + base = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1)); + dst_idx = src_idx = 8*((unsigned long)p->screen_base & (bytes-1)); + // add offset of source and target area + dst_idx += dy*bits_per_line + dx*p->var.bits_per_pixel; + src_idx += sy*bits_per_line + sx*p->var.bits_per_pixel; + + if (p->fbops->fb_sync) + p->fbops->fb_sync(p); + + if (rev_copy) { + while (height--) { + dst_idx -= bits_per_line; + src_idx -= bits_per_line; + bitcpy_rev(p, base + (dst_idx / bits), dst_idx % bits, + base + (src_idx / bits), src_idx % bits, bits, + width*p->var.bits_per_pixel, bswapmask); + } + } else { + while (height--) { + bitcpy(p, base + (dst_idx / bits), dst_idx % bits, + base + (src_idx / bits), src_idx % bits, bits, + width*p->var.bits_per_pixel, bswapmask); + dst_idx += bits_per_line; + src_idx += bits_per_line; + } + } +} + +EXPORT_SYMBOL(cfb_copyarea); + +MODULE_AUTHOR("James Simmons "); +MODULE_DESCRIPTION("Generic software accelerated copyarea"); +MODULE_LICENSE("GPL"); + diff --git a/drivers/video/fbdev/core/cfbfillrect.c b/drivers/video/fbdev/core/cfbfillrect.c new file mode 100644 index 000000000000..ba9f58b2a5e8 --- /dev/null +++ b/drivers/video/fbdev/core/cfbfillrect.c @@ -0,0 +1,371 @@ +/* + * Generic fillrect for frame buffers with packed pixels of any depth. + * + * Copyright (C) 2000 James Simmons (jsimmons@linux-fbdev.org) + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * NOTES: + * + * Also need to add code to deal with cards endians that are different than + * the native cpu endians. I also need to deal with MSB position in the word. + * + */ +#include +#include +#include +#include +#include "fb_draw.h" + +#if BITS_PER_LONG == 32 +# define FB_WRITEL fb_writel +# define FB_READL fb_readl +#else +# define FB_WRITEL fb_writeq +# define FB_READL fb_readq +#endif + + /* + * Aligned pattern fill using 32/64-bit memory accesses + */ + +static void +bitfill_aligned(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, + unsigned long pat, unsigned n, int bits, u32 bswapmask) +{ + unsigned long first, last; + + if (!n) + return; + + first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask); + last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask); + + if (dst_idx+n <= bits) { + // Single word + if (last) + first &= last; + FB_WRITEL(comp(pat, FB_READL(dst), first), dst); + } else { + // Multiple destination words + + // Leading bits + if (first!= ~0UL) { + FB_WRITEL(comp(pat, FB_READL(dst), first), dst); + dst++; + n -= bits - dst_idx; + } + + // Main chunk + n /= bits; + while (n >= 8) { + FB_WRITEL(pat, dst++); + FB_WRITEL(pat, dst++); + FB_WRITEL(pat, dst++); + FB_WRITEL(pat, dst++); + FB_WRITEL(pat, dst++); + FB_WRITEL(pat, dst++); + FB_WRITEL(pat, dst++); + FB_WRITEL(pat, dst++); + n -= 8; + } + while (n--) + FB_WRITEL(pat, dst++); + + // Trailing bits + if (last) + FB_WRITEL(comp(pat, FB_READL(dst), last), dst); + } +} + + + /* + * Unaligned generic pattern fill using 32/64-bit memory accesses + * The pattern must have been expanded to a full 32/64-bit value + * Left/right are the appropriate shifts to convert to the pattern to be + * used for the next 32/64-bit word + */ + +static void +bitfill_unaligned(struct fb_info *p, unsigned long __iomem *dst, int dst_idx, + unsigned long pat, int left, int right, unsigned n, int bits) +{ + unsigned long first, last; + + if (!n) + return; + + first = FB_SHIFT_HIGH(p, ~0UL, dst_idx); + last = ~(FB_SHIFT_HIGH(p, ~0UL, (dst_idx+n) % bits)); + + if (dst_idx+n <= bits) { + // Single word + if (last) + first &= last; + FB_WRITEL(comp(pat, FB_READL(dst), first), dst); + } else { + // Multiple destination words + // Leading bits + if (first) { + FB_WRITEL(comp(pat, FB_READL(dst), first), dst); + dst++; + pat = pat << left | pat >> right; + n -= bits - dst_idx; + } + + // Main chunk + n /= bits; + while (n >= 4) { + FB_WRITEL(pat, dst++); + pat = pat << left | pat >> right; + FB_WRITEL(pat, dst++); + pat = pat << left | pat >> right; + FB_WRITEL(pat, dst++); + pat = pat << left | pat >> right; + FB_WRITEL(pat, dst++); + pat = pat << left | pat >> right; + n -= 4; + } + while (n--) { + FB_WRITEL(pat, dst++); + pat = pat << left | pat >> right; + } + + // Trailing bits + if (last) + FB_WRITEL(comp(pat, FB_READL(dst), last), dst); + } +} + + /* + * Aligned pattern invert using 32/64-bit memory accesses + */ +static void +bitfill_aligned_rev(struct fb_info *p, unsigned long __iomem *dst, + int dst_idx, unsigned long pat, unsigned n, int bits, + u32 bswapmask) +{ + unsigned long val = pat, dat; + unsigned long first, last; + + if (!n) + return; + + first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask); + last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask); + + if (dst_idx+n <= bits) { + // Single word + if (last) + first &= last; + dat = FB_READL(dst); + FB_WRITEL(comp(dat ^ val, dat, first), dst); + } else { + // Multiple destination words + // Leading bits + if (first!=0UL) { + dat = FB_READL(dst); + FB_WRITEL(comp(dat ^ val, dat, first), dst); + dst++; + n -= bits - dst_idx; + } + + // Main chunk + n /= bits; + while (n >= 8) { + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + n -= 8; + } + while (n--) { + FB_WRITEL(FB_READL(dst) ^ val, dst); + dst++; + } + // Trailing bits + if (last) { + dat = FB_READL(dst); + FB_WRITEL(comp(dat ^ val, dat, last), dst); + } + } +} + + + /* + * Unaligned generic pattern invert using 32/64-bit memory accesses + * The pattern must have been expanded to a full 32/64-bit value + * Left/right are the appropriate shifts to convert to the pattern to be + * used for the next 32/64-bit word + */ + +static void +bitfill_unaligned_rev(struct fb_info *p, unsigned long __iomem *dst, + int dst_idx, unsigned long pat, int left, int right, + unsigned n, int bits) +{ + unsigned long first, last, dat; + + if (!n) + return; + + first = FB_SHIFT_HIGH(p, ~0UL, dst_idx); + last = ~(FB_SHIFT_HIGH(p, ~0UL, (dst_idx+n) % bits)); + + if (dst_idx+n <= bits) { + // Single word + if (last) + first &= last; + dat = FB_READL(dst); + FB_WRITEL(comp(dat ^ pat, dat, first), dst); + } else { + // Multiple destination words + + // Leading bits + if (first != 0UL) { + dat = FB_READL(dst); + FB_WRITEL(comp(dat ^ pat, dat, first), dst); + dst++; + pat = pat << left | pat >> right; + n -= bits - dst_idx; + } + + // Main chunk + n /= bits; + while (n >= 4) { + FB_WRITEL(FB_READL(dst) ^ pat, dst); + dst++; + pat = pat << left | pat >> right; + FB_WRITEL(FB_READL(dst) ^ pat, dst); + dst++; + pat = pat << left | pat >> right; + FB_WRITEL(FB_READL(dst) ^ pat, dst); + dst++; + pat = pat << left | pat >> right; + FB_WRITEL(FB_READL(dst) ^ pat, dst); + dst++; + pat = pat << left | pat >> right; + n -= 4; + } + while (n--) { + FB_WRITEL(FB_READL(dst) ^ pat, dst); + dst++; + pat = pat << left | pat >> right; + } + + // Trailing bits + if (last) { + dat = FB_READL(dst); + FB_WRITEL(comp(dat ^ pat, dat, last), dst); + } + } +} + +void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) +{ + unsigned long pat, pat2, fg; + unsigned long width = rect->width, height = rect->height; + int bits = BITS_PER_LONG, bytes = bits >> 3; + u32 bpp = p->var.bits_per_pixel; + unsigned long __iomem *dst; + int dst_idx, left; + + if (p->state != FBINFO_STATE_RUNNING) + return; + + if (p->fix.visual == FB_VISUAL_TRUECOLOR || + p->fix.visual == FB_VISUAL_DIRECTCOLOR ) + fg = ((u32 *) (p->pseudo_palette))[rect->color]; + else + fg = rect->color; + + pat = pixel_to_pat(bpp, fg); + + dst = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1)); + dst_idx = ((unsigned long)p->screen_base & (bytes - 1))*8; + dst_idx += rect->dy*p->fix.line_length*8+rect->dx*bpp; + /* FIXME For now we support 1-32 bpp only */ + left = bits % bpp; + if (p->fbops->fb_sync) + p->fbops->fb_sync(p); + if (!left) { + u32 bswapmask = fb_compute_bswapmask(p); + void (*fill_op32)(struct fb_info *p, + unsigned long __iomem *dst, int dst_idx, + unsigned long pat, unsigned n, int bits, + u32 bswapmask) = NULL; + + switch (rect->rop) { + case ROP_XOR: + fill_op32 = bitfill_aligned_rev; + break; + case ROP_COPY: + fill_op32 = bitfill_aligned; + break; + default: + printk( KERN_ERR "cfb_fillrect(): unknown rop, defaulting to ROP_COPY\n"); + fill_op32 = bitfill_aligned; + break; + } + while (height--) { + dst += dst_idx >> (ffs(bits) - 1); + dst_idx &= (bits - 1); + fill_op32(p, dst, dst_idx, pat, width*bpp, bits, + bswapmask); + dst_idx += p->fix.line_length*8; + } + } else { + int right, r; + void (*fill_op)(struct fb_info *p, unsigned long __iomem *dst, + int dst_idx, unsigned long pat, int left, + int right, unsigned n, int bits) = NULL; +#ifdef __LITTLE_ENDIAN + right = left; + left = bpp - right; +#else + right = bpp - left; +#endif + switch (rect->rop) { + case ROP_XOR: + fill_op = bitfill_unaligned_rev; + break; + case ROP_COPY: + fill_op = bitfill_unaligned; + break; + default: + printk(KERN_ERR "cfb_fillrect(): unknown rop, defaulting to ROP_COPY\n"); + fill_op = bitfill_unaligned; + break; + } + while (height--) { + dst += dst_idx / bits; + dst_idx &= (bits - 1); + r = dst_idx % bpp; + /* rotate pattern to the correct start position */ + pat2 = le_long_to_cpu(rolx(cpu_to_le_long(pat), r, bpp)); + fill_op(p, dst, dst_idx, pat2, left, right, + width*bpp, bits); + dst_idx += p->fix.line_length*8; + } + } +} + +EXPORT_SYMBOL(cfb_fillrect); + +MODULE_AUTHOR("James Simmons "); +MODULE_DESCRIPTION("Generic software accelerated fill rectangle"); +MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/core/cfbimgblt.c b/drivers/video/fbdev/core/cfbimgblt.c new file mode 100644 index 000000000000..a2bb276a8b24 --- /dev/null +++ b/drivers/video/fbdev/core/cfbimgblt.c @@ -0,0 +1,313 @@ +/* + * Generic BitBLT function for frame buffer with packed pixels of any depth. + * + * Copyright (C) June 1999 James Simmons + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * NOTES: + * + * This function copys a image from system memory to video memory. The + * image can be a bitmap where each 0 represents the background color and + * each 1 represents the foreground color. Great for font handling. It can + * also be a color image. This is determined by image_depth. The color image + * must be laid out exactly in the same format as the framebuffer. Yes I know + * their are cards with hardware that coverts images of various depths to the + * framebuffer depth. But not every card has this. All images must be rounded + * up to the nearest byte. For example a bitmap 12 bits wide must be two + * bytes width. + * + * Tony: + * Incorporate mask tables similar to fbcon-cfb*.c in 2.4 API. This speeds + * up the code significantly. + * + * Code for depths not multiples of BITS_PER_LONG is still kludgy, which is + * still processed a bit at a time. + * + * Also need to add code to deal with cards endians that are different than + * the native cpu endians. I also need to deal with MSB position in the word. + */ +#include +#include +#include +#include +#include "fb_draw.h" + +#define DEBUG + +#ifdef DEBUG +#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt,__func__,## args) +#else +#define DPRINTK(fmt, args...) +#endif + +static const u32 cfb_tab8_be[] = { + 0x00000000,0x000000ff,0x0000ff00,0x0000ffff, + 0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff, + 0xff000000,0xff0000ff,0xff00ff00,0xff00ffff, + 0xffff0000,0xffff00ff,0xffffff00,0xffffffff +}; + +static const u32 cfb_tab8_le[] = { + 0x00000000,0xff000000,0x00ff0000,0xffff0000, + 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00, + 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff, + 0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff +}; + +static const u32 cfb_tab16_be[] = { + 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff +}; + +static const u32 cfb_tab16_le[] = { + 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff +}; + +static const u32 cfb_tab32[] = { + 0x00000000, 0xffffffff +}; + +#define FB_WRITEL fb_writel +#define FB_READL fb_readl + +static inline void color_imageblit(const struct fb_image *image, + struct fb_info *p, u8 __iomem *dst1, + u32 start_index, + u32 pitch_index) +{ + /* Draw the penguin */ + u32 __iomem *dst, *dst2; + u32 color = 0, val, shift; + int i, n, bpp = p->var.bits_per_pixel; + u32 null_bits = 32 - bpp; + u32 *palette = (u32 *) p->pseudo_palette; + const u8 *src = image->data; + u32 bswapmask = fb_compute_bswapmask(p); + + dst2 = (u32 __iomem *) dst1; + for (i = image->height; i--; ) { + n = image->width; + dst = (u32 __iomem *) dst1; + shift = 0; + val = 0; + + if (start_index) { + u32 start_mask = ~fb_shifted_pixels_mask_u32(p, + start_index, bswapmask); + val = FB_READL(dst) & start_mask; + shift = start_index; + } + while (n--) { + if (p->fix.visual == FB_VISUAL_TRUECOLOR || + p->fix.visual == FB_VISUAL_DIRECTCOLOR ) + color = palette[*src]; + else + color = *src; + color <<= FB_LEFT_POS(p, bpp); + val |= FB_SHIFT_HIGH(p, color, shift ^ bswapmask); + if (shift >= null_bits) { + FB_WRITEL(val, dst++); + + val = (shift == null_bits) ? 0 : + FB_SHIFT_LOW(p, color, 32 - shift); + } + shift += bpp; + shift &= (32 - 1); + src++; + } + if (shift) { + u32 end_mask = fb_shifted_pixels_mask_u32(p, shift, + bswapmask); + + FB_WRITEL((FB_READL(dst) & end_mask) | val, dst); + } + dst1 += p->fix.line_length; + if (pitch_index) { + dst2 += p->fix.line_length; + dst1 = (u8 __iomem *)((long __force)dst2 & ~(sizeof(u32) - 1)); + + start_index += pitch_index; + start_index &= 32 - 1; + } + } +} + +static inline void slow_imageblit(const struct fb_image *image, struct fb_info *p, + u8 __iomem *dst1, u32 fgcolor, + u32 bgcolor, + u32 start_index, + u32 pitch_index) +{ + u32 shift, color = 0, bpp = p->var.bits_per_pixel; + u32 __iomem *dst, *dst2; + u32 val, pitch = p->fix.line_length; + u32 null_bits = 32 - bpp; + u32 spitch = (image->width+7)/8; + const u8 *src = image->data, *s; + u32 i, j, l; + u32 bswapmask = fb_compute_bswapmask(p); + + dst2 = (u32 __iomem *) dst1; + fgcolor <<= FB_LEFT_POS(p, bpp); + bgcolor <<= FB_LEFT_POS(p, bpp); + + for (i = image->height; i--; ) { + shift = val = 0; + l = 8; + j = image->width; + dst = (u32 __iomem *) dst1; + s = src; + + /* write leading bits */ + if (start_index) { + u32 start_mask = ~fb_shifted_pixels_mask_u32(p, + start_index, bswapmask); + val = FB_READL(dst) & start_mask; + shift = start_index; + } + + while (j--) { + l--; + color = (*s & (1 << l)) ? fgcolor : bgcolor; + val |= FB_SHIFT_HIGH(p, color, shift ^ bswapmask); + + /* Did the bitshift spill bits to the next long? */ + if (shift >= null_bits) { + FB_WRITEL(val, dst++); + val = (shift == null_bits) ? 0 : + FB_SHIFT_LOW(p, color, 32 - shift); + } + shift += bpp; + shift &= (32 - 1); + if (!l) { l = 8; s++; } + } + + /* write trailing bits */ + if (shift) { + u32 end_mask = fb_shifted_pixels_mask_u32(p, shift, + bswapmask); + + FB_WRITEL((FB_READL(dst) & end_mask) | val, dst); + } + + dst1 += pitch; + src += spitch; + if (pitch_index) { + dst2 += pitch; + dst1 = (u8 __iomem *)((long __force)dst2 & ~(sizeof(u32) - 1)); + start_index += pitch_index; + start_index &= 32 - 1; + } + + } +} + +/* + * fast_imageblit - optimized monochrome color expansion + * + * Only if: bits_per_pixel == 8, 16, or 32 + * image->width is divisible by pixel/dword (ppw); + * fix->line_legth is divisible by 4; + * beginning and end of a scanline is dword aligned + */ +static inline void fast_imageblit(const struct fb_image *image, struct fb_info *p, + u8 __iomem *dst1, u32 fgcolor, + u32 bgcolor) +{ + u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel; + u32 ppw = 32/bpp, spitch = (image->width + 7)/8; + u32 bit_mask, end_mask, eorx, shift; + const char *s = image->data, *src; + u32 __iomem *dst; + const u32 *tab = NULL; + int i, j, k; + + switch (bpp) { + case 8: + tab = fb_be_math(p) ? cfb_tab8_be : cfb_tab8_le; + break; + case 16: + tab = fb_be_math(p) ? cfb_tab16_be : cfb_tab16_le; + break; + case 32: + default: + tab = cfb_tab32; + break; + } + + for (i = ppw-1; i--; ) { + fgx <<= bpp; + bgx <<= bpp; + fgx |= fgcolor; + bgx |= bgcolor; + } + + bit_mask = (1 << ppw) - 1; + eorx = fgx ^ bgx; + k = image->width/ppw; + + for (i = image->height; i--; ) { + dst = (u32 __iomem *) dst1, shift = 8; src = s; + + for (j = k; j--; ) { + shift -= ppw; + end_mask = tab[(*src >> shift) & bit_mask]; + FB_WRITEL((end_mask & eorx)^bgx, dst++); + if (!shift) { shift = 8; src++; } + } + dst1 += p->fix.line_length; + s += spitch; + } +} + +void cfb_imageblit(struct fb_info *p, const struct fb_image *image) +{ + u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0; + u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel; + u32 width = image->width; + u32 dx = image->dx, dy = image->dy; + u8 __iomem *dst1; + + if (p->state != FBINFO_STATE_RUNNING) + return; + + bitstart = (dy * p->fix.line_length * 8) + (dx * bpp); + start_index = bitstart & (32 - 1); + pitch_index = (p->fix.line_length & (bpl - 1)) * 8; + + bitstart /= 8; + bitstart &= ~(bpl - 1); + dst1 = p->screen_base + bitstart; + + if (p->fbops->fb_sync) + p->fbops->fb_sync(p); + + if (image->depth == 1) { + if (p->fix.visual == FB_VISUAL_TRUECOLOR || + p->fix.visual == FB_VISUAL_DIRECTCOLOR) { + fgcolor = ((u32*)(p->pseudo_palette))[image->fg_color]; + bgcolor = ((u32*)(p->pseudo_palette))[image->bg_color]; + } else { + fgcolor = image->fg_color; + bgcolor = image->bg_color; + } + + if (32 % bpp == 0 && !start_index && !pitch_index && + ((width & (32/bpp-1)) == 0) && + bpp >= 8 && bpp <= 32) + fast_imageblit(image, p, dst1, fgcolor, bgcolor); + else + slow_imageblit(image, p, dst1, fgcolor, bgcolor, + start_index, pitch_index); + } else + color_imageblit(image, p, dst1, start_index, pitch_index); +} + +EXPORT_SYMBOL(cfb_imageblit); + +MODULE_AUTHOR("James Simmons "); +MODULE_DESCRIPTION("Generic software accelerated imaging drawing"); +MODULE_LICENSE("GPL"); + diff --git a/drivers/video/fbdev/core/fb_ddc.c b/drivers/video/fbdev/core/fb_ddc.c new file mode 100644 index 000000000000..94322ccfedde --- /dev/null +++ b/drivers/video/fbdev/core/fb_ddc.c @@ -0,0 +1,119 @@ +/* + * drivers/video/fb_ddc.c - DDC/EDID read support. + * + * Copyright (C) 2006 Dennis Munsie + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include "../edid.h" + +#define DDC_ADDR 0x50 + +static unsigned char *fb_do_probe_ddc_edid(struct i2c_adapter *adapter) +{ + unsigned char start = 0x0; + unsigned char *buf = kmalloc(EDID_LENGTH, GFP_KERNEL); + struct i2c_msg msgs[] = { + { + .addr = DDC_ADDR, + .flags = 0, + .len = 1, + .buf = &start, + }, { + .addr = DDC_ADDR, + .flags = I2C_M_RD, + .len = EDID_LENGTH, + .buf = buf, + } + }; + + if (!buf) { + dev_warn(&adapter->dev, "unable to allocate memory for EDID " + "block.\n"); + return NULL; + } + + if (i2c_transfer(adapter, msgs, 2) == 2) + return buf; + + dev_warn(&adapter->dev, "unable to read EDID block.\n"); + kfree(buf); + return NULL; +} + +unsigned char *fb_ddc_read(struct i2c_adapter *adapter) +{ + struct i2c_algo_bit_data *algo_data = adapter->algo_data; + unsigned char *edid = NULL; + int i, j; + + algo_data->setscl(algo_data->data, 1); + + for (i = 0; i < 3; i++) { + /* For some old monitors we need the + * following process to initialize/stop DDC + */ + algo_data->setsda(algo_data->data, 1); + msleep(13); + + algo_data->setscl(algo_data->data, 1); + for (j = 0; j < 5; j++) { + msleep(10); + if (algo_data->getscl(algo_data->data)) + break; + } + if (j == 5) + continue; + + algo_data->setsda(algo_data->data, 0); + msleep(15); + algo_data->setscl(algo_data->data, 0); + msleep(15); + algo_data->setsda(algo_data->data, 1); + msleep(15); + + /* Do the real work */ + edid = fb_do_probe_ddc_edid(adapter); + algo_data->setsda(algo_data->data, 0); + algo_data->setscl(algo_data->data, 0); + msleep(15); + + algo_data->setscl(algo_data->data, 1); + for (j = 0; j < 10; j++) { + msleep(10); + if (algo_data->getscl(algo_data->data)) + break; + } + + algo_data->setsda(algo_data->data, 1); + msleep(15); + algo_data->setscl(algo_data->data, 0); + algo_data->setsda(algo_data->data, 0); + if (edid) + break; + } + /* Release the DDC lines when done or the Apple Cinema HD display + * will switch off + */ + algo_data->setsda(algo_data->data, 1); + algo_data->setscl(algo_data->data, 1); + + adapter->class |= I2C_CLASS_DDC; + return edid; +} + +EXPORT_SYMBOL_GPL(fb_ddc_read); + +MODULE_AUTHOR("Dennis Munsie "); +MODULE_DESCRIPTION("DDC/EDID reading support"); +MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c new file mode 100644 index 000000000000..900aa4ecd617 --- /dev/null +++ b/drivers/video/fbdev/core/fb_defio.c @@ -0,0 +1,245 @@ +/* + * linux/drivers/video/fb_defio.c + * + * Copyright (C) 2006 Jaya Kumar + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* to support deferred IO */ +#include +#include + +static struct page *fb_deferred_io_page(struct fb_info *info, unsigned long offs) +{ + void *screen_base = (void __force *) info->screen_base; + struct page *page; + + if (is_vmalloc_addr(screen_base + offs)) + page = vmalloc_to_page(screen_base + offs); + else + page = pfn_to_page((info->fix.smem_start + offs) >> PAGE_SHIFT); + + return page; +} + +/* this is to find and return the vmalloc-ed fb pages */ +static int fb_deferred_io_fault(struct vm_area_struct *vma, + struct vm_fault *vmf) +{ + unsigned long offset; + struct page *page; + struct fb_info *info = vma->vm_private_data; + + offset = vmf->pgoff << PAGE_SHIFT; + if (offset >= info->fix.smem_len) + return VM_FAULT_SIGBUS; + + page = fb_deferred_io_page(info, offset); + if (!page) + return VM_FAULT_SIGBUS; + + get_page(page); + + if (vma->vm_file) + page->mapping = vma->vm_file->f_mapping; + else + printk(KERN_ERR "no mapping available\n"); + + BUG_ON(!page->mapping); + page->index = vmf->pgoff; + + vmf->page = page; + return 0; +} + +int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync) +{ + struct fb_info *info = file->private_data; + struct inode *inode = file_inode(file); + int err = filemap_write_and_wait_range(inode->i_mapping, start, end); + if (err) + return err; + + /* Skip if deferred io is compiled-in but disabled on this fbdev */ + if (!info->fbdefio) + return 0; + + mutex_lock(&inode->i_mutex); + /* Kill off the delayed work */ + cancel_delayed_work_sync(&info->deferred_work); + + /* Run it immediately */ + err = schedule_delayed_work(&info->deferred_work, 0); + mutex_unlock(&inode->i_mutex); + return err; +} +EXPORT_SYMBOL_GPL(fb_deferred_io_fsync); + +/* vm_ops->page_mkwrite handler */ +static int fb_deferred_io_mkwrite(struct vm_area_struct *vma, + struct vm_fault *vmf) +{ + struct page *page = vmf->page; + struct fb_info *info = vma->vm_private_data; + struct fb_deferred_io *fbdefio = info->fbdefio; + struct page *cur; + + /* this is a callback we get when userspace first tries to + write to the page. we schedule a workqueue. that workqueue + will eventually mkclean the touched pages and execute the + deferred framebuffer IO. then if userspace touches a page + again, we repeat the same scheme */ + + file_update_time(vma->vm_file); + + /* protect against the workqueue changing the page list */ + mutex_lock(&fbdefio->lock); + + /* first write in this cycle, notify the driver */ + if (fbdefio->first_io && list_empty(&fbdefio->pagelist)) + fbdefio->first_io(info); + + /* + * We want the page to remain locked from ->page_mkwrite until + * the PTE is marked dirty to avoid page_mkclean() being called + * before the PTE is updated, which would leave the page ignored + * by defio. + * Do this by locking the page here and informing the caller + * about it with VM_FAULT_LOCKED. + */ + lock_page(page); + + /* we loop through the pagelist before adding in order + to keep the pagelist sorted */ + list_for_each_entry(cur, &fbdefio->pagelist, lru) { + /* this check is to catch the case where a new + process could start writing to the same page + through a new pte. this new access can cause the + mkwrite even when the original ps's pte is marked + writable */ + if (unlikely(cur == page)) + goto page_already_added; + else if (cur->index > page->index) + break; + } + + list_add_tail(&page->lru, &cur->lru); + +page_already_added: + mutex_unlock(&fbdefio->lock); + + /* come back after delay to process the deferred IO */ + schedule_delayed_work(&info->deferred_work, fbdefio->delay); + return VM_FAULT_LOCKED; +} + +static const struct vm_operations_struct fb_deferred_io_vm_ops = { + .fault = fb_deferred_io_fault, + .page_mkwrite = fb_deferred_io_mkwrite, +}; + +static int fb_deferred_io_set_page_dirty(struct page *page) +{ + if (!PageDirty(page)) + SetPageDirty(page); + return 0; +} + +static const struct address_space_operations fb_deferred_io_aops = { + .set_page_dirty = fb_deferred_io_set_page_dirty, +}; + +static int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) +{ + vma->vm_ops = &fb_deferred_io_vm_ops; + vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; + if (!(info->flags & FBINFO_VIRTFB)) + vma->vm_flags |= VM_IO; + vma->vm_private_data = info; + return 0; +} + +/* workqueue callback */ +static void fb_deferred_io_work(struct work_struct *work) +{ + struct fb_info *info = container_of(work, struct fb_info, + deferred_work.work); + struct list_head *node, *next; + struct page *cur; + struct fb_deferred_io *fbdefio = info->fbdefio; + + /* here we mkclean the pages, then do all deferred IO */ + mutex_lock(&fbdefio->lock); + list_for_each_entry(cur, &fbdefio->pagelist, lru) { + lock_page(cur); + page_mkclean(cur); + unlock_page(cur); + } + + /* driver's callback with pagelist */ + fbdefio->deferred_io(info, &fbdefio->pagelist); + + /* clear the list */ + list_for_each_safe(node, next, &fbdefio->pagelist) { + list_del(node); + } + mutex_unlock(&fbdefio->lock); +} + +void fb_deferred_io_init(struct fb_info *info) +{ + struct fb_deferred_io *fbdefio = info->fbdefio; + + BUG_ON(!fbdefio); + mutex_init(&fbdefio->lock); + info->fbops->fb_mmap = fb_deferred_io_mmap; + INIT_DELAYED_WORK(&info->deferred_work, fb_deferred_io_work); + INIT_LIST_HEAD(&fbdefio->pagelist); + if (fbdefio->delay == 0) /* set a default of 1 s */ + fbdefio->delay = HZ; +} +EXPORT_SYMBOL_GPL(fb_deferred_io_init); + +void fb_deferred_io_open(struct fb_info *info, + struct inode *inode, + struct file *file) +{ + file->f_mapping->a_ops = &fb_deferred_io_aops; +} +EXPORT_SYMBOL_GPL(fb_deferred_io_open); + +void fb_deferred_io_cleanup(struct fb_info *info) +{ + struct fb_deferred_io *fbdefio = info->fbdefio; + struct page *page; + int i; + + BUG_ON(!fbdefio); + cancel_delayed_work_sync(&info->deferred_work); + + /* clear out the mapping that we setup */ + for (i = 0 ; i < info->fix.smem_len; i += PAGE_SIZE) { + page = fb_deferred_io_page(info, i); + page->mapping = NULL; + } + + info->fbops->fb_mmap = NULL; + mutex_destroy(&fbdefio->lock); +} +EXPORT_SYMBOL_GPL(fb_deferred_io_cleanup); + +MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/core/fb_draw.h b/drivers/video/fbdev/core/fb_draw.h new file mode 100644 index 000000000000..624ee115f129 --- /dev/null +++ b/drivers/video/fbdev/core/fb_draw.h @@ -0,0 +1,186 @@ +#ifndef _FB_DRAW_H +#define _FB_DRAW_H + +#include +#include +#include + + /* + * Compose two values, using a bitmask as decision value + * This is equivalent to (a & mask) | (b & ~mask) + */ + +static inline unsigned long +comp(unsigned long a, unsigned long b, unsigned long mask) +{ + return ((a ^ b) & mask) ^ b; +} + + /* + * Create a pattern with the given pixel's color + */ + +#if BITS_PER_LONG == 64 +static inline unsigned long +pixel_to_pat( u32 bpp, u32 pixel) +{ + switch (bpp) { + case 1: + return 0xfffffffffffffffful*pixel; + case 2: + return 0x5555555555555555ul*pixel; + case 4: + return 0x1111111111111111ul*pixel; + case 8: + return 0x0101010101010101ul*pixel; + case 12: + return 0x1001001001001001ul*pixel; + case 16: + return 0x0001000100010001ul*pixel; + case 24: + return 0x0001000001000001ul*pixel; + case 32: + return 0x0000000100000001ul*pixel; + default: + WARN(1, "pixel_to_pat(): unsupported pixelformat %d\n", bpp); + return 0; + } +} +#else +static inline unsigned long +pixel_to_pat( u32 bpp, u32 pixel) +{ + switch (bpp) { + case 1: + return 0xfffffffful*pixel; + case 2: + return 0x55555555ul*pixel; + case 4: + return 0x11111111ul*pixel; + case 8: + return 0x01010101ul*pixel; + case 12: + return 0x01001001ul*pixel; + case 16: + return 0x00010001ul*pixel; + case 24: + return 0x01000001ul*pixel; + case 32: + return 0x00000001ul*pixel; + default: + WARN(1, "pixel_to_pat(): unsupported pixelformat %d\n", bpp); + return 0; + } +} +#endif + +#ifdef CONFIG_FB_CFB_REV_PIXELS_IN_BYTE +#if BITS_PER_LONG == 64 +#define REV_PIXELS_MASK1 0x5555555555555555ul +#define REV_PIXELS_MASK2 0x3333333333333333ul +#define REV_PIXELS_MASK4 0x0f0f0f0f0f0f0f0ful +#else +#define REV_PIXELS_MASK1 0x55555555ul +#define REV_PIXELS_MASK2 0x33333333ul +#define REV_PIXELS_MASK4 0x0f0f0f0ful +#endif + +static inline unsigned long fb_rev_pixels_in_long(unsigned long val, + u32 bswapmask) +{ + if (bswapmask & 1) + val = comp(val >> 1, val << 1, REV_PIXELS_MASK1); + if (bswapmask & 2) + val = comp(val >> 2, val << 2, REV_PIXELS_MASK2); + if (bswapmask & 3) + val = comp(val >> 4, val << 4, REV_PIXELS_MASK4); + return val; +} + +static inline u32 fb_shifted_pixels_mask_u32(struct fb_info *p, u32 index, + u32 bswapmask) +{ + u32 mask; + + if (!bswapmask) { + mask = FB_SHIFT_HIGH(p, ~(u32)0, index); + } else { + mask = 0xff << FB_LEFT_POS(p, 8); + mask = FB_SHIFT_LOW(p, mask, index & (bswapmask)) & mask; + mask = FB_SHIFT_HIGH(p, mask, index & ~(bswapmask)); +#if defined(__i386__) || defined(__x86_64__) + /* Shift argument is limited to 0 - 31 on x86 based CPU's */ + if(index + bswapmask < 32) +#endif + mask |= FB_SHIFT_HIGH(p, ~(u32)0, + (index + bswapmask) & ~(bswapmask)); + } + return mask; +} + +static inline unsigned long fb_shifted_pixels_mask_long(struct fb_info *p, + u32 index, + u32 bswapmask) +{ + unsigned long mask; + + if (!bswapmask) { + mask = FB_SHIFT_HIGH(p, ~0UL, index); + } else { + mask = 0xff << FB_LEFT_POS(p, 8); + mask = FB_SHIFT_LOW(p, mask, index & (bswapmask)) & mask; + mask = FB_SHIFT_HIGH(p, mask, index & ~(bswapmask)); +#if defined(__i386__) || defined(__x86_64__) + /* Shift argument is limited to 0 - 31 on x86 based CPU's */ + if(index + bswapmask < BITS_PER_LONG) +#endif + mask |= FB_SHIFT_HIGH(p, ~0UL, + (index + bswapmask) & ~(bswapmask)); + } + return mask; +} + + +static inline u32 fb_compute_bswapmask(struct fb_info *info) +{ + u32 bswapmask = 0; + unsigned bpp = info->var.bits_per_pixel; + + if ((bpp < 8) && (info->var.nonstd & FB_NONSTD_REV_PIX_IN_B)) { + /* + * Reversed order of pixel layout in bytes + * works only for 1, 2 and 4 bpp + */ + bswapmask = 7 - bpp + 1; + } + return bswapmask; +} + +#else /* CONFIG_FB_CFB_REV_PIXELS_IN_BYTE */ + +static inline unsigned long fb_rev_pixels_in_long(unsigned long val, + u32 bswapmask) +{ + return val; +} + +#define fb_shifted_pixels_mask_u32(p, i, b) FB_SHIFT_HIGH((p), ~(u32)0, (i)) +#define fb_shifted_pixels_mask_long(p, i, b) FB_SHIFT_HIGH((p), ~0UL, (i)) +#define fb_compute_bswapmask(...) 0 + +#endif /* CONFIG_FB_CFB_REV_PIXELS_IN_BYTE */ + +#define cpu_to_le_long _cpu_to_le_long(BITS_PER_LONG) +#define _cpu_to_le_long(x) __cpu_to_le_long(x) +#define __cpu_to_le_long(x) cpu_to_le##x + +#define le_long_to_cpu _le_long_to_cpu(BITS_PER_LONG) +#define _le_long_to_cpu(x) __le_long_to_cpu(x) +#define __le_long_to_cpu(x) le##x##_to_cpu + +static inline unsigned long rolx(unsigned long word, unsigned int shift, unsigned int x) +{ + return (word << shift) | (word >> (x - shift)); +} + +#endif /* FB_DRAW_H */ diff --git a/drivers/video/fbdev/core/fb_notify.c b/drivers/video/fbdev/core/fb_notify.c new file mode 100644 index 000000000000..74c2da528884 --- /dev/null +++ b/drivers/video/fbdev/core/fb_notify.c @@ -0,0 +1,47 @@ +/* + * linux/drivers/video/fb_notify.c + * + * Copyright (C) 2006 Antonino Daplas + * + * 2001 - Documented with DocBook + * - Brad Douglas + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + */ +#include +#include +#include + +static BLOCKING_NOTIFIER_HEAD(fb_notifier_list); + +/** + * fb_register_client - register a client notifier + * @nb: notifier block to callback on events + */ +int fb_register_client(struct notifier_block *nb) +{ + return blocking_notifier_chain_register(&fb_notifier_list, nb); +} +EXPORT_SYMBOL(fb_register_client); + +/** + * fb_unregister_client - unregister a client notifier + * @nb: notifier block to callback on events + */ +int fb_unregister_client(struct notifier_block *nb) +{ + return blocking_notifier_chain_unregister(&fb_notifier_list, nb); +} +EXPORT_SYMBOL(fb_unregister_client); + +/** + * fb_notifier_call_chain - notify clients of fb_events + * + */ +int fb_notifier_call_chain(unsigned long val, void *v) +{ + return blocking_notifier_call_chain(&fb_notifier_list, val, v); +} +EXPORT_SYMBOL_GPL(fb_notifier_call_chain); diff --git a/drivers/video/fbdev/core/fb_sys_fops.c b/drivers/video/fbdev/core/fb_sys_fops.c new file mode 100644 index 000000000000..ff275d7f3eaf --- /dev/null +++ b/drivers/video/fbdev/core/fb_sys_fops.c @@ -0,0 +1,104 @@ +/* + * linux/drivers/video/fb_sys_read.c - Generic file operations where + * framebuffer is in system RAM + * + * Copyright (C) 2007 Antonino Daplas + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + * + */ +#include +#include +#include + +ssize_t fb_sys_read(struct fb_info *info, char __user *buf, size_t count, + loff_t *ppos) +{ + unsigned long p = *ppos; + void *src; + int err = 0; + unsigned long total_size; + + if (info->state != FBINFO_STATE_RUNNING) + return -EPERM; + + total_size = info->screen_size; + + if (total_size == 0) + total_size = info->fix.smem_len; + + if (p >= total_size) + return 0; + + if (count >= total_size) + count = total_size; + + if (count + p > total_size) + count = total_size - p; + + src = (void __force *)(info->screen_base + p); + + if (info->fbops->fb_sync) + info->fbops->fb_sync(info); + + if (copy_to_user(buf, src, count)) + err = -EFAULT; + + if (!err) + *ppos += count; + + return (err) ? err : count; +} +EXPORT_SYMBOL_GPL(fb_sys_read); + +ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, + size_t count, loff_t *ppos) +{ + unsigned long p = *ppos; + void *dst; + int err = 0; + unsigned long total_size; + + if (info->state != FBINFO_STATE_RUNNING) + return -EPERM; + + total_size = info->screen_size; + + if (total_size == 0) + total_size = info->fix.smem_len; + + if (p > total_size) + return -EFBIG; + + if (count > total_size) { + err = -EFBIG; + count = total_size; + } + + if (count + p > total_size) { + if (!err) + err = -ENOSPC; + + count = total_size - p; + } + + dst = (void __force *) (info->screen_base + p); + + if (info->fbops->fb_sync) + info->fbops->fb_sync(info); + + if (copy_from_user(dst, buf, count)) + err = -EFAULT; + + if (!err) + *ppos += count; + + return (err) ? err : count; +} +EXPORT_SYMBOL_GPL(fb_sys_write); + +MODULE_AUTHOR("Antonino Daplas "); +MODULE_DESCRIPTION("Generic file read (fb in system RAM)"); +MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev/core/fbcmap.c new file mode 100644 index 000000000000..f89245b8ba8e --- /dev/null +++ b/drivers/video/fbdev/core/fbcmap.c @@ -0,0 +1,362 @@ +/* + * linux/drivers/video/fbcmap.c -- Colormap handling for frame buffer devices + * + * Created 15 Jun 1997 by Geert Uytterhoeven + * + * 2001 - Documented with DocBook + * - Brad Douglas + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + */ + +#include +#include +#include +#include +#include + +static u16 red2[] __read_mostly = { + 0x0000, 0xaaaa +}; +static u16 green2[] __read_mostly = { + 0x0000, 0xaaaa +}; +static u16 blue2[] __read_mostly = { + 0x0000, 0xaaaa +}; + +static u16 red4[] __read_mostly = { + 0x0000, 0xaaaa, 0x5555, 0xffff +}; +static u16 green4[] __read_mostly = { + 0x0000, 0xaaaa, 0x5555, 0xffff +}; +static u16 blue4[] __read_mostly = { + 0x0000, 0xaaaa, 0x5555, 0xffff +}; + +static u16 red8[] __read_mostly = { + 0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa +}; +static u16 green8[] __read_mostly = { + 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa +}; +static u16 blue8[] __read_mostly = { + 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa +}; + +static u16 red16[] __read_mostly = { + 0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa, + 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff +}; +static u16 green16[] __read_mostly = { + 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa, + 0x5555, 0x5555, 0xffff, 0xffff, 0x5555, 0x5555, 0xffff, 0xffff +}; +static u16 blue16[] __read_mostly = { + 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, + 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff +}; + +static const struct fb_cmap default_2_colors = { + .len=2, .red=red2, .green=green2, .blue=blue2 +}; +static const struct fb_cmap default_8_colors = { + .len=8, .red=red8, .green=green8, .blue=blue8 +}; +static const struct fb_cmap default_4_colors = { + .len=4, .red=red4, .green=green4, .blue=blue4 +}; +static const struct fb_cmap default_16_colors = { + .len=16, .red=red16, .green=green16, .blue=blue16 +}; + + + +/** + * fb_alloc_cmap - allocate a colormap + * @cmap: frame buffer colormap structure + * @len: length of @cmap + * @transp: boolean, 1 if there is transparency, 0 otherwise + * @flags: flags for kmalloc memory allocation + * + * Allocates memory for a colormap @cmap. @len is the + * number of entries in the palette. + * + * Returns negative errno on error, or zero on success. + * + */ + +int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags) +{ + int size = len * sizeof(u16); + int ret = -ENOMEM; + + if (cmap->len != len) { + fb_dealloc_cmap(cmap); + if (!len) + return 0; + + cmap->red = kmalloc(size, flags); + if (!cmap->red) + goto fail; + cmap->green = kmalloc(size, flags); + if (!cmap->green) + goto fail; + cmap->blue = kmalloc(size, flags); + if (!cmap->blue) + goto fail; + if (transp) { + cmap->transp = kmalloc(size, flags); + if (!cmap->transp) + goto fail; + } else { + cmap->transp = NULL; + } + } + cmap->start = 0; + cmap->len = len; + ret = fb_copy_cmap(fb_default_cmap(len), cmap); + if (ret) + goto fail; + return 0; + +fail: + fb_dealloc_cmap(cmap); + return ret; +} + +int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp) +{ + return fb_alloc_cmap_gfp(cmap, len, transp, GFP_ATOMIC); +} + +/** + * fb_dealloc_cmap - deallocate a colormap + * @cmap: frame buffer colormap structure + * + * Deallocates a colormap that was previously allocated with + * fb_alloc_cmap(). + * + */ + +void fb_dealloc_cmap(struct fb_cmap *cmap) +{ + kfree(cmap->red); + kfree(cmap->green); + kfree(cmap->blue); + kfree(cmap->transp); + + cmap->red = cmap->green = cmap->blue = cmap->transp = NULL; + cmap->len = 0; +} + +/** + * fb_copy_cmap - copy a colormap + * @from: frame buffer colormap structure + * @to: frame buffer colormap structure + * + * Copy contents of colormap from @from to @to. + */ + +int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to) +{ + int tooff = 0, fromoff = 0; + int size; + + if (to->start > from->start) + fromoff = to->start - from->start; + else + tooff = from->start - to->start; + size = to->len - tooff; + if (size > (int) (from->len - fromoff)) + size = from->len - fromoff; + if (size <= 0) + return -EINVAL; + size *= sizeof(u16); + + memcpy(to->red+tooff, from->red+fromoff, size); + memcpy(to->green+tooff, from->green+fromoff, size); + memcpy(to->blue+tooff, from->blue+fromoff, size); + if (from->transp && to->transp) + memcpy(to->transp+tooff, from->transp+fromoff, size); + return 0; +} + +int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to) +{ + int tooff = 0, fromoff = 0; + int size; + + if (to->start > from->start) + fromoff = to->start - from->start; + else + tooff = from->start - to->start; + size = to->len - tooff; + if (size > (int) (from->len - fromoff)) + size = from->len - fromoff; + if (size <= 0) + return -EINVAL; + size *= sizeof(u16); + + if (copy_to_user(to->red+tooff, from->red+fromoff, size)) + return -EFAULT; + if (copy_to_user(to->green+tooff, from->green+fromoff, size)) + return -EFAULT; + if (copy_to_user(to->blue+tooff, from->blue+fromoff, size)) + return -EFAULT; + if (from->transp && to->transp) + if (copy_to_user(to->transp+tooff, from->transp+fromoff, size)) + return -EFAULT; + return 0; +} + +/** + * fb_set_cmap - set the colormap + * @cmap: frame buffer colormap structure + * @info: frame buffer info structure + * + * Sets the colormap @cmap for a screen of device @info. + * + * Returns negative errno on error, or zero on success. + * + */ + +int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *info) +{ + int i, start, rc = 0; + u16 *red, *green, *blue, *transp; + u_int hred, hgreen, hblue, htransp = 0xffff; + + red = cmap->red; + green = cmap->green; + blue = cmap->blue; + transp = cmap->transp; + start = cmap->start; + + if (start < 0 || (!info->fbops->fb_setcolreg && + !info->fbops->fb_setcmap)) + return -EINVAL; + if (info->fbops->fb_setcmap) { + rc = info->fbops->fb_setcmap(cmap, info); + } else { + for (i = 0; i < cmap->len; i++) { + hred = *red++; + hgreen = *green++; + hblue = *blue++; + if (transp) + htransp = *transp++; + if (info->fbops->fb_setcolreg(start++, + hred, hgreen, hblue, + htransp, info)) + break; + } + } + if (rc == 0) + fb_copy_cmap(cmap, &info->cmap); + + return rc; +} + +int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) +{ + int rc, size = cmap->len * sizeof(u16); + struct fb_cmap umap; + + if (size < 0 || size < cmap->len) + return -E2BIG; + + memset(&umap, 0, sizeof(struct fb_cmap)); + rc = fb_alloc_cmap_gfp(&umap, cmap->len, cmap->transp != NULL, + GFP_KERNEL); + if (rc) + return rc; + if (copy_from_user(umap.red, cmap->red, size) || + copy_from_user(umap.green, cmap->green, size) || + copy_from_user(umap.blue, cmap->blue, size) || + (cmap->transp && copy_from_user(umap.transp, cmap->transp, size))) { + rc = -EFAULT; + goto out; + } + umap.start = cmap->start; + if (!lock_fb_info(info)) { + rc = -ENODEV; + goto out; + } + + rc = fb_set_cmap(&umap, info); + unlock_fb_info(info); +out: + fb_dealloc_cmap(&umap); + return rc; +} + +/** + * fb_default_cmap - get default colormap + * @len: size of palette for a depth + * + * Gets the default colormap for a specific screen depth. @len + * is the size of the palette for a particular screen depth. + * + * Returns pointer to a frame buffer colormap structure. + * + */ + +const struct fb_cmap *fb_default_cmap(int len) +{ + if (len <= 2) + return &default_2_colors; + if (len <= 4) + return &default_4_colors; + if (len <= 8) + return &default_8_colors; + return &default_16_colors; +} + + +/** + * fb_invert_cmaps - invert all defaults colormaps + * + * Invert all default colormaps. + * + */ + +void fb_invert_cmaps(void) +{ + u_int i; + + for (i = 0; i < ARRAY_SIZE(red2); i++) { + red2[i] = ~red2[i]; + green2[i] = ~green2[i]; + blue2[i] = ~blue2[i]; + } + for (i = 0; i < ARRAY_SIZE(red4); i++) { + red4[i] = ~red4[i]; + green4[i] = ~green4[i]; + blue4[i] = ~blue4[i]; + } + for (i = 0; i < ARRAY_SIZE(red8); i++) { + red8[i] = ~red8[i]; + green8[i] = ~green8[i]; + blue8[i] = ~blue8[i]; + } + for (i = 0; i < ARRAY_SIZE(red16); i++) { + red16[i] = ~red16[i]; + green16[i] = ~green16[i]; + blue16[i] = ~blue16[i]; + } +} + + + /* + * Visible symbols for modules + */ + +EXPORT_SYMBOL(fb_alloc_cmap); +EXPORT_SYMBOL(fb_dealloc_cmap); +EXPORT_SYMBOL(fb_copy_cmap); +EXPORT_SYMBOL(fb_set_cmap); +EXPORT_SYMBOL(fb_default_cmap); +EXPORT_SYMBOL(fb_invert_cmaps); diff --git a/drivers/video/fbdev/core/fbcvt.c b/drivers/video/fbdev/core/fbcvt.c new file mode 100644 index 000000000000..7cb715dfc0e1 --- /dev/null +++ b/drivers/video/fbdev/core/fbcvt.c @@ -0,0 +1,379 @@ +/* + * linux/drivers/video/fbcvt.c - VESA(TM) Coordinated Video Timings + * + * Copyright (C) 2005 Antonino Daplas + * + * Based from the VESA(TM) Coordinated Video Timing Generator by + * Graham Loveridge April 9, 2003 available at + * http://www.elo.utfsm.cl/~elo212/docs/CVTd6r1.xls + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + * + */ +#include +#include + +#define FB_CVT_CELLSIZE 8 +#define FB_CVT_GTF_C 40 +#define FB_CVT_GTF_J 20 +#define FB_CVT_GTF_K 128 +#define FB_CVT_GTF_M 600 +#define FB_CVT_MIN_VSYNC_BP 550 +#define FB_CVT_MIN_VPORCH 3 +#define FB_CVT_MIN_BPORCH 6 + +#define FB_CVT_RB_MIN_VBLANK 460 +#define FB_CVT_RB_HBLANK 160 +#define FB_CVT_RB_V_FPORCH 3 + +#define FB_CVT_FLAG_REDUCED_BLANK 1 +#define FB_CVT_FLAG_MARGINS 2 +#define FB_CVT_FLAG_INTERLACED 4 + +struct fb_cvt_data { + u32 xres; + u32 yres; + u32 refresh; + u32 f_refresh; + u32 pixclock; + u32 hperiod; + u32 hblank; + u32 hfreq; + u32 htotal; + u32 vtotal; + u32 vsync; + u32 hsync; + u32 h_front_porch; + u32 h_back_porch; + u32 v_front_porch; + u32 v_back_porch; + u32 h_margin; + u32 v_margin; + u32 interlace; + u32 aspect_ratio; + u32 active_pixels; + u32 flags; + u32 status; +}; + +static const unsigned char fb_cvt_vbi_tab[] = { + 4, /* 4:3 */ + 5, /* 16:9 */ + 6, /* 16:10 */ + 7, /* 5:4 */ + 7, /* 15:9 */ + 8, /* reserved */ + 9, /* reserved */ + 10 /* custom */ +}; + +/* returns hperiod * 1000 */ +static u32 fb_cvt_hperiod(struct fb_cvt_data *cvt) +{ + u32 num = 1000000000/cvt->f_refresh; + u32 den; + + if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK) { + num -= FB_CVT_RB_MIN_VBLANK * 1000; + den = 2 * (cvt->yres/cvt->interlace + 2 * cvt->v_margin); + } else { + num -= FB_CVT_MIN_VSYNC_BP * 1000; + den = 2 * (cvt->yres/cvt->interlace + cvt->v_margin * 2 + + FB_CVT_MIN_VPORCH + cvt->interlace/2); + } + + return 2 * (num/den); +} + +/* returns ideal duty cycle * 1000 */ +static u32 fb_cvt_ideal_duty_cycle(struct fb_cvt_data *cvt) +{ + u32 c_prime = (FB_CVT_GTF_C - FB_CVT_GTF_J) * + (FB_CVT_GTF_K) + 256 * FB_CVT_GTF_J; + u32 m_prime = (FB_CVT_GTF_K * FB_CVT_GTF_M); + u32 h_period_est = cvt->hperiod; + + return (1000 * c_prime - ((m_prime * h_period_est)/1000))/256; +} + +static u32 fb_cvt_hblank(struct fb_cvt_data *cvt) +{ + u32 hblank = 0; + + if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK) + hblank = FB_CVT_RB_HBLANK; + else { + u32 ideal_duty_cycle = fb_cvt_ideal_duty_cycle(cvt); + u32 active_pixels = cvt->active_pixels; + + if (ideal_duty_cycle < 20000) + hblank = (active_pixels * 20000)/ + (100000 - 20000); + else { + hblank = (active_pixels * ideal_duty_cycle)/ + (100000 - ideal_duty_cycle); + } + } + + hblank &= ~((2 * FB_CVT_CELLSIZE) - 1); + + return hblank; +} + +static u32 fb_cvt_hsync(struct fb_cvt_data *cvt) +{ + u32 hsync; + + if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK) + hsync = 32; + else + hsync = (FB_CVT_CELLSIZE * cvt->htotal)/100; + + hsync &= ~(FB_CVT_CELLSIZE - 1); + return hsync; +} + +static u32 fb_cvt_vbi_lines(struct fb_cvt_data *cvt) +{ + u32 vbi_lines, min_vbi_lines, act_vbi_lines; + + if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK) { + vbi_lines = (1000 * FB_CVT_RB_MIN_VBLANK)/cvt->hperiod + 1; + min_vbi_lines = FB_CVT_RB_V_FPORCH + cvt->vsync + + FB_CVT_MIN_BPORCH; + + } else { + vbi_lines = (FB_CVT_MIN_VSYNC_BP * 1000)/cvt->hperiod + 1 + + FB_CVT_MIN_VPORCH; + min_vbi_lines = cvt->vsync + FB_CVT_MIN_BPORCH + + FB_CVT_MIN_VPORCH; + } + + if (vbi_lines < min_vbi_lines) + act_vbi_lines = min_vbi_lines; + else + act_vbi_lines = vbi_lines; + + return act_vbi_lines; +} + +static u32 fb_cvt_vtotal(struct fb_cvt_data *cvt) +{ + u32 vtotal = cvt->yres/cvt->interlace; + + vtotal += 2 * cvt->v_margin + cvt->interlace/2 + fb_cvt_vbi_lines(cvt); + vtotal |= cvt->interlace/2; + + return vtotal; +} + +static u32 fb_cvt_pixclock(struct fb_cvt_data *cvt) +{ + u32 pixclock; + + if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK) + pixclock = (cvt->f_refresh * cvt->vtotal * cvt->htotal)/1000; + else + pixclock = (cvt->htotal * 1000000)/cvt->hperiod; + + pixclock /= 250; + pixclock *= 250; + pixclock *= 1000; + + return pixclock; +} + +static u32 fb_cvt_aspect_ratio(struct fb_cvt_data *cvt) +{ + u32 xres = cvt->xres; + u32 yres = cvt->yres; + u32 aspect = -1; + + if (xres == (yres * 4)/3 && !((yres * 4) % 3)) + aspect = 0; + else if (xres == (yres * 16)/9 && !((yres * 16) % 9)) + aspect = 1; + else if (xres == (yres * 16)/10 && !((yres * 16) % 10)) + aspect = 2; + else if (xres == (yres * 5)/4 && !((yres * 5) % 4)) + aspect = 3; + else if (xres == (yres * 15)/9 && !((yres * 15) % 9)) + aspect = 4; + else { + printk(KERN_INFO "fbcvt: Aspect ratio not CVT " + "standard\n"); + aspect = 7; + cvt->status = 1; + } + + return aspect; +} + +static void fb_cvt_print_name(struct fb_cvt_data *cvt) +{ + u32 pixcount, pixcount_mod; + int cnt = 255, offset = 0, read = 0; + u8 *buf = kzalloc(256, GFP_KERNEL); + + if (!buf) + return; + + pixcount = (cvt->xres * (cvt->yres/cvt->interlace))/1000000; + pixcount_mod = (cvt->xres * (cvt->yres/cvt->interlace)) % 1000000; + pixcount_mod /= 1000; + + read = snprintf(buf+offset, cnt, "fbcvt: %dx%d@%d: CVT Name - ", + cvt->xres, cvt->yres, cvt->refresh); + offset += read; + cnt -= read; + + if (cvt->status) + snprintf(buf+offset, cnt, "Not a CVT standard - %d.%03d Mega " + "Pixel Image\n", pixcount, pixcount_mod); + else { + if (pixcount) { + read = snprintf(buf+offset, cnt, "%d", pixcount); + cnt -= read; + offset += read; + } + + read = snprintf(buf+offset, cnt, ".%03dM", pixcount_mod); + cnt -= read; + offset += read; + + if (cvt->aspect_ratio == 0) + read = snprintf(buf+offset, cnt, "3"); + else if (cvt->aspect_ratio == 3) + read = snprintf(buf+offset, cnt, "4"); + else if (cvt->aspect_ratio == 1 || cvt->aspect_ratio == 4) + read = snprintf(buf+offset, cnt, "9"); + else if (cvt->aspect_ratio == 2) + read = snprintf(buf+offset, cnt, "A"); + else + read = 0; + cnt -= read; + offset += read; + + if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK) { + read = snprintf(buf+offset, cnt, "-R"); + cnt -= read; + offset += read; + } + } + + printk(KERN_INFO "%s\n", buf); + kfree(buf); +} + +static void fb_cvt_convert_to_mode(struct fb_cvt_data *cvt, + struct fb_videomode *mode) +{ + mode->refresh = cvt->f_refresh; + mode->pixclock = KHZ2PICOS(cvt->pixclock/1000); + mode->left_margin = cvt->h_back_porch; + mode->right_margin = cvt->h_front_porch; + mode->hsync_len = cvt->hsync; + mode->upper_margin = cvt->v_back_porch; + mode->lower_margin = cvt->v_front_porch; + mode->vsync_len = cvt->vsync; + + mode->sync &= ~(FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT); + + if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK) + mode->sync |= FB_SYNC_HOR_HIGH_ACT; + else + mode->sync |= FB_SYNC_VERT_HIGH_ACT; +} + +/* + * fb_find_mode_cvt - calculate mode using VESA(TM) CVT + * @mode: pointer to fb_videomode; xres, yres, refresh and vmode must be + * pre-filled with the desired values + * @margins: add margin to calculation (1.8% of xres and yres) + * @rb: compute with reduced blanking (for flatpanels) + * + * RETURNS: + * 0 for success + * @mode is filled with computed values. If interlaced, the refresh field + * will be filled with the field rate (2x the frame rate) + * + * DESCRIPTION: + * Computes video timings using VESA(TM) Coordinated Video Timings + */ +int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb) +{ + struct fb_cvt_data cvt; + + memset(&cvt, 0, sizeof(cvt)); + + if (margins) + cvt.flags |= FB_CVT_FLAG_MARGINS; + + if (rb) + cvt.flags |= FB_CVT_FLAG_REDUCED_BLANK; + + if (mode->vmode & FB_VMODE_INTERLACED) + cvt.flags |= FB_CVT_FLAG_INTERLACED; + + cvt.xres = mode->xres; + cvt.yres = mode->yres; + cvt.refresh = mode->refresh; + cvt.f_refresh = cvt.refresh; + cvt.interlace = 1; + + if (!cvt.xres || !cvt.yres || !cvt.refresh) { + printk(KERN_INFO "fbcvt: Invalid input parameters\n"); + return 1; + } + + if (!(cvt.refresh == 50 || cvt.refresh == 60 || cvt.refresh == 70 || + cvt.refresh == 85)) { + printk(KERN_INFO "fbcvt: Refresh rate not CVT " + "standard\n"); + cvt.status = 1; + } + + cvt.xres &= ~(FB_CVT_CELLSIZE - 1); + + if (cvt.flags & FB_CVT_FLAG_INTERLACED) { + cvt.interlace = 2; + cvt.f_refresh *= 2; + } + + if (cvt.flags & FB_CVT_FLAG_REDUCED_BLANK) { + if (cvt.refresh != 60) { + printk(KERN_INFO "fbcvt: 60Hz refresh rate " + "advised for reduced blanking\n"); + cvt.status = 1; + } + } + + if (cvt.flags & FB_CVT_FLAG_MARGINS) { + cvt.h_margin = (cvt.xres * 18)/1000; + cvt.h_margin &= ~(FB_CVT_CELLSIZE - 1); + cvt.v_margin = ((cvt.yres/cvt.interlace)* 18)/1000; + } + + cvt.aspect_ratio = fb_cvt_aspect_ratio(&cvt); + cvt.active_pixels = cvt.xres + 2 * cvt.h_margin; + cvt.hperiod = fb_cvt_hperiod(&cvt); + cvt.vsync = fb_cvt_vbi_tab[cvt.aspect_ratio]; + cvt.vtotal = fb_cvt_vtotal(&cvt); + cvt.hblank = fb_cvt_hblank(&cvt); + cvt.htotal = cvt.active_pixels + cvt.hblank; + cvt.hsync = fb_cvt_hsync(&cvt); + cvt.pixclock = fb_cvt_pixclock(&cvt); + cvt.hfreq = cvt.pixclock/cvt.htotal; + cvt.h_back_porch = cvt.hblank/2 + cvt.h_margin; + cvt.h_front_porch = cvt.hblank - cvt.hsync - cvt.h_back_porch + + 2 * cvt.h_margin; + cvt.v_back_porch = 3 + cvt.v_margin; + cvt.v_front_porch = cvt.vtotal - cvt.yres/cvt.interlace - + cvt.v_back_porch - cvt.vsync; + fb_cvt_print_name(&cvt); + fb_cvt_convert_to_mode(&cvt, mode); + + return 0; +} diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c new file mode 100644 index 000000000000..b6d5008f361f --- /dev/null +++ b/drivers/video/fbdev/core/fbmem.c @@ -0,0 +1,2002 @@ +/* + * linux/drivers/video/fbmem.c + * + * Copyright (C) 1994 Martin Schaller + * + * 2001 - Documented with DocBook + * - Brad Douglas + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + /* + * Frame buffer device initialization and setup routines + */ + +#define FBPIXMAPSIZE (1024 * 8) + +static DEFINE_MUTEX(registration_lock); + +struct fb_info *registered_fb[FB_MAX] __read_mostly; +EXPORT_SYMBOL(registered_fb); + +int num_registered_fb __read_mostly; +EXPORT_SYMBOL(num_registered_fb); + +static struct fb_info *get_fb_info(unsigned int idx) +{ + struct fb_info *fb_info; + + if (idx >= FB_MAX) + return ERR_PTR(-ENODEV); + + mutex_lock(®istration_lock); + fb_info = registered_fb[idx]; + if (fb_info) + atomic_inc(&fb_info->count); + mutex_unlock(®istration_lock); + + return fb_info; +} + +static void put_fb_info(struct fb_info *fb_info) +{ + if (!atomic_dec_and_test(&fb_info->count)) + return; + if (fb_info->fbops->fb_destroy) + fb_info->fbops->fb_destroy(fb_info); +} + +int lock_fb_info(struct fb_info *info) +{ + mutex_lock(&info->lock); + if (!info->fbops) { + mutex_unlock(&info->lock); + return 0; + } + return 1; +} +EXPORT_SYMBOL(lock_fb_info); + +/* + * Helpers + */ + +int fb_get_color_depth(struct fb_var_screeninfo *var, + struct fb_fix_screeninfo *fix) +{ + int depth = 0; + + if (fix->visual == FB_VISUAL_MONO01 || + fix->visual == FB_VISUAL_MONO10) + depth = 1; + else { + if (var->green.length == var->blue.length && + var->green.length == var->red.length && + var->green.offset == var->blue.offset && + var->green.offset == var->red.offset) + depth = var->green.length; + else + depth = var->green.length + var->red.length + + var->blue.length; + } + + return depth; +} +EXPORT_SYMBOL(fb_get_color_depth); + +/* + * Data padding functions. + */ +void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height) +{ + __fb_pad_aligned_buffer(dst, d_pitch, src, s_pitch, height); +} +EXPORT_SYMBOL(fb_pad_aligned_buffer); + +void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, u32 height, + u32 shift_high, u32 shift_low, u32 mod) +{ + u8 mask = (u8) (0xfff << shift_high), tmp; + int i, j; + + for (i = height; i--; ) { + for (j = 0; j < idx; j++) { + tmp = dst[j]; + tmp &= mask; + tmp |= *src >> shift_low; + dst[j] = tmp; + tmp = *src << shift_high; + dst[j+1] = tmp; + src++; + } + tmp = dst[idx]; + tmp &= mask; + tmp |= *src >> shift_low; + dst[idx] = tmp; + if (shift_high < mod) { + tmp = *src << shift_high; + dst[idx+1] = tmp; + } + src++; + dst += d_pitch; + } +} +EXPORT_SYMBOL(fb_pad_unaligned_buffer); + +/* + * we need to lock this section since fb_cursor + * may use fb_imageblit() + */ +char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size) +{ + u32 align = buf->buf_align - 1, offset; + char *addr = buf->addr; + + /* If IO mapped, we need to sync before access, no sharing of + * the pixmap is done + */ + if (buf->flags & FB_PIXMAP_IO) { + if (info->fbops->fb_sync && (buf->flags & FB_PIXMAP_SYNC)) + info->fbops->fb_sync(info); + return addr; + } + + /* See if we fit in the remaining pixmap space */ + offset = buf->offset + align; + offset &= ~align; + if (offset + size > buf->size) { + /* We do not fit. In order to be able to re-use the buffer, + * we must ensure no asynchronous DMA'ing or whatever operation + * is in progress, we sync for that. + */ + if (info->fbops->fb_sync && (buf->flags & FB_PIXMAP_SYNC)) + info->fbops->fb_sync(info); + offset = 0; + } + buf->offset = offset + size; + addr += offset; + + return addr; +} +EXPORT_SYMBOL(fb_get_buffer_offset); + +#ifdef CONFIG_LOGO + +static inline unsigned safe_shift(unsigned d, int n) +{ + return n < 0 ? d >> -n : d << n; +} + +static void fb_set_logocmap(struct fb_info *info, + const struct linux_logo *logo) +{ + struct fb_cmap palette_cmap; + u16 palette_green[16]; + u16 palette_blue[16]; + u16 palette_red[16]; + int i, j, n; + const unsigned char *clut = logo->clut; + + palette_cmap.start = 0; + palette_cmap.len = 16; + palette_cmap.red = palette_red; + palette_cmap.green = palette_green; + palette_cmap.blue = palette_blue; + palette_cmap.transp = NULL; + + for (i = 0; i < logo->clutsize; i += n) { + n = logo->clutsize - i; + /* palette_cmap provides space for only 16 colors at once */ + if (n > 16) + n = 16; + palette_cmap.start = 32 + i; + palette_cmap.len = n; + for (j = 0; j < n; ++j) { + palette_cmap.red[j] = clut[0] << 8 | clut[0]; + palette_cmap.green[j] = clut[1] << 8 | clut[1]; + palette_cmap.blue[j] = clut[2] << 8 | clut[2]; + clut += 3; + } + fb_set_cmap(&palette_cmap, info); + } +} + +static void fb_set_logo_truepalette(struct fb_info *info, + const struct linux_logo *logo, + u32 *palette) +{ + static const unsigned char mask[] = { 0,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff }; + unsigned char redmask, greenmask, bluemask; + int redshift, greenshift, blueshift; + int i; + const unsigned char *clut = logo->clut; + + /* + * We have to create a temporary palette since console palette is only + * 16 colors long. + */ + /* Bug: Doesn't obey msb_right ... (who needs that?) */ + redmask = mask[info->var.red.length < 8 ? info->var.red.length : 8]; + greenmask = mask[info->var.green.length < 8 ? info->var.green.length : 8]; + bluemask = mask[info->var.blue.length < 8 ? info->var.blue.length : 8]; + redshift = info->var.red.offset - (8 - info->var.red.length); + greenshift = info->var.green.offset - (8 - info->var.green.length); + blueshift = info->var.blue.offset - (8 - info->var.blue.length); + + for ( i = 0; i < logo->clutsize; i++) { + palette[i+32] = (safe_shift((clut[0] & redmask), redshift) | + safe_shift((clut[1] & greenmask), greenshift) | + safe_shift((clut[2] & bluemask), blueshift)); + clut += 3; + } +} + +static void fb_set_logo_directpalette(struct fb_info *info, + const struct linux_logo *logo, + u32 *palette) +{ + int redshift, greenshift, blueshift; + int i; + + redshift = info->var.red.offset; + greenshift = info->var.green.offset; + blueshift = info->var.blue.offset; + + for (i = 32; i < 32 + logo->clutsize; i++) + palette[i] = i << redshift | i << greenshift | i << blueshift; +} + +static void fb_set_logo(struct fb_info *info, + const struct linux_logo *logo, u8 *dst, + int depth) +{ + int i, j, k; + const u8 *src = logo->data; + u8 xor = (info->fix.visual == FB_VISUAL_MONO01) ? 0xff : 0; + u8 fg = 1, d; + + switch (fb_get_color_depth(&info->var, &info->fix)) { + case 1: + fg = 1; + break; + case 2: + fg = 3; + break; + default: + fg = 7; + break; + } + + if (info->fix.visual == FB_VISUAL_MONO01 || + info->fix.visual == FB_VISUAL_MONO10) + fg = ~((u8) (0xfff << info->var.green.length)); + + switch (depth) { + case 4: + for (i = 0; i < logo->height; i++) + for (j = 0; j < logo->width; src++) { + *dst++ = *src >> 4; + j++; + if (j < logo->width) { + *dst++ = *src & 0x0f; + j++; + } + } + break; + case 1: + for (i = 0; i < logo->height; i++) { + for (j = 0; j < logo->width; src++) { + d = *src ^ xor; + for (k = 7; k >= 0; k--) { + *dst++ = ((d >> k) & 1) ? fg : 0; + j++; + } + } + } + break; + } +} + +/* + * Three (3) kinds of logo maps exist. linux_logo_clut224 (>16 colors), + * linux_logo_vga16 (16 colors) and linux_logo_mono (2 colors). Depending on + * the visual format and color depth of the framebuffer, the DAC, the + * pseudo_palette, and the logo data will be adjusted accordingly. + * + * Case 1 - linux_logo_clut224: + * Color exceeds the number of console colors (16), thus we set the hardware DAC + * using fb_set_cmap() appropriately. The "needs_cmapreset" flag will be set. + * + * For visuals that require color info from the pseudo_palette, we also construct + * one for temporary use. The "needs_directpalette" or "needs_truepalette" flags + * will be set. + * + * Case 2 - linux_logo_vga16: + * The number of colors just matches the console colors, thus there is no need + * to set the DAC or the pseudo_palette. However, the bitmap is packed, ie, + * each byte contains color information for two pixels (upper and lower nibble). + * To be consistent with fb_imageblit() usage, we therefore separate the two + * nibbles into separate bytes. The "depth" flag will be set to 4. + * + * Case 3 - linux_logo_mono: + * This is similar with Case 2. Each byte contains information for 8 pixels. + * We isolate each bit and expand each into a byte. The "depth" flag will + * be set to 1. + */ +static struct logo_data { + int depth; + int needs_directpalette; + int needs_truepalette; + int needs_cmapreset; + const struct linux_logo *logo; +} fb_logo __read_mostly; + +static void fb_rotate_logo_ud(const u8 *in, u8 *out, u32 width, u32 height) +{ + u32 size = width * height, i; + + out += size - 1; + + for (i = size; i--; ) + *out-- = *in++; +} + +static void fb_rotate_logo_cw(const u8 *in, u8 *out, u32 width, u32 height) +{ + int i, j, h = height - 1; + + for (i = 0; i < height; i++) + for (j = 0; j < width; j++) + out[height * j + h - i] = *in++; +} + +static void fb_rotate_logo_ccw(const u8 *in, u8 *out, u32 width, u32 height) +{ + int i, j, w = width - 1; + + for (i = 0; i < height; i++) + for (j = 0; j < width; j++) + out[height * (w - j) + i] = *in++; +} + +static void fb_rotate_logo(struct fb_info *info, u8 *dst, + struct fb_image *image, int rotate) +{ + u32 tmp; + + if (rotate == FB_ROTATE_UD) { + fb_rotate_logo_ud(image->data, dst, image->width, + image->height); + image->dx = info->var.xres - image->width - image->dx; + image->dy = info->var.yres - image->height - image->dy; + } else if (rotate == FB_ROTATE_CW) { + fb_rotate_logo_cw(image->data, dst, image->width, + image->height); + tmp = image->width; + image->width = image->height; + image->height = tmp; + tmp = image->dy; + image->dy = image->dx; + image->dx = info->var.xres - image->width - tmp; + } else if (rotate == FB_ROTATE_CCW) { + fb_rotate_logo_ccw(image->data, dst, image->width, + image->height); + tmp = image->width; + image->width = image->height; + image->height = tmp; + tmp = image->dx; + image->dx = image->dy; + image->dy = info->var.yres - image->height - tmp; + } + + image->data = dst; +} + +static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, + int rotate, unsigned int num) +{ + unsigned int x; + + if (rotate == FB_ROTATE_UR) { + for (x = 0; + x < num && image->dx + image->width <= info->var.xres; + x++) { + info->fbops->fb_imageblit(info, image); + image->dx += image->width + 8; + } + } else if (rotate == FB_ROTATE_UD) { + for (x = 0; x < num && image->dx >= 0; x++) { + info->fbops->fb_imageblit(info, image); + image->dx -= image->width + 8; + } + } else if (rotate == FB_ROTATE_CW) { + for (x = 0; + x < num && image->dy + image->height <= info->var.yres; + x++) { + info->fbops->fb_imageblit(info, image); + image->dy += image->height + 8; + } + } else if (rotate == FB_ROTATE_CCW) { + for (x = 0; x < num && image->dy >= 0; x++) { + info->fbops->fb_imageblit(info, image); + image->dy -= image->height + 8; + } + } +} + +static int fb_show_logo_line(struct fb_info *info, int rotate, + const struct linux_logo *logo, int y, + unsigned int n) +{ + u32 *palette = NULL, *saved_pseudo_palette = NULL; + unsigned char *logo_new = NULL, *logo_rotate = NULL; + struct fb_image image; + + /* Return if the frame buffer is not mapped or suspended */ + if (logo == NULL || info->state != FBINFO_STATE_RUNNING || + info->flags & FBINFO_MODULE) + return 0; + + image.depth = 8; + image.data = logo->data; + + if (fb_logo.needs_cmapreset) + fb_set_logocmap(info, logo); + + if (fb_logo.needs_truepalette || + fb_logo.needs_directpalette) { + palette = kmalloc(256 * 4, GFP_KERNEL); + if (palette == NULL) + return 0; + + if (fb_logo.needs_truepalette) + fb_set_logo_truepalette(info, logo, palette); + else + fb_set_logo_directpalette(info, logo, palette); + + saved_pseudo_palette = info->pseudo_palette; + info->pseudo_palette = palette; + } + + if (fb_logo.depth <= 4) { + logo_new = kmalloc(logo->width * logo->height, GFP_KERNEL); + if (logo_new == NULL) { + kfree(palette); + if (saved_pseudo_palette) + info->pseudo_palette = saved_pseudo_palette; + return 0; + } + image.data = logo_new; + fb_set_logo(info, logo, logo_new, fb_logo.depth); + } + + image.dx = 0; + image.dy = y; + image.width = logo->width; + image.height = logo->height; + + if (rotate) { + logo_rotate = kmalloc(logo->width * + logo->height, GFP_KERNEL); + if (logo_rotate) + fb_rotate_logo(info, logo_rotate, &image, rotate); + } + + fb_do_show_logo(info, &image, rotate, n); + + kfree(palette); + if (saved_pseudo_palette != NULL) + info->pseudo_palette = saved_pseudo_palette; + kfree(logo_new); + kfree(logo_rotate); + return logo->height; +} + + +#ifdef CONFIG_FB_LOGO_EXTRA + +#define FB_LOGO_EX_NUM_MAX 10 +static struct logo_data_extra { + const struct linux_logo *logo; + unsigned int n; +} fb_logo_ex[FB_LOGO_EX_NUM_MAX]; +static unsigned int fb_logo_ex_num; + +void fb_append_extra_logo(const struct linux_logo *logo, unsigned int n) +{ + if (!n || fb_logo_ex_num == FB_LOGO_EX_NUM_MAX) + return; + + fb_logo_ex[fb_logo_ex_num].logo = logo; + fb_logo_ex[fb_logo_ex_num].n = n; + fb_logo_ex_num++; +} + +static int fb_prepare_extra_logos(struct fb_info *info, unsigned int height, + unsigned int yres) +{ + unsigned int i; + + /* FIXME: logo_ex supports only truecolor fb. */ + if (info->fix.visual != FB_VISUAL_TRUECOLOR) + fb_logo_ex_num = 0; + + for (i = 0; i < fb_logo_ex_num; i++) { + if (fb_logo_ex[i].logo->type != fb_logo.logo->type) { + fb_logo_ex[i].logo = NULL; + continue; + } + height += fb_logo_ex[i].logo->height; + if (height > yres) { + height -= fb_logo_ex[i].logo->height; + fb_logo_ex_num = i; + break; + } + } + return height; +} + +static int fb_show_extra_logos(struct fb_info *info, int y, int rotate) +{ + unsigned int i; + + for (i = 0; i < fb_logo_ex_num; i++) + y += fb_show_logo_line(info, rotate, + fb_logo_ex[i].logo, y, fb_logo_ex[i].n); + + return y; +} + +#else /* !CONFIG_FB_LOGO_EXTRA */ + +static inline int fb_prepare_extra_logos(struct fb_info *info, + unsigned int height, + unsigned int yres) +{ + return height; +} + +static inline int fb_show_extra_logos(struct fb_info *info, int y, int rotate) +{ + return y; +} + +#endif /* CONFIG_FB_LOGO_EXTRA */ + + +int fb_prepare_logo(struct fb_info *info, int rotate) +{ + int depth = fb_get_color_depth(&info->var, &info->fix); + unsigned int yres; + + memset(&fb_logo, 0, sizeof(struct logo_data)); + + if (info->flags & FBINFO_MISC_TILEBLITTING || + info->flags & FBINFO_MODULE) + return 0; + + if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) { + depth = info->var.blue.length; + if (info->var.red.length < depth) + depth = info->var.red.length; + if (info->var.green.length < depth) + depth = info->var.green.length; + } + + if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR && depth > 4) { + /* assume console colormap */ + depth = 4; + } + + /* Return if no suitable logo was found */ + fb_logo.logo = fb_find_logo(depth); + + if (!fb_logo.logo) { + return 0; + } + + if (rotate == FB_ROTATE_UR || rotate == FB_ROTATE_UD) + yres = info->var.yres; + else + yres = info->var.xres; + + if (fb_logo.logo->height > yres) { + fb_logo.logo = NULL; + return 0; + } + + /* What depth we asked for might be different from what we get */ + if (fb_logo.logo->type == LINUX_LOGO_CLUT224) + fb_logo.depth = 8; + else if (fb_logo.logo->type == LINUX_LOGO_VGA16) + fb_logo.depth = 4; + else + fb_logo.depth = 1; + + + if (fb_logo.depth > 4 && depth > 4) { + switch (info->fix.visual) { + case FB_VISUAL_TRUECOLOR: + fb_logo.needs_truepalette = 1; + break; + case FB_VISUAL_DIRECTCOLOR: + fb_logo.needs_directpalette = 1; + fb_logo.needs_cmapreset = 1; + break; + case FB_VISUAL_PSEUDOCOLOR: + fb_logo.needs_cmapreset = 1; + break; + } + } + + return fb_prepare_extra_logos(info, fb_logo.logo->height, yres); +} + +int fb_show_logo(struct fb_info *info, int rotate) +{ + int y; + + y = fb_show_logo_line(info, rotate, fb_logo.logo, 0, + num_online_cpus()); + y = fb_show_extra_logos(info, y, rotate); + + return y; +} +#else +int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; } +int fb_show_logo(struct fb_info *info, int rotate) { return 0; } +#endif /* CONFIG_LOGO */ +EXPORT_SYMBOL(fb_show_logo); + +static void *fb_seq_start(struct seq_file *m, loff_t *pos) +{ + mutex_lock(®istration_lock); + return (*pos < FB_MAX) ? pos : NULL; +} + +static void *fb_seq_next(struct seq_file *m, void *v, loff_t *pos) +{ + (*pos)++; + return (*pos < FB_MAX) ? pos : NULL; +} + +static void fb_seq_stop(struct seq_file *m, void *v) +{ + mutex_unlock(®istration_lock); +} + +static int fb_seq_show(struct seq_file *m, void *v) +{ + int i = *(loff_t *)v; + struct fb_info *fi = registered_fb[i]; + + if (fi) + seq_printf(m, "%d %s\n", fi->node, fi->fix.id); + return 0; +} + +static const struct seq_operations proc_fb_seq_ops = { + .start = fb_seq_start, + .next = fb_seq_next, + .stop = fb_seq_stop, + .show = fb_seq_show, +}; + +static int proc_fb_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &proc_fb_seq_ops); +} + +static const struct file_operations fb_proc_fops = { + .owner = THIS_MODULE, + .open = proc_fb_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +/* + * We hold a reference to the fb_info in file->private_data, + * but if the current registered fb has changed, we don't + * actually want to use it. + * + * So look up the fb_info using the inode minor number, + * and just verify it against the reference we have. + */ +static struct fb_info *file_fb_info(struct file *file) +{ + struct inode *inode = file_inode(file); + int fbidx = iminor(inode); + struct fb_info *info = registered_fb[fbidx]; + + if (info != file->private_data) + info = NULL; + return info; +} + +static ssize_t +fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) +{ + unsigned long p = *ppos; + struct fb_info *info = file_fb_info(file); + u8 *buffer, *dst; + u8 __iomem *src; + int c, cnt = 0, err = 0; + unsigned long total_size; + + if (!info || ! info->screen_base) + return -ENODEV; + + if (info->state != FBINFO_STATE_RUNNING) + return -EPERM; + + if (info->fbops->fb_read) + return info->fbops->fb_read(info, buf, count, ppos); + + total_size = info->screen_size; + + if (total_size == 0) + total_size = info->fix.smem_len; + + if (p >= total_size) + return 0; + + if (count >= total_size) + count = total_size; + + if (count + p > total_size) + count = total_size - p; + + buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, + GFP_KERNEL); + if (!buffer) + return -ENOMEM; + + src = (u8 __iomem *) (info->screen_base + p); + + if (info->fbops->fb_sync) + info->fbops->fb_sync(info); + + while (count) { + c = (count > PAGE_SIZE) ? PAGE_SIZE : count; + dst = buffer; + fb_memcpy_fromfb(dst, src, c); + dst += c; + src += c; + + if (copy_to_user(buf, buffer, c)) { + err = -EFAULT; + break; + } + *ppos += c; + buf += c; + cnt += c; + count -= c; + } + + kfree(buffer); + + return (err) ? err : cnt; +} + +static ssize_t +fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) +{ + unsigned long p = *ppos; + struct fb_info *info = file_fb_info(file); + u8 *buffer, *src; + u8 __iomem *dst; + int c, cnt = 0, err = 0; + unsigned long total_size; + + if (!info || !info->screen_base) + return -ENODEV; + + if (info->state != FBINFO_STATE_RUNNING) + return -EPERM; + + if (info->fbops->fb_write) + return info->fbops->fb_write(info, buf, count, ppos); + + total_size = info->screen_size; + + if (total_size == 0) + total_size = info->fix.smem_len; + + if (p > total_size) + return -EFBIG; + + if (count > total_size) { + err = -EFBIG; + count = total_size; + } + + if (count + p > total_size) { + if (!err) + err = -ENOSPC; + + count = total_size - p; + } + + buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, + GFP_KERNEL); + if (!buffer) + return -ENOMEM; + + dst = (u8 __iomem *) (info->screen_base + p); + + if (info->fbops->fb_sync) + info->fbops->fb_sync(info); + + while (count) { + c = (count > PAGE_SIZE) ? PAGE_SIZE : count; + src = buffer; + + if (copy_from_user(src, buf, c)) { + err = -EFAULT; + break; + } + + fb_memcpy_tofb(dst, src, c); + dst += c; + src += c; + *ppos += c; + buf += c; + cnt += c; + count -= c; + } + + kfree(buffer); + + return (cnt) ? cnt : err; +} + +int +fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) +{ + struct fb_fix_screeninfo *fix = &info->fix; + unsigned int yres = info->var.yres; + int err = 0; + + if (var->yoffset > 0) { + if (var->vmode & FB_VMODE_YWRAP) { + if (!fix->ywrapstep || (var->yoffset % fix->ywrapstep)) + err = -EINVAL; + else + yres = 0; + } else if (!fix->ypanstep || (var->yoffset % fix->ypanstep)) + err = -EINVAL; + } + + if (var->xoffset > 0 && (!fix->xpanstep || + (var->xoffset % fix->xpanstep))) + err = -EINVAL; + + if (err || !info->fbops->fb_pan_display || + var->yoffset > info->var.yres_virtual - yres || + var->xoffset > info->var.xres_virtual - info->var.xres) + return -EINVAL; + + if ((err = info->fbops->fb_pan_display(var, info))) + return err; + info->var.xoffset = var->xoffset; + info->var.yoffset = var->yoffset; + if (var->vmode & FB_VMODE_YWRAP) + info->var.vmode |= FB_VMODE_YWRAP; + else + info->var.vmode &= ~FB_VMODE_YWRAP; + return 0; +} +EXPORT_SYMBOL(fb_pan_display); + +static int fb_check_caps(struct fb_info *info, struct fb_var_screeninfo *var, + u32 activate) +{ + struct fb_event event; + struct fb_blit_caps caps, fbcaps; + int err = 0; + + memset(&caps, 0, sizeof(caps)); + memset(&fbcaps, 0, sizeof(fbcaps)); + caps.flags = (activate & FB_ACTIVATE_ALL) ? 1 : 0; + event.info = info; + event.data = ∩︀ + fb_notifier_call_chain(FB_EVENT_GET_REQ, &event); + info->fbops->fb_get_caps(info, &fbcaps, var); + + if (((fbcaps.x ^ caps.x) & caps.x) || + ((fbcaps.y ^ caps.y) & caps.y) || + (fbcaps.len < caps.len)) + err = -EINVAL; + + return err; +} + +int +fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) +{ + int flags = info->flags; + int ret = 0; + + if (var->activate & FB_ACTIVATE_INV_MODE) { + struct fb_videomode mode1, mode2; + + fb_var_to_videomode(&mode1, var); + fb_var_to_videomode(&mode2, &info->var); + /* make sure we don't delete the videomode of current var */ + ret = fb_mode_is_equal(&mode1, &mode2); + + if (!ret) { + struct fb_event event; + + event.info = info; + event.data = &mode1; + ret = fb_notifier_call_chain(FB_EVENT_MODE_DELETE, &event); + } + + if (!ret) + fb_delete_videomode(&mode1, &info->modelist); + + + ret = (ret) ? -EINVAL : 0; + goto done; + } + + if ((var->activate & FB_ACTIVATE_FORCE) || + memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) { + u32 activate = var->activate; + + /* When using FOURCC mode, make sure the red, green, blue and + * transp fields are set to 0. + */ + if ((info->fix.capabilities & FB_CAP_FOURCC) && + var->grayscale > 1) { + if (var->red.offset || var->green.offset || + var->blue.offset || var->transp.offset || + var->red.length || var->green.length || + var->blue.length || var->transp.length || + var->red.msb_right || var->green.msb_right || + var->blue.msb_right || var->transp.msb_right) + return -EINVAL; + } + + if (!info->fbops->fb_check_var) { + *var = info->var; + goto done; + } + + ret = info->fbops->fb_check_var(var, info); + + if (ret) + goto done; + + if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) { + struct fb_var_screeninfo old_var; + struct fb_videomode mode; + + if (info->fbops->fb_get_caps) { + ret = fb_check_caps(info, var, activate); + + if (ret) + goto done; + } + + old_var = info->var; + info->var = *var; + + if (info->fbops->fb_set_par) { + ret = info->fbops->fb_set_par(info); + + if (ret) { + info->var = old_var; + printk(KERN_WARNING "detected " + "fb_set_par error, " + "error code: %d\n", ret); + goto done; + } + } + + fb_pan_display(info, &info->var); + fb_set_cmap(&info->cmap, info); + fb_var_to_videomode(&mode, &info->var); + + if (info->modelist.prev && info->modelist.next && + !list_empty(&info->modelist)) + ret = fb_add_videomode(&mode, &info->modelist); + + if (!ret && (flags & FBINFO_MISC_USEREVENT)) { + struct fb_event event; + int evnt = (activate & FB_ACTIVATE_ALL) ? + FB_EVENT_MODE_CHANGE_ALL : + FB_EVENT_MODE_CHANGE; + + info->flags &= ~FBINFO_MISC_USEREVENT; + event.info = info; + event.data = &mode; + fb_notifier_call_chain(evnt, &event); + } + } + } + + done: + return ret; +} +EXPORT_SYMBOL(fb_set_var); + +int +fb_blank(struct fb_info *info, int blank) +{ + struct fb_event event; + int ret = -EINVAL, early_ret; + + if (blank > FB_BLANK_POWERDOWN) + blank = FB_BLANK_POWERDOWN; + + event.info = info; + event.data = ␣ + + early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event); + + if (info->fbops->fb_blank) + ret = info->fbops->fb_blank(blank, info); + + if (!ret) + fb_notifier_call_chain(FB_EVENT_BLANK, &event); + else { + /* + * if fb_blank is failed then revert effects of + * the early blank event. + */ + if (!early_ret) + fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event); + } + + return ret; +} +EXPORT_SYMBOL(fb_blank); + +static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, + unsigned long arg) +{ + struct fb_ops *fb; + struct fb_var_screeninfo var; + struct fb_fix_screeninfo fix; + struct fb_con2fbmap con2fb; + struct fb_cmap cmap_from; + struct fb_cmap_user cmap; + struct fb_event event; + void __user *argp = (void __user *)arg; + long ret = 0; + + switch (cmd) { + case FBIOGET_VSCREENINFO: + if (!lock_fb_info(info)) + return -ENODEV; + var = info->var; + unlock_fb_info(info); + + ret = copy_to_user(argp, &var, sizeof(var)) ? -EFAULT : 0; + break; + case FBIOPUT_VSCREENINFO: + if (copy_from_user(&var, argp, sizeof(var))) + return -EFAULT; + console_lock(); + if (!lock_fb_info(info)) { + console_unlock(); + return -ENODEV; + } + info->flags |= FBINFO_MISC_USEREVENT; + ret = fb_set_var(info, &var); + info->flags &= ~FBINFO_MISC_USEREVENT; + unlock_fb_info(info); + console_unlock(); + if (!ret && copy_to_user(argp, &var, sizeof(var))) + ret = -EFAULT; + break; + case FBIOGET_FSCREENINFO: + if (!lock_fb_info(info)) + return -ENODEV; + fix = info->fix; + unlock_fb_info(info); + + ret = copy_to_user(argp, &fix, sizeof(fix)) ? -EFAULT : 0; + break; + case FBIOPUTCMAP: + if (copy_from_user(&cmap, argp, sizeof(cmap))) + return -EFAULT; + ret = fb_set_user_cmap(&cmap, info); + break; + case FBIOGETCMAP: + if (copy_from_user(&cmap, argp, sizeof(cmap))) + return -EFAULT; + if (!lock_fb_info(info)) + return -ENODEV; + cmap_from = info->cmap; + unlock_fb_info(info); + ret = fb_cmap_to_user(&cmap_from, &cmap); + break; + case FBIOPAN_DISPLAY: + if (copy_from_user(&var, argp, sizeof(var))) + return -EFAULT; + console_lock(); + if (!lock_fb_info(info)) { + console_unlock(); + return -ENODEV; + } + ret = fb_pan_display(info, &var); + unlock_fb_info(info); + console_unlock(); + if (ret == 0 && copy_to_user(argp, &var, sizeof(var))) + return -EFAULT; + break; + case FBIO_CURSOR: + ret = -EINVAL; + break; + case FBIOGET_CON2FBMAP: + if (copy_from_user(&con2fb, argp, sizeof(con2fb))) + return -EFAULT; + if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) + return -EINVAL; + con2fb.framebuffer = -1; + event.data = &con2fb; + if (!lock_fb_info(info)) + return -ENODEV; + event.info = info; + fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event); + unlock_fb_info(info); + ret = copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; + break; + case FBIOPUT_CON2FBMAP: + if (copy_from_user(&con2fb, argp, sizeof(con2fb))) + return -EFAULT; + if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) + return -EINVAL; + if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) + return -EINVAL; + if (!registered_fb[con2fb.framebuffer]) + request_module("fb%d", con2fb.framebuffer); + if (!registered_fb[con2fb.framebuffer]) { + ret = -EINVAL; + break; + } + event.data = &con2fb; + console_lock(); + if (!lock_fb_info(info)) { + console_unlock(); + return -ENODEV; + } + event.info = info; + ret = fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP, &event); + unlock_fb_info(info); + console_unlock(); + break; + case FBIOBLANK: + console_lock(); + if (!lock_fb_info(info)) { + console_unlock(); + return -ENODEV; + } + info->flags |= FBINFO_MISC_USEREVENT; + ret = fb_blank(info, arg); + info->flags &= ~FBINFO_MISC_USEREVENT; + unlock_fb_info(info); + console_unlock(); + break; + default: + if (!lock_fb_info(info)) + return -ENODEV; + fb = info->fbops; + if (fb->fb_ioctl) + ret = fb->fb_ioctl(info, cmd, arg); + else + ret = -ENOTTY; + unlock_fb_info(info); + } + return ret; +} + +static long fb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + struct fb_info *info = file_fb_info(file); + + if (!info) + return -ENODEV; + return do_fb_ioctl(info, cmd, arg); +} + +#ifdef CONFIG_COMPAT +struct fb_fix_screeninfo32 { + char id[16]; + compat_caddr_t smem_start; + u32 smem_len; + u32 type; + u32 type_aux; + u32 visual; + u16 xpanstep; + u16 ypanstep; + u16 ywrapstep; + u32 line_length; + compat_caddr_t mmio_start; + u32 mmio_len; + u32 accel; + u16 reserved[3]; +}; + +struct fb_cmap32 { + u32 start; + u32 len; + compat_caddr_t red; + compat_caddr_t green; + compat_caddr_t blue; + compat_caddr_t transp; +}; + +static int fb_getput_cmap(struct fb_info *info, unsigned int cmd, + unsigned long arg) +{ + struct fb_cmap_user __user *cmap; + struct fb_cmap32 __user *cmap32; + __u32 data; + int err; + + cmap = compat_alloc_user_space(sizeof(*cmap)); + cmap32 = compat_ptr(arg); + + if (copy_in_user(&cmap->start, &cmap32->start, 2 * sizeof(__u32))) + return -EFAULT; + + if (get_user(data, &cmap32->red) || + put_user(compat_ptr(data), &cmap->red) || + get_user(data, &cmap32->green) || + put_user(compat_ptr(data), &cmap->green) || + get_user(data, &cmap32->blue) || + put_user(compat_ptr(data), &cmap->blue) || + get_user(data, &cmap32->transp) || + put_user(compat_ptr(data), &cmap->transp)) + return -EFAULT; + + err = do_fb_ioctl(info, cmd, (unsigned long) cmap); + + if (!err) { + if (copy_in_user(&cmap32->start, + &cmap->start, + 2 * sizeof(__u32))) + err = -EFAULT; + } + return err; +} + +static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix, + struct fb_fix_screeninfo32 __user *fix32) +{ + __u32 data; + int err; + + err = copy_to_user(&fix32->id, &fix->id, sizeof(fix32->id)); + + data = (__u32) (unsigned long) fix->smem_start; + err |= put_user(data, &fix32->smem_start); + + err |= put_user(fix->smem_len, &fix32->smem_len); + err |= put_user(fix->type, &fix32->type); + err |= put_user(fix->type_aux, &fix32->type_aux); + err |= put_user(fix->visual, &fix32->visual); + err |= put_user(fix->xpanstep, &fix32->xpanstep); + err |= put_user(fix->ypanstep, &fix32->ypanstep); + err |= put_user(fix->ywrapstep, &fix32->ywrapstep); + err |= put_user(fix->line_length, &fix32->line_length); + + data = (__u32) (unsigned long) fix->mmio_start; + err |= put_user(data, &fix32->mmio_start); + + err |= put_user(fix->mmio_len, &fix32->mmio_len); + err |= put_user(fix->accel, &fix32->accel); + err |= copy_to_user(fix32->reserved, fix->reserved, + sizeof(fix->reserved)); + + if (err) + return -EFAULT; + return 0; +} + +static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, + unsigned long arg) +{ + mm_segment_t old_fs; + struct fb_fix_screeninfo fix; + struct fb_fix_screeninfo32 __user *fix32; + int err; + + fix32 = compat_ptr(arg); + + old_fs = get_fs(); + set_fs(KERNEL_DS); + err = do_fb_ioctl(info, cmd, (unsigned long) &fix); + set_fs(old_fs); + + if (!err) + err = do_fscreeninfo_to_user(&fix, fix32); + + return err; +} + +static long fb_compat_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) +{ + struct fb_info *info = file_fb_info(file); + struct fb_ops *fb; + long ret = -ENOIOCTLCMD; + + if (!info) + return -ENODEV; + fb = info->fbops; + switch(cmd) { + case FBIOGET_VSCREENINFO: + case FBIOPUT_VSCREENINFO: + case FBIOPAN_DISPLAY: + case FBIOGET_CON2FBMAP: + case FBIOPUT_CON2FBMAP: + arg = (unsigned long) compat_ptr(arg); + case FBIOBLANK: + ret = do_fb_ioctl(info, cmd, arg); + break; + + case FBIOGET_FSCREENINFO: + ret = fb_get_fscreeninfo(info, cmd, arg); + break; + + case FBIOGETCMAP: + case FBIOPUTCMAP: + ret = fb_getput_cmap(info, cmd, arg); + break; + + default: + if (fb->fb_compat_ioctl) + ret = fb->fb_compat_ioctl(info, cmd, arg); + break; + } + return ret; +} +#endif + +static int +fb_mmap(struct file *file, struct vm_area_struct * vma) +{ + struct fb_info *info = file_fb_info(file); + struct fb_ops *fb; + unsigned long mmio_pgoff; + unsigned long start; + u32 len; + + if (!info) + return -ENODEV; + fb = info->fbops; + if (!fb) + return -ENODEV; + mutex_lock(&info->mm_lock); + if (fb->fb_mmap) { + int res; + res = fb->fb_mmap(info, vma); + mutex_unlock(&info->mm_lock); + return res; + } + + /* + * Ugh. This can be either the frame buffer mapping, or + * if pgoff points past it, the mmio mapping. + */ + start = info->fix.smem_start; + len = info->fix.smem_len; + mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT; + if (vma->vm_pgoff >= mmio_pgoff) { + if (info->var.accel_flags) { + mutex_unlock(&info->mm_lock); + return -EINVAL; + } + + vma->vm_pgoff -= mmio_pgoff; + start = info->fix.mmio_start; + len = info->fix.mmio_len; + } + mutex_unlock(&info->mm_lock); + + vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); + fb_pgprotect(file, vma, start); + + return vm_iomap_memory(vma, start, len); +} + +static int +fb_open(struct inode *inode, struct file *file) +__acquires(&info->lock) +__releases(&info->lock) +{ + int fbidx = iminor(inode); + struct fb_info *info; + int res = 0; + + info = get_fb_info(fbidx); + if (!info) { + request_module("fb%d", fbidx); + info = get_fb_info(fbidx); + if (!info) + return -ENODEV; + } + if (IS_ERR(info)) + return PTR_ERR(info); + + mutex_lock(&info->lock); + if (!try_module_get(info->fbops->owner)) { + res = -ENODEV; + goto out; + } + file->private_data = info; + if (info->fbops->fb_open) { + res = info->fbops->fb_open(info,1); + if (res) + module_put(info->fbops->owner); + } +#ifdef CONFIG_FB_DEFERRED_IO + if (info->fbdefio) + fb_deferred_io_open(info, inode, file); +#endif +out: + mutex_unlock(&info->lock); + if (res) + put_fb_info(info); + return res; +} + +static int +fb_release(struct inode *inode, struct file *file) +__acquires(&info->lock) +__releases(&info->lock) +{ + struct fb_info * const info = file->private_data; + + mutex_lock(&info->lock); + if (info->fbops->fb_release) + info->fbops->fb_release(info,1); + module_put(info->fbops->owner); + mutex_unlock(&info->lock); + put_fb_info(info); + return 0; +} + +static const struct file_operations fb_fops = { + .owner = THIS_MODULE, + .read = fb_read, + .write = fb_write, + .unlocked_ioctl = fb_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = fb_compat_ioctl, +#endif + .mmap = fb_mmap, + .open = fb_open, + .release = fb_release, +#ifdef HAVE_ARCH_FB_UNMAPPED_AREA + .get_unmapped_area = get_fb_unmapped_area, +#endif +#ifdef CONFIG_FB_DEFERRED_IO + .fsync = fb_deferred_io_fsync, +#endif + .llseek = default_llseek, +}; + +struct class *fb_class; +EXPORT_SYMBOL(fb_class); + +static int fb_check_foreignness(struct fb_info *fi) +{ + const bool foreign_endian = fi->flags & FBINFO_FOREIGN_ENDIAN; + + fi->flags &= ~FBINFO_FOREIGN_ENDIAN; + +#ifdef __BIG_ENDIAN + fi->flags |= foreign_endian ? 0 : FBINFO_BE_MATH; +#else + fi->flags |= foreign_endian ? FBINFO_BE_MATH : 0; +#endif /* __BIG_ENDIAN */ + + if (fi->flags & FBINFO_BE_MATH && !fb_be_math(fi)) { + pr_err("%s: enable CONFIG_FB_BIG_ENDIAN to " + "support this framebuffer\n", fi->fix.id); + return -ENOSYS; + } else if (!(fi->flags & FBINFO_BE_MATH) && fb_be_math(fi)) { + pr_err("%s: enable CONFIG_FB_LITTLE_ENDIAN to " + "support this framebuffer\n", fi->fix.id); + return -ENOSYS; + } + + return 0; +} + +static bool apertures_overlap(struct aperture *gen, struct aperture *hw) +{ + /* is the generic aperture base the same as the HW one */ + if (gen->base == hw->base) + return true; + /* is the generic aperture base inside the hw base->hw base+size */ + if (gen->base > hw->base && gen->base < hw->base + hw->size) + return true; + return false; +} + +static bool fb_do_apertures_overlap(struct apertures_struct *gena, + struct apertures_struct *hwa) +{ + int i, j; + if (!hwa || !gena) + return false; + + for (i = 0; i < hwa->count; ++i) { + struct aperture *h = &hwa->ranges[i]; + for (j = 0; j < gena->count; ++j) { + struct aperture *g = &gena->ranges[j]; + printk(KERN_DEBUG "checking generic (%llx %llx) vs hw (%llx %llx)\n", + (unsigned long long)g->base, + (unsigned long long)g->size, + (unsigned long long)h->base, + (unsigned long long)h->size); + if (apertures_overlap(g, h)) + return true; + } + } + + return false; +} + +static int do_unregister_framebuffer(struct fb_info *fb_info); + +#define VGA_FB_PHYS 0xA0000 +static int do_remove_conflicting_framebuffers(struct apertures_struct *a, + const char *name, bool primary) +{ + int i, ret; + + /* check all firmware fbs and kick off if the base addr overlaps */ + for (i = 0 ; i < FB_MAX; i++) { + struct apertures_struct *gen_aper; + if (!registered_fb[i]) + continue; + + if (!(registered_fb[i]->flags & FBINFO_MISC_FIRMWARE)) + continue; + + gen_aper = registered_fb[i]->apertures; + if (fb_do_apertures_overlap(gen_aper, a) || + (primary && gen_aper && gen_aper->count && + gen_aper->ranges[0].base == VGA_FB_PHYS)) { + + printk(KERN_INFO "fb: switching to %s from %s\n", + name, registered_fb[i]->fix.id); + ret = do_unregister_framebuffer(registered_fb[i]); + if (ret) + return ret; + } + } + + return 0; +} + +static int do_register_framebuffer(struct fb_info *fb_info) +{ + int i, ret; + struct fb_event event; + struct fb_videomode mode; + + if (fb_check_foreignness(fb_info)) + return -ENOSYS; + + ret = do_remove_conflicting_framebuffers(fb_info->apertures, + fb_info->fix.id, + fb_is_primary_device(fb_info)); + if (ret) + return ret; + + if (num_registered_fb == FB_MAX) + return -ENXIO; + + num_registered_fb++; + for (i = 0 ; i < FB_MAX; i++) + if (!registered_fb[i]) + break; + fb_info->node = i; + atomic_set(&fb_info->count, 1); + mutex_init(&fb_info->lock); + mutex_init(&fb_info->mm_lock); + + fb_info->dev = device_create(fb_class, fb_info->device, + MKDEV(FB_MAJOR, i), NULL, "fb%d", i); + if (IS_ERR(fb_info->dev)) { + /* Not fatal */ + printk(KERN_WARNING "Unable to create device for framebuffer %d; errno = %ld\n", i, PTR_ERR(fb_info->dev)); + fb_info->dev = NULL; + } else + fb_init_device(fb_info); + + if (fb_info->pixmap.addr == NULL) { + fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL); + if (fb_info->pixmap.addr) { + fb_info->pixmap.size = FBPIXMAPSIZE; + fb_info->pixmap.buf_align = 1; + fb_info->pixmap.scan_align = 1; + fb_info->pixmap.access_align = 32; + fb_info->pixmap.flags = FB_PIXMAP_DEFAULT; + } + } + fb_info->pixmap.offset = 0; + + if (!fb_info->pixmap.blit_x) + fb_info->pixmap.blit_x = ~(u32)0; + + if (!fb_info->pixmap.blit_y) + fb_info->pixmap.blit_y = ~(u32)0; + + if (!fb_info->modelist.prev || !fb_info->modelist.next) + INIT_LIST_HEAD(&fb_info->modelist); + + if (fb_info->skip_vt_switch) + pm_vt_switch_required(fb_info->dev, false); + else + pm_vt_switch_required(fb_info->dev, true); + + fb_var_to_videomode(&mode, &fb_info->var); + fb_add_videomode(&mode, &fb_info->modelist); + registered_fb[i] = fb_info; + + event.info = fb_info; + console_lock(); + if (!lock_fb_info(fb_info)) { + console_unlock(); + return -ENODEV; + } + + fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); + unlock_fb_info(fb_info); + console_unlock(); + return 0; +} + +static int do_unregister_framebuffer(struct fb_info *fb_info) +{ + struct fb_event event; + int i, ret = 0; + + i = fb_info->node; + if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) + return -EINVAL; + + console_lock(); + if (!lock_fb_info(fb_info)) { + console_unlock(); + return -ENODEV; + } + + event.info = fb_info; + ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event); + unlock_fb_info(fb_info); + console_unlock(); + + if (ret) + return -EINVAL; + + pm_vt_switch_unregister(fb_info->dev); + + unlink_framebuffer(fb_info); + if (fb_info->pixmap.addr && + (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) + kfree(fb_info->pixmap.addr); + fb_destroy_modelist(&fb_info->modelist); + registered_fb[i] = NULL; + num_registered_fb--; + fb_cleanup_device(fb_info); + event.info = fb_info; + console_lock(); + fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); + console_unlock(); + + /* this may free fb info */ + put_fb_info(fb_info); + return 0; +} + +int unlink_framebuffer(struct fb_info *fb_info) +{ + int i; + + i = fb_info->node; + if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) + return -EINVAL; + + if (fb_info->dev) { + device_destroy(fb_class, MKDEV(FB_MAJOR, i)); + fb_info->dev = NULL; + } + return 0; +} +EXPORT_SYMBOL(unlink_framebuffer); + +int remove_conflicting_framebuffers(struct apertures_struct *a, + const char *name, bool primary) +{ + int ret; + + mutex_lock(®istration_lock); + ret = do_remove_conflicting_framebuffers(a, name, primary); + mutex_unlock(®istration_lock); + + return ret; +} +EXPORT_SYMBOL(remove_conflicting_framebuffers); + +/** + * register_framebuffer - registers a frame buffer device + * @fb_info: frame buffer info structure + * + * Registers a frame buffer device @fb_info. + * + * Returns negative errno on error, or zero for success. + * + */ +int +register_framebuffer(struct fb_info *fb_info) +{ + int ret; + + mutex_lock(®istration_lock); + ret = do_register_framebuffer(fb_info); + mutex_unlock(®istration_lock); + + return ret; +} +EXPORT_SYMBOL(register_framebuffer); + +/** + * unregister_framebuffer - releases a frame buffer device + * @fb_info: frame buffer info structure + * + * Unregisters a frame buffer device @fb_info. + * + * Returns negative errno on error, or zero for success. + * + * This function will also notify the framebuffer console + * to release the driver. + * + * This is meant to be called within a driver's module_exit() + * function. If this is called outside module_exit(), ensure + * that the driver implements fb_open() and fb_release() to + * check that no processes are using the device. + */ +int +unregister_framebuffer(struct fb_info *fb_info) +{ + int ret; + + mutex_lock(®istration_lock); + ret = do_unregister_framebuffer(fb_info); + mutex_unlock(®istration_lock); + + return ret; +} +EXPORT_SYMBOL(unregister_framebuffer); + +/** + * fb_set_suspend - low level driver signals suspend + * @info: framebuffer affected + * @state: 0 = resuming, !=0 = suspending + * + * This is meant to be used by low level drivers to + * signal suspend/resume to the core & clients. + * It must be called with the console semaphore held + */ +void fb_set_suspend(struct fb_info *info, int state) +{ + struct fb_event event; + + event.info = info; + if (state) { + fb_notifier_call_chain(FB_EVENT_SUSPEND, &event); + info->state = FBINFO_STATE_SUSPENDED; + } else { + info->state = FBINFO_STATE_RUNNING; + fb_notifier_call_chain(FB_EVENT_RESUME, &event); + } +} +EXPORT_SYMBOL(fb_set_suspend); + +/** + * fbmem_init - init frame buffer subsystem + * + * Initialize the frame buffer subsystem. + * + * NOTE: This function is _only_ to be called by drivers/char/mem.c. + * + */ + +static int __init +fbmem_init(void) +{ + proc_create("fb", 0, NULL, &fb_proc_fops); + + if (register_chrdev(FB_MAJOR,"fb",&fb_fops)) + printk("unable to get major %d for fb devs\n", FB_MAJOR); + + fb_class = class_create(THIS_MODULE, "graphics"); + if (IS_ERR(fb_class)) { + printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class)); + fb_class = NULL; + } + return 0; +} + +#ifdef MODULE +module_init(fbmem_init); +static void __exit +fbmem_exit(void) +{ + remove_proc_entry("fb", NULL); + class_destroy(fb_class); + unregister_chrdev(FB_MAJOR, "fb"); +} + +module_exit(fbmem_exit); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Framebuffer base"); +#else +subsys_initcall(fbmem_init); +#endif + +int fb_new_modelist(struct fb_info *info) +{ + struct fb_event event; + struct fb_var_screeninfo var = info->var; + struct list_head *pos, *n; + struct fb_modelist *modelist; + struct fb_videomode *m, mode; + int err = 1; + + list_for_each_safe(pos, n, &info->modelist) { + modelist = list_entry(pos, struct fb_modelist, list); + m = &modelist->mode; + fb_videomode_to_var(&var, m); + var.activate = FB_ACTIVATE_TEST; + err = fb_set_var(info, &var); + fb_var_to_videomode(&mode, &var); + if (err || !fb_mode_is_equal(m, &mode)) { + list_del(pos); + kfree(pos); + } + } + + err = 1; + + if (!list_empty(&info->modelist)) { + event.info = info; + err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event); + } + + return err; +} + +static char *video_options[FB_MAX] __read_mostly; +static int ofonly __read_mostly; + +/** + * fb_get_options - get kernel boot parameters + * @name: framebuffer name as it would appear in + * the boot parameter line + * (video=:) + * @option: the option will be stored here + * + * NOTE: Needed to maintain backwards compatibility + */ +int fb_get_options(const char *name, char **option) +{ + char *opt, *options = NULL; + int retval = 0; + int name_len = strlen(name), i; + + if (name_len && ofonly && strncmp(name, "offb", 4)) + retval = 1; + + if (name_len && !retval) { + for (i = 0; i < FB_MAX; i++) { + if (video_options[i] == NULL) + continue; + if (!video_options[i][0]) + continue; + opt = video_options[i]; + if (!strncmp(name, opt, name_len) && + opt[name_len] == ':') + options = opt + name_len + 1; + } + } + /* No match, pass global option */ + if (!options && option && fb_mode_option) + options = kstrdup(fb_mode_option, GFP_KERNEL); + if (options && !strncmp(options, "off", 3)) + retval = 1; + + if (option) + *option = options; + + return retval; +} +EXPORT_SYMBOL(fb_get_options); + +#ifndef MODULE +/** + * video_setup - process command line options + * @options: string of options + * + * Process command line options for frame buffer subsystem. + * + * NOTE: This function is a __setup and __init function. + * It only stores the options. Drivers have to call + * fb_get_options() as necessary. + * + * Returns zero. + * + */ +static int __init video_setup(char *options) +{ + int i, global = 0; + + if (!options || !*options) + global = 1; + + if (!global && !strncmp(options, "ofonly", 6)) { + ofonly = 1; + global = 1; + } + + if (!global && !strchr(options, ':')) { + fb_mode_option = options; + global = 1; + } + + if (!global) { + for (i = 0; i < FB_MAX; i++) { + if (video_options[i] == NULL) { + video_options[i] = options; + break; + } + + } + } + + return 1; +} +__setup("video=", video_setup); +#endif + +MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c new file mode 100644 index 000000000000..c204ebe6187e --- /dev/null +++ b/drivers/video/fbdev/core/fbmon.c @@ -0,0 +1,1592 @@ +/* + * linux/drivers/video/fbmon.c + * + * Copyright (C) 2002 James Simmons + * + * Credits: + * + * The EDID Parser is a conglomeration from the following sources: + * + * 1. SciTech SNAP Graphics Architecture + * Copyright (C) 1991-2002 SciTech Software, Inc. All rights reserved. + * + * 2. XFree86 4.3.0, interpret_edid.c + * Copyright 1998 by Egbert Eich + * + * 3. John Fremlin and + * Ani Joshi + * + * Generalized Timing Formula is derived from: + * + * GTF Spreadsheet by Andy Morrish (1/5/97) + * available at http://www.vesa.org + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + * + */ +#include +#include +#include +#include +#include