linux/drivers/video/fbdev/tdfxfb.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 *
 * tdfxfb.c
 *
 * Author: Hannu Mallat <[email protected]>
 *
 * Copyright © 1999 Hannu Mallat
 * All rights reserved
 *
 * Created      : Thu Sep 23 18:17:43 1999, hmallat
 * Last modified: Tue Nov  2 21:19:47 1999, hmallat
 *
 * I2C part copied from the i2c-voodoo3.c driver by:
 * Frodo Looijaard <[email protected]>,
 * Philip Edelbrock <[email protected]>,
 * Ralph Metzler <[email protected]>, and
 * Mark D. Studebaker <[email protected]>
 *
 * Lots of the information here comes from the Daryll Strauss' Banshee
 * patches to the XF86 server, and the rest comes from the 3dfx
 * Banshee specification. I'm very much indebted to Daryll for his
 * work on the X server.
 *
 * Voodoo3 support was contributed Harold Oga. Lots of additions
 * (proper acceleration, 24 bpp, hardware cursor) and bug fixes by Attila
 * Kesmarki. Thanks guys!
 *
 * Voodoo1 and Voodoo2 support aren't relevant to this driver as they
 * behave very differently from the Voodoo3/4/5. For anyone wanting to
 * use frame buffer on the Voodoo1/2, see the sstfb driver (which is
 * located at http://www.sourceforge.net/projects/sstfb).
 *
 * While I _am_ grateful to 3Dfx for releasing the specs for Banshee,
 * I do wish the next version is a bit more complete. Without the XF86
 * patches I couldn't have gotten even this far... for instance, the
 * extensions to the VGA register set go completely unmentioned in the
 * spec! Also, lots of references are made to the 'SST core', but no
 * spec is publicly available, AFAIK.
 *
 * The structure of this driver comes pretty much from the Permedia
 * driver by Ilario Nardinocchi, which in turn is based on skeletonfb.
 *
 * TODO:
 * - multihead support (basically need to support an array of fb_infos)
 * - support other architectures (PPC, Alpha); does the fact that the VGA
 *   core can be accessed only thru I/O (not memory mapped) complicate
 *   things?
 *
 * Version history:
 *
 * 0.1.4 (released 2002-05-28)	ported over to new fbdev api by James Simmons
 *
 * 0.1.3 (released 1999-11-02)	added Attila's panning support, code
 *				reorg, hwcursor address page size alignment
 *				(for mmapping both frame buffer and regs),
 *				and my changes to get rid of hardcoded
 *				VGA i/o register locations (uses PCI
 *				configuration info now)
 * 0.1.2 (released 1999-10-19)	added Attila Kesmarki's bug fixes and
 *				improvements
 * 0.1.1 (released 1999-10-07)	added Voodoo3 support by Harold Oga.
 * 0.1.0 (released 1999-10-06)	initial version
 *
 */

#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/fb.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/io.h>

#include <video/tdfx.h>

#define DPRINTK(a, b...)

#define BANSHEE_MAX_PIXCLOCK
#define VOODOO3_MAX_PIXCLOCK
#define VOODOO5_MAX_PIXCLOCK

static const struct fb_fix_screeninfo tdfx_fix =;

static const struct fb_var_screeninfo tdfx_var =;

/*
 * PCI driver prototypes
 */
static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id);
static void tdfxfb_remove(struct pci_dev *pdev);

static const struct pci_device_id tdfxfb_id_table[] =;

static struct pci_driver tdfxfb_driver =;

MODULE_DEVICE_TABLE(pci, tdfxfb_id_table);

/*
 * Driver data
 */
static int nopan;
static int nowrap =;      /* not implemented (yet) */
static int hwcursor =;
static char *mode_option;
static bool nomtrr;

/* -------------------------------------------------------------------------
 *			Hardware-specific funcions
 * ------------------------------------------------------------------------- */

static inline u8 vga_inb(struct tdfx_par *par, u32 reg)
{}

static inline void vga_outb(struct tdfx_par *par, u32 reg, u8 val)
{}

static inline void gra_outb(struct tdfx_par *par, u32 idx, u8 val)
{}

static inline void seq_outb(struct tdfx_par *par, u32 idx, u8 val)
{}

static inline u8 seq_inb(struct tdfx_par *par, u32 idx)
{}

static inline void crt_outb(struct tdfx_par *par, u32 idx, u8 val)
{}

static inline u8 crt_inb(struct tdfx_par *par, u32 idx)
{}

static inline void att_outb(struct tdfx_par *par, u32 idx, u8 val)
{}

static inline void vga_disable_video(struct tdfx_par *par)
{}

static inline void vga_enable_video(struct tdfx_par *par)
{}

static inline void vga_enable_palette(struct tdfx_par *par)
{}

static inline u32 tdfx_inl(struct tdfx_par *par, unsigned int reg)
{}

static inline void tdfx_outl(struct tdfx_par *par, unsigned int reg, u32 val)
{}

static inline void banshee_make_room(struct tdfx_par *par, int size)
{}

static int banshee_wait_idle(struct fb_info *info)
{}

/*
 * Set the color of a palette entry in 8bpp mode
 */
static inline void do_setpalentry(struct tdfx_par *par, unsigned regno, u32 c)
{}

static u32 do_calc_pll(int freq, int *freq_out)
{}

static void do_write_regs(struct fb_info *info, struct banshee_reg *reg)
{}

static unsigned long do_lfb_size(struct tdfx_par *par, unsigned short dev_id)
{}

/* ------------------------------------------------------------------------- */

static int tdfxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{}

static int tdfxfb_set_par(struct fb_info *info)
{}

/* A handy macro shamelessly pinched from matroxfb */
#define CNVT_TOHW(val, width)

static int tdfxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
			    unsigned blue, unsigned transp,
			    struct fb_info *info)
{}

/* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */
static int tdfxfb_blank(int blank, struct fb_info *info)
{}

/*
 * Set the starting position of the visible screen to var->yoffset
 */
static int tdfxfb_pan_display(struct fb_var_screeninfo *var,
			      struct fb_info *info)
{}

#ifdef CONFIG_FB_3DFX_ACCEL
/*
 * FillRect 2D command (solidfill or invert (via ROP_XOR))
 */
static void tdfxfb_fillrect(struct fb_info *info,
			    const struct fb_fillrect *rect)
{}

/*
 * Screen-to-Screen BitBlt 2D command (for the bmove fb op.)
 */
static void tdfxfb_copyarea(struct fb_info *info,
			    const struct fb_copyarea *area)
{}

static void tdfxfb_imageblit(struct fb_info *info, const struct fb_image *image)
{}
#endif /* CONFIG_FB_3DFX_ACCEL */

static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
{}

static const struct fb_ops tdfxfb_ops =;

#ifdef CONFIG_FB_3DFX_I2C
/* The voo GPIO registers don't have individual masks for each bit
   so we always have to read before writing. */

static void tdfxfb_i2c_setscl(void *data, int val)
{}

static void tdfxfb_i2c_setsda(void *data, int val)
{}

/* The GPIO pins are open drain, so the pins always remain outputs.
   We rely on the i2c-algo-bit routines to set the pins high before
   reading the input from other chips. */

static int tdfxfb_i2c_getscl(void *data)
{}

static int tdfxfb_i2c_getsda(void *data)
{}

static void tdfxfb_ddc_setscl(void *data, int val)
{}

static void tdfxfb_ddc_setsda(void *data, int val)
{}

static int tdfxfb_ddc_getscl(void *data)
{}

static int tdfxfb_ddc_getsda(void *data)
{}

static int tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan, const char *name,
				struct device *dev)
{}

static int tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan, const char *name,
				struct device *dev)
{}

static void tdfxfb_create_i2c_busses(struct fb_info *info)
{}

static void tdfxfb_delete_i2c_busses(struct tdfx_par *par)
{}

static int tdfxfb_probe_i2c_connector(struct tdfx_par *par,
				      struct fb_monspecs *specs)
{}
#endif /* CONFIG_FB_3DFX_I2C */

/**
 *      tdfxfb_probe - Device Initializiation
 *
 *      @pdev:  PCI Device to initialize
 *      @id:    PCI Device ID
 *
 *      Initializes and allocates resources for PCI device @pdev.
 *
 */
static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{}

#ifndef MODULE
static void __init tdfxfb_setup(char *options)
{}
#endif

/**
 *      tdfxfb_remove - Device removal
 *
 *      @pdev:  PCI Device to cleanup
 *
 *      Releases all resources allocated during the course of the driver's
 *      lifetime for the PCI device @pdev.
 *
 */
static void tdfxfb_remove(struct pci_dev *pdev)
{}

static int __init tdfxfb_init(void)
{}

static void __exit tdfxfb_exit(void)
{}

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

module_param(hwcursor, int, 0644);
MODULE_PARM_DESC();
module_param(mode_option, charp, 0);
MODULE_PARM_DESC();
module_param(nomtrr, bool, 0);
MODULE_PARM_DESC();

module_init();
module_exit(tdfxfb_exit);