xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Mon Feb 16 15:45:01 PST 2009


 configure.ac                |    3 
 hw/kdrive/linux/Makefile.am |    4 
 hw/kdrive/linux/agp.c       |  354 --------------------------------------------
 hw/kdrive/linux/agp.h       |   71 --------
 hw/kdrive/src/Makefile.am   |    7 
 hw/kdrive/src/vga.c         |  317 ---------------------------------------
 hw/kdrive/src/vga.h         |  144 -----------------
 7 files changed, 900 deletions(-)

New commits:
commit 970725d23e83285d41e3f7cab678a825d9cc25cf
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 16 18:44:00 2009 -0500

    kdrive: Nuke dead AGP and VGA code. (#19921)

diff --git a/configure.ac b/configure.ac
index 9126d2a..aede4b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -371,7 +371,6 @@ AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
 AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
 
 DRI=no
-KDRIVE_HW=no
 dnl it would be nice to autodetect these *CONS_SUPPORTs
 case $host_os in
   *freebsd* | *dragonfly*)
@@ -398,7 +397,6 @@ case $host_os in
 	;;
   *linux*)
 	DRI=yes
-	KDRIVE_HW=yes
 	;;
   *solaris*)
 	PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no)
@@ -407,7 +405,6 @@ case $host_os in
 	AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
 	;;
 esac
-AM_CONDITIONAL(KDRIVE_HW, test "x$KDRIVE_HW" = xyes)
 
 XORG_RELEASE_VERSION
 dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the
diff --git a/hw/kdrive/linux/Makefile.am b/hw/kdrive/linux/Makefile.am
index ee23d3a..be07561 100644
--- a/hw/kdrive/linux/Makefile.am
+++ b/hw/kdrive/linux/Makefile.am
@@ -10,14 +10,10 @@ if TSLIB
 TSLIB_C = tslib.c
 endif
 
-if KDRIVE_HW
 KDRIVE_HW_SOURCES =	\
-	agp.c		\
-	agp.h		\
 	evdev.c		\
 	keyboard.c	\
 	linux.c
-endif
 
 liblinux_la_SOURCES = 	\
 	bus.c		\
diff --git a/hw/kdrive/linux/agp.c b/hw/kdrive/linux/agp.c
deleted file mode 100644
index 80fb725..0000000
--- a/hw/kdrive/linux/agp.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Abstraction of the AGP GART interface.
- *
- * This version is for both Linux and FreeBSD.
- *
- * Copyright © 2000-2001 Nokia Home Communications
- * Copyright © 2000 VA Linux Systems, Inc.
- 
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, and/or sell copies of the Software, and to permit persons
-to whom the Software is furnished to do so, provided that the above
-copyright notice(s) and this permission notice appear in all copies of
-the Software and that both the above copyright notice(s) and this
-permission notice appear in supporting documentation.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
-SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
-RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder
-shall not be used in advertising or otherwise to promote the sale, use
-or other dealings in this Software without prior written authorization
-of the copyright holder.
-
- */
-
-/*
- * Author: Pontus Lidman <pontus.lidman at nokia.com> (adaption to KDrive) and others
- */
-
-#ifdef HAVE_CONFIG_H
-#include <kdrive-config.h>
-#endif
-#include <X11/X.h>
-#include "misc.h"
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include "agp.h"
-
-#if defined(linux)
-#include <asm/ioctl.h>
-
-#include <linux/agpgart.h>
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-#include <sys/ioctl.h>
-#include <sys/agpio.h>
-#endif
-
-#ifndef AGP_DEVICE
-#define AGP_DEVICE		"/dev/agpgart"
-#endif
-/* AGP page size is independent of the host page size. */
-#ifndef AGP_PAGE_SIZE
-#define AGP_PAGE_SIZE		4096
-#endif
-#define AGPGART_MAJOR_VERSION	0
-#define AGPGART_MINOR_VERSION	99
-
-static int gartFd = -1;
-static int acquiredScreen = -1;
-
-/*
- * Open /dev/agpgart.  Keep it open until server exit.
- */
-
-static Bool
-GARTInit(void)
-{
-	static Bool initDone = FALSE;
-	struct _agp_info agpinf;
-
-	if (initDone)
-		return (gartFd != -1);
-
-	initDone = TRUE;
-
-	if (gartFd == -1)
-		gartFd = open(AGP_DEVICE, O_RDWR, 0);
-	else
-		return FALSE;
-
-	if (gartFd == -1) {
-            fprintf(stderr, "Unable to open " AGP_DEVICE " (%s)\n",
-                    strerror(errno)); 
-            return FALSE;
-	}
-
-	KdAcquireGART(-1);
-	/* Check the kernel driver version. */
-	if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
-            fprintf(stderr, "GARTInit: AGPIOC_INFO failed (%s)\n", 
-                    strerror(errno)); 
-            close(gartFd);
-            gartFd = -1;
-            return FALSE;
-	}
-	KdReleaseGART(-1);
-
-#if defined(linux)
-	/* Per Dave Jones, every effort will be made to keep the
-	 * agpgart interface backwards compatible, so allow all
-	 * future versions.
-	 */
-	if (
-#if (AGPGART_MAJOR_VERSION > 0) /* quiet compiler */
-	    agpinf.version.major < AGPGART_MAJOR_VERSION ||
-#endif
-	    (agpinf.version.major == AGPGART_MAJOR_VERSION &&
-	     agpinf.version.minor < AGPGART_MINOR_VERSION)) {
-            fprintf(stderr, 
-                    "Kernel agpgart driver version is not current" 
-                    " (%d.%d vs %d.%d)\n", 
-                    agpinf.version.major, agpinf.version.minor, 
-                    AGPGART_MAJOR_VERSION, AGPGART_MINOR_VERSION); 
-            close(gartFd);
-            gartFd = -1;
-            return FALSE;
-	}
-#endif
-	
-	return TRUE;
-}
-
-Bool
-KdAgpGARTSupported()
-{
-	return GARTInit();
-}
-
-AgpInfoPtr
-KdGetAGPInfo(int screenNum)
-{
-	struct _agp_info agpinf;
-	AgpInfoPtr info;
-
-	if (!GARTInit())
-		return NULL;
-
-
-	if ((info = calloc(sizeof(AgpInfo), 1)) == NULL) {
-            fprintf(stderr, "Failed to allocate AgpInfo\n"); 
-            return NULL;
-	}
-
-	if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
-            fprintf(stderr, 
-                    "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n", 
-                    strerror(errno)); 
-            return NULL;
-	}
-
-	info->bridgeId = agpinf.bridge_id;
-	info->agpMode = agpinf.agp_mode;
-	info->base = agpinf.aper_base;
-	info->size = agpinf.aper_size;
-	info->totalPages = agpinf.pg_total;
-	info->systemPages = agpinf.pg_system;
-	info->usedPages = agpinf.pg_used;
-
-	return info;
-}
-
-/*
- * XXX If multiple screens can acquire the GART, should we have a reference
- * count instead of using acquiredScreen?
- */
-
-Bool
-KdAcquireGART(int screenNum)
-{
-    if (screenNum != -1 && !GARTInit())
-        return FALSE;
-    
-    if (screenNum == -1 || acquiredScreen != screenNum) {
-        if (ioctl(gartFd, AGPIOC_ACQUIRE, 0) != 0) {
-            fprintf(stderr, 
-                    "AGPIOC_ACQUIRE failed (%s)\n", 
-                    strerror(errno)); 
-            return FALSE;
-        }
-        acquiredScreen = screenNum;
-    }
-    
-    return TRUE;
-}
-
-Bool
-KdReleaseGART(int screenNum)
-{
-	if (screenNum != -1 && !GARTInit())
-		return FALSE;
-
-	if (acquiredScreen == screenNum) {
-		if (ioctl(gartFd, AGPIOC_RELEASE, 0) != 0) {
- 			fprintf(stderr,
- 				   "AGPIOC_RELEASE failed (%s)\n",
- 				   strerror(errno)); 
-			return FALSE;
-		}
-		acquiredScreen = -1;
-		return TRUE;
-	}
-	return FALSE;
-}
-
-int
-KdAllocateGARTMemory(int screenNum, unsigned long size, int type,
-			unsigned long *physical)
-{
-	struct _agp_allocate alloc;
-	int pages;
-
-	/*
-	 * Allocates "size" bytes of GART memory (rounds up to the next
-	 * page multiple) or type "type".  A handle (key) for the allocated
-	 * memory is returned.  On error, the return value is -1.
-	 */
-
-	if (!GARTInit() || acquiredScreen != screenNum)
-		return -1;
-
-	pages = (size / AGP_PAGE_SIZE);
-	if (size % AGP_PAGE_SIZE != 0)
-		pages++;
-
-	/* XXX check for pages == 0? */
-
-	alloc.pg_count = pages;
-	alloc.type = type;
-
-	if (ioctl(gartFd, AGPIOC_ALLOCATE, &alloc) != 0) {
-            fprintf(stderr, "KdAllocateGARTMemory: " 
-                    "allocation of %d pages failed\n\t(%s)\n", pages, 
-                    strerror(errno)); 
-		return -1;
-	}
-
-	if (physical)
-		*physical = alloc.physical;
-
-	return alloc.key;
-}
-
-
-/* Bind GART memory with "key" at "offset" */
-Bool
-KdBindGARTMemory(int screenNum, int key, unsigned long offset)
-{
-	struct _agp_bind bind;
-	int pageOffset;
-
-	if (!GARTInit() || acquiredScreen != screenNum)
-		return FALSE;
-
-	if (acquiredScreen != screenNum) {
-            fprintf(stderr, 
-                    "AGP not acquired by this screen\n"); 
-            return FALSE;
-	}
-
-	if (offset % AGP_PAGE_SIZE != 0) {
-            fprintf(stderr, "KdBindGARTMemory: " 
-                    "offset (0x%lx) is not page-aligned (%d)\n", 
-                    offset, AGP_PAGE_SIZE); 
-            return FALSE;
-	}
-	pageOffset = offset / AGP_PAGE_SIZE;
-
-	bind.pg_start = pageOffset;
-	bind.key = key;
-
-	if (ioctl(gartFd, AGPIOC_BIND, &bind) != 0) {
-		fprintf(stderr, "KdBindGARTMemory: "
-                        "binding of gart memory with key %d\n"
-                        "\tat offset 0x%lx failed (%s)\n",
-                        key, offset, strerror(errno));
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-
-/* Unbind GART memory with "key" */
-Bool
-KdUnbindGARTMemory(int screenNum, int key)
-{
-	struct _agp_unbind unbind;
-
-	if (!GARTInit() || acquiredScreen != screenNum)
-		return FALSE;
-
-	if (acquiredScreen != screenNum) {
-		fprintf(stderr,
-			   "AGP not acquired by this screen\n");
-		return FALSE;
-	}
-
-	unbind.priority = 0;
-	unbind.key = key;
-
-	if (ioctl(gartFd, AGPIOC_UNBIND, &unbind) != 0) {
-		fprintf(stderr, "KdUnbindGARTMemory: "
-			   "unbinding of gart memory with key %d "
-			   "failed (%s)\n", key, strerror(errno));
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-
-/* XXX Interface may change. */
-Bool
-KdEnableAGP(int screenNum, CARD32 mode)
-{
-	agp_setup setup;
-
-	if (!GARTInit() || acquiredScreen != screenNum)
-		return FALSE;
-
-	setup.agp_mode = mode;
-	if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) {
-		fprintf(stderr, "KdEnableAGP: "
-			   "AGPIOC_SETUP with mode %ld failed (%s)\n",
-			   mode, strerror(errno));
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
diff --git a/hw/kdrive/linux/agp.h b/hw/kdrive/linux/agp.h
deleted file mode 100644
index 419dee1..0000000
--- a/hw/kdrive/linux/agp.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* COPYRIGHT AND PERMISSION NOTICE
-
-Copyright (c) 2000, 2001 Nokia Home Communications
-
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, and/or sell copies of the Software, and to permit persons
-to whom the Software is furnished to do so, provided that the above
-copyright notice(s) and this permission notice appear in all copies of
-the Software and that both the above copyright notice(s) and this
-permission notice appear in supporting documentation.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
-SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
-RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder
-shall not be used in advertising or otherwise to promote the sale, use
-or other dealings in this Software without prior written authorization
-of the copyright holder.
-
-X Window System is a trademark of The Open Group */
-
-/* agp.h - header file for KDrive AGP GART interface
- *
- * Author: Pontus Lidman <pontus.lidman at nokia.com>
- *
- */
-
-#ifndef _AGP_H_
-#define _AGP_H_
-
-#include <X11/Xdefs.h>
-#include <X11/Xmd.h>
-
-/* These two definitions must be consistent with the kernel's,
-   but using 1 or 2 in driver code is even uglier */
-#define AGP_DCACHE_MEMORY 1
-#define AGP_PHYS_MEMORY   2
-
-typedef struct _AgpInfo {
-	unsigned long	bridgeId;
-	unsigned long	agpMode;
-	unsigned long	base;
-	unsigned long	size;
-	unsigned long	totalPages;
-	unsigned long	systemPages;
-	unsigned long	usedPages;
-} AgpInfo, *AgpInfoPtr;
-
-extern Bool KdAgpGARTSupported(void);
-extern AgpInfoPtr KdGetAGPInfo(int screenNum);
-extern Bool KdAcquireGART(int screenNum);
-extern Bool KdReleaseGART(int screenNum);
-extern int KdAllocateGARTMemory(int screenNum, unsigned long size, int type,
-				  unsigned long *physical);
-extern Bool KdBindGARTMemory(int screenNum, int key, unsigned long offset);
-extern Bool KdUnbindGARTMemory(int screenNum, int key);
-extern Bool KdEnableAGP(int screenNum, CARD32 mode);
-
-#endif /* _AGP_H_ */
diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am
index f4424dc..968978e 100644
--- a/hw/kdrive/src/Makefile.am
+++ b/hw/kdrive/src/Makefile.am
@@ -6,12 +6,6 @@ AM_CFLAGS =	-DHAVE_DIX_CONFIG_H
 
 noinst_LTLIBRARIES = libkdrive.la libkdrivestubs.la
 
-if KDRIVE_HW
-KDRIVE_HW_SOURCES =	\
-	vga.c		\
-	vga.h
-endif
-
 if XV
 KDRIVE_XV_SOURCES =	\
 	kxv.c		\
@@ -31,7 +25,6 @@ libkdrive_la_SOURCES =	\
 	kmode.c		\
 	kshadow.c	\
 	$(KDRIVE_XV_SOURCES) \
-	$(KDRIVE_HW_SOURCES) \
         $(top_srcdir)/mi/miinitext.c
 
 libkdrivestubs_la_SOURCES = \
diff --git a/hw/kdrive/src/vga.c b/hw/kdrive/src/vga.c
deleted file mode 100644
index 5a0a967..0000000
--- a/hw/kdrive/src/vga.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Copyright © 1999 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Keith Packard makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <kdrive-config.h>
-#endif
-#include "vga.h"
-#include <stdio.h>
-
-#ifdef linux
-#ifdef __i386__
-#define extern static
-#include <sys/io.h>
-#undef extern
-
-#define _VgaInb(r)	inb(r)
-#define _VgaOutb(v,r)	outb(v,r)
-#else
-#define _VgaInb(r)	0
-#define _VgaOutb(v,r)	
-#endif
-
-#define _VgaByteAddr(a)	((VGAVOL8 *) (a))
-#define _VgaBytePort(a)	(a)
-#endif
-
-
-#undef VGA_DEBUG_REGISTERS
-#ifdef VGA_DEBUG_REGISTERS
-#define VGA_DEBUG(a)	fprintf a
-#else
-#define VGA_DEBUG(a)
-#endif
-
-VGA8
-VgaInb (VGA16 r)
-{
-    return _VgaInb(r);
-}
-
-void
-VgaOutb (VGA8 v, VGA16 r)
-{
-    _VgaOutb (v,r);
-}
-	
-VGA8
-VgaReadMemb (VGA32 addr)
-{
-    return *_VgaByteAddr(addr);
-}
-
-void
-VgaWriteMemb (VGA8 v, VGA32 addr)
-{
-    *_VgaByteAddr(addr) = v;
-}
-
-VGA8
-VgaFetch (VgaCard *card, VGA16 reg)
-{
-    VgaMap	map;
-    VGA8	value = 0;
-
-    (*card->map) (card, reg, &map, VGAFALSE);
-    switch (map.access) {
-    case VgaAccessMem:
-	value = VgaReadMemb (map.port);
-	VGA_DEBUG ((stderr, "%08x -> %2x\n", map.port, value));
-	break;
-    case VgaAccessIo:
-	value = _VgaInb (map.port);
-	VGA_DEBUG ((stderr, "%4x    -> %2x\n", map.port, value));
-	break;
-    case VgaAccessIndMem:
-	VgaWriteMemb (map.index, map.port + map.addr);
-	value = VgaReadMemb (map.port + map.value);
-	VGA_DEBUG ((stderr, "%4x/%2x -> %2x\n", map.port, map.index, value));
-	break;
-    case VgaAccessIndIo:
-	_VgaOutb (map.index, map.port + map.addr);
-	value = _VgaInb (map.port + map.value);
-	VGA_DEBUG ((stderr, "%4x/%2x -> %2x\n", map.port, map.index, value));
-	break;
-    case VgaAccessDone:
-	value = map.value;
-	VGA_DEBUG ((stderr, "direct %4x -> %2x\n", reg, value));
-	break;
-    }
-    return value;
-}
-
-void
-VgaStore (VgaCard *card, VGA16 reg, VGA8 value)
-{
-    VgaMap  map;
-
-    map.value = value;
-    (*card->map) (card, reg, &map, VGATRUE);
-    switch (map.access) {
-    case VgaAccessMem:
-	VGA_DEBUG ((stderr, "%8x <- %2x\n", map.port, value));
-	VgaWriteMemb (map.value, map.port);
-	break;
-    case VgaAccessIo:
-	VGA_DEBUG ((stderr, "%4x    <- %2x\n", map.port, value));
-	_VgaOutb (value, map.port);
-	break;
-    case VgaAccessIndMem:
-	VgaWriteMemb (map.index, map.port + map.addr);
-	VgaWriteMemb (value, map.port + map.value);
-	VGA_DEBUG ((stderr, "%4x/%2x <- %2x\n", map.port, map.index, value));
-	break;
-    case VgaAccessIndIo:
-	VGA_DEBUG ((stderr, "%4x/%2x <- %2x\n", map.port, map.index, value));
-	_VgaOutb (map.index, map.port + map.addr);
-	_VgaOutb (value, map.port + map.value);
-	break;
-    case VgaAccessDone:
-	VGA_DEBUG ((stderr, "direct %4x <- %2x\n", reg, value));
-	break;
-    }
-}
-
-void
-VgaPreserve (VgaCard *card)
-{
-    VgaSave *s;
-    VGA16   id;
-
-    for (s = card->saves; s->first != VGA_REG_NONE; s++)
-    {
-	for (id = s->first; id <= s->last; id++)
-	{
-	    card->values[id].cur = VgaFetch (card, id);
-	    card->values[id].save = card->values[id].cur;
-	    card->values[id].flags = VGA_VALUE_VALID | VGA_VALUE_SAVED;
-	}
-    }
-}
-
-void
-VgaRestore (VgaCard *card)
-{
-    VgaSave *s;
-    VGA16   id;
-
-    for (s = card->saves; s->first != VGA_REG_NONE; s++)
-    {
-	for (id = s->first; id <= s->last; id++)
-	{
-	    if (card->values[id].flags & VGA_VALUE_SAVED)
-	    {
-		VgaStore (card, id, card->values[id].save);
-		card->values[id].cur = card->values[id].save;
-	    }
-	}
-    }
-}
-
-void
-VgaFinish (VgaCard *card)
-{
-    VGA16   id;
-
-    for (id = 0; id < card->max; id++)
-	card->values[id].flags = 0;
-}
-
-void
-VgaInvalidate (VgaCard *card)
-{
-    VGA16   id;
-
-    for (id = 0; id < card->max; id++)
-	card->values[id].flags &= ~VGA_VALUE_VALID;
-}
-
-
-static void
-_VgaSync (VgaCard *card, VGA16 id)
-{
-    if (!(card->values[id].flags & VGA_VALUE_VALID))
-    {
-	card->values[id].cur = VgaFetch (card, id);
-	card->values[id].flags |= VGA_VALUE_VALID;
-    }
-}
-
-void
-VgaSet (VgaCard *card, VgaReg *reg, VGA32 value)
-{
-    VGA8    v, mask, new;
-    
-    while (reg->len)
-    {
-	if (reg->id != VGA_REG_NONE)
-	{
-	    _VgaSync (card, reg->id);
-	    mask = ((1 << reg->len) - 1);
-	    new = value & mask;
-	    mask <<= reg->base;
-	    new <<= reg->base;
-	    v = card->values[reg->id].cur;
-	    v = (v & ~mask) | new;
-	    card->values[reg->id].cur = v;
-	    card->values[reg->id].flags |= VGA_VALUE_MODIFIED|VGA_VALUE_DIRTY;
-	}
-	value >>= reg->len;
-	reg++;
-    }
-}
-
-void
-VgaFlushReg (VgaCard *card, VgaReg *reg)
-{
-    while (reg->len)
-    {
-	if (reg->id != VGA_REG_NONE)
-	{
-	    if (card->values[reg->id].flags & VGA_VALUE_DIRTY)
-	    {
-		VgaStore (card, reg->id, card->values[reg->id].cur);
-		card->values[reg->id].flags &= ~VGA_VALUE_DIRTY;
-	    }
-	}
-	reg++;
-    }
-    
-}
-
-void
-VgaSetImm (VgaCard *card, VgaReg *reg, VGA32 value)
-{
-    VgaSet (card, reg, value);
-    VgaFlushReg (card, reg);
-}
-
-VGA32
-VgaGet (VgaCard *card, VgaReg *reg)
-{
-    VGA32   value, offset, v;
-    VGA8    mask;
-
-    value = 0;
-    offset = 0;
-    while (reg->len)
-    {
-	if (reg->id != VGA_REG_NONE)
-	{
-	    _VgaSync (card, reg->id);
-	    mask = ((1 << reg->len) - 1);
-	    v = (card->values[reg->id].cur >> reg->base) & mask;
-	    value |= (v << offset);
-	}
-	offset += reg->len;
-	reg++;
-    }
-    return value;
-}
-
-VGA32
-VgaGetImm (VgaCard *card, VgaReg *reg)
-{
-    VgaReg  *r = reg;
-    
-    while (r->len)
-    {
-	if (r->id != VGA_REG_NONE)
-	    card->values[r->id].flags &= ~VGA_VALUE_VALID;
-	r++;
-    }
-    return VgaGet (card, reg);
-}
-
-void
-VgaFlush (VgaCard *card)
-{
-    VGA16   id;
-
-    for (id = 0; id < card->max; id++)
-    {
-	if (card->values[id].flags & VGA_VALUE_DIRTY)
-	{
-	    VgaStore (card, id, card->values[id].cur);
-	    card->values[id].flags &= ~VGA_VALUE_DIRTY;
-	}
-    }
-}
-
-void
-VgaFill (VgaCard *card, VGA16 low, VGA16 high)
-{
-    VGA16   id;
-
-    for (id = low; id < high; id++)
-	_VgaSync (card, id);
-}
diff --git a/hw/kdrive/src/vga.h b/hw/kdrive/src/vga.h
deleted file mode 100644
index 0615d52..0000000
--- a/hw/kdrive/src/vga.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright © 1999 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Keith Packard makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _VGA_H_
-#define _VGA_H_
-
-typedef unsigned long	VGA32;
-typedef unsigned short	VGA16;
-typedef unsigned char	VGA8;
-typedef int		VGABOOL;
-typedef volatile VGA8	VGAVOL8;
-
-#define VGATRUE	    1
-#define VGAFALSE    0
-
-typedef struct _vgaReg {
-    VGA16	id;
-    VGA8	base;
-    VGA8	len;
-} VgaReg;
-
-#define VGA_REG_NONE	    0xffff
-#define VGA_REG_END	    VGA_REG_NONE, 0, 0
-
-typedef struct _vgaValue {
-    VGA8	save;
-    VGA8	cur;
-    VGA16	flags;
-} VgaValue;
-
-#define VGA_VALUE_VALID	    1	/* value ever fetched */
-#define VGA_VALUE_MODIFIED  2	/* value ever changed */
-#define VGA_VALUE_DIRTY	    4	/* value needs syncing */
-#define VGA_VALUE_SAVED	    8	/* value preserved */
-
-typedef enum _vgaAccess {
-    VgaAccessMem, VgaAccessIo, VgaAccessIndMem, VgaAccessIndIo,
-    VgaAccessDone
-} VgaAccess;
-
-typedef struct _vgaMap {
-    VgaAccess	access;
-    VGA32	port;
-    VGA8	addr;	    /* for Ind access; addr offset from port */
-    VGA8	value;	    /* for Ind access; value offset from port */
-    VGA8	index;	    /* for Ind access; index value */
-} VgaMap;
-
-#define VGA_UNLOCK_FIXED    1	/* dont save current value */
-#define VGA_UNLOCK_LOCK	    2	/* execute only on relock */
-#define VGA_UNLOCK_UNLOCK   4	/* execute only on unlock */
-
-typedef struct _vgaSave {
-    VGA16	first;
-    VGA16	last;
-} VgaSave;
-
-#define VGA_SAVE_END	VGA_REG_NONE, VGA_REG_NONE
-
-typedef struct _vgaCard {
-    void	(*map) (struct _vgaCard *card, VGA16 reg, VgaMap *map, VGABOOL write);
-    void	*closure;
-    int		max;
-    VgaValue	*values;
-    VgaSave	*saves;
-} VgaCard;
-
-VGA8
-VgaInb (VGA16 r);
-
-void
-VgaOutb (VGA8 v, VGA16 r);
-    
-VGA8
-VgaReadMemb (VGA32 addr);
-
-void
-VgaWriteMemb (VGA8 v, VGA32 addr);
-
-void
-VgaSetImm (VgaCard *card, VgaReg *reg, VGA32 value);
-
-VGA32
-VgaGetImm (VgaCard *card, VgaReg *reg);
-
-void
-VgaSet (VgaCard *card, VgaReg *reg, VGA32 value);
-
-VGA32
-VgaGet (VgaCard *card, VgaReg *reg);
-
-void
-VgaFlush (VgaCard *card);
-
-void
-VgaFill (VgaCard *card, VGA16 low, VGA16 high);
-
-void
-VgaPreserve (VgaCard *card);
-
-void
-VgaInvalidate (VgaCard *card);
-
-void
-VgaRestore (VgaCard *card);
-
-void
-VgaFinish (VgaCard *card);
-
-void
-VgaFlushReg (VgaCard *card, VgaReg *reg);
-
-VGA8
-VgaFetch (VgaCard *card, VGA16 id);
-
-void
-VgaStore (VgaCard *card, VGA16 id, VGA8 value);
-
-VGA8
-_VgaFetchInd (VGA16 port, VGA8 reg);
-
-void
-_VgaStoreInd (VGA16 port, VGA8 reg, VGA8 value);
-
-#endif /* _VGA_H_ */


More information about the xorg-commit mailing list