#ifndef _CYBER5K_FB_H
#define _CYBER5K_FB_H

#include <linux/config.h>

#define MMIO_SIZE	0x000c0000
#define MMIO_OFFSET	0x00800000

#define NR_PALETTE	256

struct cyber5k_color {
	unsigned char red;
	unsigned char green;
	unsigned char blue;
};

/**
 * Structure representing a cyber5k graphics card.
 */
struct cyber5k_info {
	struct pci_dev *dev;		/* Pointer to the pci device. */
	unsigned long ref_ps;		/* Reference clock in picoseconds. */
	unsigned char mclk[3];		/* Memory clock pll bytes. */

	unsigned long base_phys;	/* Physical address of pci resource. */
	unsigned long smem_base;	/* Remapped memory of pci resource. */
	unsigned long mmio_base;	/* Start of memory mapped registers. */
	unsigned long vmem_size;	/* Size of video memory. */

	struct cyber5k_color *palette;	/* Color palette pointer. */
	unsigned int pseudo_palette[16];/* Pseudo colors for truecolor. */

	int blanked;			/* != 0 -> screen blanked */

	unsigned long cursor_offset;	/* Cursor bitmap offset in video mem */
	int cursor_on;			/* guess what.. */
};

/**
 * Structure containing the registers that are dependent on the
 * graphics mode.
 */
struct cyber5k_regs {
	unsigned char vclk[3];		/* Video clock pll bytes. */
	unsigned char crtc[20];		/* Display mode registers. */
	unsigned short *tv_regs;	/* TV registers. */
	int tvnorm;			/* =0 PAL, =1 NTSC */
};

/**
 * Structure describing a tv mode.
 */
struct cyber5k_tvmode {
	unsigned int xres, yres;	/* Resolution. */
	unsigned char *vclk;		/* TV video clock pll bytes. */
	unsigned char *crtc;		/* TV display mode registers. */
	unsigned short *tv_regs;	/* TV registers. */
};

extern struct cyber5k_tvmode cyber5k_pal_modes[];
extern struct cyber5k_tvmode cyber5k_ntsc_modes[];

#endif
