diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-08 00:53:00 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-08 00:53:00 +0000 |
commit | b8553086288629b4efb77e97f5582e08bc50ad65 (patch) | |
tree | 0a19bd1c21e148f35c7a0f76baa4f7a056b966b0 /drivers/video | |
parent | 75b6d92f2dd5112b02f4e78cf9f35f9825946ef0 (diff) |
Merge with 2.4.0-test3-pre4.
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/Config.in | 7 | ||||
-rw-r--r-- | drivers/video/atyfb.c | 2 | ||||
-rw-r--r-- | drivers/video/clgenfb.c | 3 | ||||
-rw-r--r-- | drivers/video/fbmem.c | 2 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_DAC1064.c | 19 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_DAC1064.h | 8 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_Ti3026.c | 3 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_base.c | 73 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_base.h | 4 | ||||
-rw-r--r-- | drivers/video/matrox/matroxfb_crtc2.c | 14 | ||||
-rw-r--r-- | drivers/video/offb.c | 9 | ||||
-rw-r--r-- | drivers/video/riva/fbdev.c | 6 | ||||
-rw-r--r-- | drivers/video/riva/riva_hw.c | 2 | ||||
-rw-r--r-- | drivers/video/riva/riva_tbl.h | 4 | ||||
-rw-r--r-- | drivers/video/tdfxfb.c | 230 |
15 files changed, 146 insertions, 240 deletions
diff --git a/drivers/video/Config.in b/drivers/video/Config.in index 6529b53c5..0b30ebb38 100644 --- a/drivers/video/Config.in +++ b/drivers/video/Config.in @@ -119,7 +119,7 @@ if [ "$CONFIG_FB" = "y" ]; then fi tristate ' ATI Mach64 display support (EXPERIMENTAL)' CONFIG_FB_ATY tristate ' ATI Rage 128 display support (EXPERIMENTAL)' CONFIG_FB_ATY128 - bool ' 3Dfx Banshee/Voodoo3 display support (EXPERIMENTAL)' CONFIG_FB_3DFX + tristate ' 3Dfx Banshee/Voodoo3 display support (EXPERIMENTAL)' CONFIG_FB_3DFX tristate ' SIS 630/540 display support (EXPERIMENTAL)' CONFIG_FB_SIS fi fi @@ -240,7 +240,7 @@ if [ "$CONFIG_FB" = "y" ]; then "$CONFIG_FB_IGA" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \ "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ "$CONFIG_FB_P9100" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \ - "$CONFIG_FB_RIVA" = "m" -o \ + "$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_3DFX" = "m" -o \ "$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_CYBER2000" = "m" -o \ "$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_SIS" = "m" ]; then define_tristate CONFIG_FBCON_CFB8 m @@ -263,7 +263,7 @@ if [ "$CONFIG_FB" = "y" ]; then if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \ "$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_VESA" = "m" -o \ "$CONFIG_FB_VIRTUAL" = "m" -o "$CONFIG_FB_TBOX" = "m" -o \ - "$CONFIG_FB_Q40" = "m" -o \ + "$CONFIG_FB_Q40" = "m" -o "$CONFIG_FB_3DFX" = "m" -o \ "$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \ "$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \ "$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \ @@ -306,6 +306,7 @@ if [ "$CONFIG_FB" = "y" ]; then "$CONFIG_FB_TGA" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \ "$CONFIG_FB_MATROX" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ "$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \ + "$CONFIG_FB_3DFX" = "m" -o \ "$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_SIS" = "m" ]; then define_tristate CONFIG_FBCON_CFB32 m fi diff --git a/drivers/video/atyfb.c b/drivers/video/atyfb.c index 08fcf8141..d32a621b7 100644 --- a/drivers/video/atyfb.c +++ b/drivers/video/atyfb.c @@ -612,6 +612,7 @@ static inline void aty_st_8(unsigned int regindex, u8 val, writeb (val, info->ati_regbase + regindex); } +#if defined(CONFIG_PPC) || defined(CONFIG_PMAC_PBOOK) static void aty_st_lcd(int index, u32 val, const struct fb_info_aty *info) { unsigned long temp; @@ -633,6 +634,7 @@ static u32 aty_ld_lcd(int index, const struct fb_info_aty *info) /* read the register value */ return aty_ld_le32(LCD_DATA, info); } +#endif /* * Generic Mach64 routines diff --git a/drivers/video/clgenfb.c b/drivers/video/clgenfb.c index bb8d302fc..bdabd1e45 100644 --- a/drivers/video/clgenfb.c +++ b/drivers/video/clgenfb.c @@ -2557,7 +2557,6 @@ static int __init clgen_pci_setup (struct clgenfb_info *info, #endif /* CONFIG_FB_OF */ struct pci_dev *pdev; unsigned long board_addr, board_size; - u16 tmp16; DPRINTK ("ENTER\n"); @@ -2618,14 +2617,12 @@ static int __init clgen_pci_setup (struct clgenfb_info *info, } if (!request_mem_region(board_addr, board_size, "clgenfb")) { - pci_write_config_word (pdev, PCI_COMMAND, tmp16); printk(KERN_ERR "clgen: cannot reserve region 0x%lx, abort\n", board_addr); return -1; } #if 0 /* if the system didn't claim this region, we would... */ if (!request_mem_region(0xA0000, 65535, "clgenfb")) { - pci_write_config_word (pdev, PCI_COMMAND, tmp16); printk(KERN_ERR "clgen: cannot reserve region 0x%lx, abort\n", 0xA0000L); release_mem_region(board_addr, board_size); diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 3707b611a..2ab527f02 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -709,7 +709,7 @@ fbmem_init(void) create_proc_read_entry("fb", 0, 0, fbmem_read_proc, NULL); - devfs_handle = devfs_mk_dir (NULL, "fb", 0, NULL); + devfs_handle = devfs_mk_dir (NULL, "fb", NULL); if (devfs_register_chrdev(FB_MAJOR,"fb",&fb_fops)) printk("unable to get major %d for fb devs\n", FB_MAJOR); diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c index db84a3000..e8a3738f8 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.c +++ b/drivers/video/matrox/matroxfb_DAC1064.c @@ -169,9 +169,9 @@ static void matroxfb_DAC1064_cursor(struct display* p, int mode, int x, int y) { if (mode == CM_ERASE) { if (ACCESS_FBINFO(cursor.state) != CM_ERASE) { + del_timer_sync(&ACCESS_FBINFO(cursor.timer)); matroxfb_DAC_lock_irqsave(flags); ACCESS_FBINFO(cursor.state) = CM_ERASE; - del_timer(&ACCESS_FBINFO(cursor.timer)); outDAC1064(PMINFO M1064_XCURCTRL, M1064_XCURCTRL_DIS); matroxfb_DAC_unlock_irqrestore(flags); } @@ -184,6 +184,7 @@ static void matroxfb_DAC1064_cursor(struct display* p, int mode, int x, int y) { y -= p->var.yoffset; if (p->var.vmode & FB_VMODE_DOUBLE) y *= 2; + del_timer_sync(&ACCESS_FBINFO(cursor.timer)); matroxfb_DAC_lock_irqsave(flags); if ((x != ACCESS_FBINFO(cursor.x)) || (y != ACCESS_FBINFO(cursor.y)) || ACCESS_FBINFO(cursor.redraw)) { ACCESS_FBINFO(cursor.redraw) = 0; @@ -339,16 +340,18 @@ void DAC1064_global_init(CPMINFO struct matrox_hw_state* hw) { #if defined(CONFIG_FB_MATROX_MAVEN) || defined(CONFIG_FB_MATROX_MAVEN_MODULE) if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) { hw->DACreg[POS1064_XPIXCLKCTRL] = M1064_XPIXCLKCTRL_PLL_UP | M1064_XPIXCLKCTRL_EN | M1064_XPIXCLKCTRL_SRC_EXT; - hw->DACreg[POS1064_XMISCCTRL] |= G400_XMISCCTRL_MFC_MAFC | G400_XMISCCTRL_VDO_MAFC12; - } else if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_SECONDARY) - hw->DACreg[POS1064_XMISCCTRL] |= G400_XMISCCTRL_MFC_MAFC | G400_XMISCCTRL_VDO_C2_MAFC12; + hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_MAFC | G400_XMISCCTRL_VDO_MAFC12; + } else if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_SECONDARY) { + hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_MAFC | G400_XMISCCTRL_VDO_C2_MAFC12; + } else +#endif + if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP) + hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_PANELLINK | G400_XMISCCTRL_VDO_MAFC12; else - hw->DACreg[POS1064_XMISCCTRL] |= G400_XMISCCTRL_MFC_DIS; + hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_DIS; + if ((ACCESS_FBINFO(output.ph) | ACCESS_FBINFO(output.sh)) & MATROXFB_OUTPUT_CONN_PRIMARY) hw->DACreg[POS1064_XMISCCTRL] |= M1064_XMISCCTRL_DAC_EN; -#else - hw->DACreg[POS1064_XMISCCTRL] |= M1064_XMISCCTRL_MFC_DIS | M1064_XMISCCTRL_DAC_EN; -#endif } void DAC1064_global_restore(CPMINFO const struct matrox_hw_state* hw) { diff --git a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h index 4a8fdb801..256a11d2c 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.h +++ b/drivers/video/matrox/matroxfb_DAC1064.h @@ -84,10 +84,10 @@ void DAC1064_global_restore(CPMINFO const struct matrox_hw_state*); #define M1064_XMISCCTRL_MFC_VGA 0x00 #define M1064_XMISCCTRL_MFC_MAFC 0x02 #define M1064_XMISCCTRL_MFC_DIS 0x06 -#define G400_XMISCCTRL_MFC_MAFC 0x02 -#define G400_XMISCCTRL_MFC_PANELLINK 0x04 -#define G400_XMISCCTRL_MFC_DIS 0x06 -#define G400_XMISCCTRL_MFC_MASK 0x06 +#define GX00_XMISCCTRL_MFC_MAFC 0x02 +#define GX00_XMISCCTRL_MFC_PANELLINK 0x04 +#define GX00_XMISCCTRL_MFC_DIS 0x06 +#define GX00_XMISCCTRL_MFC_MASK 0x06 #define M1064_XMISCCTRL_DAC_6BIT 0x00 #define M1064_XMISCCTRL_DAC_8BIT 0x08 #define M1064_XMISCCTRL_DAC_WIDTHMASK 0x08 diff --git a/drivers/video/matrox/matroxfb_Ti3026.c b/drivers/video/matrox/matroxfb_Ti3026.c index 6bc3cea64..67dc556b0 100644 --- a/drivers/video/matrox/matroxfb_Ti3026.c +++ b/drivers/video/matrox/matroxfb_Ti3026.c @@ -352,9 +352,9 @@ static void matroxfb_ti3026_cursor(struct display* p, int mode, int x, int y) { if (mode == CM_ERASE) { if (ACCESS_FBINFO(cursor.state) != CM_ERASE) { + del_timer_sync(&ACCESS_FBINFO(cursor.timer)); matroxfb_DAC_lock_irqsave(flags); ACCESS_FBINFO(cursor.state) = CM_ERASE; - del_timer(&ACCESS_FBINFO(cursor.timer)); outTi3026(PMINFO TVP3026_XCURCTRL, ACCESS_FBINFO(currenthw->DACreg[POS3026_XCURCTRL])); matroxfb_DAC_unlock_irqrestore(flags); } @@ -367,6 +367,7 @@ static void matroxfb_ti3026_cursor(struct display* p, int mode, int x, int y) { y -= p->var.yoffset; if (p->var.vmode & FB_VMODE_DOUBLE) y *= 2; + del_timer_sync(&ACCESS_FBINFO(cursor.timer)); matroxfb_DAC_lock_irqsave(flags); if ((x != ACCESS_FBINFO(cursor.x)) || (y != ACCESS_FBINFO(cursor.y)) || ACCESS_FBINFO(cursor.redraw)) { ACCESS_FBINFO(cursor.redraw) = 0; diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index 040c79c2d..ef94171bc 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c @@ -97,7 +97,6 @@ #if defined(CONFIG_FB_OF) unsigned char nvram_read_byte(int); -int matrox_of_init(struct device_node *dp); static int default_vmode = VMODE_NVRAM; static int default_cmode = CMODE_NVRAM; #endif @@ -192,7 +191,7 @@ static void matroxfb_remove(WPMINFO int dummy) { } matroxfb_unregister_device(MINFO); unregister_framebuffer(&ACCESS_FBINFO(fbcon)); - del_timer(&ACCESS_FBINFO(cursor.timer)); + del_timer_sync(&ACCESS_FBINFO(cursor.timer)); #ifdef CONFIG_MTRR if (ACCESS_FBINFO(mtrr.vram_valid)) mtrr_del(ACCESS_FBINFO(mtrr.vram), ACCESS_FBINFO(video.base), ACCESS_FBINFO(video.len)); @@ -827,7 +826,7 @@ static int matroxfb_set_var(struct fb_var_screeninfo *var, int con, /* copy last setting... */ memcpy(hw, ohw, sizeof(*hw)); - del_timer(&ACCESS_FBINFO(cursor.timer)); + del_timer_sync(&ACCESS_FBINFO(cursor.timer)); ACCESS_FBINFO(cursor.state) = CM_ERASE; ACCESS_FBINFO(hw_switch->init(PMINFO hw, &mt, display)); @@ -845,7 +844,7 @@ static int matroxfb_set_var(struct fb_var_screeninfo *var, int con, hw->CRTC[0x0C] = (pos & 0xFF00) >> 8; hw->CRTCEXT[0] = (hw->CRTCEXT[0] & 0xF0) | ((pos >> 16) & 0x0F) | ((pos >> 14) & 0x40); hw->CRTCEXT[8] = pos >> 21; - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_PRIMARY) { + if (ACCESS_FBINFO(output.ph) & (MATROXFB_OUTPUT_CONN_PRIMARY | MATROXFB_OUTPUT_CONN_DFP)) { if (ACCESS_FBINFO(primout)) ACCESS_FBINFO(primout)->compute(MINFO, &mt, hw); } @@ -856,7 +855,7 @@ static int matroxfb_set_var(struct fb_var_screeninfo *var, int con, up_read(&ACCESS_FBINFO(altout.lock)); } ACCESS_FBINFO(hw_switch->restore(PMINFO hw, ohw, display)); - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_PRIMARY) { + if (ACCESS_FBINFO(output.ph) & (MATROXFB_OUTPUT_CONN_PRIMARY | MATROXFB_OUTPUT_CONN_DFP)) { if (ACCESS_FBINFO(primout)) ACCESS_FBINFO(primout)->program(MINFO, hw); } @@ -869,7 +868,7 @@ static int matroxfb_set_var(struct fb_var_screeninfo *var, int con, ACCESS_FBINFO(cursor.redraw) = 1; ACCESS_FBINFO(currenthw) = hw; ACCESS_FBINFO(newhw) = ohw; - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_PRIMARY) { + if (ACCESS_FBINFO(output.ph) & (MATROXFB_OUTPUT_CONN_PRIMARY | MATROXFB_OUTPUT_CONN_DFP)) { if (ACCESS_FBINFO(primout)) ACCESS_FBINFO(primout)->start(MINFO); } @@ -881,7 +880,7 @@ static int matroxfb_set_var(struct fb_var_screeninfo *var, int con, } matrox_cfbX_init(PMINFO display); do_install_cmap(PMINFO display); -#if defined(CONFIG_FB_OF) && defined(CONFIG_FB_COMPAT_XPMAC) +#if defined(CONFIG_FB_COMPAT_XPMAC) if (console_fb_info == &ACCESS_FBINFO(fbcon)) { int vmode, cmode; @@ -899,7 +898,7 @@ static int matroxfb_set_var(struct fb_var_screeninfo *var, int con, display_info.cmap_data_address = 0; display_info.disp_reg_address = ACCESS_FBINFO(mmio.base); } -#endif /* CONFIG_FB_OF && CONFIG_FB_COMPAT_XPMAC */ +#endif /* CONFIG_FB_COMPAT_XPMAC */ } } return 0; @@ -1065,6 +1064,13 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file, up_read(&ACCESS_FBINFO(crtc2.lock)); } return 0; + case MATROXFB_OUTPUT_DFP: + if (!(ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_DFP)) + return -ENXIO; + if (mom.mode!= MATROXFB_OUTPUT_MODE_MONITOR) + return -EINVAL; + /* mode did not change... */ + return 0; default: return -EINVAL; } @@ -1091,6 +1097,11 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file, if (val) return val; break; + case MATROXFB_OUTPUT_DFP: + if (!(ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_DFP)) + return -ENXIO; + mom.mode = MATROXFB_OUTPUT_MODE_MONITOR; + break; default: return -EINVAL; } @@ -1106,6 +1117,12 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file, return -EINVAL; if (tmp & ACCESS_FBINFO(output.sh)) return -EINVAL; + if (tmp & MATROXFB_OUTPUT_CONN_DFP) { + if (tmp & MATROXFB_OUTPUT_CONN_SECONDARY) + return -EINVAL; + if (ACCESS_FBINFO(output.sh)) + return -EINVAL; + } if (tmp == ACCESS_FBINFO(output.ph)) return 0; ACCESS_FBINFO(output.ph) = tmp; @@ -1122,6 +1139,10 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file, u_int32_t tmp; tmp = ACCESS_FBINFO(output.all) & ~ACCESS_FBINFO(output.sh); + if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP) + tmp &= ~MATROXFB_OUTPUT_CONN_SECONDARY; + if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) + tmp &= ~MATROXFB_OUTPUT_CONN_DFP; put_user_ret(tmp, (u_int32_t*)arg, -EFAULT); return 0; } @@ -1290,6 +1311,7 @@ static int sync = -1; /* "matrox:sync:xxxxx" */ static unsigned int fv = 0; /* "matrox:fv:xxxxx" */ static unsigned int fh = 0; /* "matrox:fh:xxxxxk" */ static unsigned int maxclk = 0; /* "matrox:maxclk:xxxxM" */ +static int dfp = 0; /* "matrox:dfp */ static char fontname[64]; /* "matrox:font:xxxxx" */ #ifndef MODULE @@ -1386,11 +1408,13 @@ static struct video_board vbG400 = {0x2000000, 0x1000000, FB_ACCEL_MATROX_MGAG4 #define DEVF_TEXT16B 0x0400 #define DEVF_CRTC2 0x0800 #define DEVF_MAVEN_CAPABLE 0x1000 +#define DEVF_PANELLINK_CAPABLE 0x2000 #define DEVF_GCORE (DEVF_VIDEO64BIT | DEVF_SWAPS | DEVF_CROSS4MB | DEVF_DDC_8_2) +#define DEVF_G2CORE (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE | DEVF_PANELLINK_CAPABLE) #define DEVF_G100 (DEVF_GCORE) /* no doc, no vxres... */ -#define DEVF_G200 (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE) -#define DEVF_G400 (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2) +#define DEVF_G200 (DEVF_G2CORE) +#define DEVF_G400 (DEVF_G2CORE | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2) static struct board { unsigned short vendor, device, rev, svid, sid; @@ -1586,6 +1610,12 @@ static int initMatrox2(WPMINFO struct display* d, struct board* b){ ACCESS_FBINFO(devflags.precise_width) = !(b->flags & DEVF_ANY_VXRES); ACCESS_FBINFO(devflags.crtc2) = b->flags & DEVF_CRTC2; ACCESS_FBINFO(devflags.maven_capable) = b->flags & DEVF_MAVEN_CAPABLE; + if (b->flags & DEVF_PANELLINK_CAPABLE) { + ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_DFP; + if (dfp) + ACCESS_FBINFO(output.ph) |= MATROXFB_OUTPUT_CONN_DFP; + } + ACCESS_FBINFO(devflags.textstep) = ACCESS_FBINFO(devflags.vgastep) * ACCESS_FBINFO(devflags.textmode); ACCESS_FBINFO(devflags.textvram) = 65536 / ACCESS_FBINFO(devflags.textmode); @@ -1791,7 +1821,7 @@ static int initMatrox2(WPMINFO struct display* d, struct board* b){ } /* FIXME: Where to move this?! */ -#if defined(CONFIG_FB_OF) +#if defined(CONFIG_PPC) #if defined(CONFIG_FB_COMPAT_XPMAC) strcpy(ACCESS_FBINFO(matrox_name), "MTRX,"); /* OpenFirmware naming convension */ strncat(ACCESS_FBINFO(matrox_name), b->name, 26); @@ -1817,7 +1847,7 @@ static int initMatrox2(WPMINFO struct display* d, struct board* b){ vesafb_defined = var; /* Note: mac_vmode_to_var() doesnot set all parameters */ } } -#endif +#endif /* CONFIG_PPC */ vesafb_defined.xres_virtual = vesafb_defined.xres; if (nopan) { vesafb_defined.yres_virtual = vesafb_defined.yres; @@ -2383,6 +2413,8 @@ int __init matroxfb_setup(char *options) { blink = value; else if (!strcmp(this_opt, "grayscale")) grayscale = value; + else if (!strcmp(this_opt, "dfp")) + dfp = value; else { strncpy(videomode, this_opt, sizeof(videomode)-1); } @@ -2407,21 +2439,6 @@ int __init matroxfb_init(void) return 0; } -#if defined(CONFIG_FB_OF) -int __init matrox_of_init(struct device_node *dp){ - DBG("matrox_of_init"); - - if (disabled) - return -ENXIO; - if (!initialized) { - initialized = 1; - matrox_init(); - } - /* failure? */ - return 0; -} -#endif /* CONFIG_FB_OF */ - #else /* *************************** init module code **************************** */ @@ -2500,6 +2517,8 @@ MODULE_PARM(grayscale, "i"); MODULE_PARM_DESC(grayscale, "Sets display into grayscale. Works perfectly with paletized videomode (4, 8bpp), some limitations apply to 16, 24 and 32bpp videomodes (default=nograyscale)"); MODULE_PARM(cross4MB, "i"); MODULE_PARM_DESC(cross4MB, "Specifies that 4MB boundary can be in middle of line. (default=autodetected)"); +MODULE_PARM(dfp, "i"); +MODULE_PARM_DESC(dfp, "Specifies whether to use digital flat panel interface of G200/G400 (0 or 1) (default=0)"); #ifdef CONFIG_FB_OF MODULE_PARM(vmode, "i"); MODULE_PARM_DESC(vmode, "Specify the vmode mode number that should be used (640x480 default)"); diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h index 0cb21b0f9..c8a47fe9e 100644 --- a/drivers/video/matrox/matroxfb_base.h +++ b/drivers/video/matrox/matroxfb_base.h @@ -56,10 +56,10 @@ #include <video/fbcon-cfb24.h> #include <video/fbcon-cfb32.h> -#if defined(CONFIG_FB_OF) #if defined(CONFIG_FB_COMPAT_XPMAC) #include <asm/vc_ioctl.h> #endif +#if defined(CONFIG_PPC) #include <asm/prom.h> #include <asm/pci-bridge.h> #include <video/macmodes.h> @@ -544,7 +544,7 @@ struct matrox_fb_info { struct timer_list timer; } cursor; struct { unsigned red, green, blue, transp; } palette[256]; -#if defined(CONFIG_FB_OF) && defined(CONFIG_FB_COMPAT_XPMAC) +#if defined(CONFIG_FB_COMPAT_XPMAC) char matrox_name[32]; #endif /* These ifdefs must be last! They differ for module & non-module compiles */ diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c index 1219c0f2f..f4824762b 100644 --- a/drivers/video/matrox/matroxfb_crtc2.c +++ b/drivers/video/matrox/matroxfb_crtc2.c @@ -527,6 +527,10 @@ static int matroxfb_dh_ioctl(struct inode* inode, return -EINVAL; if (tmp & ACCESS_FBINFO(output.ph)) return -EINVAL; + if (tmp & MATROXFB_OUTPUT_CONN_DFP) + return -EINVAL; + if ((ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP) && tmp) + return -EINVAL; if (tmp == ACCESS_FBINFO(output.sh)) return 0; ACCESS_FBINFO(output.sh) = tmp; @@ -542,7 +546,11 @@ static int matroxfb_dh_ioctl(struct inode* inode, { u_int32_t tmp; - tmp = ACCESS_FBINFO(output.all) & ~ACCESS_FBINFO(output.ph); + /* we do not support DFP from CRTC2 */ + tmp = ACCESS_FBINFO(output.all) & ~ACCESS_FBINFO(output.ph) & ~MATROXFB_OUTPUT_CONN_DFP; + /* CRTC1 in DFP mode disables CRTC2 at all (I know, I'm lazy) */ + if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP) + tmp = 0; put_user_ret(tmp, (u_int32_t*)arg, -EFAULT); return 0; } @@ -675,6 +683,10 @@ static int matroxfb_dh_regit(CPMINFO struct matroxfb_dh_fb_info* m2info) { if (ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_SECONDARY) { ACCESS_FBINFO(output.sh) |= MATROXFB_OUTPUT_CONN_SECONDARY; ACCESS_FBINFO(output.ph) &= ~MATROXFB_OUTPUT_CONN_SECONDARY; + if (ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_DFP) { + ACCESS_FBINFO(output.sh) &= ~MATROXFB_OUTPUT_CONN_DFP; + ACCESS_FBINFO(output.ph) &= ~MATROXFB_OUTPUT_CONN_DFP; + } } matroxfb_dh_set_var(&matroxfb_dh_defined, -2, &m2info->fbcon); diff --git a/drivers/video/offb.c b/drivers/video/offb.c index eebefb776..d98ab4e0e 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c @@ -275,9 +275,6 @@ extern void imsttfb_of_init(struct device_node *dp); #ifdef CONFIG_FB_CT65550 extern void chips_of_init(struct device_node *dp); #endif /* CONFIG_FB_CT65550 */ -#ifdef CONFIG_FB_MATROX -extern int matrox_of_init(struct device_node *dp); -#endif /* CONFIG_FB_MATROX */ #ifdef CONFIG_FB_CONTROL extern void control_of_init(struct device_node *dp); #endif /* CONFIG_FB_CONTROL */ @@ -411,12 +408,6 @@ static int __init offb_init_driver(struct device_node *dp) return 1; } #endif /* CONFIG_FB_CT65550 */ -#ifdef CONFIG_FB_MATROX - if (!strncmp(dp->name, "MTRX", 4)) { - matrox_of_init(dp); - return 1; - } -#endif /* CONFIG_FB_MATROX */ #ifdef CONFIG_FB_CONTROL if(!strcmp(dp->name, "control")) { control_of_init(dp); diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c index 4c2a13791..4b388f60b 100644 --- a/drivers/video/riva/fbdev.c +++ b/drivers/video/riva/fbdev.c @@ -402,7 +402,7 @@ static int __devinit riva_init_disp (struct rivafb_info *rinfo) disp->var = rivafb_default_var; info->disp = disp; -#warning FIXME: assure that disp->cmap is completely filled out + /* FIXME: assure that disp->cmap is completely filled out */ disp->screen_base = rinfo->fb_base; disp->visual = FB_VISUAL_PSEUDOCOLOR; @@ -727,7 +727,7 @@ static int rivafb_get_fix (struct fb_fix_screeninfo *fix, int con, fix->line_length = p->line_length; -#warning FIXME: set up MMIO region, export via FB_ACCEL_xxx + /* FIXME: set up MMIO region, export via FB_ACCEL_xxx */ fix->mmio_start = 0; fix->mmio_len = 0; fix->accel = FB_ACCEL_NONE; @@ -960,7 +960,7 @@ static int rivafb_set_var (struct fb_var_screeninfo *var, int con, dsp->type = FB_TYPE_PACKED_PIXELS; -#warning FIXME: verify that the above code sets dsp->* fields correctly + /* FIXME: verify that the above code sets dsp->* fields correctly */ memcpy (&dsp->var, &v, sizeof (v)); diff --git a/drivers/video/riva/riva_hw.c b/drivers/video/riva/riva_hw.c index 1bd904c8e..532f8c017 100644 --- a/drivers/video/riva/riva_hw.c +++ b/drivers/video/riva/riva_hw.c @@ -592,7 +592,7 @@ static void nv4CalcArbitration ) { int data, pagemiss, cas,width, video_enable, color_key_enable, bpp, align; - int nvclks, mclks, pclks, vpagemiss, crtpagemiss, vbs; + int nvclks, mclks, pclks, vpagemiss, crtpagemiss, vbs=0; int found, mclk_extra, mclk_loop, cbs, m1, p1; int mclk_freq, pclk_freq, nvclk_freq, mp_enable; int us_m, us_n, us_p, video_drain_rate, crtc_drain_rate; diff --git a/drivers/video/riva/riva_tbl.h b/drivers/video/riva/riva_tbl.h index 8188c0fd8..23e7cb75b 100644 --- a/drivers/video/riva/riva_tbl.h +++ b/drivers/video/riva/riva_tbl.h @@ -60,6 +60,8 @@ static unsigned RivaTablePTIMER[][2] = {0x00000050, 0x00000000}, {0x00000040, 0xFFFFFFFF} }; + +#if 0 static unsigned RivaTableFIFO[][2] = { {0x00000000, 0x80000000}, @@ -70,6 +72,8 @@ static unsigned RivaTableFIFO[][2] = {0x00002800, 0x80000012}, {0x00003800, 0x80000013} }; +#endif + static unsigned nv3TablePFIFO[][2] = { {0x00000140, 0x00000000}, diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 499d8fef7..bbd547454 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c @@ -86,23 +86,7 @@ #include <video/fbcon-cfb24.h> #include <video/fbcon-cfb32.h> -#ifndef LINUX_VERSION_CODE -#include <linux/version.h> -#endif - -#ifndef KERNEL_VERSION -#define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z)) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) -#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) -/* nothing? */ -#else #include <linux/spinlock.h> -#endif /* membase0 register offsets */ #define STATUS 0x00 @@ -332,10 +316,10 @@ struct fb_info_tdfx { u32 max_pixclock; unsigned long regbase_phys; - unsigned long regbase_virt; + void *regbase_virt; unsigned long regbase_size; unsigned long bufbase_phys; - unsigned long bufbase_virt; + void *bufbase_virt; unsigned long bufbase_size; unsigned long iobase; @@ -368,6 +352,9 @@ struct fb_info_tdfx { } cursor; spinlock_t DAClock; +#ifdef CONFIG_MTRR + int mtrr_idx; +#endif }; /* @@ -468,11 +455,7 @@ static unsigned long do_lfb_size(void); /* * Interface used by the world */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) -void tdfxfb_init(void); -#else int tdfxfb_init(void); -#endif void tdfxfb_setup(char *options, int *ints); @@ -505,71 +488,8 @@ struct mode default_mode[] = { 0, FB_VMODE_NONINTERLACED } } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - , - { "800x600-8@56", /* @ 56 Hz */ - { - 800, 600, 800, 600, 0, 0, 8, 0, - {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0}, - 0, FB_ACTIVATE_NOW, -1, -1, FB_ACCELF_TEXT, - 27778, 128, 24, 22, 1, 72, 2, - 0, FB_VMODE_NONINTERLACED - } - }, - { "1024x768-8@60", /* @ 60 Hz */ - { - 1024, 768, 1024, 768, 0, 0, 8, 0, - {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0}, - 0, FB_ACTIVATE_NOW, -1, -1, FB_ACCELF_TEXT, - 15385, 168, 8, 29, 3, 144, 6, - 0, FB_VMODE_NONINTERLACED - } - }, - { "1280x1024-8@61", /* @ 61 Hz */ - { - 1280, 1024, 1280, 1024, 0, 0, 8, 0, - {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0}, - 0, FB_ACTIVATE_NOW, -1, -1, FB_ACCELF_TEXT, - 9091, 200, 48, 26, 1, 184, 3, - 0, FB_VMODE_NONINTERLACED - } - }, - { "1024x768-16@60", /* @ 60 Hz */ /* basically for testing */ - { - 1024, 768, 1024, 768, 0, 0, 16, 0, - {11, 5, 0}, {5, 6, 0}, {0, 5, 0}, {0, 0, 0}, - 0, FB_ACTIVATE_NOW, -1, -1, FB_ACCELF_TEXT, - 15385, 168, 8, 29, 3, 144, 6, - 0, FB_VMODE_NONINTERLACED - } - }, - { "1024x768-24@60", /* @ 60 Hz */ - { - 1024, 768, 1024, 768, 0, 0, 24, 0, - {16, 8, 0}, {8, 8, 0}, {0, 8, 0}, {0, 0, 0}, - 0, FB_ACTIVATE_NOW, -1, -1, FB_ACCELF_TEXT, - 15385, 168, 8, 29, 3, 144, 6, - 0, FB_VMODE_NONINTERLACED - } - }, - { "1024x768-32@60", /* @ 60 Hz */ - { - 1024, 768, 1024, 768, 0, 0, 32, 0, - {16, 8, 0}, {8, 8, 0}, {0, 8, 0}, {0, 0, 0}, - 0, FB_ACTIVATE_NOW, -1, -1, FB_ACCELF_TEXT, - 15385, 168, 8, 29, 3, 144, 6, - 0, FB_VMODE_NONINTERLACED - } - } - -#endif }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) -static int modes = sizeof(default_mode)/sizeof(struct mode); -static int default_mode_index = 0; -#endif - static struct fb_info_tdfx fb_info; static int noaccel = 0; @@ -1674,17 +1594,10 @@ static int tdfxfb_encode_fix(struct fb_fix_screeninfo* fix, info->dev == PCI_DEVICE_ID_3DFX_BANSHEE ? "3Dfx Banshee" : "3Dfx Voodoo3"); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - fix->smem_start = (char*)info->bufbase_phys; - fix->smem_len = info->bufbase_size; - fix->mmio_start = (char*)info->regbase_phys; - fix->mmio_len = info->regbase_size; -#else fix->smem_start = info->bufbase_phys; fix->smem_len = info->bufbase_size; fix->mmio_start = info->regbase_phys; fix->mmio_len = info->regbase_size; -#endif fix->accel = FB_ACCEL_3DFX_BANSHEE; fix->type = FB_TYPE_PACKED_PIXELS; fix->type_aux = 0; @@ -1815,7 +1728,7 @@ static int tdfxfb_set_var(struct fb_var_screeninfo *var, struct fb_fix_screeninfo fix; tdfxfb_encode_fix(&fix, &par, info); - display->screen_base = (char *)info->bufbase_virt; + display->screen_base = info->bufbase_virt; display->visual = fix.visual; display->type = fix.type; display->type_aux = fix.type_aux; @@ -1940,20 +1853,10 @@ static int tdfxfb_ioctl(struct inode *inode, return -EINVAL; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) -__initfunc(void tdfxfb_init(void)) { -#else int __init tdfxfb_init(void) { -#endif struct pci_dev *pdev = NULL; struct fb_var_screeninfo var; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - if(!pcibios_present()) return; -#else - if(!pcibios_present()) return -ENXIO; -#endif - while ((pdev = pci_find_device(PCI_VENDOR_ID_3DFX, PCI_ANY_ID, pdev))) { if(((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) && ((pdev->device == PCI_DEVICE_ID_3DFX_BANSHEE) || @@ -1968,67 +1871,38 @@ int __init tdfxfb_init(void) { ? BANSHEE_MAX_PIXCLOCK : VOODOO3_MAX_PIXCLOCK; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - fb_info.regbase_phys = pdev->base_address[0] & PCI_BASE_ADDRESS_MEM_MASK; - fb_info.regbase_size = 1 << 24; - fb_info.regbase_virt = - (unsigned long)ioremap_nocache(fb_info.regbase_phys, 1 << 24); - if(!fb_info.regbase_virt) { - printk("fb: Can't remap %s register area.\n", name); - return; - } - - fb_info.bufbase_phys = pdev->base_address[1] & PCI_BASE_ADDRESS_MEM_MASK; - if(!(fb_info.bufbase_size = do_lfb_size())) { - printk("fb: Can't count %s memory.\n", name); - iounmap((void*)fb_info.regbase_virt); - return; - } - fb_info.bufbase_virt = - (unsigned long)ioremap_nocache(fb_info.bufbase_phys, fb_info.bufbase_size); - if(!fb_info.regbase_virt) { - printk("fb: Can't remap %s framebuffer.\n", name); - iounmap((void*)fb_info.regbase_virt); - return; - } - - fb_info.iobase = pdev->base_address[2] & PCI_BASE_ADDRESS_IO_MASK; -#else fb_info.regbase_phys = pci_resource_start(pdev, 0); fb_info.regbase_size = 1 << 24; - fb_info.regbase_virt = - (unsigned long)ioremap_nocache(fb_info.regbase_phys, 1 << 24); + fb_info.regbase_virt = ioremap_nocache(fb_info.regbase_phys, 1 << 24); if(!fb_info.regbase_virt) { printk("fb: Can't remap %s register area.\n", name); return -ENXIO; } - fb_info.bufbase_phys = pdev->resource[1].start; + fb_info.bufbase_phys = pci_resource_start (pdev, 1); if(!(fb_info.bufbase_size = do_lfb_size())) { - iounmap((void*)fb_info.regbase_virt); + iounmap(fb_info.regbase_virt); printk("fb: Can't count %s memory.\n", name); return -ENXIO; } - fb_info.bufbase_virt = - (unsigned long)ioremap_nocache(fb_info.bufbase_phys, fb_info.bufbase_size); + fb_info.bufbase_virt = ioremap_nocache(fb_info.bufbase_phys, fb_info.bufbase_size); if(!fb_info.regbase_virt) { printk("fb: Can't remap %s framebuffer.\n", name); - iounmap((void*)fb_info.regbase_virt); + iounmap(fb_info.regbase_virt); return -ENXIO; } - fb_info.iobase = pdev->resource[2].start; -#endif + fb_info.iobase = pci_resource_start (pdev, 2); printk("fb: %s memory = %ldK\n", name, fb_info.bufbase_size >> 10); #ifdef CONFIG_MTRR if (!nomtrr) { - if (mtrr_add(fb_info.bufbase_phys, fb_info.bufbase_size, - MTRR_TYPE_WRCOMB, 1)>=0) + fb_info.mtrr_idx = mtrr_add(fb_info.bufbase_phys, fb_info.bufbase_size, + MTRR_TYPE_WRCOMB, 1); printk("fb: MTRR's turned on\n"); } -#endif +#endif /* clear framebuffer memory */ memset_io(fb_info.bufbase_virt, 0, fb_info.bufbase_size); @@ -2053,16 +1927,10 @@ int __init tdfxfb_init(void) { fb_info.fb_info.blank = &tdfxfb_blank; fb_info.fb_info.flags = FBINFO_FLAG_DEFAULT; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - var = default_mode[default_mode_index < modes - ? default_mode_index - : 0].var; -#else memset(&var, 0, sizeof(var)); if(!mode_option || !fb_find_mode(&var, &fb_info.fb_info, mode_option, NULL, 0, NULL, 8)) var = default_mode[0].var; -#endif if(noaccel) var.accel_flags &= ~FB_ACCELF_TEXT; else var.accel_flags |= FB_ACCELF_TEXT; @@ -2081,57 +1949,73 @@ int __init tdfxfb_init(void) { if(tdfxfb_decode_var(&var, &fb_info.default_par, &fb_info)) { /* this is getting really bad!... */ printk("tdfxfb: can't decode default video mode\n"); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - return; -#else return -ENXIO; -#endif } } - fb_info.disp.screen_base = (void*)fb_info.bufbase_virt; + fb_info.disp.screen_base = fb_info.bufbase_virt; fb_info.disp.var = var; if(tdfxfb_set_var(&var, -1, &fb_info.fb_info)) { printk("tdfxfb: can't set default video mode\n"); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - return; -#else return -ENXIO; -#endif } if(register_framebuffer(&fb_info.fb_info) < 0) { printk("tdfxfb: can't register framebuffer\n"); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - return; -#else return -ENXIO; -#endif } printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.fb_info.node), fb_info.fb_info.modename); + /* FIXME: module cannot be unloaded */ + /* verify tdfxfb_exit before removing this */ MOD_INC_USE_COUNT; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - return; -#else return 0; -#endif } } /* hmm, no frame suitable buffer found ... */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - return; -#else return -ENXIO; +} + +/** + * tdfxfb_exit - Driver cleanup + * + * Releases all resources allocated during the + * course of the driver's lifetime. + * + * FIXME - do results of fb_alloc_cmap need disposal? + */ +static void __exit tdfxfb_exit (void) +{ + unregister_framebuffer(&fb_info.fb_info); + del_timer_sync(&fb_info.cursor.timer); + +#ifdef CONFIG_MTRR + if (!nomtrr) { + mtrr_del(fb_info.mtrr_idx, fb_info.bufbase_phys, fb_info.bufbase_size); + printk("fb: MTRR's turned off\n"); + } #endif + + iounmap(fb_info.regbase_virt); + iounmap(fb_info.bufbase_virt); } +MODULE_AUTHOR("Hannu Mallat <hmallat@cc.hut.fi>"); +MODULE_DESCRIPTION("3Dfx framebuffer device driver"); + +#ifdef MODULE +module_init(tdfxfb_init); +#endif +module_exit(tdfxfb_exit); + + +#ifndef MODULE void tdfxfb_setup(char *options, int *ints) { char* this_opt; @@ -2160,19 +2044,11 @@ void tdfxfb_setup(char *options, } else if (!strncmp(this_opt, "font:", 5)) { strncpy(fontname, this_opt + 5, 40); } else { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) - int i; - for(i = 0; i < modes; i++) { - if(!strcmp(this_opt, default_mode[i].name)) { - default_mode_index = i; - } - } -#else mode_option = this_opt; -#endif } } } +#endif static int tdfxfb_switch_con(int con, struct fb_info *fb) { @@ -2438,7 +2314,7 @@ static void tdfxfb_hwcursor_init(void) start = (fb_info.bufbase_size-1024) & PAGE_MASK; fb_info.bufbase_size=start; fb_info.cursor.cursorimage=fb_info.bufbase_size; - printk("tdfxfb: reserving 1024 bytes for the hwcursor at 0x%08lx\n", + printk("tdfxfb: reserving 1024 bytes for the hwcursor at %p\n", fb_info.regbase_virt+fb_info.cursor.cursorimage); } |