#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/pci.h>
#include <linux/init.h>
#include <linux/console.h>
#include <asm/io.h>
#include <asm/irq.h>
#include "savagefb.h"
#define SAVAGEFB_VERSION …
static char *mode_option = …;
#ifdef MODULE
MODULE_AUTHOR("(c) 2001-2002 Denis Oliver Kropp <[email protected]>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("FBDev driver for S3 Savage PCI/AGP Chips");
#endif
static void vgaHWSeqReset(struct savagefb_par *par, int start)
{ … }
static void vgaHWProtect(struct savagefb_par *par, int on)
{ … }
static void vgaHWRestore(struct savagefb_par *par, struct savage_reg *reg)
{ … }
static void vgaHWInit(struct fb_var_screeninfo *var,
struct savagefb_par *par,
struct xtimings *timings,
struct savage_reg *reg)
{ … }
static void
savage3D_waitfifo(struct savagefb_par *par, int space)
{ … }
static void
savage4_waitfifo(struct savagefb_par *par, int space)
{ … }
static void
savage2000_waitfifo(struct savagefb_par *par, int space)
{ … }
static void
savage3D_waitidle(struct savagefb_par *par)
{ … }
static void
savage4_waitidle(struct savagefb_par *par)
{ … }
static void
savage2000_waitidle(struct savagefb_par *par)
{ … }
#ifdef CONFIG_FB_SAVAGE_ACCEL
static void
SavageSetup2DEngine(struct savagefb_par *par)
{ … }
static void savagefb_set_clip(struct fb_info *info)
{ … }
#else
static void SavageSetup2DEngine(struct savagefb_par *par) {}
#endif
static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1,
int min_n2, int max_n2, long freq_min,
long freq_max, unsigned int *mdiv,
unsigned int *ndiv, unsigned int *r)
{ … }
static int common_calc_clock(long freq, int min_m, int min_n1, int max_n1,
int min_n2, int max_n2, long freq_min,
long freq_max, unsigned char *mdiv,
unsigned char *ndiv)
{ … }
#ifdef SAVAGEFB_DEBUG
static void SavagePrintRegs(struct savagefb_par *par)
{
unsigned char i;
int vgaCRIndex = 0x3d4;
int vgaCRReg = 0x3d5;
printk(KERN_DEBUG "SR x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE "
"xF");
for (i = 0; i < 0x70; i++) {
if (!(i % 16))
printk(KERN_DEBUG "\nSR%xx ", i >> 4);
vga_out8(0x3c4, i, par);
printk(KERN_DEBUG " %02x", vga_in8(0x3c5, par));
}
printk(KERN_DEBUG "\n\nCR x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC "
"xD xE xF");
for (i = 0; i < 0xB7; i++) {
if (!(i % 16))
printk(KERN_DEBUG "\nCR%xx ", i >> 4);
vga_out8(vgaCRIndex, i, par);
printk(KERN_DEBUG " %02x", vga_in8(vgaCRReg, par));
}
printk(KERN_DEBUG "\n\n");
}
#endif
static void savage_get_default_par(struct savagefb_par *par, struct savage_reg *reg)
{ … }
static void savage_set_default_par(struct savagefb_par *par,
struct savage_reg *reg)
{ … }
static void savage_update_var(struct fb_var_screeninfo *var,
const struct fb_videomode *modedb)
{ … }
static int savagefb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info)
{ … }
static int savagefb_decode_var(struct fb_var_screeninfo *var,
struct savagefb_par *par,
struct savage_reg *reg)
{ … }
static int savagefb_setcolreg(unsigned regno,
unsigned red,
unsigned green,
unsigned blue,
unsigned transp,
struct fb_info *info)
{ … }
static void savagefb_set_par_int(struct savagefb_par *par, struct savage_reg *reg)
{ … }
static void savagefb_update_start(struct savagefb_par *par, int base)
{ … }
static void savagefb_set_fix(struct fb_info *info)
{ … }
static int savagefb_set_par(struct fb_info *info)
{ … }
static int savagefb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{ … }
static int savagefb_blank(int blank, struct fb_info *info)
{ … }
static int savagefb_open(struct fb_info *info, int user)
{ … }
static int savagefb_release(struct fb_info *info, int user)
{ … }
static const struct fb_ops savagefb_ops = …;
static const struct fb_var_screeninfo savagefb_var800x600x8 = …;
static void savage_enable_mmio(struct savagefb_par *par)
{ … }
static void savage_disable_mmio(struct savagefb_par *par)
{ … }
static int savage_map_mmio(struct fb_info *info)
{ … }
static void savage_unmap_mmio(struct fb_info *info)
{ … }
static int savage_map_video(struct fb_info *info, int video_len)
{ … }
static void savage_unmap_video(struct fb_info *info)
{ … }
static int savage_init_hw(struct savagefb_par *par)
{ … }
static int savage_init_fb_info(struct fb_info *info, struct pci_dev *dev,
const struct pci_device_id *id)
{ … }
static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ … }
static void savagefb_remove(struct pci_dev *dev)
{ … }
static int savagefb_suspend_late(struct device *dev, pm_message_t mesg)
{ … }
static int __maybe_unused savagefb_suspend(struct device *dev)
{ … }
static int __maybe_unused savagefb_hibernate(struct device *dev)
{ … }
static int __maybe_unused savagefb_freeze(struct device *dev)
{ … }
static int __maybe_unused savagefb_resume(struct device *dev)
{ … }
static const struct dev_pm_ops savagefb_pm_ops = …;
static const struct pci_device_id savagefb_devices[] = …;
MODULE_DEVICE_TABLE(pci, savagefb_devices);
static struct pci_driver savagefb_driver = …;
static void __exit savage_done(void)
{ … }
static int __init savagefb_setup(char *options)
{ … }
static int __init savagefb_init(void)
{ … }
module_init(…) …;
module_exit(savage_done);
module_param(mode_option, charp, 0);
MODULE_PARM_DESC(…) …;