diff options
| -rw-r--r-- | Documentation/fb/index.rst | 1 | ||||
| -rw-r--r-- | Documentation/fb/intelfb.rst | 155 | ||||
| -rw-r--r-- | Documentation/userspace-api/ioctl/ioctl-number.rst | 1 | ||||
| -rw-r--r-- | MAINTAINERS | 7 | ||||
| -rw-r--r-- | drivers/Makefile | 3 | ||||
| -rw-r--r-- | drivers/video/fbdev/Kconfig | 39 | ||||
| -rw-r--r-- | drivers/video/fbdev/intelfb/Makefile | 8 | ||||
| -rw-r--r-- | drivers/video/fbdev/intelfb/intelfb.h | 382 | ||||
| -rw-r--r-- | drivers/video/fbdev/intelfb/intelfb_i2c.c | 209 | ||||
| -rw-r--r-- | drivers/video/fbdev/intelfb/intelfbdrv.c | 1680 | ||||
| -rw-r--r-- | drivers/video/fbdev/intelfb/intelfbhw.c | 2115 | ||||
| -rw-r--r-- | drivers/video/fbdev/intelfb/intelfbhw.h | 609 |
12 files changed, 1 insertions, 5208 deletions
diff --git a/Documentation/fb/index.rst b/Documentation/fb/index.rst index baf02393d8ee..33e3c49f8856 100644 --- a/Documentation/fb/index.rst +++ b/Documentation/fb/index.rst @@ -19,7 +19,6 @@ Frame Buffer framebuffer gxfb intel810 - intelfb internals lxfb matroxfb diff --git a/Documentation/fb/intelfb.rst b/Documentation/fb/intelfb.rst deleted file mode 100644 index e2d0903f4efb..000000000000 --- a/Documentation/fb/intelfb.rst +++ /dev/null @@ -1,155 +0,0 @@ -============================================================= -Intel 830M/845G/852GM/855GM/865G/915G/945G Framebuffer driver -============================================================= - -A. Introduction -=============== - -This is a framebuffer driver for various Intel 8xx/9xx compatible -graphics devices. These would include: - - - Intel 830M - - Intel 845G - - Intel 852GM - - Intel 855GM - - Intel 865G - - Intel 915G - - Intel 915GM - - Intel 945G - - Intel 945GM - - Intel 945GME - - Intel 965G - - Intel 965GM - -B. List of available options -============================= - - a. "video=intelfb" - enables the intelfb driver - - Recommendation: required - - b. "mode=<xres>x<yres>[-<bpp>][@<refresh>]" - select mode - - Recommendation: user preference - (default = 1024x768-32@70) - - c. "vram=<value>" - select amount of system RAM in MB to allocate for the video memory - if not enough RAM was already allocated by the BIOS. - - Recommendation: 1 - 4 MB. - (default = 4 MB) - - d. "voffset=<value>" - select at what offset in MB of the logical memory to allocate the - framebuffer memory. The intent is to avoid the memory blocks - used by standard graphics applications (XFree86). Depending on your - usage, adjust the value up or down, (0 for maximum usage, 63/127 MB - for the least amount). Note, an arbitrary setting may conflict - with XFree86. - - Recommendation: do not set - (default = 48 MB) - - e. "accel" - enable text acceleration. This can be enabled/reenabled anytime - by using 'fbset -accel true/false'. - - Recommendation: enable - (default = set) - - f. "hwcursor" - enable cursor acceleration. - - Recommendation: enable - (default = set) - - g. "mtrr" - enable MTRR. This allows data transfers to the framebuffer memory - to occur in bursts which can significantly increase performance. - Not very helpful with the intel chips because of 'shared memory'. - - Recommendation: set - (default = set) - - h. "fixed" - disable mode switching. - - Recommendation: do not set - (default = not set) - - The binary parameters can be unset with a "no" prefix, example "noaccel". - The default parameter (not named) is the mode. - -C. Kernel booting -================= - -Separate each option/option-pair by commas (,) and the option from its value -with an equals sign (=) as in the following:: - - video=intelfb:option1,option2=value2 - -Sample Usage ------------- - -In /etc/lilo.conf, add the line:: - - append="video=intelfb:mode=800x600-32@75,accel,hwcursor,vram=8" - -This will initialize the framebuffer to 800x600 at 32bpp and 75Hz. The -framebuffer will use 8 MB of System RAM. hw acceleration of text and cursor -will be enabled. - -Remarks -------- - -If setting this parameter doesn't work (you stay in a 80x25 text-mode), -you might need to set the "vga=<mode>" parameter too - see vesafb.txt -in this directory. - - -D. Module options -================== - -The module parameters are essentially similar to the kernel -parameters. The main difference is that you need to include a Boolean value -(1 for TRUE, and 0 for FALSE) for those options which don't need a value. - -Example, to enable MTRR, include "mtrr=1". - -Sample Usage ------------- - -Using the same setup as described above, load the module like this:: - - modprobe intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1 - -Or just add the following to a configuration file in /etc/modprobe.d/:: - - options intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1 - -and just do a:: - - modprobe intelfb - - -E. Acknowledgment: -=================== - - 1. Geert Uytterhoeven - his excellent howto and the virtual - framebuffer driver code made this possible. - - 2. Jeff Hartmann for his agpgart code. - - 3. David Dawes for his original kernel 2.4 code. - - 4. The X developers. Insights were provided just by reading the - XFree86 source code. - - 5. Antonino A. Daplas for his inspiring i810fb driver. - - 6. Andrew Morton for his kernel patches maintenance. - -Sylvain diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst index d8b6cb1a3636..457e16f06e04 100644 --- a/Documentation/userspace-api/ioctl/ioctl-number.rst +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst @@ -128,7 +128,6 @@ Code Seq# Include File Comments 'F' all linux/fb.h conflict! 'F' 01-02 drivers/scsi/pmcraid.h conflict! 'F' 20 drivers/video/fsl-diu-fb.h conflict! -'F' 20 drivers/video/intelfb/intelfb.h conflict! 'F' 20 linux/ivtvfb.h conflict! 'F' 20 linux/matroxfb.h conflict! 'F' 20 drivers/video/aty/atyfb_base.c conflict! diff --git a/MAINTAINERS b/MAINTAINERS index d3054a00c8e3..c43d2733a029 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10652,13 +10652,6 @@ S: Supported F: drivers/infiniband/hw/irdma/ F: include/uapi/rdma/irdma-abi.h -INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) -M: Maik Broemme <mbroemme@libmpq.org> -L: linux-fbdev@vger.kernel.org -S: Maintained -F: Documentation/fb/intelfb.rst -F: drivers/video/fbdev/intelfb/ - INTEL GPIO DRIVERS M: Andy Shevchenko <andy@kernel.org> L: linux-gpio@vger.kernel.org diff --git a/drivers/Makefile b/drivers/Makefile index d828329c268d..37fd6ce3bd7f 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -71,9 +71,8 @@ obj-y += gpu/ obj-$(CONFIG_CONNECTOR) += connector/ -# i810fb and intelfb depend on char/agp/ +# i810fb depends on char/agp/ 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/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 3cdd2d50f59b..845a9f5bebc2 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -829,45 +829,6 @@ config FB_I810_I2C If unsure, say Y. -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_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_IOMEM_FOPS - select FB_MODE_HELPERS - select BOOT_VESA_SUPPORT if FB_INTEL = y - select VIDEO_NOMODESET - 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_INTEL=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 <file:Documentation/fb/intelfb.rst> - -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 diff --git a/drivers/video/fbdev/intelfb/Makefile b/drivers/video/fbdev/intelfb/Makefile deleted file mode 100644 index 7ff2debb31af..000000000000 --- a/drivers/video/fbdev/intelfb/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_FB_INTEL) += intelfb.o - -intelfb-y := intelfbdrv.o intelfbhw.o -intelfb-$(CONFIG_FB_INTEL_I2C) += intelfb_i2c.o -intelfb-objs := $(intelfb-y) - -ccflags-$(CONFIG_FB_INTEL_DEBUG) := -DDEBUG -DREGDUMP diff --git a/drivers/video/fbdev/intelfb/intelfb.h b/drivers/video/fbdev/intelfb/intelfb.h deleted file mode 100644 index 5de703902a21..000000000000 --- a/drivers/video/fbdev/intelfb/intelfb.h +++ /dev/null @@ -1,382 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _INTELFB_H -#define _INTELFB_H - -/* $DHD: intelfb/intelfb.h,v 1.40 2003/06/27 15:06:25 dawes Exp $ */ - -#include <linux/agp_backend.h> -#include <linux/fb.h> - -#ifdef CONFIG_FB_INTEL_I2C -#include <linux/i2c.h> -#include <linux/i2c-algo-bit.h> -#endif - -/*** Version/name ***/ -#define INTELFB_VERSION "0.9.6" -#define INTELFB_MODULE_NAME "intelfb" -#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/945GME/965G/965GM" - - -/*** Debug/feature defines ***/ - -#ifndef DEBUG -#define DEBUG 0 -#endif - -#ifndef VERBOSE -#define VERBOSE 0 -#endif - -#ifndef REGDUMP -#define REGDUMP 0 -#endif - -#ifndef DETECT_VGA_CLASS_ONLY -#define DETECT_VGA_CLASS_ONLY 1 -#endif - -#ifndef ALLOCATE_FOR_PANNING -#define ALLOCATE_FOR_PANNING 1 -#endif - -#ifndef PREFERRED_MODE -#define PREFERRED_MODE "1024x768-32@70" -#endif - -/*** hw-related values ***/ - -/* Resource Allocation */ -#define INTELFB_FB_ACQUIRED 1 -#define INTELFB_MMIO_ACQUIRED 2 - -/* PCI ids for supported devices */ -#define PCI_DEVICE_ID_INTEL_830M 0x3577 -#define PCI_DEVICE_ID_INTEL_845G 0x2562 -#define PCI_DEVICE_ID_INTEL_85XGM 0x3582 -#define PCI_DEVICE_ID_INTEL_854 0x358E -#define PCI_DEVICE_ID_INTEL_865G 0x2572 -#define PCI_DEVICE_ID_INTEL_915G 0x2582 -#define PCI_DEVICE_ID_INTEL_915GM 0x2592 -#define PCI_DEVICE_ID_INTEL_945G 0x2772 -#define PCI_DEVICE_ID_INTEL_945GM 0x27A2 -#define PCI_DEVICE_ID_INTEL_945GME 0x27AE -#define PCI_DEVICE_ID_INTEL_965G 0x29A2 -#define PCI_DEVICE_ID_INTEL_965GM 0x2A02 - -/* Size of MMIO region */ -#define INTEL_REG_SIZE 0x80000 - -#define STRIDE_ALIGNMENT 16 -#define STRIDE_ALIGNMENT_I9XX 64 - -#define PALETTE_8_ENTRIES 256 - - -/*** Macros ***/ - -/* basic arithmetic */ -#define KB(x) ((x) * 1024) -#define MB(x) ((x) * 1024 * 1024) -#define BtoKB(x) ((x) / 1024) -#define BtoMB(x) ((x) / 1024 / 1024) - -#define GTT_PAGE_SIZE KB(4) - -#define ROUND_UP_TO(x, y) (((x) + (y) - 1) / (y) * (y)) -#define ROUND_DOWN_TO(x, y) ((x) / (y) * (y)) -#define ROUND_UP_TO_PAGE(x) ROUND_UP_TO((x), GTT_PAGE_SIZE) -#define ROUND_DOWN_TO_PAGE(x) ROUND_DOWN_TO((x), GTT_PAGE_SIZE) - -/* messages */ -#define PFX INTELFB_MODULE_NAME ": " - -#define ERR_MSG(fmt, args...) printk(KERN_ERR PFX fmt, ## args) -#define WRN_MSG(fmt, args...) printk(KERN_WARNING PFX fmt, ## args) -#define NOT_MSG(fmt, args...) printk(KERN_NOTICE PFX fmt, ## args) -#define INF_MSG(fmt, args...) printk(KERN_INFO PFX fmt, ## args) -#if DEBUG -#define DBG_MSG(fmt, args...) printk(KERN_DEBUG PFX fmt, ## args) -#else -#define DBG_MSG(fmt, args...) while (0) printk(fmt, ## args) -#endif - -/* get commonly used pointers */ -#define GET_DINFO(info) (info)->par - -/* misc macros */ -#define ACCEL(d, i) \ - ((d)->accel && !(d)->ring_lockup && \ - ((i)->var.accel_flags & FB_ACCELF_TEXT)) - -/*#define NOACCEL_CHIPSET(d) \ - ((d)->chipset != INTEL_865G)*/ -#define NOACCEL_CHIPSET(d) \ - (0) - -#define FIXED_MODE(d) ((d)->fixed_mode) - -/*** Driver parameters ***/ - -#define RINGBUFFER_SIZE KB(64) -#define HW_CURSOR_SIZE KB(4) - -/* Intel agpgart driver */ -#define AGP_PHYSICAL_MEMORY 2 - -/* store information about an Ixxx DVO */ -/* The i830->i865 use multiple DVOs with multiple i2cs */ -/* the i915, i945 have a single sDVO i2c bus - which is different */ -#define MAX_OUTPUTS 6 - -/* these are outputs from the chip - integrated only - external chips are via DVO or SDVO output */ -#define INTELFB_OUTPUT_UNUSED 0 -#define INTELFB_OUTPUT_ANALOG 1 -#define INTELFB_OUTPUT_DVO 2 -#define INTELFB_OUTPUT_SDVO 3 -#define INTELFB_OUTPUT_LVDS 4 -#define INTELFB_OUTPUT_TVOUT 5 - -#define INTELFB_DVO_CHIP_NONE 0 -#define INTELFB_DVO_CHIP_LVDS 1 -#define INTELFB_DVO_CHIP_TMDS 2 -#define INTELFB_DVO_CHIP_TVOUT 4 - -#define INTELFB_OUTPUT_PIPE_NC 0 -#define INTELFB_OUTPUT_PIPE_A 1 -#define INTELFB_OUTPUT_PIPE_B 2 - -/*** Data Types ***/ - -/* supported chipsets */ -enum intel_chips { - INTEL_830M, - INTEL_845G, - INTEL_85XGM, - INTEL_852GM, - INTEL_852GME, - INTEL_854, - INTEL_855GM, - INTEL_855GME, - INTEL_865G, - INTEL_915G, - INTEL_915GM, - INTEL_945G, - INTEL_945GM, - INTEL_945GME, - INTEL_965G, - INTEL_965GM, -}; - -struct intelfb_hwstate { - u32 vga0_divisor; - u32 vga1_divisor; - u32 vga_pd; - u32 dpll_a; - u32 dpll_b; - u32 fpa0; - u32 fpa1; - u32 fpb0; - u32 fpb1; - u32 palette_a[PALETTE_8_ENTRIES]; - u32 palette_b[PALETTE_8_ENTRIES]; - u32 htotal_a; - u32 hblank_a; - u32 hsync_a; - u32 vtotal_a; - u32 vblank_a; - u32 vsync_a; - u32 src_size_a; - u32 bclrpat_a; - u32 htotal_b; - u32 hblank_b; - u32 hsync_b; - u32 vtotal_b; - u32 vblank_b; - u32 vsync_b; - u32 src_size_b; - u32 bclrpat_b; - u32 adpa; - u32 dvoa; - u32 dvob; - u32 dvoc; - u32 dvoa_srcdim; - u32 dvob_srcdim; - u32 dvoc_srcdim; - u32 lvds; - u32 pipe_a_conf; - u32 pipe_b_conf; - u32 disp_arb; - u32 cursor_a_control; - u32 cursor_b_control; - u32 cursor_a_base; - u32 cursor_b_base; - u32 cursor_size; - u32 disp_a_ctrl; - u32 disp_b_ctrl; - u32 disp_a_base; - u32 disp_b_base; - u32 cursor_a_palette[4]; - u32 cursor_b_palette[4]; - u32 disp_a_stride; - u32 disp_b_stride; - u32 vgacntrl; - u32 add_id; - u32 swf0x[7]; - u32 swf1x[7]; - u32 swf3x[3]; - u32 fence[8]; - u32 instpm; - u32 mem_mode; - u32 fw_blc_0; - u32 fw_blc_1; - u16 hwstam; - u16 ier; - u16 iir; - u16 imr; -}; - -struct intelfb_heap_data { - u32 physical; - u8 __iomem *virtual; - u32 offset; /* in GATT pages */ - u32 size; /* in bytes */ -}; - -#ifdef CONFIG_FB_INTEL_I2C -struct intelfb_i2c_chan { - struct intelfb_info *dinfo; - u32 reg; - struct i2c_adapter adapter; - struct i2c_algo_bit_data algo; -}; -#endif - -struct intelfb_output_rec { - int type; - int pipe; - int flags; - -#ifdef CONFIG_FB_INTEL_I2C - struct intelfb_i2c_chan i2c_bus; - struct intelfb_i2c_chan ddc_bus; -#endif -}; - -struct intelfb_vsync { - wait_queue_head_t wait; - unsigned int count; - int pan_display; - u32 pan_offset; -}; - -struct intelfb_info { - struct fb_info *info; - const struct fb_ops *fbops; - struct pci_dev *pdev; - - struct intelfb_hwstate save_state; - - /* agpgart structs */ - struct agp_memory *gtt_fb_mem; /* use all stolen memory or vram */ - struct agp_memory *gtt_ring_mem; /* ring buffer */ - struct agp_memory *gtt_cursor_mem; /* hw cursor */ - - /* use a gart reserved fb mem */ - u8 fbmem_gart; - - int wc_cookie; - - /* heap data */ - struct intelfb_heap_data aperture; - struct intelfb_heap_data fb; - struct intelfb_heap_data ring; - struct intelfb_heap_data cursor; - - /* mmio regs */ - u32 mmio_base_phys; - u8 __iomem *mmio_base; - - /* fb start offset (in bytes) */ - u32 fb_start; - - /* ring buffer */ - u32 ring_head; - u32 ring_tail; - u32 ring_tail_mask; - u32 ring_space; - u32 ring_lockup; - - /* palette */ - u32 pseudo_palette[16]; - - /* chip info */ - int pci_chipset; - int chipset; - const char *name; - int mobile; - - /* current mode */ - int bpp, depth; - u32 visual; - int xres, yres, pitch; - int pixclock; - - /* current pipe */ - int pipe; - - /* some flags */ - int accel; - int hwcursor; - int fixed_mode; - int ring_active; - int flag; - unsigned long irq_flags; - int open; - - /* vsync */ - struct intelfb_vsync vsync; - spinlock_t int_lock; - - /* hw cursor */ - int cursor_on; - int cursor_blanked; - u8 cursor_src[64]; - - /* initial parameters */ - int initial_vga; - struct fb_var_screeninfo initial_var; - u32 initial_fb_base; - u32 initial_video_ram; - u32 initial_pitch; - - /* driver registered */ - int registered; - - /* index into plls */ - int pll_index; - - /* outputs */ - int num_outputs; - struct intelfb_output_rec output[MAX_OUTPUTS]; -}; - -#define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G) || \ - ((dinfo)->chipset == INTEL_915GM) || \ - ((dinfo)->chipset == INTEL_945G) || \ - ((dinfo)->chipset == INTEL_945GM) || \ - ((dinfo)->chipset == INTEL_945GME) || \ - ((dinfo)->chipset == INTEL_965G) || \ - ((dinfo)->chipset == INTEL_965GM)) - -/*** function prototypes ***/ - -extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var); - -#ifdef CONFIG_FB_INTEL_I2C -extern void intelfb_create_i2c_busses(struct intelfb_info *dinfo); -extern void intelfb_delete_i2c_busses(struct intelfb_info *dinfo); -#endif - -#endif /* _INTELFB_H */ diff --git a/drivers/video/fbdev/intelfb/intelfb_i2c.c b/drivers/video/fbdev/intelfb/intelfb_i2c.c deleted file mode 100644 index 3300bd31d9d7..000000000000 --- a/drivers/video/fbdev/intelfb/intelfb_i2c.c +++ /dev/null @@ -1,209 +0,0 @@ -/************************************************************************** - - Copyright 2006 Dave Airlie <airlied@linux.ie> - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -on the rights to use, copy, modify, merge, publish, distribute, sub -license, and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next -paragraph) shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/delay.h> -#include <linux/pci.h> -#include <linux/fb.h> - -#include <linux/i2c.h> -#include <linux/i2c-algo-bit.h> - -#include <asm/io.h> - -#include "intelfb.h" -#include "intelfbhw.h" - -/* bit locations in the registers */ -#define SCL_DIR_MASK 0x0001 -#define SCL_DIR 0x0002 -#define SCL_VAL_MASK 0x0004 -#define SCL_VAL_OUT 0x0008 -#define SCL_VAL_IN 0x0010 -#define SDA_DIR_MASK 0x0100 -#define SDA_DIR 0x0200 -#define SDA_VAL_MASK 0x0400 -#define SDA_VAL_OUT 0x0800 -#define SDA_VAL_IN 0x1000 - -static void intelfb_gpio_setscl(void *data, int state) -{ - struct intelfb_i2c_chan *chan = data; - struct intelfb_info *dinfo = chan->dinfo; - u32 val; - - OUTREG(chan->reg, (state ? SCL_VAL_OUT : 0) | - SCL_DIR | SCL_DIR_MASK | SCL_VAL_MASK); - val = INREG(chan->reg); -} - -static void intelfb_gpio_setsda(void *data, int state) -{ - struct intelfb_i2c_chan *chan = data; - struct intelfb_info *dinfo = chan->dinfo; - u32 val; - - OUTREG(chan->reg, (state ? SDA_VAL_OUT : 0) | - SDA_DIR | SDA_DIR_MASK | SDA_VAL_MASK); - val = INREG(chan->reg); -} - -static int intelfb_gpio_getscl(void *data) -{ - struct intelfb_i2c_chan *chan = data; - struct intelfb_info *dinfo = chan->dinfo; - u32 val; - - OUTREG(chan->reg, SCL_DIR_MASK); - OUTREG(chan->reg, 0); - val = INREG(chan->reg); - return ((val & SCL_VAL_IN) != 0); -} - -static int intelfb_gpio_getsda(void *data) -{ - struct intelfb_i2c_chan *chan = data; - struct intelfb_info *dinfo = chan->dinfo; - u32 val; - - OUTREG(chan->reg, SDA_DIR_MASK); - OUTREG(chan->reg, 0); - val = INREG(chan->reg); - return ((val & SDA_VAL_IN) != 0); -} - -static int intelfb_setup_i2c_bus(struct intelfb_info *dinfo, - struct intelfb_i2c_chan *chan, - const u32 reg, const char *name, - int class) -{ - int rc; - - chan->dinfo = dinfo; - chan->reg = reg; - snprintf(chan->adapter.name, sizeof(chan->adapter.name), - "intelfb %s", name); - chan->adapter.class = class; - chan->adapter.owner = THIS_MODULE; - chan->adapter.algo_data = &chan->algo; - chan->adapter.dev.parent = &chan->dinfo->pdev->dev; - chan->algo.setsda = intelfb_gpio_setsda; - chan->algo.setscl = intelfb_gpio_setscl; - chan->algo.getsda = intelfb_gpio_getsda; - chan->algo.getscl = intelfb_gpio_getscl; - chan->algo.udelay = 40; - chan->algo.timeout = 20; - chan->algo.data = chan; - - i2c_set_adapdata(&chan->adapter, chan); - - /* Raise SCL and SDA */ - intelfb_gpio_setsda(chan, 1); - intelfb_gpio_setscl(chan, 1); - udelay(20); - - rc = i2c_bit_add_bus(&chan->adapter); - if (rc == 0) - DBG_MSG("I2C bus %s registered.\n", name); - else - WRN_MSG("Failed to register I2C bus %s.\n", name); - return rc; -} - -void intelfb_create_i2c_busses(struct intelfb_info *dinfo) -{ - int i = 0; - - /* everyone has at least a single analog output */ - dinfo->num_outputs = 1; - dinfo->output[i].type = INTELFB_OUTPUT_ANALOG; - - /* setup the DDC bus for analog output */ - intelfb_setup_i2c_bus(dinfo, &dinfo->output[i].ddc_bus, GPIOA, - "CRTDDC_A", I2C_CLASS_DDC); - i++; - - /* need to add the output busses for each device - - this function is very incomplete - - i915GM has LVDS and TVOUT for example - */ - switch(dinfo->chipset) { - case INTEL_830M: - case INTEL_845G: - case INTEL_854: - case INTEL_855GM: - case INTEL_865G: - dinfo->output[i].type = INTELFB_OUTPUT_DVO; - intelfb_setup_i2c_bus(dinfo, &dinfo->output[i].ddc_bus, - GPIOD, "DVODDC_D", I2C_CLASS_DDC); - intelfb_setup_i2c_bus(dinfo, &dinfo->output[i].i2c_bus, - GPIOE, "DVOI2C_E", 0); - i++; - break; - case INTEL_915G: - case INTEL_915GM: - /* has some LVDS + tv-out */ - case INTEL_945G: - case INTEL_945GM: - case INTEL_945GME: - case INTEL_965G: - case INTEL_965GM: - /* SDVO ports have a single control bus - 2 devices */ - dinfo->output[i].type = INTELFB_OUTPUT_SDVO; - intelfb_setup_i2c_bus(dinfo, &dinfo->output[i].i2c_bus, - GPIOE, "SDVOCTRL_E", 0); - /* TODO: initialize the SDVO */ - /* I830SDVOInit(pScrn, i, DVOB); */ - i++; - - /* set up SDVOC */ - dinfo->output[i].type = INTELFB_OUTPUT_SDVO; - dinfo->output[i].i2c_bus = dinfo->output[i - 1].i2c_bus; - /* TODO: initialize the SDVO */ - /* I830SDVOInit(pScrn, i, DVOC); */ - i++; - break; - } - dinfo->num_outputs = i; -} - -void intelfb_delete_i2c_busses(struct intelfb_info *dinfo) -{ - int i; - - for (i = 0; i < MAX_OUTPUTS; i++) { - if (dinfo->output[i].i2c_bus.dinfo) { - i2c_del_adapter(&dinfo->output[i].i2c_bus.adapter); - dinfo->output[i].i2c_bus.dinfo = NULL; - } - if (dinfo->output[i].ddc_bus.dinfo) { - i2c_del_adapter(&dinfo->output[i].ddc_bus.adapter); - dinfo->output[i].ddc_bus.dinfo = NULL; - } - } -} diff --git a/drivers/video/fbdev/intelfb/intelfbdrv.c b/drivers/video/fbdev/intelfb/intelfbdrv.c deleted file mode 100644 index d29d80a16295..000000000000 --- a/drivers/video/fbdev/intelfb/intelfbdrv.c +++ /dev/null @@ -1,1680 +0,0 @@ -/* - * intelfb - * - * Linux framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G/915G/915GM/ - * 945G/945GM/945GME/965G/965GM integrated graphics chips. - * - * Copyright © 2002, 2003 David Dawes <dawes@xfree86.org> - * 2004 Sylvain Meyer - * 2006 David Airlie - * - * This driver consists of two parts. The first part (intelfbdrv.c) provides - * the basic fbdev interfaces, is derived in part from the radeonfb and - * vesafb drivers, and is covered by the GPL. The second part (intelfbhw.c) - * provides the code to program the hardware. Most of it is derived from - * the i810/i830 XFree86 driver. The HW-specific code is covered here - * under a dual license (GPL and MIT/XFree86 license). - * - * Author: David Dawes - * - */ - -/* $DHD: intelfb/intelfbdrv.c,v 1.20 2003/06/27 15:17:40 dawes Exp $ */ - -/* - * Changes: - * 01/2003 - Initial driver (0.1.0), no mode switching, no acceleration. - * This initial version is a basic core that works a lot like - * the vesafb driver. It must be built-in to the kernel, - * and the initial video mode must be set with vga=XXX at - * boot time. (David Dawes) - * - * 01/2003 - Version 0.2.0: Mode switching added, colormap support - * implemented, Y panning, and soft screen blanking implemented. - * No acceleration yet. (David Dawes) - * - * 01/2003 - Version 0.3.0: fbcon acceleration support added. Module - * option handling added. (David Dawes) - * - * 01/2003 - Version 0.4.0: fbcon HW cursor support added. (David Dawes) - * - * 01/2003 - Version 0.4.1: Add auto-generation of built-in modes. - * (David Dawes) - * - * 02/2003 - Version 0.4.2: Add check for active non-CRT devices, and - * mode validation checks. (David Dawes) - * - * 02/2003 - Version 0.4.3: Check when the VC is in graphics mode so that - * acceleration is disabled while an XFree86 server is running. - * (David Dawes) - * - * 02/2003 - Version 0.4.4: Monitor DPMS support. (David Dawes) - * - * 02/2003 - Version 0.4.5: Basic XFree86 + fbdev working. (David Dawes) - * - * 02/2003 - Version 0.5.0: Modify to work with the 2.5.32 kernel as well - * as 2.4.x kernels. (David Dawes) - * - * 02/2003 - Version 0.6.0: Split out HW-specifics into a separate file. - * (David Dawes) - * - * 02/2003 - Version 0.7.0: Test on 852GM/855GM. Acceleration and HW - * cursor are disabled on this platform. (David Dawes) - * - * 02/2003 - Version 0.7.1: Test on 845G. Acceleration is disabled - * on this platform. (David Dawes) - * - * 02/2003 - Version 0.7.2: Test on 830M. Acceleration and HW - * cursor are disabled on this platform. (David Dawes) - * - * 02/2003 - Version 0.7.3: Fix 8-bit modes for mobile platforms - * (David Dawes) - * - * 02/2003 - Version 0.7.4: Add checks for FB and FBCON_HAS_CFB* configured - * in the kernel, and add mode bpp verification and default - * bpp selection based on which FBCON_HAS_CFB* are configured. - * (David Dawes) - * - * 02/2003 - Version 0.7.5: Add basic package/install scripts based on the - * DRI packaging scripts. (David Dawes) - * - * 04/2003 - Version 0.7.6: Fix typo that affects builds with SMP-enabled - * kernels. (David Dawes, reported by Anupam). - * - * 06/2003 - Version 0.7.7: - * Fix Makefile.kernel build problem (Tsutomu Yasuda). - * Fix mis-placed #endif (2.4.21 kernel). - * - * 09/2004 - Version 0.9.0 - by Sylvain Meyer - * Port to linux 2.6 kernel fbdev - * Fix HW accel and HW cursor on i845G - * Use of agpgart for fb memory reservation - * Add mtrr support - * - * 10/2004 - Version 0.9.1 - * Use module_param instead of old MODULE_PARM - * Some cleanup - * - * 11/2004 - Version 0.9.2 - * Add vram option to reserve more memory than stolen by BIOS - * Fix intelfbhw_pan_display typo - * Add __initdata annotations - * - * 04/2008 - Version 0.9.5 - * Add support for 965G/965GM. (Maik Broemme <mbroemme@plusserver.de>) - * - * 08/2008 - Version 0.9.6 - * Add support for 945GME. (Phil Endecott <spam_from_intelfb@chezphil.org>) - */ - -#include <linux/aperture.h> -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/string.h> -#include <linux/mm.h> -#include <linux/slab.h> -#include <linux/delay.h> -#include <linux/fb.h> -#include <linux/ioport.h> -#include <linux/init.h> -#include <linux/pci.h> -#include <linux/vmalloc.h> -#include <linux/pagemap.h> -#include <linux/screen_info.h> - -#include <asm/io.h> - -#include "intelfb.h" -#include "intelfbhw.h" -#include "../edid.h" - -static void get_initial_mode(struct intelfb_info *dinfo); -static void update_dinfo(struct intelfb_info *dinfo, - struct fb_var_screeninfo *var); -static int intelfb_open(struct fb_info *info, int user); -static int intelfb_release(struct fb_info *info, int user); -static int intelfb_check_var(struct fb_var_screeninfo *var, - struct fb_info *info); -static int intelfb_set_par(struct fb_info *info); -static int intelfb_setcolreg(unsigned regno, unsigned red, unsigned green, - unsigned blue, unsigned transp, - struct fb_info *info); - -static int intelfb_blank(int blank, struct fb_info *info); -static int intelfb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info); - -static void intelfb_fillrect(struct fb_info *info, - const struct fb_fillrect *rect); -static void intelfb_copyarea(struct fb_info *info, - const struct fb_copyarea *region); -static void intelfb_imageblit(struct fb_info *info, - const struct fb_image *image); -static int intelfb_cursor(struct fb_info *info, - struct fb_cursor *cursor); - -static int intelfb_sync(struct fb_info *info); - -static int intelfb_ioctl(struct fb_info *info, - unsigned int cmd, unsigned long arg); - -static int intelfb_pci_register(struct pci_dev *pdev, - const struct pci_device_id *ent); -static void intelfb_pci_unregister(struct pci_dev *pdev); -static int intelfb_set_fbinfo(struct intelfb_info *dinfo); - -/* - * Limiting the class to PCI_CLASS_DISPLAY_VGA prevents function 1 of the - * mobile chipsets from being registered. - */ -#if DETECT_VGA_CLASS_ONLY -#define INTELFB_CLASS_MASK ~0 < |
