- /*
- * linux/drivers/video/amifb.c -- Amiga builtin chipset frame buffer device
- *
- * Copyright (C) 1995 Geert Uytterhoeven
- *
- * with work by Roman Zippel
- *
- *
- * This file is based on the Atari frame buffer device (atafb.c):
- *
- * Copyright (C) 1994 Martin Schaller
- * Roman Hodek
- *
- * with work by Andreas Schwab
- * Guenther Kelleter
- *
- * and on the original Amiga console driver (amicon.c):
- *
- * Copyright (C) 1993 Hamish Macdonald
- * Greg Harp
- * Copyright (C) 1994 David Carter [carter@compsci.bristol.ac.uk]
- *
- * with work by William Rucklidge (wjr@cs.cornell.edu)
- * Geert Uytterhoeven
- * Jes Sorensen (jds@kom.auc.dk)
- *
- *
- * History:
- *
- * - 24 Jul 96: Copper generates now vblank interrupt and
- * VESA Power Saving Protocol is fully implemented
- * - 14 Jul 96: Rework and hopefully last ECS bugs fixed
- * - 7 Mar 96: Hardware sprite support by Roman Zippel
- * - 18 Feb 96: OCS and ECS support by Roman Zippel
- * Hardware functions completely rewritten
- * - 2 Dec 95: AGA version by Geert Uytterhoeven
- *
- * 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/module.h>
- #include <linux/kernel.h>
- #include <linux/errno.h>
- #include <linux/string.h>
- #include <linux/mm.h>
- #include <linux/tty.h>
- #include <linux/slab.h>
- #include <linux/delay.h>
- #include <linux/config.h>
- #include <linux/interrupt.h>
- #include <linux/fb.h>
- #include <linux/init.h>
- #include <linux/console.h>
- #include <linux/ioport.h>
- #include <asm/uaccess.h>
- #include <asm/system.h>
- #include <asm/irq.h>
- #include <asm/amigahw.h>
- #include <asm/amigaints.h>
- #include <asm/setup.h>
- #include <video/fbcon.h>
- #include <video/fbcon-afb.h>
- #include <video/fbcon-ilbm.h>
- #include <video/fbcon-mfb.h>
- #define DEBUG
- #if !defined(CONFIG_FB_AMIGA_OCS) && !defined(CONFIG_FB_AMIGA_ECS) && !defined(CONFIG_FB_AMIGA_AGA)
- #define CONFIG_FB_AMIGA_OCS /* define at least one fb driver, this will change later */
- #endif
- #if !defined(CONFIG_FB_AMIGA_OCS)
- # define IS_OCS (0)
- #elif defined(CONFIG_FB_AMIGA_ECS) || defined(CONFIG_FB_AMIGA_AGA)
- # define IS_OCS (chipset == TAG_OCS)
- #else
- # define CONFIG_FB_AMIGA_OCS_ONLY
- # define IS_OCS (1)
- #endif
- #if !defined(CONFIG_FB_AMIGA_ECS)
- # define IS_ECS (0)
- #elif defined(CONFIG_FB_AMIGA_OCS) || defined(CONFIG_FB_AMIGA_AGA)
- # define IS_ECS (chipset == TAG_ECS)
- #else
- # define CONFIG_FB_AMIGA_ECS_ONLY
- # define IS_ECS (1)
- #endif
- #if !defined(CONFIG_FB_AMIGA_AGA)
- # define IS_AGA (0)
- #elif defined(CONFIG_FB_AMIGA_OCS) || defined(CONFIG_FB_AMIGA_ECS)
- # define IS_AGA (chipset == TAG_AGA)
- #else
- # define CONFIG_FB_AMIGA_AGA_ONLY
- # define IS_AGA (1)
- #endif
- #ifdef DEBUG
- # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
- #else
- # define DPRINTK(fmt, args...)
- #endif
- /*******************************************************************************
- Generic video timings
- ---------------------
- Timings used by the frame buffer interface:
- +----------+---------------------------------------------+----------+-------+
- | | ^ | | |
- | | |upper_margin | | |
- | |