linux/drivers/video/fbdev/pm3fb.c

/*
 *  linux/drivers/video/pm3fb.c -- 3DLabs Permedia3 frame buffer device
 *
 *  Copyright (C) 2001 Romain Dolbeau <[email protected]>.
 *
 *  Ported to 2.6 kernel on 1 May 2007 by Krzysztof Helt <[email protected]>
 *	based on pm2fb.c
 *
 *  Based on code written by:
 *	   Sven Luther, <[email protected]>
 *	   Alan Hourihane, <[email protected]>
 *	   Russell King, <[email protected]>
 *  Based on linux/drivers/video/skeletonfb.c:
 *	Copyright (C) 1997 Geert Uytterhoeven
 *  Based on linux/driver/video/pm2fb.c:
 *	Copyright (C) 1998-1999 Ilario Nardinocchi ([email protected])
 *	Copyright (C) 1999 Jakub Jelinek ([email protected])
 *
 *  This file is subject to the terms and conditions of the GNU General Public
 *  License. See the file COPYING in the main directory of this archive for
 *  more details.
 *
 */

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

#include <video/pm3fb.h>

#if !defined(CONFIG_PCI)
#error "Only generic PCI cards supported."
#endif

#undef PM3FB_MASTER_DEBUG
#ifdef PM3FB_MASTER_DEBUG
#define DPRINTK
#else
#define DPRINTK(a, b...)
#endif

#define PM3_PIXMAP_SIZE

/*
 * Driver data
 */
static int hwcursor =;
static char *mode_option;
static bool noaccel;
static bool nomtrr;

/*
 * This structure defines the hardware state of the graphics card. Normally
 * you place this in a header file in linux/include/video. This file usually
 * also includes register information. That allows other driver subsystems
 * and userland applications the ability to use the same header file to
 * avoid duplicate work and easy porting of software.
 */
struct pm3_par {};

/*
 * Here we define the default structs fb_fix_screeninfo and fb_var_screeninfo
 * if we don't use modedb. If we do use modedb see pm3fb_init how to use it
 * to get a fb_var_screeninfo. Otherwise define a default var as well.
 */
static struct fb_fix_screeninfo pm3fb_fix =;

/*
 * Utility functions
 */

static inline u32 PM3_READ_REG(struct pm3_par *par, s32 off)
{}

static inline void PM3_WRITE_REG(struct pm3_par *par, s32 off, u32 v)
{}

static inline void PM3_WAIT(struct pm3_par *par, u32 n)
{}

static inline void PM3_WRITE_DAC_REG(struct pm3_par *par, unsigned r, u8 v)
{}

static inline void pm3fb_set_color(struct pm3_par *par, unsigned char regno,
			unsigned char r, unsigned char g, unsigned char b)
{}

static void pm3fb_clear_colormap(struct pm3_par *par,
			unsigned char r, unsigned char g, unsigned char b)
{}

/* Calculating various clock parameters */
static void pm3fb_calculate_clock(unsigned long reqclock,
				unsigned char *prescale,
				unsigned char *feedback,
				unsigned char *postscale)
{}

static inline int pm3fb_depth(const struct fb_var_screeninfo *var)
{}

static inline int pm3fb_shift_bpp(unsigned bpp, int v)
{}

/* acceleration */
static int pm3fb_sync(struct fb_info *info)
{}

static void pm3fb_init_engine(struct fb_info *info)
{}

static void pm3fb_fillrect(struct fb_info *info,
				const struct fb_fillrect *region)
{}

static void pm3fb_copyarea(struct fb_info *info,
				const struct fb_copyarea *area)
{}

static void pm3fb_imageblit(struct fb_info *info, const struct fb_image *image)
{}
/* end of acceleration functions */

/*
 *	Hardware Cursor support.
 */
static const u8 cursor_bits_lookup[16] =;

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

/* write the mode to registers */
static void pm3fb_write_mode(struct fb_info *info)
{}

/*
 * hardware independent functions
 */
static int pm3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{}

static int pm3fb_set_par(struct fb_info *info)
{}

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

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

static int pm3fb_blank(int blank_mode, struct fb_info *info)
{}

	/*
	 *  Frame buffer operations
	 */

static const struct fb_ops pm3fb_ops =;

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

	/*
	 *  Initialization
	 */

/* mmio register are already mapped when this function is called */
/* the pm3fb_fix.smem_start is also set */
static unsigned long pm3fb_size_memory(struct pm3_par *par)
{}

static int pm3fb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
{}

	/*
	 *  Cleanup
	 */
static void pm3fb_remove(struct pci_dev *dev)
{}

static const struct pci_device_id pm3fb_id_table[] =;

/* For PCI drivers */
static struct pci_driver pm3fb_driver =;

MODULE_DEVICE_TABLE(pci, pm3fb_id_table);

#ifndef MODULE
	/*
	 *  Setup
	 */

/*
 * Only necessary if your driver takes special options,
 * otherwise we fall back on the generic fb_setup().
 */
static int __init pm3fb_setup(char *options)
{}
#endif /* MODULE */

static int __init pm3fb_init(void)
{}

#ifdef MODULE
static void __exit pm3fb_exit(void)
{
	pci_unregister_driver(&pm3fb_driver);
}

module_exit(pm3fb_exit);
#endif
module_init();

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

MODULE_DESCRIPTION();
MODULE_LICENSE();