#include <linux/init.h>
#include <linux/fb.h>
#include <linux/pci.h>
+#include <linux/selection.h>
#include <asm/io.h>
#include <video/tgafb.h>
#include <linux/selection.h>
static void tgafb_copyarea(struct fb_info *, const struct fb_copyarea *);
static int tgafb_pci_register(struct pci_dev *, const struct pci_device_id *);
-#ifdef MODULE
static void tgafb_pci_unregister(struct pci_dev *);
-#endif
static const char *mode_option = "640x480@60";
.fb_fillrect = tgafb_fillrect,
.fb_copyarea = tgafb_copyarea,
.fb_imageblit = tgafb_imageblit,
- .fb_cursor = soft_cursor,
};
vvvr &= ~(TGA_VALID_VIDEO | TGA_VALID_BLANK);
switch (blank) {
- case 0: /* Unblanking */
+ case FB_BLANK_UNBLANK: /* Unblanking */
if (par->vesa_blanked) {
TGA_WRITE_REG(par, vhcr & 0xbfffffff, TGA_HORIZ_REG);
TGA_WRITE_REG(par, vvcr & 0xbfffffff, TGA_VERT_REG);
TGA_WRITE_REG(par, vvvr | TGA_VALID_VIDEO, TGA_VALID_REG);
break;
- case 1: /* Normal blanking */
+ case FB_BLANK_NORMAL: /* Normal blanking */
TGA_WRITE_REG(par, vvvr | TGA_VALID_VIDEO | TGA_VALID_BLANK,
TGA_VALID_REG);
break;
- case 2: /* VESA blank (vsync off) */
+ case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
TGA_WRITE_REG(par, vvcr | 0x40000000, TGA_VERT_REG);
TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG);
par->vesa_blanked = 1;
break;
- case 3: /* VESA blank (hsync off) */
+ case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
TGA_WRITE_REG(par, vhcr | 0x40000000, TGA_HORIZ_REG);
TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG);
par->vesa_blanked = 1;
break;
- case 4: /* Poweroff */
+ case FB_BLANK_POWERDOWN: /* Poweroff */
TGA_WRITE_REG(par, vhcr | 0x40000000, TGA_HORIZ_REG);
TGA_WRITE_REG(par, vvcr | 0x40000000, TGA_VERT_REG);
TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG);
unsigned long rincr, line_length, shift, pos, is8bpp;
unsigned long i, j;
const unsigned char *data;
- void *regs_base, *fb_base;
+ void __iomem *regs_base;
+ void __iomem *fb_base;
dx = image->dx;
dy = image->dy;
int is8bpp = info->var.bits_per_pixel == 8;
u32 dx, dy, width, height, vxres, vyres, color;
unsigned long pos, align, line_length, i, j;
- void *regs_base, *fb_base;
+ void __iomem *regs_base;
+ void __iomem *fb_base;
dx = rect->dx;
dy = rect->dy;
u32 height, u32 width)
{
struct tga_par *par = (struct tga_par *) info->par;
- void *tga_regs = par->tga_regs_base;
+ void __iomem *tga_regs = par->tga_regs_base;
unsigned long dpos, spos, i, n64;
/* Set up the MODE and PIXELSHIFT registers. */
u32 height, u32 width)
{
struct tga_par *par = (struct tga_par *) info->par;
- void *tga_regs = par->tga_regs_base;
- void *tga_fb = par->tga_fb_base;
- void *src, *dst;
+ void __iomem *tga_regs = par->tga_regs_base;
+ void __iomem *tga_fb = par->tga_fb_base;
+ void __iomem *src;
+ void __iomem *dst;
unsigned long i, n16;
/* Set up the MODE and PIXELSHIFT registers. */
u32 smask_first, dmask_first, dmask_last;
int pixel_shift, need_prime, need_second;
unsigned long n64, n32, xincr_first;
- void *tga_regs, *tga_fb;
+ void __iomem *tga_regs;
+ void __iomem *tga_fb;
yincr = line_length;
if (dy > sy) {
for (i = 0; i < height; ++i) {
unsigned long j;
- void *sfb, *dfb;
+ void __iomem *sfb;
+ void __iomem *dfb;
sfb = tga_fb + spos;
dfb = tga_fb + dpos;
dfb += 32;
}
- if (n64 && (((long)sfb | (long)dfb) & 63))
+ if (n64 && (((unsigned long)sfb | (unsigned long)dfb) & 63))
printk(KERN_ERR
"tgafb: misaligned copy64 (s:%p, d:%p)\n",
sfb, dfb);
unsigned long depos, sepos, dealign, sealign;
u32 mask_first, mask_last;
unsigned long n32;
- void *tga_regs, *tga_fb;
+ void __iomem *tga_regs;
+ void __iomem *tga_fb;
yincr = line_length;
if (dy > sy) {
for (i = 0; i < height; ++i) {
unsigned long j;
- void *sfb, *dfb;
+ void __iomem *sfb;
+ void __iomem *dfb;
sfb = tga_fb + sepos;
dfb = tga_fb + depos;
u32 pseudo_palette[16];
} *all;
- void *mem_base;
+ void __iomem *mem_base;
unsigned long bar0_start, bar0_len;
u8 tga_type;
int ret;
pci_read_config_byte(pdev, PCI_REVISION_ID, &all->par.tga_chip_rev);
/* Setup framebuffer. */
- all->info.flags = FBINFO_FLAG_DEFAULT;
+ all->info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA |
+ FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT;
all->info.fbops = &tgafb_ops;
- all->info.screen_base = (char *) all->par.tga_fb_base;
- all->info.currcon = -1;
+ all->info.screen_base = all->par.tga_fb_base;
all->info.par = &all->par;
all->info.pseudo_palette = all->pseudo_palette;
tgafb_set_par(&all->info);
tgafb_init_fix(&all->info);
+ all->info.device = &pdev->dev;
if (register_framebuffer(&all->info) < 0) {
printk(KERN_ERR "tgafb: Could not register framebuffer\n");
ret = -EINVAL;
return ret;
}
-int __init
-tgafb_init(void)
-{
- return pci_module_init(&tgafb_driver);
-}
-
-#ifdef MODULE
static void __exit
tgafb_pci_unregister(struct pci_dev *pdev)
{
kfree(info);
}
+#ifdef MODULE
static void __exit
tgafb_exit(void)
{
}
#endif /* !MODULE */
+int __init
+tgafb_init(void)
+{
+#ifndef MODULE
+ char *option = NULL;
+
+ if (fb_get_options("tgafb", &option))
+ return -ENODEV;
+ tgafb_setup(option);
+#endif
+ return pci_register_driver(&tgafb_driver);
+}
+
/*
* Modularisation
*/
-#ifdef MODULE
module_init(tgafb_init);
+
+#ifdef MODULE
module_exit(tgafb_exit);
#endif