X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fvideo%2Faty%2Fatyfb_base.c;h=9ea75f18169c942d987637da3924e86c61b29c74;hb=c98959f566e0c695b1b237ad8e0f8f825d31fa71;hp=1e8e9ade9396086e2a829811841a5c304ae50fc0;hpb=c1cc53be0fc112cc8cb21ac4e0ab1af0a4082943;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 1e8e9ad..9ea75f1 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -240,9 +240,6 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, static int atyfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); static int atyfb_blank(int blank, struct fb_info *info); static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg); -extern void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); -extern void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); -extern void atyfb_imageblit(struct fb_info *info, const struct fb_image *image); #ifdef __sparc__ static int atyfb_mmap(struct fb_info *info, struct vm_area_struct *vma); #endif @@ -409,7 +406,7 @@ static struct { { PCI_CHIP_MACH64LB, "3D RAGE LT PRO (Mach64 LB, AGP)", 236, 75, 100, 135, ATI_CHIP_264LTPRO }, { PCI_CHIP_MACH64LD, "3D RAGE LT PRO (Mach64 LD, AGP)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, { PCI_CHIP_MACH64LI, "3D RAGE LT PRO (Mach64 LI, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO | M64F_G3_PB_1_1 | M64F_G3_PB_1024x768 }, - { PCI_CHIP_MACH64LP, "3D RAGE LT PRO (Mach64 LP, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, + { PCI_CHIP_MACH64LP, "3D RAGE LT PRO (Mach64 LP, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO | M64F_G3_PB_1024x768 }, { PCI_CHIP_MACH64LQ, "3D RAGE LT PRO (Mach64 LQ, PCI)", 230, 100, 100, 135, ATI_CHIP_264LTPRO }, { PCI_CHIP_MACH64GM, "3D RAGE XL (Mach64 GM, AGP 2x)", 230, 83, 63, 135, ATI_CHIP_264XL }, @@ -1535,7 +1532,7 @@ static int atyfb_open(struct fb_info *info, int user) return (0); } -static irqreturn_t aty_irq(int irq, void *dev_id, struct pt_regs *fp) +static irqreturn_t aty_irq(int irq, void *dev_id) { struct atyfb_par *par = dev_id; int handled = 0; @@ -2353,11 +2350,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name) const char *ramname = NULL, *xtal; int gtb_memsize, has_var = 0; struct fb_var_screeninfo var; - u8 pll_ref_div; u32 i; -#if defined(CONFIG_PPC) - int sense; -#endif init_waitqueue_head(&par->vblank.wait); spin_lock_init(&par->int_lock); @@ -2467,18 +2460,21 @@ static int __devinit aty_init(struct fb_info *info, const char *name) par->pll_limits.mclk = 63; } - if (M64_HAS(GTB_DSP) - && (pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par))) { - int diff1, diff2; - diff1 = 510 * 14 / pll_ref_div - par->pll_limits.pll_max; - diff2 = 510 * 29 / pll_ref_div - par->pll_limits.pll_max; - if (diff1 < 0) - diff1 = -diff1; - if (diff2 < 0) - diff2 = -diff2; - if (diff2 < diff1) { - par->ref_clk_per = 1000000000000ULL / 29498928; - xtal = "29.498928"; + if (M64_HAS(GTB_DSP)) { + u8 pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par); + + if (pll_ref_div) { + int diff1, diff2; + diff1 = 510 * 14 / pll_ref_div - par->pll_limits.pll_max; + diff2 = 510 * 29 / pll_ref_div - par->pll_limits.pll_max; + if (diff1 < 0) + diff1 = -diff1; + if (diff2 < 0) + diff2 = -diff2; + if (diff2 < diff1) { + par->ref_clk_per = 1000000000000ULL / 29498928; + xtal = "29.498928"; + } } } #endif /* CONFIG_FB_ATY_CT */ @@ -2604,9 +2600,8 @@ static int __devinit aty_init(struct fb_info *info, const char *name) par->pll_ops->init_pll(info, &par->pll); /* - * Last page of 8 MB (4 MB on ISA) aperture is MMIO - * FIXME: we should use the auxiliary aperture instead so we can access - * the full 8 MB of video RAM on 8 MB boards + * Last page of 8 MB (4 MB on ISA) aperture is MMIO, + * unless the auxiliary register aperture is used. */ if (!par->aux_start && @@ -2672,6 +2667,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name) has_var = 1; } else { if (default_vmode == VMODE_CHOOSE) { + int sense; if (M64_HAS(G3_PB_1024x768)) /* G3 PowerBook with 1024x768 LCD */ default_vmode = VMODE_1024_768_60; @@ -3530,6 +3526,10 @@ static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *i atyfb_setup_generic_fail: iounmap(par->ati_regbase); par->ati_regbase = NULL; + if (info->screen_base) { + iounmap(info->screen_base); + info->screen_base = NULL; + } return ret; } @@ -3698,6 +3698,10 @@ static int __devinit atyfb_atari_probe(void) } if (aty_init(info, "ISA bus")) { + if (info->screen_base) + iounmap(info->screen_base); + if (par->ati_regbase) + iounmap(par->ati_regbase); framebuffer_release(info); /* This is insufficient! kernel_map has added two large chunks!! */ return -ENXIO; @@ -3707,6 +3711,8 @@ static int __devinit atyfb_atari_probe(void) #endif /* CONFIG_ATARI */ +#ifdef CONFIG_PCI + static void __devexit atyfb_remove(struct fb_info *info) { struct atyfb_par *par = (struct atyfb_par *) info->par; @@ -3754,7 +3760,6 @@ static void __devexit atyfb_remove(struct fb_info *info) framebuffer_release(info); } -#ifdef CONFIG_PCI static void __devexit atyfb_pci_remove(struct pci_dev *pdev) {