mm: kill vma flag VM_RESERVED and mm->reserved_vm counter
[deliverable/linux.git] / drivers / video / aty / atyfb_base.c
CommitLineData
1da177e4
LT
1/*
2 * ATI Frame Buffer Device Driver Core
3 *
4 * Copyright (C) 2004 Alex Kern <alex.kern@gmx.de>
5 * Copyright (C) 1997-2001 Geert Uytterhoeven
6 * Copyright (C) 1998 Bernd Harries
7 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
8 *
9 * This driver supports the following ATI graphics chips:
10 * - ATI Mach64
11 *
12 * To do: add support for
13 * - ATI Rage128 (from aty128fb.c)
14 * - ATI Radeon (from radeonfb.c)
15 *
16 * This driver is partly based on the PowerMac console driver:
17 *
18 * Copyright (C) 1996 Paul Mackerras
19 *
20 * and on the PowerMac ATI/mach64 display driver:
21 *
22 * Copyright (C) 1997 Michael AK Tesch
23 *
24 * with work by Jon Howell
25 * Harry AC Eaton
26 * Anthony Tong <atong@uiuc.edu>
27 *
28 * Generic LCD support written by Daniel Mantione, ported from 2.4.20 by Alex Kern
96de0e25 29 * Many Thanks to Ville Syrjälä for patches and fixing nasting 16 bit color bug.
1da177e4
LT
30 *
31 * This file is subject to the terms and conditions of the GNU General Public
32 * License. See the file COPYING in the main directory of this archive for
33 * more details.
34 *
35 * Many thanks to Nitya from ATI devrel for support and patience !
36 */
37
38/******************************************************************************
39
40 TODO:
41
42 - cursor support on all cards and all ramdacs.
43 - cursor parameters controlable via ioctl()s.
44 - guess PLL and MCLK based on the original PLL register values initialized
45 by Open Firmware (if they are initialized). BIOS is done
46
47 (Anyone with Mac to help with this?)
48
49******************************************************************************/
50
51
1da177e4
LT
52#include <linux/module.h>
53#include <linux/moduleparam.h>
54#include <linux/kernel.h>
55#include <linux/errno.h>
56#include <linux/string.h>
57#include <linux/mm.h>
58#include <linux/slab.h>
59#include <linux/vmalloc.h>
60#include <linux/delay.h>
61#include <linux/console.h>
62#include <linux/fb.h>
63#include <linux/init.h>
64#include <linux/pci.h>
65#include <linux/interrupt.h>
66#include <linux/spinlock.h>
67#include <linux/wait.h>
5474c120 68#include <linux/backlight.h>
eafad22a
VS
69#include <linux/reboot.h>
70#include <linux/dmi.h>
1da177e4
LT
71
72#include <asm/io.h>
84902b7a 73#include <linux/uaccess.h>
1da177e4
LT
74
75#include <video/mach64.h>
76#include "atyfb.h"
77#include "ati_ids.h"
78
79#ifdef __powerpc__
e8222502 80#include <asm/machdep.h>
1da177e4
LT
81#include <asm/prom.h>
82#include "../macmodes.h"
83#endif
84#ifdef __sparc__
1da177e4 85#include <asm/fbio.h>
63c3f460
DM
86#include <asm/oplib.h>
87#include <asm/prom.h>
1da177e4
LT
88#endif
89
90#ifdef CONFIG_ADB_PMU
91#include <linux/adb.h>
92#include <linux/pmu.h>
93#endif
94#ifdef CONFIG_BOOTX_TEXT
95#include <asm/btext.h>
96#endif
97#ifdef CONFIG_PMAC_BACKLIGHT
98#include <asm/backlight.h>
99#endif
100#ifdef CONFIG_MTRR
101#include <asm/mtrr.h>
102#endif
103
104/*
105 * Debug flags.
106 */
107#undef DEBUG
108/*#define DEBUG*/
109
110/* Make sure n * PAGE_SIZE is protected at end of Aperture for GUI-regs */
111/* - must be large enough to catch all GUI-Regs */
112/* - must be aligned to a PAGE boundary */
113#define GUI_RESERVE (1 * PAGE_SIZE)
114
115/* FIXME: remove the FAIL definition */