//#define CRTC2
// YUY2 support (see config.format) added by A'rpi/ESP-team
// double buffering added by A'rpi/ESP-team
// brightness/contrast introduced by eyck
// Set this value, if autodetection fails! (video ram size in megabytes)
// #define MGA_MEMORY_SIZE 16
//#define MGA_ALLOW_IRQ
#define MGA_VSYNC_POS 2
/*
*
* mga_vid.c
*
* Copyright (C) 1999 Aaron Holtzman
*
* Module skeleton based on gutted agpgart module by Jeff Hartmann
* <slicer@ionet.net>
*
* Matrox MGA G200/G400 YUV Video Interface module Version 0.1.0
*
* BES == Back End Scaler
*
* This software has been released under the terms of the GNU Public
* license. See http://www.gnu.org/copyleft/gpl.html for details.
*/
//It's entirely possible this major conflicts with something else
/* mknod /dev/mga_vid c 178 0 */
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10)
#include <linux/malloc.h>
#else
#include <linux/slab.h>
#endif
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include "mga_vid.h"
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
#ifdef CONFIG_DEVFS_FS
#includ