From a30424c269479d1e722932c24f1c7e260914c390 Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard@openedhand.com>
Date: Fri, 11 Jan 2008 12:56:32 +0000
Subject: xserver-kdrive: Clean up unused patches and broken git recipe

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3465 311d38ba-8fff-0310-9ca6-ca027cbcb966
---
 .../xserver-kdrive-1.3.0.0/disable-apm.patch       |   20 +
 .../enable-builtin-fonts.patch                     |   12 +
 .../xserver-kdrive-1.3.0.0/fbdev-not-fix.patch     |   14 +
 .../hide-cursor-and-ppm-root.patch                 |  307 +
 .../xserver-kdrive-1.3.0.0/kdrive-evdev.patch      |  515 ++
 .../xserver-kdrive-1.3.0.0/kdrive-use-evdev.patch  |   54 +
 .../xserver-kdrive-1.3.0.0/kmode-palm.patch        |   34 +
 .../xserver-kdrive-1.3.0.0/kmode.patch             |   28 +
 .../xserver-kdrive-1.3.0.0/no-serial-probing.patch |   13 +
 .../build-20050207-against-X11R7.diff              |  464 --
 .../xserver-kdrive/build-fix-panoramix.patch       |   18 -
 .../xorg-xserver/xserver-kdrive/devfs.patch        |   47 -
 .../xorg-xserver/xserver-kdrive/disable-apm.patch  |   20 -
 .../xserver-kdrive/disable-xf86-dga-xorgcfg.patch  |   37 -
 .../xserver-kdrive/enable-builtin-fonts.patch      |   12 -
 .../xorg-xserver/xserver-kdrive/enable-epson.patch |   11 -
 .../xorg-xserver/xserver-kdrive/enable-tslib.patch |   23 -
 .../xorg-xserver/xserver-kdrive/epson.patch        |   11 -
 .../xserver-kdrive/faster-rotated.patch            |  241 -
 .../xserver-kdrive/fbdev-not-fix.patch             |   14 -
 .../xserver-kdrive/hide-cursor-and-ppm-root.patch  |  307 -
 .../xorg-xserver/xserver-kdrive/kdrive-evdev.patch |  515 --
 .../xserver-kdrive/kdrive-use-evdev.patch          |   54 -
 .../xserver-kdrive/kdrive-vidmemarea.patch         |  756 ---
 .../xorg-xserver/xserver-kdrive/kmode-palm.patch   |   34 -
 .../xorg-xserver/xserver-kdrive/kmode.patch        |   28 -
 .../xserver-kdrive/no-serial-probing.patch         |   13 -
 .../xorg-xserver/xserver-kdrive/onlyfb.patch       |   21 -
 .../xorg-xserver/xserver-kdrive/optional-xkb.patch |   54 -
 .../xserver-kdrive/w100-fix-offscreen-bmp.patch    |   15 -
 .../xorg-xserver/xserver-kdrive/w100.patch         | 6388 --------------------
 .../xorg-xserver/xserver-kdrive/xcalibrate.patch   |  351 --
 .../xserver-kdrive/xfbdev-fb-opt.patch             |   82 -
 .../xserver-kdrive/xserver-kdrive-poodle.patch     |   44 -
 meta/packages/xorg-xserver/xserver-kdrive_git.bb   |   48 -
 35 files changed, 997 insertions(+), 9608 deletions(-)
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/disable-apm.patch
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/enable-builtin-fonts.patch
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/fbdev-not-fix.patch
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/hide-cursor-and-ppm-root.patch
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-evdev.patch
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-use-evdev.patch
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kmode-palm.patch
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kmode.patch
 create mode 100644 meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/no-serial-probing.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/build-20050207-against-X11R7.diff
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/build-fix-panoramix.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/devfs.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/disable-apm.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/disable-xf86-dga-xorgcfg.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/enable-builtin-fonts.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/enable-epson.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/enable-tslib.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/epson.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/faster-rotated.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/fbdev-not-fix.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/hide-cursor-and-ppm-root.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/kdrive-evdev.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/kdrive-use-evdev.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/kdrive-vidmemarea.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/kmode-palm.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/kmode.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/no-serial-probing.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/onlyfb.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/optional-xkb.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/w100-fix-offscreen-bmp.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/w100.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/xcalibrate.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/xfbdev-fb-opt.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive/xserver-kdrive-poodle.patch
 delete mode 100644 meta/packages/xorg-xserver/xserver-kdrive_git.bb

diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/disable-apm.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/disable-apm.patch
new file mode 100644
index 000000000..bd8842721
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/disable-apm.patch
@@ -0,0 +1,20 @@
+--- xserver/hw/kdrive/linux/linux.c.orig	2005-04-23 15:56:13.988849232 +0000
++++ xserver/hw/kdrive/linux/linux.c	2005-04-23 15:57:05.001094192 +0000
+@@ -342,7 +342,7 @@
+     /*
+      * Open the APM driver
+      */
+-    LinuxApmFd = open ("/dev/apm_bios", 2);
++    /*LinuxApmFd = open ("/dev/apm_bios", 2);
+     if (LinuxApmFd < 0 && errno == ENOENT)
+ 	LinuxApmFd = open ("/dev/misc/apm_bios", 2); 
+     if (LinuxApmFd >= 0)
+@@ -352,7 +352,7 @@
+ 	RegisterBlockAndWakeupHandlers (LinuxApmBlock, LinuxApmWakeup, 0);
+ 	AddEnabledDevice (LinuxApmFd);
+     }
+-	
++    */	
+     /*
+      * now get the VT
+      */
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/enable-builtin-fonts.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/enable-builtin-fonts.patch
new file mode 100644
index 000000000..13a6c2c95
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/enable-builtin-fonts.patch
@@ -0,0 +1,12 @@
+--- xorg-server-X11R7.1-1.1.0/dix/dixfonts.c.orig	2006-06-08 14:49:12.158684250 +0200
++++ xorg-server-X11R7.1-1.1.0/dix/dixfonts.c	2006-06-08 14:49:52.493205000 +0200
+@@ -52,8 +52,8 @@
+ /* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */
+ 
+ #define NEED_REPLIES
+ #ifdef HAVE_DIX_CONFIG_H
+-#include <dix-config.h>
++#include <kdrive-config.h>
+ #endif
+ 
+ #include <X11/X.h>
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/fbdev-not-fix.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/fbdev-not-fix.patch
new file mode 100644
index 000000000..f87e7cc2c
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/fbdev-not-fix.patch
@@ -0,0 +1,14 @@
+--- xserver/hw/kdrive/fbdev/fbdev.c~	2004-09-15 00:08:10.000000000 +0100
++++ xserver/hw/kdrive/fbdev/fbdev.c	2004-11-13 17:47:02.000000000 +0000
+@@ -198,6 +198,11 @@
+ 	return FALSE;
+     }
+ 
++    /* Re-get the "fixed" parameters since they might have changed */
++    k = ioctl (priv->fd, FBIOGET_FSCREENINFO, &priv->fix);
++    if (k < 0)
++        perror ("FBIOGET_FSCREENINFO");
++
+     /* Now get the new screeninfo */
+     ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var);
+     depth = priv->var.bits_per_pixel;
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/hide-cursor-and-ppm-root.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/hide-cursor-and-ppm-root.patch
new file mode 100644
index 000000000..c160cd41d
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/hide-cursor-and-ppm-root.patch
@@ -0,0 +1,307 @@
+diff -u -r xorg-server-X11R7.1-1.1.0.orig/dix/window.c xorg-server-X11R7.1-1.1.0/dix/window.c
+--- xorg-server-X11R7.1-1.1.0.orig/dix/window.c	2007-01-08 14:30:38.000000000 +0000
++++ xorg-server-X11R7.1-1.1.0/dix/window.c	2007-01-16 17:16:19.000000000 +0000
+@@ -185,6 +185,8 @@
+ _X_EXPORT int numSaveUndersViewable = 0;
+ _X_EXPORT int deltaSaveUndersViewable = 0;
+ 
++char* RootPPM = NULL;
++
+ #ifdef DEBUG
+ /******
+  * PrintWindowTree
+@@ -311,6 +313,115 @@
+ #endif
+ }
+ 
++static int
++get_int(FILE *fp)
++{
++  int c = 0;
++
++  while ((c = getc(fp)) != EOF)
++    {
++      if (isspace(c))
++	continue;
++
++      if (c == '#')
++	while (c = getc(fp))
++	  if (c == EOF)
++	    return 0;
++	  else if (c == '\n')
++	    break;
++
++      if (isdigit(c)) 
++	{
++	  int val = c - '0';
++	  while ((c = getc(fp)) && isdigit(c))
++	    val = (val * 10) + (c - '0');
++	  return val;
++	}
++    }
++
++  return 0;
++}
++
++static unsigned char*
++ppm_load (const char* path, int depth, int *width, int *height)
++{
++  FILE *fp;
++  int   max, n = 0, w, h, i, j, bytes_per_line;
++  unsigned char *data, *res, h1, h2;
++
++  if (depth < 16 || depth > 32)
++    return NULL;
++
++  if (depth > 16)
++    depth = 32;
++
++  fp = fopen (path, "r");
++  if (fp == NULL)
++    return FALSE;
++
++  h1 = getc(fp);
++  h2 = getc(fp);
++
++  /* magic is 'P6' for raw ppm */
++  if (h1 != 'P' && h2 != '6')
++      goto fail;
++
++  w = get_int(fp);
++  h = get_int(fp);
++
++  if (w == 0 || h == 0)
++    goto fail;
++
++  max = get_int(fp);
++
++  if (max != 255)
++      goto fail;
++
++  bytes_per_line = ((w * depth + 31) >> 5) << 2;
++
++  res = data = malloc(bytes_per_line * h);
++
++  for (i=0; i<h; i++)
++    {
++      for (j=0; j<w; j++)
++	{
++	  unsigned char buf[3];
++	  fread(buf, 1, 3, fp);
++	  
++	  switch (depth)
++	    {
++	    case 24:
++	    case 32:
++	      *data     = buf[2];
++	      *(data+1) = buf[1];
++	      *(data+2) = buf[0];
++	      data += 4;
++	      break;
++	    case 16:
++	    default:
++	      *(unsigned short*)data
++		= ((buf[0] >> 3) << 11) | ((buf[1] >> 2) << 5) | (buf[2] >> 3);
++	      data += 2;
++	      break;
++	    }
++	}
++      data += (bytes_per_line - (w*(depth>>3)));
++    }
++
++  data = res;
++
++  *width  = w;
++  *height = h;
++
++  fclose(fp);
++
++  return res;
++
++ fail:
++  fclose(fp);
++  return NULL;
++}
++
+ static void
+ MakeRootTile(WindowPtr pWin)
+ {
+@@ -321,6 +432,36 @@
+     register unsigned char *from, *to;
+     register int i, j;
+ 
++    if (RootPPM != NULL)
++      {
++	int            w, h;
++	unsigned char *data;
++
++	if ((data = ppm_load (RootPPM, pScreen->rootDepth, &w, &h)) != NULL)
++	  {
++	    pWin->background.pixmap 
++	      = (*pScreen->CreatePixmap)(pScreen, w, h, pScreen->rootDepth);
++
++	    pWin->backgroundState = BackgroundPixmap;
++	    pGC = GetScratchGC(pScreen->rootDepth, pScreen);
++	    if (!pWin->background.pixmap || !pGC)
++	      FatalError("could not create root tile");
++
++	    ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
++
++	    (*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, 
++				  pGC, 
++				  pScreen->rootDepth,
++				  0, 0, w, h, 0, ZPixmap, (char *)data);
++	    FreeScratchGC(pGC);
++	    
++	    free(data);
++	    return;
++	  }
++	else
++	  ErrorF("Unable to load root window image.");
++      }
++
+     pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
+ 						    pScreen->rootDepth);
+ 
+@@ -357,6 +498,7 @@
+ 
+ }
+ 
++
+ WindowPtr
+ AllocateWindow(ScreenPtr pScreen)
+ {
+diff -u -r xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kdrive.c xorg-server-X11R7.1-1.1.0/hw/kdrive/src/kdrive.c
+--- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kdrive.c	2007-01-08 14:30:38.000000000 +0000
++++ xorg-server-X11R7.1-1.1.0/hw/kdrive/src/kdrive.c	2007-01-15 17:53:06.000000000 +0000
+@@ -58,6 +58,9 @@
+     { 32, 32 }
+ };
+ 
++int 
++ProcXFixesHideCursor (ClientPtr client) ;
++
+ #define NUM_KD_DEPTHS (sizeof (kdDepths) / sizeof (kdDepths[0]))
+ 
+ int                 kdScreenPrivateIndex;
+@@ -84,6 +87,9 @@
+ KdOsFuncs	*kdOsFuncs;
+ extern WindowPtr *WindowTable;
+ 
++extern Bool CursorInitiallyHidden; /* See Xfixes cursor.c */
++extern char* RootPPM;		   /* dix/window.c */
++
+ void
+ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
+ {
+@@ -312,6 +318,7 @@
+     KdSetRootClip (pScreen, TRUE);
+     if (pScreenPriv->card->cfuncs->dpms)
+ 	(*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState);
++
+     return TRUE;
+ }
+ 
+@@ -686,10 +693,14 @@
+     ErrorF("-mouse path[,n]  Filename of mouse device, n is number of buttons\n");
+     ErrorF("-switchCmd       Command to execute on vt switch\n");
+     ErrorF("-nozap           Don't terminate server on Ctrl+Alt+Backspace\n");
++    ErrorF("-hide-cursor     Start with cursor hidden\n");
++    ErrorF("-root-ppm [path] Specify ppm file to use as root window background.\n");
+     ErrorF("vtxx             Use virtual terminal xx instead of the next available\n");
+ #ifdef PSEUDO8
+     p8UseMsg ();
+ #endif
++
++
+ }
+ 
+ int
+@@ -761,6 +772,19 @@
+ 	kdSoftCursor = TRUE;
+ 	return 1;
+     }
++    if (!strcmp (argv[i], "-hide-cursor"))
++    {
++      CursorInitiallyHidden = TRUE;
++      return 1;
++    }
++    if (!strcmp (argv[i], "-root-ppm"))
++    {
++      if ((i+1) < argc)
++	RootPPM =  argv[i+1];
++      else
++	UseMsg ();
++      return 2;
++    }
+     if (!strcmp (argv[i], "-videoTest"))
+     {
+ 	kdVideoTest = TRUE;
+diff -u -r xorg-server-X11R7.1-1.1.0.orig/xfixes/cursor.c xorg-server-X11R7.1-1.1.0/xfixes/cursor.c
+--- xorg-server-X11R7.1-1.1.0.orig/xfixes/cursor.c	2007-01-08 14:30:38.000000000 +0000
++++ xorg-server-X11R7.1-1.1.0/xfixes/cursor.c	2007-01-11 16:33:00.000000000 +0000
+@@ -59,9 +59,12 @@
+ static RESTYPE		CursorWindowType;
+ static int		CursorScreenPrivateIndex = -1;
+ static int		CursorGeneration;
++static Bool             CursorGloballyHidden; 
+ static CursorPtr	CursorCurrent;
+ static CursorPtr        pInvisibleCursor = NULL;
+ 
++Bool CursorInitiallyHidden = FALSE;
++
+ static void deleteCursorHideCountsForScreen (ScreenPtr pScreen);
+ 
+ #define VERIFY_CURSOR(pCursor, cursor, client, access) { \
+@@ -130,7 +133,7 @@
+ 
+     Unwrap (cs, pScreen, DisplayCursor);
+ 
+-    if (cs->pCursorHideCounts != NULL) {
++    if (cs->pCursorHideCounts != NULL || CursorGloballyHidden) {
+ 	ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor);
+     } else {
+ 	ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
+@@ -848,6 +851,12 @@
+ 	return BadWindow;
+     }
+ 
++    /* Is cursor set to be initially hidden ?, if so reset this 
++     * flag as now visibility assumed under control of client.
++    */
++    if (CursorGloballyHidden)
++      CursorGloballyHidden = FALSE;
++
+     /* 
+      * Has client hidden the cursor before on this screen? 
+      * If so, just increment the count. 
+@@ -899,9 +908,19 @@
+ 	return BadWindow;
+     }
+ 
++    /* X was started with cursor hidden, therefore just reset our flag
++     * (returning to normal client control) and cause cursor to now be
++     * shown.
++    */
++    if (CursorGloballyHidden == TRUE)
++      {
++	CursorGloballyHidden = FALSE;
++	return (client->noClientException);
++      }
++
+     /* 
+      * Has client hidden the cursor on this screen?
+-     * If not, generate an error.
++     * If so, generate an error.
+      */
+     pChc = findCursorHideCount(client, pWin->drawable.pScreen);
+     if (pChc == NULL) {
+@@ -1009,6 +1028,8 @@
+ XFixesCursorInit (void)
+ {
+     int	i;
++
++    CursorGloballyHidden = CursorInitiallyHidden;
+     
+     if (CursorGeneration != serverGeneration)
+     {
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-evdev.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-evdev.patch
new file mode 100644
index 000000000..2dc22bf50
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-evdev.patch
@@ -0,0 +1,515 @@
+# Kdrive evdev support patch, posted by Ander Conselvan de Oliveira at
+# http://lists.freedesktop.org/archives/xorg/2005-December/011635.html
+diff -u -r --exclude=CVS --exclude=Makefile --exclude='*.o' --exclude=ephyr --exclude='*.Po' xserver.original/hw/kdrive/linux/evdev.c xserver/hw/kdrive/linux/evdev.c
+--- xserver.original/hw/kdrive/linux/evdev.c	2005-12-16 10:36:05.000000000 -0200
++++ xserver/hw/kdrive/linux/evdev.c	2005-12-16 10:40:51.077410192 -0200
+@@ -31,9 +31,11 @@
+ #include <X11/X.h>
+ #include <X11/Xproto.h>
+ #include <X11/Xpoll.h>
++#include <X11/keysym.h>
+ #include "inputstr.h"
+ #include "scrnintstr.h"
+ #include "kdrive.h"
++#include "kkeymap.h"
+ 
+ #define NUM_EVENTS  128
+ #define ABS_UNSET   -65535
+@@ -105,9 +107,10 @@
+ {
+     KdMouseInfo		*mi = closure;
+     Kevdev		*ke = mi->driver;
+-    int			i;
++    int			i, j;
+     struct input_event	events[NUM_EVENTS];
+     int			n;
++    int                 flags;
+ 
+     n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
+     if (n <= 0)
+@@ -115,22 +118,64 @@
+     n /= sizeof (struct input_event);
+     for (i = 0; i < n; i++)
+     {
++	flags = KD_MOUSE_DELTA | kdMouseInfo->buttonState;
+ 	switch (events[i].type) {
+ 	case EV_SYN:
+ 	    break;
+ 	case EV_KEY:
+-	    EvdevMotion (mi);
+-	    ASSIGNBIT(ke->key,events[i].code, events[i].value);
+-	    if (events[i].code < 0x100)
+-		ErrorF ("key %d %d\n", events[i].code, events[i].value);
+-	    else
+-		ErrorF ("key 0x%x %d\n", events[i].code, events[i].value);
++	  if (events[i].code >= BTN_MOUSE && events[i].code < BTN_JOYSTICK) {
++	        switch (events[i].code) {
++		case BTN_LEFT:
++		  if (events[i].value == 1)
++		    flags |= KD_BUTTON_1;
++		  else
++		    flags &= ~KD_BUTTON_1;
++		  break;
++		case BTN_MIDDLE:
++		  if (events[i].value == 1)
++		    flags |= KD_BUTTON_2;
++		  else
++		    flags &= ~KD_BUTTON_2;
++		  break;
++		case BTN_RIGHT:
++		  if (events[i].value == 1)
++		    flags |= KD_BUTTON_3;
++		  else
++		    flags &= ~KD_BUTTON_3;
++		  break;
++		default:
++		  /* Unknow button */
++		  break;
++       	        }
++		KdEnqueueMouseEvent (kdMouseInfo, flags, 0, 0);
++	    }
+ 	    break;
+ 	case EV_REL:
+-	    ke->rel[events[i].code] += events[i].value;
++	    if (events[i].code == REL_X) {
++	      KdEnqueueMouseEvent (kdMouseInfo, flags, events[i].value, 0);
++	    }
++	    else if (events[i].code == REL_Y) {
++	      KdEnqueueMouseEvent (kdMouseInfo, flags, 0, events[i].value);
++	    }
++	    else if (events[i].code == REL_WHEEL) {	      
++	      for (j = 0; j < abs (events[i].value); j++) {
++		if (events[i].value > 0)
++		  flags |= KD_BUTTON_4;
++		else
++		  flags |= KD_BUTTON_5;
++
++		KdEnqueueMouseEvent (kdMouseInfo, flags, 0, 0);
++
++		if (events[i].value > 0)
++		  flags &= ~KD_BUTTON_4;
++		else
++		  flags &= ~KD_BUTTON_5;
++
++		KdEnqueueMouseEvent (kdMouseInfo, flags, 0, 0);
++	      } /* events[i].code == REL_WHEEL */
++	    }
+ 	    break;
+ 	case EV_ABS:
+-	    ke->abs[events[i].code] = events[i].value;
+ 	    break;
+ 	}
+     }
+@@ -173,6 +218,12 @@
+ 		fd = open (kdefaultEvdev[i], 2);
+ 		if (fd >= 0)
+ 		{
++                    if (ioctl (fd, EVIOCGRAB, 1) < 0)
++                    {
++                        close (fd);
++                        continue;
++                    }
++
+ 		    mi->name = KdSaveString (kdefaultEvdev[i]);
+ 		    break;
+ 		}
+@@ -287,7 +338,319 @@
+     EvdevFini,
+ };
+ 
+-#if 0
++/* Keyboard */
++
++int kbd_fd = -1;
++int EvdevInputType = 0;
++
++KeySym evdevKeymap[(194 - 1 + 1) * 2] = {
++/* These are directly mapped from DOS scanset 0 */
++/*      1     8 */       XK_Escape, NoSymbol,
++/*      2     9 */       XK_1,  XK_exclam,
++/*      3    10 */       XK_2,  XK_at,
++/*      4    11 */       XK_3,  XK_numbersign,
++/*      5    12 */       XK_4,  XK_dollar,
++/*      6    13 */       XK_5,  XK_percent,
++/*      7    14 */       XK_6,  XK_asciicircum,
++/*      8    15 */       XK_7,  XK_ampersand,
++/*      9    16 */       XK_8,  XK_asterisk,
++/*     10    17 */       XK_9,  XK_parenleft,
++/*     11    18 */       XK_0,  XK_parenright,
++/*     12    19 */       XK_minus,      XK_underscore,
++/*     13    20 */       XK_equal,      XK_plus,
++/*     14    21 */       XK_BackSpace,  NoSymbol,
++/*     15    22 */       XK_Tab,        NoSymbol,
++/*     16    23 */       XK_Q,  NoSymbol,
++/*     17    24 */       XK_W,  NoSymbol,
++/*     18    25 */       XK_E,  NoSymbol,
++/*     19    26 */       XK_R,  NoSymbol,
++/*     20    27 */       XK_T,  NoSymbol,
++/*     21    28 */       XK_Y,  NoSymbol,
++/*     22    29 */       XK_U,  NoSymbol,
++/*     23    30 */       XK_I,  NoSymbol,
++/*     24    31 */       XK_O,  NoSymbol,
++/*     25    32 */       XK_P,  NoSymbol,
++/*     26    33 */       XK_bracketleft,        XK_braceleft,
++/*     27    34 */       XK_bracketright,       XK_braceright,
++/*     28    35 */       XK_Return,     NoSymbol,
++/*     29    36 */       XK_Control_L,  NoSymbol,
++/*     30    37 */       XK_A,  NoSymbol,
++/*     31    38 */       XK_S,  NoSymbol,
++/*     32    39 */       XK_D,  NoSymbol,
++/*     33    40 */       XK_F,  NoSymbol,
++/*     34    41 */       XK_G,  NoSymbol,
++/*     35    42 */       XK_H,  NoSymbol,
++/*     36    43 */       XK_J,  NoSymbol,
++/*     37    44 */       XK_K,  NoSymbol,
++/*     38    45 */       XK_L,  NoSymbol,
++/*     39    46 */       XK_semicolon,  XK_colon,
++/*     40    47 */       XK_apostrophe, XK_quotedbl,
++/*     41    48 */       XK_grave,      XK_asciitilde,
++/*     42    49 */       XK_Shift_L,    NoSymbol,
++/*     43    50 */       XK_backslash,  XK_bar,
++/*     44    51 */       XK_Z,  NoSymbol,
++/*     45    52 */       XK_X,  NoSymbol,
++/*     46    53 */       XK_C,  NoSymbol,
++/*     47    54 */       XK_V,  NoSymbol,
++/*     48    55 */       XK_B,  NoSymbol,
++/*     49    56 */       XK_N,  NoSymbol,
++/*     50    57 */       XK_M,  NoSymbol,
++/*     51    58 */       XK_comma,      XK_less,
++/*     52    59 */       XK_period,     XK_greater,
++/*     53    60 */       XK_slash,      XK_question,
++/*     54    61 */       XK_Shift_R,    NoSymbol,
++/*     55    62 */       XK_KP_Multiply,        NoSymbol,
++/*     56    63 */       XK_Alt_L,      XK_Meta_L,
++/*     57    64 */       XK_space,      NoSymbol,
++/*     58    65 */       XK_Caps_Lock,  NoSymbol,
++/*     59    66 */       XK_F1, NoSymbol,
++/*     60    67 */       XK_F2, NoSymbol,
++/*     61    68 */       XK_F3, NoSymbol,
++/*     62    69 */       XK_F4, NoSymbol,
++/*     63    70 */       XK_F5, NoSymbol,
++/*     64    71 */       XK_F6, NoSymbol,
++/*     65    72 */       XK_F7, NoSymbol,
++/*     66    73 */       XK_F8, NoSymbol,
++/*     67    74 */       XK_F9, NoSymbol,
++/*     68    75 */       XK_F10,        NoSymbol,
++/*     69    76 */       XK_Break,      XK_Pause,
++/*     70    77 */       XK_Scroll_Lock,        NoSymbol,
++/*     71    78 */       XK_KP_Home,    XK_KP_7,
++/*     72    79 */       XK_KP_Up,      XK_KP_8,
++/*     73    80 */       XK_KP_Page_Up, XK_KP_9,
++/*     74    81 */       XK_KP_Subtract,        NoSymbol,
++/*     75    82 */       XK_KP_Left,    XK_KP_4,
++/*     76    83 */       XK_KP_5,       NoSymbol,
++/*     77    84 */       XK_KP_Right,   XK_KP_6,
++/*     78    85 */       XK_KP_Add,     NoSymbol,
++/*     79    86 */       XK_KP_End,     XK_KP_1,
++/*     80    87 */       XK_KP_Down,    XK_KP_2,
++/*     81    88 */       XK_KP_Page_Down,       XK_KP_3,
++/*     82    89 */       XK_KP_Insert,  XK_KP_0,
++/*     83    90 */       XK_KP_Delete,  XK_KP_Decimal,
++/*     84    91 */     NoSymbol,        NoSymbol,
++/*     85    92 */     NoSymbol,        NoSymbol,
++/*     86    93 */     NoSymbol,        NoSymbol,
++/*     87    94 */       XK_F11,        NoSymbol,
++/*     88    95 */       XK_F12,        NoSymbol,
++
++/* These are remapped from the extended set (using ExtendMap) */
++
++/*     89    96 */       XK_Control_R,  NoSymbol,
++/*     90    97 */       XK_KP_Enter,   NoSymbol,
++/*     91    98 */       XK_KP_Divide,  NoSymbol,
++/*     92    99 */       XK_Sys_Req,    XK_Print,
++/*     93   100 */       XK_Alt_R,      XK_Meta_R,
++/*     94   101 */       XK_Num_Lock,   NoSymbol,
++/*     95   102 */       XK_Home,       NoSymbol,
++/*     96   103 */       XK_Up,         NoSymbol,
++/*     97   104 */       XK_Page_Up,    NoSymbol,
++/*     98   105 */       XK_Left,       NoSymbol,
++/*     99   106 */       XK_Right,      NoSymbol,
++/*    100   107 */       XK_End,        NoSymbol,
++/*    101   108 */       XK_Down,       NoSymbol,
++/*    102   109 */       XK_Page_Down,  NoSymbol,
++/*    103   110 */       XK_Insert,     NoSymbol,
++/*    104   111 */       XK_Delete,     NoSymbol,
++/*    105   112 */       XK_Super_L,    NoSymbol,
++/*    106   113 */       XK_Super_R,    NoSymbol,
++/*    107   114 */       XK_Menu,       NoSymbol,
++/*    108   115 */       NoSymbol,      NoSymbol,
++/*    109   116 */       NoSymbol,      NoSymbol,
++/*    110   117 */       NoSymbol,      NoSymbol,
++/*    111   118 */       NoSymbol,      NoSymbol,
++/*    112   119 */       NoSymbol,      NoSymbol,
++
++/*    113   120 */      NoSymbol,     NoSymbol,
++/*    114   121 */      NoSymbol,     NoSymbol,
++/*    115   122 */      NoSymbol,     NoSymbol,
++/*    116   123 */      NoSymbol,     NoSymbol,
++/*    117   124 */      NoSymbol,     NoSymbol,
++/*    118   125 */      NoSymbol,     NoSymbol,
++/*    119   126 */      NoSymbol,     NoSymbol,
++/*    120   127 */      NoSymbol,     NoSymbol,
++/*    121   128 */      NoSymbol,     NoSymbol,
++/*    122   129 */      NoSymbol,     NoSymbol,
++/*    123   130 */      NoSymbol,     NoSymbol,
++/*    124   131 */      NoSymbol,     NoSymbol,
++/*    125   132 */      NoSymbol,     NoSymbol,
++/*    126   133 */      NoSymbol,     NoSymbol,
++/*    127   134 */      NoSymbol,     NoSymbol,
++/*    128   135 */      NoSymbol,     NoSymbol,
++/*    129   136 */      NoSymbol,     NoSymbol,
++/*    130   137 */      NoSymbol,     NoSymbol,
++/*    131   138 */      NoSymbol,     NoSymbol,
++/*    132   139 */      NoSymbol,     NoSymbol,
++/*    133   140 */      NoSymbol,     NoSymbol,
++/*    134   141 */      NoSymbol,     NoSymbol,
++/*    135   142 */      NoSymbol,     NoSymbol,
++/*    136   143 */      NoSymbol,     NoSymbol,
++/*    137   144 */      NoSymbol,     NoSymbol,
++/*    138   145 */      NoSymbol,     NoSymbol,
++/*    139   146 */      NoSymbol,     NoSymbol,
++/*    140   147 */      NoSymbol,     NoSymbol,
++/*    141   148 */      NoSymbol,     NoSymbol,
++/*    142   149 */      NoSymbol,     NoSymbol,
++/*    143   150 */      NoSymbol,     NoSymbol,
++/*    144   151 */      NoSymbol,     NoSymbol,
++/*    145   152 */      NoSymbol,     NoSymbol,
++/*    146   153 */      NoSymbol,     NoSymbol,
++/*    147   154 */      NoSymbol,     NoSymbol,
++/*    148   155 */      NoSymbol,     NoSymbol,
++/*    149   156 */      NoSymbol,     NoSymbol,
++/*    150   157 */      NoSymbol,     NoSymbol,
++/*    151   158 */      NoSymbol,     NoSymbol,
++/*    152   159 */      NoSymbol,     NoSymbol,
++/*    153   160 */      NoSymbol,     NoSymbol,
++/*    154   161 */      NoSymbol,     NoSymbol,
++/*    155   162 */      NoSymbol,     NoSymbol,
++/*    156   163 */      NoSymbol,     NoSymbol,
++/*    157   164 */      NoSymbol,     NoSymbol,
++/*    158   165 */      NoSymbol,     NoSymbol,
++/*    159   166 */      NoSymbol,     NoSymbol,
++/*    160   167 */      NoSymbol,     NoSymbol,
++/*    161   168 */      NoSymbol,     NoSymbol,
++/*    162   169 */      NoSymbol,     NoSymbol,
++/*    163   170 */      NoSymbol,     NoSymbol,
++/*    164   171 */      NoSymbol,     NoSymbol,
++/*    165   172 */      NoSymbol,     NoSymbol,
++/*    166   173 */      NoSymbol,     NoSymbol,
++/*    167   174 */      NoSymbol,     NoSymbol,
++/*    168   175 */      NoSymbol,     NoSymbol,
++/*    169   176 */      NoSymbol,     NoSymbol,
++/*    170   177 */      NoSymbol,     NoSymbol,
++/*    171   178 */      NoSymbol,     NoSymbol,
++/*    172   179 */      NoSymbol,     NoSymbol,
++/*    173   180 */      NoSymbol,     NoSymbol,
++/*    174   181 */      NoSymbol,     NoSymbol,
++/*    175   182 */      NoSymbol,     NoSymbol,
++/*    176   183 */      NoSymbol,     NoSymbol,
++/*    177   184 */      NoSymbol,     NoSymbol,
++/*    178   185 */      NoSymbol,     NoSymbol,
++/*    179   186 */      NoSymbol,     NoSymbol,
++/*    180   187 */      NoSymbol,     NoSymbol,
++/*    181   188 */      NoSymbol,     NoSymbol,
++/*    182   189 */      NoSymbol,     NoSymbol,
++/*    183   190 */      NoSymbol,     NoSymbol,
++/*    184   191 */      NoSymbol,     NoSymbol,
++/*    185   192 */      NoSymbol,     NoSymbol,
++/*    186   193 */      NoSymbol,     NoSymbol,
++/*    187   194 */      NoSymbol,     NoSymbol,
++/*    188   195 */      NoSymbol,     NoSymbol,
++/*    189   196 */      NoSymbol,     NoSymbol,
++/*    190   197 */      NoSymbol,     NoSymbol,
++/*    191   198 */      NoSymbol,     NoSymbol,
++/*    192   199 */      NoSymbol,     NoSymbol,
++/*    193   200 */      NoSymbol,     NoSymbol,
++/*    194   201 */      NoSymbol,     NoSymbol,
++};
++
++static void
++EvdevKbdRead (int fd, void *closure)
++{
++    int i, n;
++    struct input_event events[NUM_EVENTS];
++
++    n = read (fd, &events, NUM_EVENTS * sizeof (struct input_event));
++    if (n <= 0)
++      return;
++
++    n /= sizeof (struct input_event);
++
++    for (i = 0; i < n; i++)
++    {
++        if (events[i].type == EV_KEY)
++      	    KdEnqueueKeyboardEvent (events[i].code, !events[i].value);
++    }
++}
++
++static void
++EvdevKbdLoad (void)
++{
++    kdMinScanCode = 0;
++    kdMaxScanCode = 193;
++    kdKeymapWidth = 2;
++    memcpy (kdKeymap, evdevKeymap, sizeof (evdevKeymap));
++}
++
++static int
++EvdevKbdInit (void)
++{
++    int fd, i;
++
++    if (!EvdevInputType)
++        EvdevInputType = KdAllocInputType ();
++
++    if (!kdKeyboard)
++    {
++        for (i = 0; i < NUM_DEFAULT_EVDEV; i++)
++        {
++            fd = open (kdefaultEvdev[i], 2);
++            if (fd >= 0)
++            {
++                kdKeyboard = KdSaveString (kdefaultEvdev[i]);
++                break;
++            }
++	}
++    }
++    else
++    {
++        fd = open (kdKeyboard, O_RDWR);
++        if (fd < 0)
++            return FALSE;
++    }
++
++    if (ioctl (fd, EVIOCGRAB, 1) < 0)
++    {
++        close (fd);
++	return FALSE;
++    }
++
++    if (!KdRegisterFd (EvdevInputType, fd, EvdevKbdRead, NULL))
++        return FALSE;
++
++    kbd_fd = fd;
++    return TRUE;
++}
++
++static void
++EvdevKbdFini (void)
++{
++}
++
++static void
++EvdevKbdLeds (int leds)
++{
++    struct input_event event;
++
++    memset(&event, 0, sizeof(event));
++
++    event.type = EV_LED;
++    event.code = LED_CAPSL;
++    event.value = leds & (1 << 0) ? 1 : 0;
++    write(kbd_fd, (char *) &event, sizeof(event));
++
++    event.type = EV_LED;
++    event.code = LED_NUML;
++    event.value = leds & (1 << 1) ? 1 : 0;
++    write(kbd_fd, (char *) &event, sizeof(event));
++
++    event.type = EV_LED;
++    event.code = LED_SCROLLL;
++    event.value = leds & (1 << 2) ? 1 : 0;
++    write(kbd_fd, (char *) &event, sizeof(event));
++
++    event.type = EV_LED;
++    event.code = LED_COMPOSE;
++    event.value = leds & (1 << 3) ? 1 : 0;
++    write(kbd_fd, (char *) &event, sizeof(event));
++}
++
++static void
++EvdevKbdBell (int volume, int frequency, int duration)
++{
++}
++
+ KdKeyboardFuncs LinuxEvdevKeyboardFuncs = {
+     EvdevKbdLoad,
+     EvdevKbdInit,
+@@ -296,4 +659,4 @@
+     EvdevKbdFini,
+     0,
+ };
+-#endif
++
+diff -u -r --exclude=CVS --exclude=Makefile --exclude='*.o' --exclude=ephyr --exclude='*.Po' xserver.original/hw/kdrive/src/kdrive.c xserver/hw/kdrive/src/kdrive.c
+--- xserver.original/hw/kdrive/src/kdrive.c	2005-12-16 10:36:07.000000000 -0200
++++ xserver/hw/kdrive/src/kdrive.c	2005-12-16 10:37:09.000000000 -0200
+@@ -73,6 +73,7 @@
+ Bool		    kdEnabled;
+ int		    kdSubpixelOrder;
+ int		    kdVirtualTerminal = -1;
++char		    *kdKeyboard = 0;
+ Bool		    kdSwitchPending;
+ char		    *kdSwitchCmd;
+ DDXPointRec	    kdOrigin;
+@@ -795,6 +796,14 @@
+ 	    UseMsg ();
+ 	return 2;
+     }
++    if (!strcmp (argv[i], "-keyboard"))
++    {
++	if ((i+1) < argc)
++	    kdKeyboard = argv[i+1];
++	else
++	    UseMsg ();
++	return 2;
++    }
+     if (!strcmp (argv[i], "-rgba"))
+     {
+ 	if ((i+1) < argc)
+diff -u -r --exclude=CVS --exclude=Makefile --exclude='*.o' --exclude=ephyr --exclude='*.Po' xserver.original/hw/kdrive/src/kdrive.h xserver/hw/kdrive/src/kdrive.h
+--- xserver.original/hw/kdrive/src/kdrive.h	2005-12-16 10:36:07.000000000 -0200
++++ xserver/hw/kdrive/src/kdrive.h	2005-12-16 10:37:09.000000000 -0200
+@@ -416,6 +416,7 @@
+ extern Bool		kdDisableZaphod;
+ extern Bool		kdDontZap;
+ extern int		kdVirtualTerminal;
++extern char		*kdKeyboard;
+ extern char		*kdSwitchCmd;
+ extern KdOsFuncs	*kdOsFuncs;
+ 
+@@ -769,7 +770,7 @@
+ ProcessInputEvents (void);
+ 
+ extern KdMouseFuncs	LinuxMouseFuncs;
+-extern KdMouseFuncs	LinuxEvdevFuncs;
++extern KdMouseFuncs	LinuxEvdevMouseFuncs;
+ extern KdMouseFuncs	Ps2MouseFuncs;
+ extern KdMouseFuncs	BusMouseFuncs;
+ extern KdMouseFuncs	MsMouseFuncs;
+@@ -777,6 +778,7 @@
+ extern KdMouseFuncs	TsFuncs;
+ #endif
+ extern KdKeyboardFuncs	LinuxKeyboardFuncs;
++extern KdKeyboardFuncs	LinuxEvdevKeyboardFuncs;
+ extern KdOsFuncs	LinuxFuncs;
+ 
+ extern KdMouseFuncs	VxWorksMouseFuncs;
+diff -u -r --exclude=CVS --exclude=Makefile --exclude='*.o' --exclude=ephyr --exclude='*.Po' xserver.original/hw/kdrive/src/kinput.c xserver/hw/kdrive/src/kinput.c
+--- xserver.original/hw/kdrive/src/kinput.c	2005-12-16 10:36:07.000000000 -0200
++++ xserver/hw/kdrive/src/kinput.c	2005-12-16 10:37:09.000000000 -0200
+@@ -1300,6 +1300,7 @@
+ 	    xE.u.u.type = KeyPress;
+ 	xE.u.u.detail = key_code;
+ 	
++#ifndef XKB
+ 	switch (KEYCOL1(key_code)) 
+ 	{
+ 	case XK_Num_Lock:
+@@ -1313,6 +1314,7 @@
+ 	    else
+ 		xE.u.u.type = KeyPress;
+ 	}
++#endif
+ 	
+ 	/*
+ 	 * Check pressed keys which are already down
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-use-evdev.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-use-evdev.patch
new file mode 100644
index 000000000..28d732560
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-use-evdev.patch
@@ -0,0 +1,54 @@
+--- xserver/hw/kdrive/fbdev/fbinit.c~	2006-01-31 17:09:33.000000000 +0100
++++ xserver/hw/kdrive/fbdev/fbinit.c	2006-01-31 17:11:55.000000000 +0100
+@@ -28,6 +28,8 @@
+ #endif
+ #include <fbdev.h>
+ 
++extern int use_evdev;
++
+ void
+ InitCard (char *name)
+ {
+@@ -45,7 +47,10 @@
+ void
+ InitInput (int argc, char **argv)
+ {
+-    KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
++    if (use_evdev)
++        KdInitInput (&LinuxEvdevMouseFuncs, &LinuxEvdevKeyboardFuncs);
++    else
++        KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
+ #ifdef TOUCHSCREEN
+     KdAddMouseDriver (&TsFuncs);
+ #endif
+--- xserver/hw/kdrive/src/kdrive.c.orig	2006-01-31 17:13:28.000000000 +0100
++++ xserver/hw/kdrive/src/kdrive.c	2006-01-31 17:15:28.000000000 +0100
+@@ -44,6 +44,8 @@
+ #include "dpmsproc.h"
+ #endif
+ 
++int use_evdev = 0;
++
+ typedef struct _kdDepths {
+     CARD8   depth;
+     CARD8   bpp;
+@@ -687,6 +689,7 @@
+     ErrorF("-videoTest       Start the server, pause momentarily and exit\n");
+     ErrorF("-origin X,Y      Locates the next screen in the the virtual screen (Xinerama)\n");
+     ErrorF("-mouse path[,n]  Filename of mouse device, n is number of buttons\n");
++    ErrorF("-use-evdev       Use Linux evdev input\n");
+     ErrorF("-switchCmd       Command to execute on vt switch\n");
+     ErrorF("-nozap           Don't terminate server on Ctrl+Alt+Backspace\n");
+     ErrorF("vtxx             Use virtual terminal xx instead of the next available\n");
+@@ -796,6 +799,11 @@
+ 	    UseMsg ();
+ 	return 2;
+     }
++    if (!strcmp (argv[i], "-use-evdev"))
++    {
++	use_evdev = 1;
++	return 1;
++    }
+     if (!strcmp (argv[i], "-keyboard"))
+     {
+ 	if ((i+1) < argc)
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kmode-palm.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kmode-palm.patch
new file mode 100644
index 000000000..255e707b5
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kmode-palm.patch
@@ -0,0 +1,34 @@
+--- kmode.c	2006-05-03 19:48:42.000000000 +0200
++++ xserver/hw/kdrive/src/kmode.c	2006-05-03 19:50:43.000000000 +0200
+@@ -32,6 +32,31 @@
+     /*	H	V	Hz	KHz */
+ 		/*  FP	    BP	    BLANK   POLARITY */
+ 
++	/* Treo 650 */
++
++    {   320,	320,	64,	16256,
++	            17,	    12,	    32,     KdSyncNegative,
++	            1,      11,     14,     KdSyncNegative,
++    },
++    
++    {   320,	320,	64,	    0,
++	            0,	    0,	    0,     KdSyncNegative,
++	            0,      0,      0,     KdSyncNegative,
++    },
++	
++	/* LifeDrive/T3/TX modes */
++
++    {   320,	480,	64,	16256,
++	            17,	    12,	    32,     KdSyncNegative,
++	            1,      11,     14,     KdSyncNegative,
++    },
++    
++    {   480,	320,	64,	    0,
++	            0,	    0,	    0,     KdSyncNegative,
++	            0,      0,      0,     KdSyncNegative,
++    },
++
++
+     /* IPAQ modeline:
+      *
+      * Modeline "320x240"      5.7222 320 337 340 352   240 241 244 254"
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kmode.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kmode.patch
new file mode 100644
index 000000000..5ad3e4e27
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kmode.patch
@@ -0,0 +1,28 @@
+--- /tmp/kmode.c	2005-06-27 14:46:19.716843288 +0200
++++ xserver/hw/kdrive/src/kmode.c	2005-06-27 14:46:30.070269328 +0200
+@@ -41,6 +41,11 @@
+ 	            1,      11,     14,     KdSyncNegative,
+     },
+     
++    {   240,	320,	64,	    0,
++	            0,	    0,	    0,     KdSyncNegative,
++	            0,      0,      0,     KdSyncNegative,
++    },
++
+     /* Other VESA modes */
+     {	640,	350,	85,	31500,			    /* VESA */
+ 		    32,	    96,	    192,    KdSyncPositive, /* 26.413 */
+@@ -80,6 +85,13 @@
+ 		   16,	    48,	    160,    KdSyncNegative, /* 31.469 */
+ 		   10,	    33,	    45,	    KdSyncNegative, /* 59.940 */
+     },
++
++
++  {   480,    640,    60,     0,                      /* VESA */
++               0,      0,     0,    KdSyncNegative, /* 31.469 */
++               0,      0,     0,     KdSyncNegative, /* 59.940 */
++   },
++  
+     
+     /* 800x600 modes */
+     {	800,	600,	85,	56250,			    /* VESA */
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/no-serial-probing.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/no-serial-probing.patch
new file mode 100644
index 000000000..35ccadaa8
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/no-serial-probing.patch
@@ -0,0 +1,13 @@
+--- xserver/hw/kdrive/linux/mouse.c.orig	2004-05-13 14:25:51.000000000 -0700
++++ xserver/hw/kdrive/linux/mouse.c	2005-09-22 12:20:47.000000000 -0700
+@@ -927,8 +927,10 @@ char *kdefaultMouse[] =  {
+     "/dev/psaux",
+     "/dev/input/mice",
+     "/dev/adbmouse",
++#ifdef BREAK_MY_SERIAL_CONSOLE
+     "/dev/ttyS0",
+     "/dev/ttyS1",
++#endif
+ };
+ 
+ #define NUM_DEFAULT_MOUSE    (sizeof (kdefaultMouse) / sizeof (kdefaultMouse[0]))
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/build-20050207-against-X11R7.diff b/meta/packages/xorg-xserver/xserver-kdrive/build-20050207-against-X11R7.diff
deleted file mode 100644
index 596e498b8..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/build-20050207-against-X11R7.diff
+++ /dev/null
@@ -1,464 +0,0 @@
---- xserver.orig/configure.ac	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/configure.ac	2006-03-11 16:46:51.000000000 +0100
-@@ -79,7 +79,7 @@
- # tslib touchscreen driver
- AC_CHECK_HEADERS([tslib.h])
- 
--REQUIRED_MODULES="randr render fixesext damageext xextensions xfont xproto xtrans xau"
-+REQUIRED_MODULES="randrproto renderproto fixesproto damageproto xextproto xfont xproto xtrans xau"
- 
- DEFAULT_FONT_PATH="/usr/lib/X11/fonts/misc,/usr/lib/X11/fonts/100dpi,/usr/lib/X11/fonts/75dpi"
- DEFAULT_VENDOR_STRING="freedesktop.org"
---- xserver.orig/dix/dispatch.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/dix/dispatch.c	2006-03-11 16:30:59.000000000 +0100
-@@ -79,7 +79,6 @@
- #endif
- 
- #include "windowstr.h"
--#include "fontstruct.h"
- #include "dixfontstr.h"
- #include "gcstruct.h"
- #include "selection.h"
---- xserver.orig/dix/glyphcurs.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/dix/glyphcurs.c	2006-03-11 16:31:57.000000000 +0100
-@@ -51,7 +51,6 @@
- #include <config.h>
- #endif
- #include "misc.h"
--#include "fontstruct.h"
- #include "dixfontstr.h"
- #include "scrnintstr.h"
- #include "gcstruct.h"
---- xserver.orig/dix/main.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/dix/main.c	2006-03-11 16:32:05.000000000 +0100
-@@ -89,7 +89,6 @@
- #include "colormap.h"
- #include "colormapst.h"
- #include "cursorstr.h"
--#include "font.h"
- #include "opaque.h"
- #include "servermd.h"
- #include "site.h"
---- xserver.orig/dix/swaprep.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/dix/swaprep.c	2006-03-11 16:32:24.000000000 +0100
-@@ -57,7 +57,7 @@
- #include <X11/Xproto.h>
- #include "misc.h"
- #include "dixstruct.h"
--#include "fontstruct.h"
-+#include "dixfont.h"
- #include "scrnintstr.h"
- #include "swaprep.h"
- #include "globals.h"
---- xserver.orig/dix/xpstubs.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/dix/xpstubs.c	2006-03-11 16:32:34.000000000 +0100
-@@ -31,7 +31,7 @@
- #include <config.h>
- #endif
- #include "misc.h"
--#include "font.h"
-+#include "dixfont.h"
- 
- Bool
- XpClientIsBitmapClient(ClientPtr client)
---- xserver.orig/fb/fbglyph.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/fb/fbglyph.c	2006-03-11 16:52:01.000000000 +0100
-@@ -26,7 +26,6 @@
- #include <config.h>
- #endif
- #include "fb.h"
--#include	"fontstruct.h"
- #include	"dixfontstr.h"
-       
- Bool
---- xserver.orig/hw/kdrive/epson/epson13806draw.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/hw/kdrive/epson/epson13806draw.c	2006-03-11 16:34:56.000000000 +0100
-@@ -38,7 +38,6 @@
- #include    "pixmapstr.h"
- #include    "regionstr.h"
- #include    "mistruct.h"
--#include    "fontstruct.h"
- #include    "dixfontstr.h"
- #include    "fb.h"
- #include    "migc.h"
---- xserver.orig/hw/kdrive/i810/i810draw.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/hw/kdrive/i810/i810draw.c	2006-03-11 16:34:41.000000000 +0100
-@@ -51,7 +51,6 @@
- #include	"pixmapstr.h"
- #include	"regionstr.h"
- #include	"mistruct.h"
--#include	"fontstruct.h"
- #include	"dixfontstr.h"
- #include	"fb.h"
- #include	"migc.h"
---- xserver.orig/hw/kdrive/src/kaa.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/hw/kdrive/src/kaa.c	2006-03-11 16:35:39.000000000 +0100
-@@ -29,7 +29,6 @@
- #endif
- #include "kdrive.h"
- #include "kaa.h"
--#include "fontstruct.h"
- #include "dixfontstr.h"
- 
- #define DEBUG_MIGRATE 0
---- xserver.orig/include/dixfont.h	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/include/dixfont.h	2006-03-11 16:43:25.000000000 +0100
-@@ -27,10 +27,10 @@
- #define DIXFONT_H 1
- 
- #include "dix.h"
--#include "font.h"
--#include "fontconf.h"
-+#include <X11/fonts/font.h>
-+#include <X11/fonts/fontconf.h>
- #include "closure.h"
--#include "fontstruct.h"
-+#include <X11/fonts/fontstruct.h>
- 
- #define NullDIXFontProp ((DIXFontPropPtr)0)
- 
---- xserver.orig/include/dixfontstr.h	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/include/dixfontstr.h	2006-03-11 16:43:31.000000000 +0100
-@@ -27,7 +27,6 @@
- 
- #include "servermd.h"
- #include "dixfont.h"
--#include "fontstruct.h"
- #include "closure.h"
- #define NEED_REPLIES
- #include "X11/Xproto.h" /* for xQueryFontReply */
---- xserver.orig/mi/mibstore.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/mi/mibstore.c	2006-03-11 16:36:26.000000000 +0100
-@@ -57,7 +57,6 @@
- #include "gcstruct.h"
- #include "windowstr.h"
- #include "pixmapstr.h"
--#include "fontstruct.h"
- #include "dixfontstr.h"
- #include "dixstruct.h"		/* For requestingClient */
- #include "mi.h"
---- xserver.orig/mi/miglblt.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/mi/miglblt.c	2006-03-11 16:53:52.000000000 +0100
-@@ -55,7 +55,6 @@
- #include	<X11/Xmd.h>
- #include	<X11/Xproto.h>
- #include	"misc.h"
--#include	"fontstruct.h"
- #include	"dixfontstr.h"
- #include	"gcstruct.h"
- #include	"windowstr.h"
---- xserver.orig/mi/mi.h	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/mi/mi.h	2006-03-11 16:36:16.000000000 +0100
-@@ -54,7 +54,7 @@
- #include "validate.h"
- #include "window.h"
- #include "gc.h"
--#include "font.h"
-+#include "dixfont.h"
- #include "input.h"
- #include "cursor.h"
- 
---- xserver.orig/mi/miinitext.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/mi/miinitext.c	2006-03-11 16:36:41.000000000 +0100
-@@ -54,6 +54,8 @@
- #include "extension.h"
- #include "micmap.h"
- #include "xext.h"
-+#include "pixmap.h"
-+#include "gc.h"
- 
- #ifdef NOPEXEXT /* sleaze for Solaris cpp building XsunMono */
- #undef PEXEXT
---- xserver.orig/mi/mipolytext.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/mi/mipolytext.c	2006-03-11 16:36:48.000000000 +0100
-@@ -63,7 +63,6 @@
- #include	<X11/Xproto.h>
- #include	"misc.h"
- #include	"gcstruct.h"
--#include	"fontstruct.h"
- #include	"dixfontstr.h"
- #include	"mi.h"
- 
---- xserver.orig/mi/misprite.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/mi/misprite.c	2006-03-11 16:37:00.000000000 +0100
-@@ -42,7 +42,6 @@
- # include   "input.h"
- # include   "mi.h"
- # include   "cursorstr.h"
--# include   "font.h"
- # include   "scrnintstr.h"
- # include   "colormapst.h"
- # include   "windowstr.h"
-@@ -50,7 +49,6 @@
- # include   "mipointer.h"
- # include   "mispritest.h"
- # include   "dixfontstr.h"
--# include   "fontstruct.h"
- #ifdef RENDER
- # include   "mipict.h"
- #endif
---- xserver.orig/miext/damage/damage.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/damage/damage.c	2006-03-11 16:37:17.000000000 +0100
-@@ -28,9 +28,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/miext/shadow/shadow.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/shadow/shadow.c	2006-03-11 16:38:13.000000000 +0100
-@@ -29,9 +29,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/miext/shadow/shalloc.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/shadow/shalloc.c	2006-03-11 16:38:25.000000000 +0100
-@@ -29,9 +29,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/miext/shadow/shpacked.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/shadow/shpacked.c	2006-03-11 16:38:33.000000000 +0100
-@@ -28,9 +28,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/miext/shadow/shplanar8.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/shadow/shplanar8.c	2006-03-11 16:38:44.000000000 +0100
-@@ -28,9 +28,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/miext/shadow/shplanar.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/shadow/shplanar.c	2006-03-11 16:38:39.000000000 +0100
-@@ -28,9 +28,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/miext/shadow/shrotate.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/shadow/shrotate.c	2006-03-11 16:38:56.000000000 +0100
-@@ -28,9 +28,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/miext/shadow/shrotpack.h	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/shadow/shrotpack.h	2006-03-11 16:39:02.000000000 +0100
-@@ -30,9 +30,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/miext/shadow/shrotpackYX.h	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/miext/shadow/shrotpackYX.h	2006-03-11 16:39:08.000000000 +0100
-@@ -25,9 +25,7 @@
- #include    <X11/X.h>
- #include    "scrnintstr.h"
- #include    "windowstr.h"
--#include    "font.h"
- #include    "dixfontstr.h"
--#include    "fontstruct.h"
- #include    "mi.h"
- #include    "regionstr.h"
- #include    "globals.h"
---- xserver.orig/os/xstrans.c	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/os/xstrans.c	2006-03-11 16:39:31.000000000 +0100
-@@ -27,4 +27,4 @@
- 
- #include "config.h"
- 
--#include <transport.c>
-+#include <X11/Xtrans/transport.c>
---- xserver.orig/os/xstrans.h	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/os/xstrans.h	2006-03-11 16:39:37.000000000 +0100
-@@ -25,4 +25,4 @@
- #define XSERV_t
- #define TRANS_SERVER
- 
--#include <Xtrans.h>
-+#include <X11/Xtrans/Xtrans.h>
---- xserver.orig/Xext/shmint.h	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/Xext/shmint.h	2006-03-11 16:29:24.000000000 +0100
-@@ -32,27 +32,6 @@
- #include "pixmap.h"
- #include "gc.h"
- 
--typedef struct _ShmFuncs {
--    PixmapPtr	(* CreatePixmap)(ScreenPtr	pScreen,
--				 int		width,
--				 int		height,
--				 int		depth,
--				 char		*addr);
--    void	(* PutImage)(DrawablePtr	dst,
--			     GCPtr		pGC,
--			     int		depth,
--			     unsigned int	format,
--			     int		w,
--			     int		h,
--			     int	    	sx,
--			     int	    	sy,
--			     int	    	sw,
--			     int	    	sh,
--			     int	    	dx,
--			     int	    	dy,
--			     char		*data);
--} ShmFuncs, *ShmFuncsPtr;
--
- void
- ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
- 
---- xserver.orig/Xext/syncint.h	2006-03-11 16:27:42.000000000 +0100
-+++ xserver/Xext/syncint.h	2006-03-11 16:30:16.000000000 +0100
-@@ -48,7 +48,7 @@
- PERFORMANCE OF THIS SOFTWARE.
- 
- ******************************************************************/
--/* $Id: syncint.h,v 3.1 2003-11-02 19:56:10 keithp Exp $ */
-+/* $Id: syncint.h,v 3.2 2005-04-20 18:42:31 clee Exp $ */
- 
- #ifndef _SYNCINT_H_
- #define _SYNCINT_H_
-@@ -57,26 +57,10 @@
- 
- #define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */
- 
--typedef struct _SyncCounter {
--    ClientPtr		client;	/* Owning client. 0 for system counters */
--    XSyncCounter	id;		/* resource ID */
--    CARD64		value;		/* counter value */
--    struct _SyncTriggerList *pTriglist;	/* list of triggers */
--    Bool		beingDestroyed; /* in process of going away */
--    struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
--} SyncCounter;
--
- /*
-  * The System Counter interface
-  */
- 
--typedef enum {
--    XSyncCounterNeverChanges,
--    XSyncCounterNeverIncreases,
--    XSyncCounterNeverDecreases,
--    XSyncCounterUnrestricted
--} SyncCounterType;
--
- typedef void
- (*SyncQueryValueProcPtr) (pointer pCounter,
- 			  CARD64 *freshvalue);
-@@ -86,16 +70,6 @@
- 			     CARD64 *lessthan,
- 			     CARD64 *greaterthan);
- 
--typedef struct _SysCounterInfo {
--    char			*name;
--    CARD64			resolution;
--    CARD64			bracket_greater;
--    CARD64			bracket_less;
--    SyncCounterType		counterType;  /* how can this counter change */
--    SyncQueryValueProcPtr	QueryValue;
--    SyncBracketValuesProcPtr	BracketValues;
--} SysCounterInfo;
--
- struct _SyncTrigger;
- 
- typedef Bool
-@@ -108,55 +82,6 @@
- typedef void
- (*SyncCounterDestroyedProcPtr) (struct _SyncTrigger *pTrigger);
- 
--typedef struct _SyncTrigger {
--    SyncCounter			*pCounter;
--    CARD64			wait_value;	/* wait value */
--    unsigned int		value_type;     /* Absolute or Relative */
--    unsigned int		test_type;	/* transition or Comparision type */
--    CARD64			test_value;	/* trigger event threshold value */
--    SyncCheckTriggerProcPtr	CheckTrigger;
--    SyncTriggerFiredProcPtr	TriggerFired;
--    SyncCounterDestroyedProcPtr	CounterDestroyed;
--} SyncTrigger;
--
--typedef struct _SyncTriggerList {
--    SyncTrigger			*pTrigger;
--    struct _SyncTriggerList	*next;
--} SyncTriggerList;
--
--typedef struct _SyncAlarmClientList {
--    ClientPtr			client;
--    XID				delete_id;
--    struct _SyncAlarmClientList *next;
--} SyncAlarmClientList;
--
--typedef struct _SyncAlarm {
--    SyncTrigger			trigger;
--    ClientPtr			client;
--    XSyncAlarm			alarm_id;
--    CARD64			delta;
--    int				events;
--    int				state;
--    SyncAlarmClientList		*pEventClients;
--} SyncAlarm;
--
--typedef struct {
--    ClientPtr	client;
--    CARD32 	delete_id;
--    int		num_waitconditions;
--} SyncAwaitHeader;
--
--typedef struct {
--    SyncTrigger trigger;
--    CARD64	event_threshold;
--    SyncAwaitHeader *pHeader;
--} SyncAwait;
--
--typedef union {
--    SyncAwaitHeader header;
--    SyncAwait	    await;
--} SyncAwaitUnion;
--
- pointer
- SyncCreateSystemCounter(char			    *name,
- 			CARD64			    inital_value,
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/build-fix-panoramix.patch b/meta/packages/xorg-xserver/xserver-kdrive/build-fix-panoramix.patch
deleted file mode 100644
index f919b48f0..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/build-fix-panoramix.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Index: git/composite/compext.c
-===================================================================
---- git.orig/composite/compext.c	2007-03-28 16:25:12.000000000 +0200
-+++ git/composite/compext.c	2007-03-28 16:25:15.000000000 +0200
-@@ -696,11 +696,13 @@
- 	if (GetPictureScreenIfSet(pScreen) == NULL)
- 	    return;
-     }
-+#ifdef PANORAMIX
-     /* Xinerama's rewriting of window drawing before Composite gets to it
-      * breaks Composite.
-      */
-     if (!noPanoramiXExtension)
- 	return;
-+#endif
- 
-     CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
-     if (!CompositeClientWindowType)
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/devfs.patch b/meta/packages/xorg-xserver/xserver-kdrive/devfs.patch
deleted file mode 100644
index a6238126c..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/devfs.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- xserver/hw/kdrive/linux/linux.c~devfs
-+++ xserver/hw/kdrive/linux/linux.c
-@@ -82,10 +82,10 @@
- 	vtno = kdVirtualTerminal;
-     else
-     {
--	if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0) 
-+	if ((fd = open("/dev/vc/0",O_WRONLY,0)) < 0) 
- 	{
- 	    FatalError(
--		       "LinuxInit: Cannot open /dev/tty0 (%s)\n",
-+		       "LinuxInit: Cannot open /dev/tty/0 (%s)\n",
- 		       strerror(errno));
- 	}
- 	if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) ||
-@@ -96,7 +96,7 @@
-     }
-     close(fd);
- 
--    sprintf(vtname,"/dev/tty%d",vtno); /* /dev/tty1-64 */
-+    sprintf(vtname,"/dev/vc/%d",vtno); /* /dev/tty1-64 */
- 
-     if ((LinuxConsoleFd = open(vtname, O_RDWR|O_NDELAY, 0)) < 0)
-     {
-@@ -113,7 +113,7 @@
-      *
-      * Why is this needed?
-      */
--    LinuxCheckChown ("/dev/tty0");
-+    LinuxCheckChown ("/dev/vc/0");
-     /*
-      * Linux doesn't switch to an active vt after the last close of a vt,
-      * so we do this ourselves by remembering which is active now.
-@@ -453,7 +453,7 @@
- 	activeVT = -1;
-     }
-     close(LinuxConsoleFd);                /* make the vt-manager happy */
--    fd = open ("/dev/tty0", O_RDWR|O_NDELAY, 0);
-+    fd = open ("/dev/vc/0", O_RDWR|O_NDELAY, 0);
-     if (fd >= 0)
-     {
- 	memset (&vts, '\0', sizeof (vts));	/* valgrind */
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/disable-apm.patch b/meta/packages/xorg-xserver/xserver-kdrive/disable-apm.patch
deleted file mode 100644
index bd8842721..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/disable-apm.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- xserver/hw/kdrive/linux/linux.c.orig	2005-04-23 15:56:13.988849232 +0000
-+++ xserver/hw/kdrive/linux/linux.c	2005-04-23 15:57:05.001094192 +0000
-@@ -342,7 +342,7 @@
-     /*
-      * Open the APM driver
-      */
--    LinuxApmFd = open ("/dev/apm_bios", 2);
-+    /*LinuxApmFd = open ("/dev/apm_bios", 2);
-     if (LinuxApmFd < 0 && errno == ENOENT)
- 	LinuxApmFd = open ("/dev/misc/apm_bios", 2); 
-     if (LinuxApmFd >= 0)
-@@ -352,7 +352,7 @@
- 	RegisterBlockAndWakeupHandlers (LinuxApmBlock, LinuxApmWakeup, 0);
- 	AddEnabledDevice (LinuxApmFd);
-     }
--	
-+    */	
-     /*
-      * now get the VT
-      */
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/disable-xf86-dga-xorgcfg.patch b/meta/packages/xorg-xserver/xserver-kdrive/disable-xf86-dga-xorgcfg.patch
deleted file mode 100644
index 9c43e52ea..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/disable-xf86-dga-xorgcfg.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- git/configure.ac.orig	2006-05-22 22:40:00.000000000 +0200
-+++ git/configure.ac	2006-06-10 15:10:14.000000000 +0200
-@@ -505,7 +505,11 @@
- XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
- 
- dnl Core modules for most extensions, et al.
-+if test "$KDRIVE" = yes; then
-+REQUIRED_MODULES="randrproto renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto"
-+else
- REQUIRED_MODULES="randrproto renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans xf86miscproto xf86vidmodeproto xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto xf86dgaproto"
-+fi
- REQUIRED_LIBS="xfont xau fontenc"
- 
- AM_CONDITIONAL(XV, [test "x$XV" = xyes])
-@@ -1514,7 +1526,9 @@
- AC_SUBST(XKB_COMPILED_DIR)
- 
- dnl and the rest of these are generic, so they're in config.h
-+if test ! x"$KDRIVE" = xyes; then
- AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
-+fi
- AC_DEFINE(XResExtension, 1, [Build XRes extension])
- 
- dnl CYGWIN does not define fd_set if _POSIX_SOURCE is defined
-@@ -1534,10 +1548,12 @@
- 
- AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
- 
-+if test ! "x$KDRIVE" = xyes ; then
- dnl xorgconfig CLI configuration utility
- PKG_CHECK_MODULES([XORGCONFIG_DEP], [xkbfile x11])
- AC_SUBST(XORGCONFIG_DEP_CFLAGS)
- AC_SUBST(XORGCONFIG_DEP_LIBS)
-+fi
- 
- dnl xorgcfg GUI configuration utility
- AC_ARG_ENABLE(xorgcfg, AS_HELP_STRING([--enable-xorgcfg], 
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/enable-builtin-fonts.patch b/meta/packages/xorg-xserver/xserver-kdrive/enable-builtin-fonts.patch
deleted file mode 100644
index 13a6c2c95..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/enable-builtin-fonts.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- xorg-server-X11R7.1-1.1.0/dix/dixfonts.c.orig	2006-06-08 14:49:12.158684250 +0200
-+++ xorg-server-X11R7.1-1.1.0/dix/dixfonts.c	2006-06-08 14:49:52.493205000 +0200
-@@ -52,8 +52,8 @@
- /* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */
- 
- #define NEED_REPLIES
- #ifdef HAVE_DIX_CONFIG_H
--#include <dix-config.h>
-+#include <kdrive-config.h>
- #endif
- 
- #include <X11/X.h>
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/enable-epson.patch b/meta/packages/xorg-xserver/xserver-kdrive/enable-epson.patch
deleted file mode 100644
index 63b13a451..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/enable-epson.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- /tmp/Makefile.am	2006-08-30 09:51:21.000000000 +0200
-+++ git/hw/kdrive/Makefile.am	2006-08-30 09:51:44.425780000 +0200
-@@ -4,7 +4,7 @@
- endif
- 
- if KDRIVEFBDEV
--FBDEV_SUBDIRS = fbdev
-+FBDEV_SUBDIRS = fbdev epson
- endif
- 
- if XSDLSERVER
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/enable-tslib.patch b/meta/packages/xorg-xserver/xserver-kdrive/enable-tslib.patch
deleted file mode 100644
index e488657b7..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/enable-tslib.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- git/configure.ac.orig	2006-05-22 22:40:00.000000000 +0200
-+++ git/configure.ac	2006-06-10 15:10:14.000000000 +0200
-@@ -1438,6 +1446,10 @@
-     fi
-     
--    # tslib...
-+    AC_CHECK_HEADERS([tslib.h])
-+    if test "$ac_cv_header_tslib_h" = yes; then
-+        AC_DEFINE(TSLIB, 1, [Build kdrive with tslib support])
-+        AC_DEFINE(TOUCHSCREEN, 1, [Build kdrive with touchscreen support])
-+    fi
- 
-     # damage shadow extension glx (NOTYET) fb mi
-     KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src'
-@@ -1467,7 +1479,7 @@
- AC_SUBST(KDRIVE_CFLAGS)
- AC_SUBST(KDRIVE_PURE_LIBS)
- AC_SUBST(KDRIVE_LIBS)
--AM_CONDITIONAL(TSLIB, false)
-+AM_CONDITIONAL(TSLIB, [test x"$ac_cv_header_tslib_h" = xyes])
- AM_CONDITIONAL(H3600_TS, false)
- AM_CONDITIONAL(KDRIVEVESA, [test x"$ac_cv_header_sys_vm86_h" = xyes])
- AM_CONDITIONAL(KDRIVEFBDEV, [test x"$ac_cv_header_linux_fb_h" = xyes])
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/epson.patch b/meta/packages/xorg-xserver/xserver-kdrive/epson.patch
deleted file mode 100644
index 07009bdc4..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/epson.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- xserver.orig/hw/kdrive/epson/epson13806stub.c	2004-10-20 10:20:51.000000000 +0200
-+++ xserver/hw/kdrive/epson/epson13806stub.c	2005-03-17 14:38:22.000000000 +0100
-@@ -55,7 +55,7 @@
- {
-     KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
- #ifdef TOUCHSCREEN
--    KdInitTouchScreen (&TsFuncs);
-+    KdAddMouseDriver (&TsFuncs);
- #endif
- }
- 
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/faster-rotated.patch b/meta/packages/xorg-xserver/xserver-kdrive/faster-rotated.patch
deleted file mode 100644
index eaf7ddec3..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/faster-rotated.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-Index: xserver/miext/shadow/shrotate.c
-===================================================================
-RCS file: /scratch/openbsd/cvs/XF4/xc/programs/Xserver/miext/shadow/shrotate.c,v
-retrieving revision 1.2
-diff -u -r1.2 shrotate.c
---- xserver/miext/shadow/shrotate.c	3 Nov 2004 00:09:54 -0000	1.2
-+++ xserver/miext/shadow/shrotate.c	20 Sep 2005 23:07:58 -0000
-@@ -45,6 +45,106 @@
- #define TOP_TO_BOTTOM	2
- #define BOTTOM_TO_TOP	-2
- 
-+
-+static void 
-+shadowUpdateRotatePackedSubRectangle(shadowBufPtr pBuf,
-+				     FbBits *shaLine, int shaFirstShift, 
-+				     int shaStepOverX, int shaStepOverY,
-+				     int shaStepDownX, int shaStepDownY,
-+				     int shaBpp, FbBits shaMask,
-+				     ScreenPtr pScreen,
-+				     int scr_x1, int scr_y, 
-+				     int scr_h, int scr_w,
-+				     int pixelsPerBits)
-+{
-+    FbBits *sha;
-+    int shaShift;
-+    int scr_x;
-+    int w;
-+
-+    /*
-+     * Copy the bits, always write across the physical frame buffer
-+     * to take advantage of write combining.
-+     */
-+    while (scr_h--)
-+    {
-+	int	    p;
-+	FbBits  bits;
-+	FbBits  *win;
-+	int	    i;
-+	CARD32  winSize;
-+	
-+	sha = shaLine;
-+	shaShift = shaFirstShift;
-+	w = scr_w;
-+	scr_x = scr_x1 * shaBpp >> FB_SHIFT;
-+	
-+	while (w)
-+	{
-+	  /*
-+	   * Map some of this line
-+	   */
-+	  win = (FbBits *) (*pBuf->window) (pScreen,
-+					    scr_y,
-+					    scr_x << 2,
-+					    SHADOW_WINDOW_WRITE,
-+					    &winSize,
-+					    pBuf->closure);
-+	    i = (winSize >> 2);
-+	    if (i > w)
-+		i = w;
-+	    w -= i;
-+	    scr_x += i;
-+	    /*
-+	     * Copy the portion of the line mapped
-+	     */
-+	    while (i--)
-+	    {
-+		bits = 0;
-+		p = pixelsPerBits;
-+		/*
-+		 * Build one word of output from multiple inputs
-+		 */
-+		while (p--)
-+		{
-+		    bits = FbScrLeft(bits, shaBpp);
-+		    bits |= FbScrRight (*sha, shaShift) & shaMask;
-+		    
-+		    shaShift -= shaStepOverX;
-+		    if (shaShift >= FB_UNIT)
-+		    {
-+			shaShift -= FB_UNIT;
-+			    sha--;
-+		    }
-+		    else if (shaShift < 0)
-+		    {
-+			shaShift += FB_UNIT;
-+			sha++;
-+		    }
-+		    sha += shaStepOverY;
-+		}
-+		*win++ = bits;
-+	    }
-+	}
-+	scr_y++;
-+	shaFirstShift -= shaStepDownX;
-+	if (shaFirstShift >= FB_UNIT)
-+	{
-+	    shaFirstShift -= FB_UNIT;
-+	    shaLine--;
-+	}
-+	else if (shaFirstShift < 0)
-+	{
-+	    shaFirstShift += FB_UNIT;
-+	    shaLine++;
-+	}
-+	shaLine += shaStepDownY;
-+    }
-+}
-+
-+#define BLOCKSIZE_HEIGHT 32
-+#define BLOCKSIZE_WIDTH 32
-+
- void
- shadowUpdateRotatePacked (ScreenPtr	pScreen,
- 			  shadowBufPtr	pBuf)
-@@ -61,7 +161,6 @@
-     int		sha_x1 = 0, sha_y1 = 0;
-     int		scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h;
-     int		scr_x, scr_y;
--    int		w;
-     int		pixelsPerBits;
-     int		pixelsMask;
-     FbStride	shaStepOverY = 0, shaStepDownY = 0;
-@@ -221,86 +320,46 @@
- 		   ((sha_x1 * shaBpp) >> FB_SHIFT));
- 
- 	/*
--	 * Copy the bits, always write across the physical frame buffer
--	 * to take advantage of write combining.
-+	 * Copy in blocks of size BLOCKSIZE_WIDTH x BLOCKSIZE_HEIGHT
-+	 * to reduce the number of cache misses when rotating 90 or
-+	 * 270 degrees.
- 	 */
--	while (scr_h--)
-+	for (scr_y = scr_y1; scr_y < scr_y2; scr_y += BLOCKSIZE_HEIGHT)
- 	{
--	    int	    p;
--	    FbBits  bits;
--	    FbBits  *win;
--	    int	    i;
--	    CARD32  winSize;
--	    
- 	    sha = shaLine;
- 	    shaShift = shaFirstShift;
--	    w = scr_w;
--	    scr_x = scr_x1 * shaBpp >> FB_SHIFT;
- 
--	    while (w)
-+	    for (scr_x = scr_x1; scr_x < scr_x2; scr_x += BLOCKSIZE_WIDTH)
- 	    {
--		/*
--		 * Map some of this line
--		 */
--		win = (FbBits *) (*pBuf->window) (pScreen,
--						  scr_y,
--						  scr_x << 2,
--						  SHADOW_WINDOW_WRITE,
--						  &winSize,
--						  pBuf->closure);
--		i = (winSize >> 2);
--		if (i > w)
--		    i = w;
--		w -= i;
--		scr_x += i;
--		/*
--		 * Copy the portion of the line mapped
--		 */
--		while (i--)
--		{
--		    bits = 0;
--		    p = pixelsPerBits;
--		    /*
--		     * Build one word of output from multiple inputs
--		     * 
--		     * Note that for 90/270 rotations, this will walk
--		     * down the shadow hitting each scanline once.
--		     * This is probably not very efficient.
--		     */
--		    while (p--)
--		    {
--			bits = FbScrLeft(bits, shaBpp);
--			bits |= FbScrRight (*sha, shaShift) & shaMask;
-+		int h = BLOCKSIZE_HEIGHT;
-+		int w = BLOCKSIZE_WIDTH;
- 
--			shaShift -= shaStepOverX;
--			if (shaShift >= FB_UNIT)
--			{
--			    shaShift -= FB_UNIT;
--			    sha--;
--			}
--			else if (shaShift < 0)
--			{
--			    shaShift += FB_UNIT;
--			    sha++;
--			}
--			sha += shaStepOverY;
--		    }
--		    *win++ = bits;
--		}
--	    }
--	    scr_y++;
--	    shaFirstShift -= shaStepDownX;
--	    if (shaFirstShift >= FB_UNIT)
--	    {
--		shaFirstShift -= FB_UNIT;
--		shaLine--;
--	    }
--	    else if (shaFirstShift < 0)
--	    {
--		shaFirstShift += FB_UNIT;
--		shaLine++;
-+		if (scr_y + h > scr_y2)
-+		    h = scr_y2 - scr_y;
-+		if (scr_x + w > scr_x2)
-+		    w = scr_x2 - scr_x;
-+		w = (w * shaBpp) >> FB_SHIFT;
-+
-+		shadowUpdateRotatePackedSubRectangle
-+		  (pBuf,
-+		   sha, shaShift,
-+		   shaStepOverX, shaStepOverY,
-+		   shaStepDownX, shaStepDownY,
-+		   shaBpp, shaMask,
-+		   pScreen,
-+		   scr_x, scr_y,
-+		   h, w,
-+		   pixelsPerBits);
-+		
-+		shaShift -= BLOCKSIZE_WIDTH * shaStepOverX;
-+		sha += BLOCKSIZE_WIDTH * shaStepOverY;
-+		sha -= (shaShift >> FB_SHIFT); 
-+		shaShift &= FB_MASK; 
- 	    }
--	    shaLine += shaStepDownY;
-+	    shaFirstShift -= BLOCKSIZE_HEIGHT * shaStepDownX;
-+	    shaLine += BLOCKSIZE_HEIGHT * shaStepDownY;
-+	    shaLine -= (shaFirstShift >> FB_SHIFT); 
-+	    shaFirstShift &= FB_MASK; 
- 	}
-     }
- }
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/fbdev-not-fix.patch b/meta/packages/xorg-xserver/xserver-kdrive/fbdev-not-fix.patch
deleted file mode 100644
index f87e7cc2c..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/fbdev-not-fix.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- xserver/hw/kdrive/fbdev/fbdev.c~	2004-09-15 00:08:10.000000000 +0100
-+++ xserver/hw/kdrive/fbdev/fbdev.c	2004-11-13 17:47:02.000000000 +0000
-@@ -198,6 +198,11 @@
- 	return FALSE;
-     }
- 
-+    /* Re-get the "fixed" parameters since they might have changed */
-+    k = ioctl (priv->fd, FBIOGET_FSCREENINFO, &priv->fix);
-+    if (k < 0)
-+        perror ("FBIOGET_FSCREENINFO");
-+
-     /* Now get the new screeninfo */
-     ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var);
-     depth = priv->var.bits_per_pixel;
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/hide-cursor-and-ppm-root.patch b/meta/packages/xorg-xserver/xserver-kdrive/hide-cursor-and-ppm-root.patch
deleted file mode 100644
index c160cd41d..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/hide-cursor-and-ppm-root.patch
+++ /dev/null
@@ -1,307 +0,0 @@
-diff -u -r xorg-server-X11R7.1-1.1.0.orig/dix/window.c xorg-server-X11R7.1-1.1.0/dix/window.c
---- xorg-server-X11R7.1-1.1.0.orig/dix/window.c	2007-01-08 14:30:38.000000000 +0000
-+++ xorg-server-X11R7.1-1.1.0/dix/window.c	2007-01-16 17:16:19.000000000 +0000
-@@ -185,6 +185,8 @@
- _X_EXPORT int numSaveUndersViewable = 0;
- _X_EXPORT int deltaSaveUndersViewable = 0;
- 
-+char* RootPPM = NULL;
-+
- #ifdef DEBUG
- /******
-  * PrintWindowTree
-@@ -311,6 +313,115 @@
- #endif
- }
- 
-+static int
-+get_int(FILE *fp)
-+{
-+  int c = 0;
-+
-+  while ((c = getc(fp)) != EOF)
-+    {
-+      if (isspace(c))
-+	continue;
-+
-+      if (c == '#')
-+	while (c = getc(fp))
-+	  if (c == EOF)
-+	    return 0;
-+	  else if (c == '\n')
-+	    break;
-+
-+      if (isdigit(c)) 
-+	{
-+	  int val = c - '0';
-+	  while ((c = getc(fp)) && isdigit(c))
-+	    val = (val * 10) + (c - '0');
-+	  return val;
-+	}
-+    }
-+
-+  return 0;
-+}
-+
-+static unsigned char*
-+ppm_load (const char* path, int depth, int *width, int *height)
-+{
-+  FILE *fp;
-+  int   max, n = 0, w, h, i, j, bytes_per_line;
-+  unsigned char *data, *res, h1, h2;
-+
-+  if (depth < 16 || depth > 32)
-+    return NULL;
-+
-+  if (depth > 16)
-+    depth = 32;
-+
-+  fp = fopen (path, "r");
-+  if (fp == NULL)
-+    return FALSE;
-+
-+  h1 = getc(fp);
-+  h2 = getc(fp);
-+
-+  /* magic is 'P6' for raw ppm */
-+  if (h1 != 'P' && h2 != '6')
-+      goto fail;
-+
-+  w = get_int(fp);
-+  h = get_int(fp);
-+
-+  if (w == 0 || h == 0)
-+    goto fail;
-+
-+  max = get_int(fp);
-+
-+  if (max != 255)
-+      goto fail;
-+
-+  bytes_per_line = ((w * depth + 31) >> 5) << 2;
-+
-+  res = data = malloc(bytes_per_line * h);
-+
-+  for (i=0; i<h; i++)
-+    {
-+      for (j=0; j<w; j++)
-+	{
-+	  unsigned char buf[3];
-+	  fread(buf, 1, 3, fp);
-+	  
-+	  switch (depth)
-+	    {
-+	    case 24:
-+	    case 32:
-+	      *data     = buf[2];
-+	      *(data+1) = buf[1];
-+	      *(data+2) = buf[0];
-+	      data += 4;
-+	      break;
-+	    case 16:
-+	    default:
-+	      *(unsigned short*)data
-+		= ((buf[0] >> 3) << 11) | ((buf[1] >> 2) << 5) | (buf[2] >> 3);
-+	      data += 2;
-+	      break;
-+	    }
-+	}
-+      data += (bytes_per_line - (w*(depth>>3)));
-+    }
-+
-+  data = res;
-+
-+  *width  = w;
-+  *height = h;
-+
-+  fclose(fp);
-+
-+  return res;
-+
-+ fail:
-+  fclose(fp);
-+  return NULL;
-+}
-+
- static void
- MakeRootTile(WindowPtr pWin)
- {
-@@ -321,6 +432,36 @@
-     register unsigned char *from, *to;
-     register int i, j;
- 
-+    if (RootPPM != NULL)
-+      {
-+	int            w, h;
-+	unsigned char *data;
-+
-+	if ((data = ppm_load (RootPPM, pScreen->rootDepth, &w, &h)) != NULL)
-+	  {
-+	    pWin->background.pixmap 
-+	      = (*pScreen->CreatePixmap)(pScreen, w, h, pScreen->rootDepth);
-+
-+	    pWin->backgroundState = BackgroundPixmap;
-+	    pGC = GetScratchGC(pScreen->rootDepth, pScreen);
-+	    if (!pWin->background.pixmap || !pGC)
-+	      FatalError("could not create root tile");
-+
-+	    ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
-+
-+	    (*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, 
-+				  pGC, 
-+				  pScreen->rootDepth,
-+				  0, 0, w, h, 0, ZPixmap, (char *)data);
-+	    FreeScratchGC(pGC);
-+	    
-+	    free(data);
-+	    return;
-+	  }
-+	else
-+	  ErrorF("Unable to load root window image.");
-+      }
-+
-     pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
- 						    pScreen->rootDepth);
- 
-@@ -357,6 +498,7 @@
- 
- }
- 
-+
- WindowPtr
- AllocateWindow(ScreenPtr pScreen)
- {
-diff -u -r xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kdrive.c xorg-server-X11R7.1-1.1.0/hw/kdrive/src/kdrive.c
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kdrive.c	2007-01-08 14:30:38.000000000 +0000
-+++ xorg-server-X11R7.1-1.1.0/hw/kdrive/src/kdrive.c	2007-01-15 17:53:06.000000000 +0000
-@@ -58,6 +58,9 @@
-     { 32, 32 }
- };
- 
-+int 
-+ProcXFixesHideCursor (ClientPtr client) ;
-+
- #define NUM_KD_DEPTHS (sizeof (kdDepths) / sizeof (kdDepths[0]))
- 
- int                 kdScreenPrivateIndex;
-@@ -84,6 +87,9 @@
- KdOsFuncs	*kdOsFuncs;
- extern WindowPtr *WindowTable;
- 
-+extern Bool CursorInitiallyHidden; /* See Xfixes cursor.c */
-+extern char* RootPPM;		   /* dix/window.c */
-+
- void
- KdSetRootClip (ScreenPtr pScreen, BOOL enable)
- {
-@@ -312,6 +318,7 @@
-     KdSetRootClip (pScreen, TRUE);
-     if (pScreenPriv->card->cfuncs->dpms)
- 	(*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState);
-+
-     return TRUE;
- }
- 
-@@ -686,10 +693,14 @@
-     ErrorF("-mouse path[,n]  Filename of mouse device, n is number of buttons\n");
-     ErrorF("-switchCmd       Command to execute on vt switch\n");
-     ErrorF("-nozap           Don't terminate server on Ctrl+Alt+Backspace\n");
-+    ErrorF("-hide-cursor     Start with cursor hidden\n");
-+    ErrorF("-root-ppm [path] Specify ppm file to use as root window background.\n");
-     ErrorF("vtxx             Use virtual terminal xx instead of the next available\n");
- #ifdef PSEUDO8
-     p8UseMsg ();
- #endif
-+
-+
- }
- 
- int
-@@ -761,6 +772,19 @@
- 	kdSoftCursor = TRUE;
- 	return 1;
-     }
-+    if (!strcmp (argv[i], "-hide-cursor"))
-+    {
-+      CursorInitiallyHidden = TRUE;
-+      return 1;
-+    }
-+    if (!strcmp (argv[i], "-root-ppm"))
-+    {
-+      if ((i+1) < argc)
-+	RootPPM =  argv[i+1];
-+      else
-+	UseMsg ();
-+      return 2;
-+    }
-     if (!strcmp (argv[i], "-videoTest"))
-     {
- 	kdVideoTest = TRUE;
-diff -u -r xorg-server-X11R7.1-1.1.0.orig/xfixes/cursor.c xorg-server-X11R7.1-1.1.0/xfixes/cursor.c
---- xorg-server-X11R7.1-1.1.0.orig/xfixes/cursor.c	2007-01-08 14:30:38.000000000 +0000
-+++ xorg-server-X11R7.1-1.1.0/xfixes/cursor.c	2007-01-11 16:33:00.000000000 +0000
-@@ -59,9 +59,12 @@
- static RESTYPE		CursorWindowType;
- static int		CursorScreenPrivateIndex = -1;
- static int		CursorGeneration;
-+static Bool             CursorGloballyHidden; 
- static CursorPtr	CursorCurrent;
- static CursorPtr        pInvisibleCursor = NULL;
- 
-+Bool CursorInitiallyHidden = FALSE;
-+
- static void deleteCursorHideCountsForScreen (ScreenPtr pScreen);
- 
- #define VERIFY_CURSOR(pCursor, cursor, client, access) { \
-@@ -130,7 +133,7 @@
- 
-     Unwrap (cs, pScreen, DisplayCursor);
- 
--    if (cs->pCursorHideCounts != NULL) {
-+    if (cs->pCursorHideCounts != NULL || CursorGloballyHidden) {
- 	ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor);
-     } else {
- 	ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
-@@ -848,6 +851,12 @@
- 	return BadWindow;
-     }
- 
-+    /* Is cursor set to be initially hidden ?, if so reset this 
-+     * flag as now visibility assumed under control of client.
-+    */
-+    if (CursorGloballyHidden)
-+      CursorGloballyHidden = FALSE;
-+
-     /* 
-      * Has client hidden the cursor before on this screen? 
-      * If so, just increment the count. 
-@@ -899,9 +908,19 @@
- 	return BadWindow;
-     }
- 
-+    /* X was started with cursor hidden, therefore just reset our flag
-+     * (returning to normal client control) and cause cursor to now be
-+     * shown.
-+    */
-+    if (CursorGloballyHidden == TRUE)
-+      {
-+	CursorGloballyHidden = FALSE;
-+	return (client->noClientException);
-+      }
-+
-     /* 
-      * Has client hidden the cursor on this screen?
--     * If not, generate an error.
-+     * If so, generate an error.
-      */
-     pChc = findCursorHideCount(client, pWin->drawable.pScreen);
-     if (pChc == NULL) {
-@@ -1009,6 +1028,8 @@
- XFixesCursorInit (void)
- {
-     int	i;
-+
-+    CursorGloballyHidden = CursorInitiallyHidden;
-     
-     if (CursorGeneration != serverGeneration)
-     {
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/kdrive-evdev.patch b/meta/packages/xorg-xserver/xserver-kdrive/kdrive-evdev.patch
deleted file mode 100644
index 2dc22bf50..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/kdrive-evdev.patch
+++ /dev/null
@@ -1,515 +0,0 @@
-# Kdrive evdev support patch, posted by Ander Conselvan de Oliveira at
-# http://lists.freedesktop.org/archives/xorg/2005-December/011635.html
-diff -u -r --exclude=CVS --exclude=Makefile --exclude='*.o' --exclude=ephyr --exclude='*.Po' xserver.original/hw/kdrive/linux/evdev.c xserver/hw/kdrive/linux/evdev.c
---- xserver.original/hw/kdrive/linux/evdev.c	2005-12-16 10:36:05.000000000 -0200
-+++ xserver/hw/kdrive/linux/evdev.c	2005-12-16 10:40:51.077410192 -0200
-@@ -31,9 +31,11 @@
- #include <X11/X.h>
- #include <X11/Xproto.h>
- #include <X11/Xpoll.h>
-+#include <X11/keysym.h>
- #include "inputstr.h"
- #include "scrnintstr.h"
- #include "kdrive.h"
-+#include "kkeymap.h"
- 
- #define NUM_EVENTS  128
- #define ABS_UNSET   -65535
-@@ -105,9 +107,10 @@
- {
-     KdMouseInfo		*mi = closure;
-     Kevdev		*ke = mi->driver;
--    int			i;
-+    int			i, j;
-     struct input_event	events[NUM_EVENTS];
-     int			n;
-+    int                 flags;
- 
-     n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
-     if (n <= 0)
-@@ -115,22 +118,64 @@
-     n /= sizeof (struct input_event);
-     for (i = 0; i < n; i++)
-     {
-+	flags = KD_MOUSE_DELTA | kdMouseInfo->buttonState;
- 	switch (events[i].type) {
- 	case EV_SYN:
- 	    break;
- 	case EV_KEY:
--	    EvdevMotion (mi);
--	    ASSIGNBIT(ke->key,events[i].code, events[i].value);
--	    if (events[i].code < 0x100)
--		ErrorF ("key %d %d\n", events[i].code, events[i].value);
--	    else
--		ErrorF ("key 0x%x %d\n", events[i].code, events[i].value);
-+	  if (events[i].code >= BTN_MOUSE && events[i].code < BTN_JOYSTICK) {
-+	        switch (events[i].code) {
-+		case BTN_LEFT:
-+		  if (events[i].value == 1)
-+		    flags |= KD_BUTTON_1;
-+		  else
-+		    flags &= ~KD_BUTTON_1;
-+		  break;
-+		case BTN_MIDDLE:
-+		  if (events[i].value == 1)
-+		    flags |= KD_BUTTON_2;
-+		  else
-+		    flags &= ~KD_BUTTON_2;
-+		  break;
-+		case BTN_RIGHT:
-+		  if (events[i].value == 1)
-+		    flags |= KD_BUTTON_3;
-+		  else
-+		    flags &= ~KD_BUTTON_3;
-+		  break;
-+		default:
-+		  /* Unknow button */
-+		  break;
-+       	        }
-+		KdEnqueueMouseEvent (kdMouseInfo, flags, 0, 0);
-+	    }
- 	    break;
- 	case EV_REL:
--	    ke->rel[events[i].code] += events[i].value;
-+	    if (events[i].code == REL_X) {
-+	      KdEnqueueMouseEvent (kdMouseInfo, flags, events[i].value, 0);
-+	    }
-+	    else if (events[i].code == REL_Y) {
-+	      KdEnqueueMouseEvent (kdMouseInfo, flags, 0, events[i].value);
-+	    }
-+	    else if (events[i].code == REL_WHEEL) {	      
-+	      for (j = 0; j < abs (events[i].value); j++) {
-+		if (events[i].value > 0)
-+		  flags |= KD_BUTTON_4;
-+		else
-+		  flags |= KD_BUTTON_5;
-+
-+		KdEnqueueMouseEvent (kdMouseInfo, flags, 0, 0);
-+
-+		if (events[i].value > 0)
-+		  flags &= ~KD_BUTTON_4;
-+		else
-+		  flags &= ~KD_BUTTON_5;
-+
-+		KdEnqueueMouseEvent (kdMouseInfo, flags, 0, 0);
-+	      } /* events[i].code == REL_WHEEL */
-+	    }
- 	    break;
- 	case EV_ABS:
--	    ke->abs[events[i].code] = events[i].value;
- 	    break;
- 	}
-     }
-@@ -173,6 +218,12 @@
- 		fd = open (kdefaultEvdev[i], 2);
- 		if (fd >= 0)
- 		{
-+                    if (ioctl (fd, EVIOCGRAB, 1) < 0)
-+                    {
-+                        close (fd);
-+                        continue;
-+                    }
-+
- 		    mi->name = KdSaveString (kdefaultEvdev[i]);
- 		    break;
- 		}
-@@ -287,7 +338,319 @@
-     EvdevFini,
- };
- 
--#if 0
-+/* Keyboard */
-+
-+int kbd_fd = -1;
-+int EvdevInputType = 0;
-+
-+KeySym evdevKeymap[(194 - 1 + 1) * 2] = {
-+/* These are directly mapped from DOS scanset 0 */
-+/*      1     8 */       XK_Escape, NoSymbol,
-+/*      2     9 */       XK_1,  XK_exclam,
-+/*      3    10 */       XK_2,  XK_at,
-+/*      4    11 */       XK_3,  XK_numbersign,
-+/*      5    12 */       XK_4,  XK_dollar,
-+/*      6    13 */       XK_5,  XK_percent,
-+/*      7    14 */       XK_6,  XK_asciicircum,
-+/*      8    15 */       XK_7,  XK_ampersand,
-+/*      9    16 */       XK_8,  XK_asterisk,
-+/*     10    17 */       XK_9,  XK_parenleft,
-+/*     11    18 */       XK_0,  XK_parenright,
-+/*     12    19 */       XK_minus,      XK_underscore,
-+/*     13    20 */       XK_equal,      XK_plus,
-+/*     14    21 */       XK_BackSpace,  NoSymbol,
-+/*     15    22 */       XK_Tab,        NoSymbol,
-+/*     16    23 */       XK_Q,  NoSymbol,
-+/*     17    24 */       XK_W,  NoSymbol,
-+/*     18    25 */       XK_E,  NoSymbol,
-+/*     19    26 */       XK_R,  NoSymbol,
-+/*     20    27 */       XK_T,  NoSymbol,
-+/*     21    28 */       XK_Y,  NoSymbol,
-+/*     22    29 */       XK_U,  NoSymbol,
-+/*     23    30 */       XK_I,  NoSymbol,
-+/*     24    31 */       XK_O,  NoSymbol,
-+/*     25    32 */       XK_P,  NoSymbol,
-+/*     26    33 */       XK_bracketleft,        XK_braceleft,
-+/*     27    34 */       XK_bracketright,       XK_braceright,
-+/*     28    35 */       XK_Return,     NoSymbol,
-+/*     29    36 */       XK_Control_L,  NoSymbol,
-+/*     30    37 */       XK_A,  NoSymbol,
-+/*     31    38 */       XK_S,  NoSymbol,
-+/*     32    39 */       XK_D,  NoSymbol,
-+/*     33    40 */       XK_F,  NoSymbol,
-+/*     34    41 */       XK_G,  NoSymbol,
-+/*     35    42 */       XK_H,  NoSymbol,
-+/*     36    43 */       XK_J,  NoSymbol,
-+/*     37    44 */       XK_K,  NoSymbol,
-+/*     38    45 */       XK_L,  NoSymbol,
-+/*     39    46 */       XK_semicolon,  XK_colon,
-+/*     40    47 */       XK_apostrophe, XK_quotedbl,
-+/*     41    48 */       XK_grave,      XK_asciitilde,
-+/*     42    49 */       XK_Shift_L,    NoSymbol,
-+/*     43    50 */       XK_backslash,  XK_bar,
-+/*     44    51 */       XK_Z,  NoSymbol,
-+/*     45    52 */       XK_X,  NoSymbol,
-+/*     46    53 */       XK_C,  NoSymbol,
-+/*     47    54 */       XK_V,  NoSymbol,
-+/*     48    55 */       XK_B,  NoSymbol,
-+/*     49    56 */       XK_N,  NoSymbol,
-+/*     50    57 */       XK_M,  NoSymbol,
-+/*     51    58 */       XK_comma,      XK_less,
-+/*     52    59 */       XK_period,     XK_greater,
-+/*     53    60 */       XK_slash,      XK_question,
-+/*     54    61 */       XK_Shift_R,    NoSymbol,
-+/*     55    62 */       XK_KP_Multiply,        NoSymbol,
-+/*     56    63 */       XK_Alt_L,      XK_Meta_L,
-+/*     57    64 */       XK_space,      NoSymbol,
-+/*     58    65 */       XK_Caps_Lock,  NoSymbol,
-+/*     59    66 */       XK_F1, NoSymbol,
-+/*     60    67 */       XK_F2, NoSymbol,
-+/*     61    68 */       XK_F3, NoSymbol,
-+/*     62    69 */       XK_F4, NoSymbol,
-+/*     63    70 */       XK_F5, NoSymbol,
-+/*     64    71 */       XK_F6, NoSymbol,
-+/*     65    72 */       XK_F7, NoSymbol,
-+/*     66    73 */       XK_F8, NoSymbol,
-+/*     67    74 */       XK_F9, NoSymbol,
-+/*     68    75 */       XK_F10,        NoSymbol,
-+/*     69    76 */       XK_Break,      XK_Pause,
-+/*     70    77 */       XK_Scroll_Lock,        NoSymbol,
-+/*     71    78 */       XK_KP_Home,    XK_KP_7,
-+/*     72    79 */       XK_KP_Up,      XK_KP_8,
-+/*     73    80 */       XK_KP_Page_Up, XK_KP_9,
-+/*     74    81 */       XK_KP_Subtract,        NoSymbol,
-+/*     75    82 */       XK_KP_Left,    XK_KP_4,
-+/*     76    83 */       XK_KP_5,       NoSymbol,
-+/*     77    84 */       XK_KP_Right,   XK_KP_6,
-+/*     78    85 */       XK_KP_Add,     NoSymbol,
-+/*     79    86 */       XK_KP_End,     XK_KP_1,
-+/*     80    87 */       XK_KP_Down,    XK_KP_2,
-+/*     81    88 */       XK_KP_Page_Down,       XK_KP_3,
-+/*     82    89 */       XK_KP_Insert,  XK_KP_0,
-+/*     83    90 */       XK_KP_Delete,  XK_KP_Decimal,
-+/*     84    91 */     NoSymbol,        NoSymbol,
-+/*     85    92 */     NoSymbol,        NoSymbol,
-+/*     86    93 */     NoSymbol,        NoSymbol,
-+/*     87    94 */       XK_F11,        NoSymbol,
-+/*     88    95 */       XK_F12,        NoSymbol,
-+
-+/* These are remapped from the extended set (using ExtendMap) */
-+
-+/*     89    96 */       XK_Control_R,  NoSymbol,
-+/*     90    97 */       XK_KP_Enter,   NoSymbol,
-+/*     91    98 */       XK_KP_Divide,  NoSymbol,
-+/*     92    99 */       XK_Sys_Req,    XK_Print,
-+/*     93   100 */       XK_Alt_R,      XK_Meta_R,
-+/*     94   101 */       XK_Num_Lock,   NoSymbol,
-+/*     95   102 */       XK_Home,       NoSymbol,
-+/*     96   103 */       XK_Up,         NoSymbol,
-+/*     97   104 */       XK_Page_Up,    NoSymbol,
-+/*     98   105 */       XK_Left,       NoSymbol,
-+/*     99   106 */       XK_Right,      NoSymbol,
-+/*    100   107 */       XK_End,        NoSymbol,
-+/*    101   108 */       XK_Down,       NoSymbol,
-+/*    102   109 */       XK_Page_Down,  NoSymbol,
-+/*    103   110 */       XK_Insert,     NoSymbol,
-+/*    104   111 */       XK_Delete,     NoSymbol,
-+/*    105   112 */       XK_Super_L,    NoSymbol,
-+/*    106   113 */       XK_Super_R,    NoSymbol,
-+/*    107   114 */       XK_Menu,       NoSymbol,
-+/*    108   115 */       NoSymbol,      NoSymbol,
-+/*    109   116 */       NoSymbol,      NoSymbol,
-+/*    110   117 */       NoSymbol,      NoSymbol,
-+/*    111   118 */       NoSymbol,      NoSymbol,
-+/*    112   119 */       NoSymbol,      NoSymbol,
-+
-+/*    113   120 */      NoSymbol,     NoSymbol,
-+/*    114   121 */      NoSymbol,     NoSymbol,
-+/*    115   122 */      NoSymbol,     NoSymbol,
-+/*    116   123 */      NoSymbol,     NoSymbol,
-+/*    117   124 */      NoSymbol,     NoSymbol,
-+/*    118   125 */      NoSymbol,     NoSymbol,
-+/*    119   126 */      NoSymbol,     NoSymbol,
-+/*    120   127 */      NoSymbol,     NoSymbol,
-+/*    121   128 */      NoSymbol,     NoSymbol,
-+/*    122   129 */      NoSymbol,     NoSymbol,
-+/*    123   130 */      NoSymbol,     NoSymbol,
-+/*    124   131 */      NoSymbol,     NoSymbol,
-+/*    125   132 */      NoSymbol,     NoSymbol,
-+/*    126   133 */      NoSymbol,     NoSymbol,
-+/*    127   134 */      NoSymbol,     NoSymbol,
-+/*    128   135 */      NoSymbol,     NoSymbol,
-+/*    129   136 */      NoSymbol,     NoSymbol,
-+/*    130   137 */      NoSymbol,     NoSymbol,
-+/*    131   138 */      NoSymbol,     NoSymbol,
-+/*    132   139 */      NoSymbol,     NoSymbol,
-+/*    133   140 */      NoSymbol,     NoSymbol,
-+/*    134   141 */      NoSymbol,     NoSymbol,
-+/*    135   142 */      NoSymbol,     NoSymbol,
-+/*    136   143 */      NoSymbol,     NoSymbol,
-+/*    137   144 */      NoSymbol,     NoSymbol,
-+/*    138   145 */      NoSymbol,     NoSymbol,
-+/*    139   146 */      NoSymbol,     NoSymbol,
-+/*    140   147 */      NoSymbol,     NoSymbol,
-+/*    141   148 */      NoSymbol,     NoSymbol,
-+/*    142   149 */      NoSymbol,     NoSymbol,
-+/*    143   150 */      NoSymbol,     NoSymbol,
-+/*    144   151 */      NoSymbol,     NoSymbol,
-+/*    145   152 */      NoSymbol,     NoSymbol,
-+/*    146   153 */      NoSymbol,     NoSymbol,
-+/*    147   154 */      NoSymbol,     NoSymbol,
-+/*    148   155 */      NoSymbol,     NoSymbol,
-+/*    149   156 */      NoSymbol,     NoSymbol,
-+/*    150   157 */      NoSymbol,     NoSymbol,
-+/*    151   158 */      NoSymbol,     NoSymbol,
-+/*    152   159 */      NoSymbol,     NoSymbol,
-+/*    153   160 */      NoSymbol,     NoSymbol,
-+/*    154   161 */      NoSymbol,     NoSymbol,
-+/*    155   162 */      NoSymbol,     NoSymbol,
-+/*    156   163 */      NoSymbol,     NoSymbol,
-+/*    157   164 */      NoSymbol,     NoSymbol,
-+/*    158   165 */      NoSymbol,     NoSymbol,
-+/*    159   166 */      NoSymbol,     NoSymbol,
-+/*    160   167 */      NoSymbol,     NoSymbol,
-+/*    161   168 */      NoSymbol,     NoSymbol,
-+/*    162   169 */      NoSymbol,     NoSymbol,
-+/*    163   170 */      NoSymbol,     NoSymbol,
-+/*    164   171 */      NoSymbol,     NoSymbol,
-+/*    165   172 */      NoSymbol,     NoSymbol,
-+/*    166   173 */      NoSymbol,     NoSymbol,
-+/*    167   174 */      NoSymbol,     NoSymbol,
-+/*    168   175 */      NoSymbol,     NoSymbol,
-+/*    169   176 */      NoSymbol,     NoSymbol,
-+/*    170   177 */      NoSymbol,     NoSymbol,
-+/*    171   178 */      NoSymbol,     NoSymbol,
-+/*    172   179 */      NoSymbol,     NoSymbol,
-+/*    173   180 */      NoSymbol,     NoSymbol,
-+/*    174   181 */      NoSymbol,     NoSymbol,
-+/*    175   182 */      NoSymbol,     NoSymbol,
-+/*    176   183 */      NoSymbol,     NoSymbol,
-+/*    177   184 */      NoSymbol,     NoSymbol,
-+/*    178   185 */      NoSymbol,     NoSymbol,
-+/*    179   186 */      NoSymbol,     NoSymbol,
-+/*    180   187 */      NoSymbol,     NoSymbol,
-+/*    181   188 */      NoSymbol,     NoSymbol,
-+/*    182   189 */      NoSymbol,     NoSymbol,
-+/*    183   190 */      NoSymbol,     NoSymbol,
-+/*    184   191 */      NoSymbol,     NoSymbol,
-+/*    185   192 */      NoSymbol,     NoSymbol,
-+/*    186   193 */      NoSymbol,     NoSymbol,
-+/*    187   194 */      NoSymbol,     NoSymbol,
-+/*    188   195 */      NoSymbol,     NoSymbol,
-+/*    189   196 */      NoSymbol,     NoSymbol,
-+/*    190   197 */      NoSymbol,     NoSymbol,
-+/*    191   198 */      NoSymbol,     NoSymbol,
-+/*    192   199 */      NoSymbol,     NoSymbol,
-+/*    193   200 */      NoSymbol,     NoSymbol,
-+/*    194   201 */      NoSymbol,     NoSymbol,
-+};
-+
-+static void
-+EvdevKbdRead (int fd, void *closure)
-+{
-+    int i, n;
-+    struct input_event events[NUM_EVENTS];
-+
-+    n = read (fd, &events, NUM_EVENTS * sizeof (struct input_event));
-+    if (n <= 0)
-+      return;
-+
-+    n /= sizeof (struct input_event);
-+
-+    for (i = 0; i < n; i++)
-+    {
-+        if (events[i].type == EV_KEY)
-+      	    KdEnqueueKeyboardEvent (events[i].code, !events[i].value);
-+    }
-+}
-+
-+static void
-+EvdevKbdLoad (void)
-+{
-+    kdMinScanCode = 0;
-+    kdMaxScanCode = 193;
-+    kdKeymapWidth = 2;
-+    memcpy (kdKeymap, evdevKeymap, sizeof (evdevKeymap));
-+}
-+
-+static int
-+EvdevKbdInit (void)
-+{
-+    int fd, i;
-+
-+    if (!EvdevInputType)
-+        EvdevInputType = KdAllocInputType ();
-+
-+    if (!kdKeyboard)
-+    {
-+        for (i = 0; i < NUM_DEFAULT_EVDEV; i++)
-+        {
-+            fd = open (kdefaultEvdev[i], 2);
-+            if (fd >= 0)
-+            {
-+                kdKeyboard = KdSaveString (kdefaultEvdev[i]);
-+                break;
-+            }
-+	}
-+    }
-+    else
-+    {
-+        fd = open (kdKeyboard, O_RDWR);
-+        if (fd < 0)
-+            return FALSE;
-+    }
-+
-+    if (ioctl (fd, EVIOCGRAB, 1) < 0)
-+    {
-+        close (fd);
-+	return FALSE;
-+    }
-+
-+    if (!KdRegisterFd (EvdevInputType, fd, EvdevKbdRead, NULL))
-+        return FALSE;
-+
-+    kbd_fd = fd;
-+    return TRUE;
-+}
-+
-+static void
-+EvdevKbdFini (void)
-+{
-+}
-+
-+static void
-+EvdevKbdLeds (int leds)
-+{
-+    struct input_event event;
-+
-+    memset(&event, 0, sizeof(event));
-+
-+    event.type = EV_LED;
-+    event.code = LED_CAPSL;
-+    event.value = leds & (1 << 0) ? 1 : 0;
-+    write(kbd_fd, (char *) &event, sizeof(event));
-+
-+    event.type = EV_LED;
-+    event.code = LED_NUML;
-+    event.value = leds & (1 << 1) ? 1 : 0;
-+    write(kbd_fd, (char *) &event, sizeof(event));
-+
-+    event.type = EV_LED;
-+    event.code = LED_SCROLLL;
-+    event.value = leds & (1 << 2) ? 1 : 0;
-+    write(kbd_fd, (char *) &event, sizeof(event));
-+
-+    event.type = EV_LED;
-+    event.code = LED_COMPOSE;
-+    event.value = leds & (1 << 3) ? 1 : 0;
-+    write(kbd_fd, (char *) &event, sizeof(event));
-+}
-+
-+static void
-+EvdevKbdBell (int volume, int frequency, int duration)
-+{
-+}
-+
- KdKeyboardFuncs LinuxEvdevKeyboardFuncs = {
-     EvdevKbdLoad,
-     EvdevKbdInit,
-@@ -296,4 +659,4 @@
-     EvdevKbdFini,
-     0,
- };
--#endif
-+
-diff -u -r --exclude=CVS --exclude=Makefile --exclude='*.o' --exclude=ephyr --exclude='*.Po' xserver.original/hw/kdrive/src/kdrive.c xserver/hw/kdrive/src/kdrive.c
---- xserver.original/hw/kdrive/src/kdrive.c	2005-12-16 10:36:07.000000000 -0200
-+++ xserver/hw/kdrive/src/kdrive.c	2005-12-16 10:37:09.000000000 -0200
-@@ -73,6 +73,7 @@
- Bool		    kdEnabled;
- int		    kdSubpixelOrder;
- int		    kdVirtualTerminal = -1;
-+char		    *kdKeyboard = 0;
- Bool		    kdSwitchPending;
- char		    *kdSwitchCmd;
- DDXPointRec	    kdOrigin;
-@@ -795,6 +796,14 @@
- 	    UseMsg ();
- 	return 2;
-     }
-+    if (!strcmp (argv[i], "-keyboard"))
-+    {
-+	if ((i+1) < argc)
-+	    kdKeyboard = argv[i+1];
-+	else
-+	    UseMsg ();
-+	return 2;
-+    }
-     if (!strcmp (argv[i], "-rgba"))
-     {
- 	if ((i+1) < argc)
-diff -u -r --exclude=CVS --exclude=Makefile --exclude='*.o' --exclude=ephyr --exclude='*.Po' xserver.original/hw/kdrive/src/kdrive.h xserver/hw/kdrive/src/kdrive.h
---- xserver.original/hw/kdrive/src/kdrive.h	2005-12-16 10:36:07.000000000 -0200
-+++ xserver/hw/kdrive/src/kdrive.h	2005-12-16 10:37:09.000000000 -0200
-@@ -416,6 +416,7 @@
- extern Bool		kdDisableZaphod;
- extern Bool		kdDontZap;
- extern int		kdVirtualTerminal;
-+extern char		*kdKeyboard;
- extern char		*kdSwitchCmd;
- extern KdOsFuncs	*kdOsFuncs;
- 
-@@ -769,7 +770,7 @@
- ProcessInputEvents (void);
- 
- extern KdMouseFuncs	LinuxMouseFuncs;
--extern KdMouseFuncs	LinuxEvdevFuncs;
-+extern KdMouseFuncs	LinuxEvdevMouseFuncs;
- extern KdMouseFuncs	Ps2MouseFuncs;
- extern KdMouseFuncs	BusMouseFuncs;
- extern KdMouseFuncs	MsMouseFuncs;
-@@ -777,6 +778,7 @@
- extern KdMouseFuncs	TsFuncs;
- #endif
- extern KdKeyboardFuncs	LinuxKeyboardFuncs;
-+extern KdKeyboardFuncs	LinuxEvdevKeyboardFuncs;
- extern KdOsFuncs	LinuxFuncs;
- 
- extern KdMouseFuncs	VxWorksMouseFuncs;
-diff -u -r --exclude=CVS --exclude=Makefile --exclude='*.o' --exclude=ephyr --exclude='*.Po' xserver.original/hw/kdrive/src/kinput.c xserver/hw/kdrive/src/kinput.c
---- xserver.original/hw/kdrive/src/kinput.c	2005-12-16 10:36:07.000000000 -0200
-+++ xserver/hw/kdrive/src/kinput.c	2005-12-16 10:37:09.000000000 -0200
-@@ -1300,6 +1300,7 @@
- 	    xE.u.u.type = KeyPress;
- 	xE.u.u.detail = key_code;
- 	
-+#ifndef XKB
- 	switch (KEYCOL1(key_code)) 
- 	{
- 	case XK_Num_Lock:
-@@ -1313,6 +1314,7 @@
- 	    else
- 		xE.u.u.type = KeyPress;
- 	}
-+#endif
- 	
- 	/*
- 	 * Check pressed keys which are already down
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/kdrive-use-evdev.patch b/meta/packages/xorg-xserver/xserver-kdrive/kdrive-use-evdev.patch
deleted file mode 100644
index 28d732560..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/kdrive-use-evdev.patch
+++ /dev/null
@@ -1,54 +0,0 @@
---- xserver/hw/kdrive/fbdev/fbinit.c~	2006-01-31 17:09:33.000000000 +0100
-+++ xserver/hw/kdrive/fbdev/fbinit.c	2006-01-31 17:11:55.000000000 +0100
-@@ -28,6 +28,8 @@
- #endif
- #include <fbdev.h>
- 
-+extern int use_evdev;
-+
- void
- InitCard (char *name)
- {
-@@ -45,7 +47,10 @@
- void
- InitInput (int argc, char **argv)
- {
--    KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
-+    if (use_evdev)
-+        KdInitInput (&LinuxEvdevMouseFuncs, &LinuxEvdevKeyboardFuncs);
-+    else
-+        KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
- #ifdef TOUCHSCREEN
-     KdAddMouseDriver (&TsFuncs);
- #endif
---- xserver/hw/kdrive/src/kdrive.c.orig	2006-01-31 17:13:28.000000000 +0100
-+++ xserver/hw/kdrive/src/kdrive.c	2006-01-31 17:15:28.000000000 +0100
-@@ -44,6 +44,8 @@
- #include "dpmsproc.h"
- #endif
- 
-+int use_evdev = 0;
-+
- typedef struct _kdDepths {
-     CARD8   depth;
-     CARD8   bpp;
-@@ -687,6 +689,7 @@
-     ErrorF("-videoTest       Start the server, pause momentarily and exit\n");
-     ErrorF("-origin X,Y      Locates the next screen in the the virtual screen (Xinerama)\n");
-     ErrorF("-mouse path[,n]  Filename of mouse device, n is number of buttons\n");
-+    ErrorF("-use-evdev       Use Linux evdev input\n");
-     ErrorF("-switchCmd       Command to execute on vt switch\n");
-     ErrorF("-nozap           Don't terminate server on Ctrl+Alt+Backspace\n");
-     ErrorF("vtxx             Use virtual terminal xx instead of the next available\n");
-@@ -796,6 +799,11 @@
- 	    UseMsg ();
- 	return 2;
-     }
-+    if (!strcmp (argv[i], "-use-evdev"))
-+    {
-+	use_evdev = 1;
-+	return 1;
-+    }
-     if (!strcmp (argv[i], "-keyboard"))
-     {
- 	if ((i+1) < argc)
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/kdrive-vidmemarea.patch b/meta/packages/xorg-xserver/xserver-kdrive/kdrive-vidmemarea.patch
deleted file mode 100644
index ed5b6f05c..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/kdrive-vidmemarea.patch
+++ /dev/null
@@ -1,756 +0,0 @@
-
-# Author : Manuel Teira <manuel.teira@telefonica.net> (sirfred in #oe)
-# Description: Support for multiple memory video zones in kdrive. Make offscreen
-# areas aware of the memory video zone it belongs to. Change the fbdev driver to
-# honour this new model.
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kdrive.c~kdrive-vidmemarea
-+++ xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kdrive.c
-@@ -908,9 +908,10 @@
-         ret = (*pScreen->CloseScreen) (index, pScreen);
-     else
- 	ret = TRUE;
--    
--    if (screen->off_screen_base < screen->memory_size)
--	KdOffscreenFini (pScreen);
-+
-+    if (KdHasOffscreen(screen)) {
-+        KdOffscreenFini(pScreen);
-+    }
-     
-     if (pScreenPriv->dpmsState != KD_DPMS_NORMAL)
- 	(*card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL);
-@@ -1219,8 +1220,9 @@
- 	if (!(*card->cfuncs->initAccel) (pScreen))
- 	    screen->dumb = TRUE;
- 
--    if (screen->off_screen_base < screen->memory_size)
--	KdOffscreenInit (pScreen);
-+    if (KdHasOffscreen(screen)) {
-+        KdOffscreenInit(pScreen);
-+    }
-     
- #ifdef PSEUDO8
-     (void) p8Init (pScreen, PSEUDO8_USE_DEFAULT);
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kdrive.h~kdrive-vidmemarea
-+++ xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kdrive.h
-@@ -63,6 +63,9 @@
- #define KD_MAX_CARD_ADDRESS 8
- #endif
- 
-+#define KD_VIDMEM_MINPRIO 0
-+#define KD_VIDMEM_MAXPRIO 255
-+
- /*
-  * Configuration information per video card
-  */
-@@ -115,6 +118,13 @@
- 
- typedef void (*KdOffscreenSaveProc) (ScreenPtr pScreen, KdOffscreenArea *area);
- 
-+typedef struct _KdVideoMemArea {
-+    CARD8  priority;
-+    CARD8 *base;
-+    CARD32 size;
-+    CARD32 available_offset;
-+} KdVideoMemArea;
-+
- typedef enum _KdOffscreenState {
-     KdOffscreenAvail,
-     KdOffscreenRemovable,
-@@ -127,7 +137,8 @@
-     int			size;
-     int			score;
-     pointer		privData;
--    
-+    KdVideoMemArea      *vidmem;
-+    int                 pool;
-     KdOffscreenSaveProc save;
- 
-     KdOffscreenState	state;
-@@ -138,6 +149,7 @@
- #define RR_Rotate_All	(RR_Rotate_0|RR_Rotate_90|RR_Rotate_180|RR_Rotate_270)
- #define RR_Reflect_All	(RR_Reflect_X|RR_Reflect_Y)
- 
-+
- typedef struct _KdScreenInfo {
-     struct _KdScreenInfo    *next;
-     KdCardInfo	*card;
-@@ -155,9 +167,8 @@
-     int		mynum;
-     DDXPointRec	origin;
-     KdFrameBuffer   fb[KD_MAX_FB];
--    CARD8	*memory_base;
--    unsigned long   memory_size;
--    unsigned long   off_screen_base;
-+    KdVideoMemArea **videomem_areas;
-+    int             num_videomem_areas;
- } KdScreenInfo;
- 
- typedef struct _KdCardFuncs {
-@@ -187,7 +198,6 @@
- 
-     void        (*getColors) (ScreenPtr, int, int, xColorItem *);
-     void        (*putColors) (ScreenPtr, int, int, xColorItem *);
--
- } KdCardFuncs;
- 
- #define KD_MAX_PSEUDO_DEPTH 8
-@@ -203,7 +213,8 @@
- 
-     int		    dpmsState;
-     
--    KdOffscreenArea *off_screen_areas;
-+    KdOffscreenArea **offscreen_pools;
-+    int             num_offscreen_pools;
- 
-     ColormapPtr     pInstalledmap[KD_MAX_FB];         /* current colormap */
-     xColorItem      systemPalette[KD_MAX_PSEUDO_SIZE];/* saved windows colors */
-@@ -881,6 +892,15 @@
- KdOffscreenInit (ScreenPtr pScreen);
- 
- KdOffscreenArea *
-+KdOffscreenAllocPrio (ScreenPtr pScreen, int size, int align,
-+                      Bool locked,
-+                      KdOffscreenSaveProc save,
-+                      pointer privData,
-+                      int minPriority,
-+                      int maxPriority,
-+                      Bool allowEviction);
-+
-+KdOffscreenArea *
- KdOffscreenAlloc (ScreenPtr pScreen, int size, int align,
- 		  Bool locked,
- 		  KdOffscreenSaveProc save,
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kaa.c~kdrive-vidmemarea
-+++ xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/kaa.c
-@@ -160,7 +160,7 @@
- 		  pPixmap->drawable.width,
- 		  pPixmap->drawable.height));
-     pPixmap->devKind = pitch;
--    pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pScreenPriv->screen->memory_base + pKaaPixmap->area->offset);
-+    pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pKaaPixmap->area->vidmem->base + pKaaPixmap->area->offset);
-     pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
-     return TRUE;
- }
-@@ -198,7 +198,7 @@
- 
-     dst = pPixmap->devPrivate.ptr;
-     dst_pitch = pPixmap->devKind;
--    
-+
-     bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
- 
-     kaaWaitSync (pPixmap->drawable.pScreen);
-@@ -336,10 +336,16 @@
- {
-     ScreenPtr	pScreen = p->drawable.pScreen;
-     KdScreenPriv(pScreen);
-+    int index;
- 
--    return ((unsigned long) ((CARD8 *) p->devPrivate.ptr - 
--			     (CARD8 *) pScreenPriv->screen->memory_base) <
--	    pScreenPriv->screen->memory_size);
-+    for (index = 0; index < pScreenPriv->screen->num_videomem_areas; index++) {
-+        KdVideoMemArea *vidmem = pScreenPriv->screen->videomem_areas[index];
-+        if ((((CARD8 *)p->devPrivate.ptr) >= vidmem->base) &&
-+            (((CARD8 *)p->devPrivate.ptr) <= (vidmem->base + vidmem->size))) {
-+            return TRUE;
-+        }
-+    }
-+    return FALSE;
- }
- 
- PixmapPtr
-@@ -1060,6 +1066,7 @@
-     KdCheckPaintWindow (pWin, pRegion, what);
- }
- 
-+
- Bool
- kaaDrawInit (ScreenPtr		pScreen,
- 	     KaaScreenInfoPtr	pScreenInfo)
-@@ -1109,7 +1116,7 @@
-      * Hookup offscreen pixmaps
-      */
-     if ((pKaaScr->info->flags & KAA_OFFSCREEN_PIXMAPS) &&
--	screen->off_screen_base < screen->memory_size)
-+	KdHasOffscreen(screen))
-     {
- 	if (!AllocatePixmapPrivate(pScreen, kaaPixmapPrivateIndex,
- 				   sizeof (KaaPixmapPrivRec)))
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/koffscreen.c~kdrive-vidmemarea
-+++ xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/src/koffscreen.c
-@@ -41,16 +41,20 @@
- {
-     KdScreenPriv (pScreen);
-     KdOffscreenArea *prev = 0, *area;
--
--    assert (pScreenPriv->screen->off_screen_areas->area.offset == 0);
--    for (area = pScreenPriv->off_screen_areas; area; area = area->next)
--    {
--	if (prev)
--	    assert (prev->offset + prev->size == area->offset);
-+    int index;
-+    
-+    for (index = 0; index < pScreenPriv->num_offscreen_pools; index++) {
-+        area = pScreenPriv->offscreen_pools[index];
-+        assert (area->vidmem->available_offset - area.offset == 0);
-+        while(area) {
-+            if (prev)
-+                assert (prev->offset + prev->size == area->offset);
- 	    
--	prev = area;
-+            prev = area;
-+            area = area->next;
-+        }
-+        assert (prev->offset + prev->size == prev->vidmem->size);
-     }
--    assert (prev->offset + prev->size == pScreenPriv->screen->memory_size);
- }
- #else
- #define KdOffscreenValidate(s)
-@@ -65,101 +69,133 @@
- }
- 
- KdOffscreenArea *
--KdOffscreenAlloc (ScreenPtr pScreen, int size, int align,
--		  Bool locked,
--		  KdOffscreenSaveProc save,
--		  pointer privData)
-+KdOffscreenAllocPrio (ScreenPtr pScreen, int size, int align,
-+                      Bool locked,
-+                      KdOffscreenSaveProc save,
-+                      pointer privData,
-+                      int minPriority,
-+                      int maxPriority,
-+                      Bool allowEviction)
- {
-     KdOffscreenArea *area, *begin, *best;
-     KdScreenPriv (pScreen);
-     int tmp, real_size = 0, best_score;
-+    int index;
-+    Bool canFit = FALSE;
- 
--    KdOffscreenValidate (pScreen);
-     if (!align)
- 	align = 1;
- 
-     if (!size)
-     {
--	DBG_OFFSCREEN (("Alloc 0x%x -> EMPTY\n", size));
-+	DBG_OFFSCREEN(("Alloc 0x%x -> EMPTY\n", size));
- 	return NULL;
-     }
- 
-     /* throw out requests that cannot fit */
--    if (size > (pScreenPriv->screen->memory_size - pScreenPriv->screen->off_screen_base))
--    {
--	DBG_OFFSCREEN (("Alloc 0x%x -> TOBIG\n", size));
--	return NULL;
-+    for (index = 0; index < pScreenPriv->screen->num_videomem_areas; index++) {
-+        KdVideoMemArea *vidmem = pScreenPriv->screen->videomem_areas[index];
-+        if ((vidmem->priority <= maxPriority) && 
-+            (vidmem->priority >= minPriority)) {
-+            if (size <= (vidmem->size - vidmem->available_offset)) {
-+                canFit = TRUE;
-+                break;
-+            }
-+        }
-     }
--    
--    /* Try to find a free space that'll fit. */
--    for (area = pScreenPriv->off_screen_areas; area; area = area->next)
-+    if (!canFit)
-     {
--	/* skip allocated areas */
--	if (area->state != KdOffscreenAvail)
--	    continue;
-+        DBG_OFFSCREEN(("Alloc 0x%x -> TOOBIG\n", size));
-+        return NULL;
-+    }
- 
--	/* adjust size to match alignment requirement */
--	real_size = size;
--	tmp = area->offset % align;
--	if (tmp)
--	    real_size += (align - tmp);
--	
--	/* does it fit? */
--	if (real_size <= area->size)
--	    break;
-+    for (index = 0; index < pScreenPriv->num_offscreen_pools; index++) {
-+        /* Look just in the head, as all the areas of the pool have
-+           the same vidmem */
-+        area = pScreenPriv->offscreen_pools[index];
-+        if ((area->vidmem->priority > maxPriority) || 
-+            (area->vidmem->priority < minPriority))
-+            continue;
-+
-+        /* Try to find a free space that'll fit. */
-+        for (area = pScreenPriv->offscreen_pools[index]; area;
-+             area = area->next) {
-+            /* skip allocated areas */
-+            if (area->state != KdOffscreenAvail)
-+                continue;
-+            
-+            /* adjust size to match alignment requirement */
-+            real_size = size;
-+            tmp = area->offset % align;
-+            if (tmp)
-+                real_size += (align - tmp);
-+            
-+            /* does it fit? */
-+            if (real_size <= area->size)
-+                break;
-+        }
-+        if (area)
-+            break;
-     }
--    
--    if (!area)
--    {
-+
-+    if (!area && allowEviction) {
- 	/* 
- 	 * Kick out existing users to make space.
- 	 *
- 	 * First, locate a region which can hold the desired object.
- 	 */
-+        for (index = 0; index < pScreenPriv->num_offscreen_pools; index++) {
-+            if ((area->vidmem->priority > maxPriority) || 
-+                (area->vidmem->priority < minPriority))
-+                continue;
- 	
--	/* prev points at the first object to boot */
--	best = NULL;
--	best_score = MAXINT;
--	for (begin = pScreenPriv->off_screen_areas; begin != NULL;
--	     begin = begin->next)
--	{
--	    int avail, score;
--	    KdOffscreenArea *scan;
-+            /* prev points at the first object to boot */
-+            best = NULL;
-+            best_score = MAXINT;
- 
--	    if (begin->state == KdOffscreenLocked)
--		continue;
-+            for (begin = pScreenPriv->offscreen_pools[index]; begin != NULL;
-+                 begin = begin->next) {
-+                int avail, score;
-+                KdOffscreenArea *scan;
- 
--	    /* adjust size to match alignment requirement */
--	    real_size = size;
--	    tmp = begin->offset % align;
--	    if (tmp)
--		real_size += (align - tmp);
-+                if (begin->state == KdOffscreenLocked)
-+                    continue;
-+
-+                /* adjust size to match alignment requirement */
-+                real_size = size;
-+                tmp = begin->offset % align;
-+                if (tmp)
-+                    real_size += (align - tmp);
- 	    
--	    avail = 0;
--	    score = 0;
--	    /* now see if we can make room here, and how "costly" it'll be. */
--	    for (scan = begin; scan != NULL; scan = scan->next)
--	    {
--		if (scan->state == KdOffscreenLocked) {
--		    /* Can't make room here, start after this locked area. */
--		    begin = scan->next;
--		    break;
--		}
--		/* Score should only be non-zero for KdOffscreenRemovable */
--		score += scan->score;
--		avail += scan->size;
--		if (avail >= real_size)
--		    break;
--	    }
--	    /* Is it the best option we've found so far? */
--	    if (avail >= real_size && score < best_score) {
--		best = begin;
--		best_score = score;
--	    }
--	}
--	area = best;
--	if (!area)
--	{
-+                avail = 0;
-+                score = 0;
-+                /* now see if we can make room here, 
-+                   and how "costly" it'll be. */
-+                for (scan = begin; scan != NULL; scan = scan->next) {
-+                    if (scan->state == KdOffscreenLocked) {
-+                        /* Can't make room here, 
-+                           start after this locked area. */
-+                        begin = scan->next;
-+                        break;
-+                    }
-+                    /* Score should only be non-zero for KdOffscreenRemovable */
-+                    score += scan->score;
-+                    avail += scan->size;
-+                    if (avail >= real_size)
-+                        break;
-+                }
-+                /* Is it the best option we've found so far? */
-+                if (avail >= real_size && score < best_score) {
-+                    best = begin;
-+                    best_score = score;
-+                }
-+            }
-+            area = best;
-+            if (area) 
-+                break;
-+        }
-+
-+	if (!area) {
- 	    DBG_OFFSCREEN (("Alloc 0x%x -> NOSPACE\n", size));
- 	    /* Could not allocate memory */
- 	    KdOffscreenValidate (pScreen);
-@@ -180,16 +216,14 @@
- 	/*
- 	 * Now get the system to merge the other needed areas together
- 	 */
--	while (area->size < real_size)
--	{
--	    assert (area->next && area->next->state == KdOffscreenRemovable);
-+	while (area->size < real_size) {
-+            assert (area->next && area->next->state == KdOffscreenRemovable);
- 	    (void) KdOffscreenKickOut (pScreen, area->next);
- 	}
-     }
--    
-+
-     /* save extra space in new area */
--    if (real_size < area->size)
--    {
-+    if (real_size < area->size) {
- 	KdOffscreenArea   *new_area = xalloc (sizeof (KdOffscreenArea));
- 	if (!new_area)
- 	    return NULL;
-@@ -198,9 +232,14 @@
- 	new_area->state = KdOffscreenAvail;
- 	new_area->save = 0;
- 	new_area->score = 0;
-+        new_area->vidmem = area->vidmem;
-+        new_area->pool = area->pool;
- 	new_area->next = area->next;
- 	area->next = new_area;
- 	area->size = real_size;
-+        DBG_OFFSCREEN (("New OffscreenArea at %p (offset:0x%08x, size:0x%08x, pool:%d\n", area, area->offset, area->size, area->pool));
-+
-+
-     }
-     /*
-      * Mark this area as in use
-@@ -212,42 +251,80 @@
-     area->privData = privData;
-     area->save = save;
-     area->score = 0;
--
-+    
-     area->save_offset = area->offset;
-     {
- 	int tmp = area->offset % align;
- 	if (tmp)
- 	    area->offset += (align - tmp);
-     }
--
-+    
-     KdOffscreenValidate (pScreen);
-     
-     DBG_OFFSCREEN (("Alloc 0x%x -> 0x%x\n", size, area->offset));
-     return area;
- }
- 
-+Bool
-+KdHasOffscreen(KdScreenInfo *screen)
-+{
-+    int index;
-+    DBG_OFFSCREEN (("KdHasOffscreen\n"));
-+
-+    for (index = 0; index < screen->num_videomem_areas; index++) {
-+        KdVideoMemArea *vidmem = screen->videomem_areas[index];
-+        if (vidmem->available_offset < vidmem->size) {
-+            return TRUE;
-+        }
-+    }
-+    return FALSE;
-+}
-+    
-+KdOffscreenArea *
-+KdOffscreenAlloc (ScreenPtr pScreen, int size, int align,
-+		  Bool locked,
-+		  KdOffscreenSaveProc save,
-+		  pointer privData)
-+{
-+    DBG_OFFSCREEN (("KdOffscreenAlloc(size:%d, align:%d, locked:%d)\n",
-+                    size, align, locked));
-+    return KdOffscreenAllocPrio(pScreen, size, align,
-+                                locked,
-+                                save,
-+                                privData,
-+                                KD_VIDMEM_MINPRIO,
-+                                KD_VIDMEM_MAXPRIO,
-+                                TRUE);
-+}
-+
- void
- KdOffscreenSwapOut (ScreenPtr pScreen)
- {
-     KdScreenPriv (pScreen);
-+    int index;
-+
-+    DBG_OFFSCREEN (("KdOffscreenSwapOut\n"));
- 
-     KdOffscreenValidate (pScreen);
--    /* loop until a single free area spans the space */
--    for (;;)
--    {
--	KdOffscreenArea *area = pScreenPriv->off_screen_areas;
-+
-+    for (index = 0; index < pScreenPriv->num_offscreen_pools; index++) {
-+        /* loop until a single free area spans the space */
-+        for (;;)
-+        {
-+            KdOffscreenArea *area = pScreenPriv->offscreen_pools[index];
- 	
--	if (!area)
--	    break;
--	if (area->state == KdOffscreenAvail)
--	{
--	    area = area->next;
--	    if (!area)
--		break;
--	}
--	assert (area->state != KdOffscreenAvail);
--	(void) KdOffscreenKickOut (pScreen, area);
--	KdOffscreenValidate (pScreen);
-+            if (!area)
-+                break;
-+            if (area->state == KdOffscreenAvail)
-+            {
-+                area = area->next;
-+                if (!area)
-+                    break;
-+            }
-+            assert (area->state != KdOffscreenAvail);
-+            (void) KdOffscreenKickOut (pScreen, area);
-+            KdOffscreenValidate (pScreen);
-+        }
-     }    
-     KdOffscreenValidate (pScreen);
-     KdOffscreenFini (pScreen);
-@@ -256,6 +333,8 @@
- void
- KdOffscreenSwapIn (ScreenPtr pScreen)
- {
-+    KdScreenPriv (pScreen);
-+    DBG_OFFSCREEN (("KdOffscreenSwapIn\n"));
-     KdOffscreenInit (pScreen);
- }
- 
-@@ -264,7 +343,7 @@
- KdOffscreenMerge (KdOffscreenArea *area)
- {
-     KdOffscreenArea	*next = area->next;
--
-+    //DBG_OFFSCREEN (("KdOffscreenMerge %p\n", area));
-     /* account for space */
-     area->size += next->size;
-     /* frob pointer */
-@@ -278,8 +357,9 @@
-     KdScreenPriv(pScreen);
-     KdOffscreenArea	*next = area->next;
-     KdOffscreenArea	*prev;
--    
--    DBG_OFFSCREEN (("Free 0x%x -> 0x%x\n", area->size, area->offset));
-+
-+    DBG_OFFSCREEN (("KdOffscreenFree 0x%x -> 0x%x\n", 
-+                    area->size, area->offset));
-     KdOffscreenValidate (pScreen);
- 
-     area->state = KdOffscreenAvail;
-@@ -290,10 +370,11 @@
-     /*
-      * Find previous area
-      */
--    if (area == pScreenPriv->off_screen_areas)
-+    if (area == pScreenPriv->offscreen_pools[area->pool])
- 	prev = 0;
-     else
--	for (prev = pScreenPriv->off_screen_areas; prev; prev = prev->next)
-+	for (prev = pScreenPriv->offscreen_pools[area->pool]; 
-+             prev; prev = prev->next)
- 	    if (prev->next == area)
- 		break;
-     
-@@ -317,21 +398,30 @@
- {
-     KaaPixmapPriv (pPixmap);
-     KdScreenPriv (pPixmap->drawable.pScreen);
-+    int index;
-     static int iter = 0;
- 
-+
-     if (!pKaaPixmap->area)
- 	return;
- 
-+    /*
-+    DBG_OFFSCREEN(("KdOffscreenMarkUsed(offset:0x%08x, pool:%d)\n", 
-+                   pKaaPixmap->area->offset,
-+                   pKaaPixmap->area->pool));
-+    */
-     /* The numbers here are arbitrary.  We may want to tune these. */
-     pKaaPixmap->area->score += 100;
-     if (++iter == 10) {
- 	KdOffscreenArea *area;
--	for (area = pScreenPriv->off_screen_areas; area != NULL;
--	     area = area->next)
--	{
--	    if (area->state == KdOffscreenRemovable)
--		area->score = (area->score * 7) / 8;
--	}
-+        for (index = 0; index < pScreenPriv->num_offscreen_pools; index++) {
-+            for (area = pScreenPriv->offscreen_pools[index]; area != NULL;
-+                 area = area->next)
-+            {
-+                if (area->state == KdOffscreenRemovable)
-+                    area->score = (area->score * 7) / 8;
-+            }
-+        }
-     }
- }
- 
-@@ -340,23 +430,41 @@
- {
-     KdScreenPriv (pScreen);
-     KdOffscreenArea *area;
-+    KdVideoMemArea *vidmem;
-+    int index, num_offscreen;
- 
--    /* Allocate a big free area */
--    area = xalloc (sizeof (KdOffscreenArea));
-+    DBG_OFFSCREEN (("KdOffscreenInit\n"));
-+    num_offscreen = 0;
-+    pScreenPriv->num_offscreen_pools = 0;
-+    pScreenPriv->offscreen_pools = NULL;
- 
--    if (!area)
--	return FALSE;
-+    for (index = 0; index < pScreenPriv->screen->num_videomem_areas; index++) {
-+        vidmem = pScreenPriv->screen->videomem_areas[index];
-+        DBG_OFFSCREEN (("Searching vidmemarea base:0x%p, size:0x%08x, available_offset:0x%08x\n", vidmem->base, vidmem->size, vidmem->available_offset));
-+        if (vidmem->available_offset < vidmem->size) {
-+            pScreenPriv->offscreen_pools = xrealloc(pScreenPriv->offscreen_pools,
-+                                                    sizeof(KdOffscreenArea*) * (pScreenPriv->num_offscreen_pools + 1));
-+            if (!pScreenPriv->offscreen_pools) {
-+                return FALSE;
-+            }
-+            pScreenPriv->offscreen_pools[pScreenPriv->num_offscreen_pools] =
-+                area = xcalloc(sizeof(KdOffscreenArea), 1);
-+            if (!area) 
-+                return FALSE;
-+
-+            area->state = KdOffscreenAvail;
-+            area->vidmem = vidmem;
-+            area->offset = vidmem->available_offset;
-+            area->size = vidmem->size - vidmem->available_offset;
-+            area->save = 0;
-+            area->pool = pScreenPriv->num_offscreen_pools;
-+            area->next = NULL;
-+            area->score = 0;
-+            pScreenPriv->num_offscreen_pools++;
-+            DBG_OFFSCREEN (("New OffscreenArea at %p (offset:0x%08x, size:0x%08x, pool:%d)\n", area, area->offset, area->size, area->pool));
-+        }
-+    }
- 
--    area->state = KdOffscreenAvail;
--    area->offset = pScreenPriv->screen->off_screen_base;
--    area->size = pScreenPriv->screen->memory_size - area->offset;
--    area->save = 0;
--    area->next = NULL;
--    area->score = 0;
--    
--    /* Add it to the free areas */
--    pScreenPriv->off_screen_areas = area;
--    
-     KdOffscreenValidate (pScreen);
- 
-     return TRUE;
-@@ -367,11 +475,17 @@
- {
-     KdScreenPriv (pScreen);
-     KdOffscreenArea *area;
--    
--    /* just free all of the area records */
--    while ((area = pScreenPriv->off_screen_areas))
--    {
--	pScreenPriv->off_screen_areas = area->next;
--	xfree (area);
-+    int index;
-+
-+    DBG_OFFSCREEN (("KdOffscreenFini\n"));
-+    for (index = 0; index < pScreenPriv->num_offscreen_pools; index++) {
-+        /* just free all of the area records */
-+        while ((area = pScreenPriv->offscreen_pools[index])) {
-+            pScreenPriv->offscreen_pools[index] = area->next;
-+            xfree (area);
-+        }
-     }
-+    xfree(pScreenPriv->offscreen_pools);
-+    pScreenPriv->offscreen_pools = NULL;
-+    pScreenPriv->num_offscreen_pools = 0;
- }
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/fbdev/fbdev.c~kdrive-vidmemarea
-+++ xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/fbdev/fbdev.c
-@@ -330,6 +330,7 @@
-     FbdevScrPriv	*scrpriv = screen->driver;
-     KdMouseMatrix	m;
-     FbdevPriv		*priv = screen->card->driver;
-+    KdVideoMemArea      *vidmem;
- 
-     if (scrpriv->randr != RR_Rotate_0)
- 	scrpriv->shadow = TRUE;
-@@ -342,15 +343,20 @@
-     
-     screen->width = priv->var.xres;
-     screen->height = priv->var.yres;
--    screen->memory_base = (CARD8 *) (priv->fb);
--    screen->memory_size = priv->fix.smem_len;
-+    screen->videomem_areas = xcalloc(sizeof(KdVideoMemArea*), 1);
-+    screen->videomem_areas[0] = vidmem = xcalloc(sizeof(KdVideoMemArea), 1);
-+    screen->num_videomem_areas = 1;
-+    
-+    vidmem->priority = KD_VIDMEM_MINPRIO;
-+    vidmem->base = (CARD8 *) (priv->fb);
-+    vidmem->size = priv->fix.smem_len;
-     
-     if (scrpriv->shadow)
-     {
- 	if (!KdShadowFbAlloc (screen, 0, 
- 			      scrpriv->randr & (RR_Rotate_90|RR_Rotate_270)))
- 	    return FALSE;
--	screen->off_screen_base = screen->memory_size;
-+        vidmem->available_offset = vidmem->size;
-     }
-     else
-     {
-@@ -358,7 +364,7 @@
-         screen->fb[0].pixelStride = (priv->fix.line_length * 8 / 
-     				 priv->var.bits_per_pixel);
-         screen->fb[0].frameBuffer = (CARD8 *) (priv->fb);
--	screen->off_screen_base = screen->fb[0].byteStride * screen->height;
-+	vidmem->available_offset = screen->fb[0].byteStride * screen->height;
-     }
-     
-     return TRUE;
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/kmode-palm.patch b/meta/packages/xorg-xserver/xserver-kdrive/kmode-palm.patch
deleted file mode 100644
index 255e707b5..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/kmode-palm.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- kmode.c	2006-05-03 19:48:42.000000000 +0200
-+++ xserver/hw/kdrive/src/kmode.c	2006-05-03 19:50:43.000000000 +0200
-@@ -32,6 +32,31 @@
-     /*	H	V	Hz	KHz */
- 		/*  FP	    BP	    BLANK   POLARITY */
- 
-+	/* Treo 650 */
-+
-+    {   320,	320,	64,	16256,
-+	            17,	    12,	    32,     KdSyncNegative,
-+	            1,      11,     14,     KdSyncNegative,
-+    },
-+    
-+    {   320,	320,	64,	    0,
-+	            0,	    0,	    0,     KdSyncNegative,
-+	            0,      0,      0,     KdSyncNegative,
-+    },
-+	
-+	/* LifeDrive/T3/TX modes */
-+
-+    {   320,	480,	64,	16256,
-+	            17,	    12,	    32,     KdSyncNegative,
-+	            1,      11,     14,     KdSyncNegative,
-+    },
-+    
-+    {   480,	320,	64,	    0,
-+	            0,	    0,	    0,     KdSyncNegative,
-+	            0,      0,      0,     KdSyncNegative,
-+    },
-+
-+
-     /* IPAQ modeline:
-      *
-      * Modeline "320x240"      5.7222 320 337 340 352   240 241 244 254"
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/kmode.patch b/meta/packages/xorg-xserver/xserver-kdrive/kmode.patch
deleted file mode 100644
index 5ad3e4e27..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/kmode.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- /tmp/kmode.c	2005-06-27 14:46:19.716843288 +0200
-+++ xserver/hw/kdrive/src/kmode.c	2005-06-27 14:46:30.070269328 +0200
-@@ -41,6 +41,11 @@
- 	            1,      11,     14,     KdSyncNegative,
-     },
-     
-+    {   240,	320,	64,	    0,
-+	            0,	    0,	    0,     KdSyncNegative,
-+	            0,      0,      0,     KdSyncNegative,
-+    },
-+
-     /* Other VESA modes */
-     {	640,	350,	85,	31500,			    /* VESA */
- 		    32,	    96,	    192,    KdSyncPositive, /* 26.413 */
-@@ -80,6 +85,13 @@
- 		   16,	    48,	    160,    KdSyncNegative, /* 31.469 */
- 		   10,	    33,	    45,	    KdSyncNegative, /* 59.940 */
-     },
-+
-+
-+  {   480,    640,    60,     0,                      /* VESA */
-+               0,      0,     0,    KdSyncNegative, /* 31.469 */
-+               0,      0,     0,     KdSyncNegative, /* 59.940 */
-+   },
-+  
-     
-     /* 800x600 modes */
-     {	800,	600,	85,	56250,			    /* VESA */
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/no-serial-probing.patch b/meta/packages/xorg-xserver/xserver-kdrive/no-serial-probing.patch
deleted file mode 100644
index 35ccadaa8..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/no-serial-probing.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- xserver/hw/kdrive/linux/mouse.c.orig	2004-05-13 14:25:51.000000000 -0700
-+++ xserver/hw/kdrive/linux/mouse.c	2005-09-22 12:20:47.000000000 -0700
-@@ -927,8 +927,10 @@ char *kdefaultMouse[] =  {
-     "/dev/psaux",
-     "/dev/input/mice",
-     "/dev/adbmouse",
-+#ifdef BREAK_MY_SERIAL_CONSOLE
-     "/dev/ttyS0",
-     "/dev/ttyS1",
-+#endif
- };
- 
- #define NUM_DEFAULT_MOUSE    (sizeof (kdefaultMouse) / sizeof (kdefaultMouse[0]))
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/onlyfb.patch b/meta/packages/xorg-xserver/xserver-kdrive/onlyfb.patch
deleted file mode 100644
index e77332498..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/onlyfb.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- xserver/hw/kdrive/Makefile.am~onlyfb
-+++ xserver/hw/kdrive/Makefile.am
-@@ -17,12 +17,4 @@
- SUBDIRS =			\
- 	src			\
- 	linux			\
--	$(XSDL_SUBDIRS)		\
--	$(FBDEV_SUBDIRS)	\
--	$(VESA_SUBDIRS)		\
--	$(XEPHYR_SUBDIRS)       \
--	ati			\
--	fake			\
--	ephyr                   \
--	i810			\
--	epson
-+	$(FBDEV_SUBDIRS)
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/optional-xkb.patch b/meta/packages/xorg-xserver/xserver-kdrive/optional-xkb.patch
deleted file mode 100644
index d9ef51c5b..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/optional-xkb.patch
+++ /dev/null
@@ -1,54 +0,0 @@
---- git/Makefile.am.orig	2006-06-09 16:01:51.000000000 +0200
-+++ git/Makefile.am	2006-06-09 16:02:59.000000000 +0200
-@@ -35,6 +35,10 @@
- XINPUT_DIR=Xi
- endif
- 
-+if XKB
-+XKB_DIR=xkb
-+endif
-+
- if DBE
- DBE_DIR=dbe
- endif
-@@ -51,7 +55,7 @@
- 	randr \
- 	render  \
- 	$(XINPUT_DIR) \
--	xkb \
-+	$(XKB_DIR) \
- 	$(DBE_DIR) \
- 	$(MFB_DIR) \
- 	$(AFB_DIR) \
---- git/configure.ac.orig	2006-05-22 22:40:00.000000000 +0200
-+++ git/configure.ac	2006-06-10 15:10:14.000000000 +0200
-@@ -418,6 +418,7 @@
- AC_ARG_ENABLE(xf86bigfont,    AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
- AC_ARG_ENABLE(dpms,           AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMS=$enableval], [DPMSExtension=yes])
- AC_ARG_ENABLE(xinput,         AS_HELP_STRING([--disable-xinput], [Build XInput Extension (default: enabled)]), [XINPUT=$enableval], [XINPUT=yes])
-+AC_ARG_ENABLE(xkb,            AS_HELP_STRING([--disable-xkb], [Build XKB (default: enabled)]), [XKB=$enableval], [XKB=yes])
- 
- dnl DDXes.
- AC_ARG_ENABLE(xorg,    	      AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
-@@ -739,12 +740,15 @@
- 
- AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
- 
--AC_DEFINE(XKB, 1, [Build XKB])
--AC_DEFINE(XKB_IN_SERVER, 1, [Build XKB server])
--AC_DEFINE(XKB_DFLT_DISABLED, 0, [Disable XKB per default])
--REQUIRED_MODULES="$REQUIRED_MODULES xkbfile"
--XKB_LIB='$(top_builddir)/xkb/libxkb.la'
--XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
-+AM_CONDITIONAL(XKB, [test "x$XKB" = xyes])
-+if test "x$XKB" = xyes; then
-+	AC_DEFINE(XKB, 1, [Build XKB])
-+	AC_DEFINE(XKB_IN_SERVER, 1, [Build XKB server])
-+	AC_DEFINE(XKB_DFLT_DISABLED, 0, [Disable XKB per default])
-+	REQUIRED_MODULES="$REQUIRED_MODULES xkbfile"
-+	XKB_LIB='$(top_builddir)/xkb/libxkb.la'
-+	XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
-+fi
- 
- AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
-                                         [Do not have `strcasecmp'.]))
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/w100-fix-offscreen-bmp.patch b/meta/packages/xorg-xserver/xserver-kdrive/w100-fix-offscreen-bmp.patch
deleted file mode 100644
index 39bc22c6b..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/w100-fix-offscreen-bmp.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Patch suggested by Manuel Teira to actually enable offscreen pixmap 
-acceleration in Xw100. Value 16 is empirical, works well on hx4700,
-but in case of issues, consider double it (other accelerated drivers
-use bigger values than 16).
-
---- xorg-server-1.2.0/hw/kdrive/w100/ati_draw.c.org	2007-04-04 10:28:57.000000000 +0000
-+++ xorg-server-1.2.0/hw/kdrive/w100/ati_draw.c	2007-04-06 14:43:40.000000000 +0000
-@@ -433,6 +433,7 @@
-      * or kaaPixmapUseScreen. But this is probably caused by some bug in this
-      * driver...  */
-     atis->kaa.flags |= KAA_OFFSCREEN_PIXMAPS;
-+    atis->kaa.pitchAlign = 16;
-     if (!kaaDrawInit(pScreen, &atis->kaa))
-         return FALSE;
- 
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/w100.patch b/meta/packages/xorg-xserver/xserver-kdrive/w100.patch
deleted file mode 100644
index 9a20fa1f1..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/w100.patch
+++ /dev/null
@@ -1,6388 +0,0 @@
-Index: git/hw/kdrive/w100/ati.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati.c	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,434 @@
-+/*
-+ * Copyright � 2006 Alberto Mardegan <mardy@users.sourceforge.net>
-+ *
-+ * 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 Alberto Mardegan not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Alberto Mardegan makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ALBERTO MARDEGAN 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 "ati.h"
-+#include "w100_regs.h"
-+
-+
-+struct pci_id_entry ati_pci_ids[] = {
-+    {0x1002, 0x5644, 0, "ATI Imageon 3200"},
-+    {0x1002, 0x5741, 0, "ATI Imageon 100"},
-+    {0x1002, 0x5744, 0, "ATI Imageon 3220"},
-+    {0, 0, 0, NULL}
-+};
-+
-+
-+static Bool
-+ATICardInit(KdCardInfo * card)
-+{
-+    ATICardInfo *atic;
-+    int i;
-+    Bool initialized = FALSE;
-+
-+    atic = xcalloc(sizeof(ATICardInfo), 1);
-+    if (atic == NULL)
-+        return FALSE;
-+
-+#ifdef KDRIVEFBDEV
-+    if (!initialized && fbdevInitialize(card, &atic->backend_priv.fbdev)) {
-+        atic->use_fbdev = TRUE;
-+        initialized = TRUE;
-+        atic->backend_funcs.cardfini = fbdevCardFini;
-+        atic->backend_funcs.scrfini = fbdevScreenFini;
-+        atic->backend_funcs.initScreen = fbdevInitScreen;
-+        atic->backend_funcs.finishInitScreen = fbdevFinishInitScreen;
-+        atic->backend_funcs.createRes = fbdevCreateResources;
-+        atic->backend_funcs.preserve = fbdevPreserve;
-+        atic->backend_funcs.restore = fbdevRestore;
-+        atic->backend_funcs.dpms = fbdevDPMS;
-+        atic->backend_funcs.enable = fbdevEnable;
-+        atic->backend_funcs.disable = fbdevDisable;
-+        atic->backend_funcs.getColors = fbdevGetColors;
-+        atic->backend_funcs.putColors = fbdevPutColors;
-+#ifdef RANDR
-+        atic->backend_funcs.randrSetConfig = fbdevRandRSetConfig;
-+#endif
-+    }
-+#endif
-+#ifdef KDRIVEVESA
-+    if (!initialized && vesaInitialize(card, &atic->backend_priv.vesa)) {
-+        atic->use_vesa = TRUE;
-+        initialized = TRUE;
-+        atic->backend_funcs.cardfini = vesaCardFini;
-+        atic->backend_funcs.scrfini = vesaScreenFini;
-+        atic->backend_funcs.initScreen = vesaInitScreen;
-+        atic->backend_funcs.finishInitScreen = vesaFinishInitScreen;
-+        atic->backend_funcs.createRes = vesaCreateResources;
-+        atic->backend_funcs.preserve = vesaPreserve;
-+        atic->backend_funcs.restore = vesaRestore;
-+        atic->backend_funcs.dpms = vesaDPMS;
-+        atic->backend_funcs.enable = vesaEnable;
-+        atic->backend_funcs.disable = vesaDisable;
-+        atic->backend_funcs.getColors = vesaGetColors;
-+        atic->backend_funcs.putColors = vesaPutColors;
-+#ifdef RANDR
-+        atic->backend_funcs.randrSetConfig = vesaRandRSetConfig;
-+#endif
-+    }
-+#endif
-+
-+    if (!initialized || !ATIMap(card, atic)) {
-+        xfree(atic);
-+        return FALSE;
-+    }
-+
-+    card->driver = atic;
-+
-+    for (i = 0; ati_pci_ids[i].name != NULL; i++) {
-+        if (ati_pci_ids[i].device == card->attr.deviceID) {
-+            atic->pci_id = &ati_pci_ids[i];
-+            break;
-+        }
-+    }
-+
-+    ErrorF("Using ATI card: %s\n", atic->pci_id->name);
-+
-+    return TRUE;
-+}
-+
-+static void
-+ATICardFini(KdCardInfo * card)
-+{
-+    ATICardInfo *atic = (ATICardInfo *) card->driver;
-+
-+    ATIUnmap(card, atic);
-+    atic->backend_funcs.cardfini(card);
-+}
-+
-+/*
-+ * Once screen->off_screen_base is set, this function
-+ * allocates the remaining memory appropriately
-+ */
-+
-+static void
-+ATISetOffscreen(KdScreenInfo * screen)
-+{
-+    ATICardInfo(screen);
-+    int screen_size;
-+    char *mmio = atic->reg_base;
-+
-+    /* check (and adjust) pitch */
-+    if (mmio) {
-+        int byteStride = screen->fb[0].byteStride;
-+        int bitStride;
-+        int pixelStride;
-+        int bpp = screen->fb[0].bitsPerPixel;
-+
-+        /*
-+         * Ensure frame buffer is correctly aligned
-+         */
-+        if (byteStride & 0x3f) {
-+            byteStride = (byteStride + 0x3f) & ~0x3f;
-+            bitStride = byteStride * 8;
-+            pixelStride = bitStride / bpp;
-+
-+            screen->fb[0].byteStride = byteStride;
-+            screen->fb[0].pixelStride = pixelStride;
-+        }
-+    }
-+
-+    screen_size = screen->fb[0].byteStride * screen->height;
-+
-+    screen->off_screen_base = screen_size;
-+
-+}
-+
-+static Bool
-+ATIScreenInit(KdScreenInfo * screen)
-+{
-+    ATIScreenInfo *atis;
-+    ATICardInfo(screen);
-+    Bool success = FALSE;
-+
-+    atis = xcalloc(sizeof(ATIScreenInfo), 1);
-+    if (atis == NULL)
-+        return FALSE;
-+
-+    atis->atic = atic;
-+    atis->screen = screen;
-+    screen->driver = atis;
-+
-+    if (screen->fb[0].depth == 0)
-+        screen->fb[0].depth = 16;
-+#ifdef KDRIVEFBDEV
-+    if (atic->use_fbdev) {
-+        success = fbdevScreenInitialize(screen, &atis->backend_priv.fbdev);
-+    }
-+#endif
-+#ifdef KDRIVEVESA
-+    if (atic->use_vesa) {
-+        success = vesaScreenInitialize(screen, &atis->backend_priv.vesa);
-+    }
-+#endif
-+
-+    if (!success) {
-+        screen->driver = NULL;
-+        xfree(atis);
-+        return FALSE;
-+    }
-+
-+    ErrorF
-+        ("Offscreen memory at offset %08x, memory base %08x, size %08x\n",
-+         screen->off_screen_base, screen->memory_base,
-+         screen->memory_size);
-+    ATISetOffscreen(screen);
-+
-+    return TRUE;
-+}
-+
-+#ifdef RANDR
-+static Bool
-+ATIRandRSetConfig(ScreenPtr pScreen,
-+                  Rotation randr, int rate, RRScreenSizePtr pSize)
-+{
-+    KdScreenPriv(pScreen);
-+    KdScreenInfo *screen = pScreenPriv->screen;
-+    ATICardInfo *atic = screen->card->driver;
-+    Bool ret;
-+
-+    ATIDrawDisable(pScreen);
-+    ret = atic->backend_funcs.randrSetConfig(pScreen, randr, rate, pSize);
-+    ATISetOffscreen(screen);
-+    /*
-+     * Set frame buffer mapping
-+     */
-+    (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap(pScreen),
-+                                    pScreen->width,
-+                                    pScreen->height,
-+                                    screen->fb[0].depth,
-+                                    screen->fb[0].bitsPerPixel,
-+                                    screen->fb[0].byteStride,
-+                                    screen->fb[0].frameBuffer);
-+
-+    ATIDrawEnable(pScreen);
-+    return ret;
-+}
-+
-+static Bool
-+ATIRandRInit(ScreenPtr pScreen)
-+{
-+    rrScrPrivPtr pScrPriv;
-+
-+    pScrPriv = rrGetScrPriv(pScreen);
-+    pScrPriv->rrSetConfig = ATIRandRSetConfig;
-+    return TRUE;
-+}
-+#endif
-+
-+static void
-+ATIScreenFini(KdScreenInfo * screen)
-+{
-+    ATIScreenInfo *atis = (ATIScreenInfo *) screen->driver;
-+    ATICardInfo *atic = screen->card->driver;
-+
-+    atic->backend_funcs.scrfini(screen);
-+    xfree(atis);
-+    screen->driver = 0;
-+}
-+
-+Bool
-+ATIMap(KdCardInfo * card, ATICardInfo * atic)
-+{
-+    atic->mem_base = (CARD8 *) KdMapDevice(ATI_MEM_BASE(card),
-+                                           ATI_MEM_SIZE(card));
-+
-+    if (atic->mem_base == NULL)
-+        return FALSE;
-+    atic->reg_base = atic->mem_base + 0x10000;  /* XXX */
-+
-+    KdSetMappedMode(ATI_MEM_BASE(card), ATI_MEM_SIZE(card),
-+                    KD_MAPPED_MODE_REGISTERS);
-+
-+    return TRUE;
-+}
-+
-+void
-+ATIUnmap(KdCardInfo * card, ATICardInfo * atic)
-+{
-+    if (atic->reg_base) {
-+        KdResetMappedMode(ATI_REG_BASE(card), ATI_REG_SIZE(card),
-+                          KD_MAPPED_MODE_REGISTERS);
-+        KdUnmapDevice((void *) atic->reg_base, ATI_REG_SIZE(card));
-+        atic->reg_base = 0;
-+    }
-+}
-+
-+static Bool
-+ATIInitScreen(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATICardInfo(pScreenPriv);
-+
-+    return atic->backend_funcs.initScreen(pScreen);
-+}
-+
-+static Bool
-+ATIFinishInitScreen(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATICardInfo(pScreenPriv);
-+
-+    if (!atic->backend_funcs.finishInitScreen(pScreen))
-+        return FALSE;
-+#ifdef RANDR
-+    if (!ATIRandRInit(pScreen))
-+        return FALSE;
-+#endif
-+    return TRUE;
-+}
-+
-+static Bool
-+ATICreateResources(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATICardInfo(pScreenPriv);
-+
-+    return atic->backend_funcs.createRes(pScreen);
-+}
-+
-+static void
-+ATIPreserve(KdCardInfo * card)
-+{
-+    ATICardInfo *atic = card->driver;
-+
-+    atic->backend_funcs.preserve(card);
-+}
-+
-+static void
-+ATIRestore(KdCardInfo * card)
-+{
-+    ATICardInfo *atic = card->driver;
-+
-+    ATIUnmap(card, atic);
-+
-+    atic->backend_funcs.restore(card);
-+}
-+
-+static Bool
-+ATIDPMS(ScreenPtr pScreen, int mode)
-+{
-+    KdScreenPriv(pScreen);
-+    ATICardInfo(pScreenPriv);
-+
-+    return atic->backend_funcs.dpms(pScreen, mode);
-+}
-+
-+static Bool
-+ATIEnable(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATICardInfo(pScreenPriv);
-+    mc_ext_mem_location_u eml;
-+    char *mmio;
-+
-+    if (!atic->backend_funcs.enable(pScreen))
-+        return FALSE;
-+
-+    if ((atic->reg_base == NULL)
-+        && !ATIMap(pScreenPriv->screen->card, atic))
-+        return FALSE;
-+
-+    mmio = atic->reg_base;
-+    eml.val = MMIO_IN32(mmio, mmMC_EXT_MEM_LOCATION);
-+    atic->ext_mem_location = eml.f.mc_ext_mem_start << 8;
-+    ATISetOffscreen(pScreenPriv->screen);
-+
-+    return TRUE;
-+}
-+
-+static void
-+ATIDisable(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATICardInfo(pScreenPriv);
-+
-+    ATIUnmap(pScreenPriv->card, atic);
-+
-+    atic->backend_funcs.disable(pScreen);
-+}
-+
-+static void
-+ATIGetColors(ScreenPtr pScreen, int fb, int n, xColorItem * pdefs)
-+{
-+    KdScreenPriv(pScreen);
-+    ATICardInfo(pScreenPriv);
-+
-+    atic->backend_funcs.getColors(pScreen, fb, n, pdefs);
-+}
-+
-+static void
-+ATIPutColors(ScreenPtr pScreen, int fb, int n, xColorItem * pdefs)
-+{
-+    KdScreenPriv(pScreen);
-+    ATICardInfo(pScreenPriv);
-+
-+    atic->backend_funcs.putColors(pScreen, fb, n, pdefs);
-+}
-+
-+/* Compute log base 2 of val. */
-+int
-+ATILog2(int val)
-+{
-+    int bits;
-+
-+    for (bits = 0; val != 0; val >>= 1, ++bits);
-+    return bits - 1;
-+}
-+
-+
-+
-+KdCardFuncs ATIFuncs = {
-+    ATICardInit,                /* cardinit */
-+    ATIScreenInit,              /* scrinit */
-+    ATIInitScreen,              /* initScreen */
-+    ATIFinishInitScreen,        /* finishInitScreen */
-+    ATICreateResources,         /* createRes */
-+    ATIPreserve,                /* preserve */
-+    ATIEnable,                  /* enable */
-+    ATIDPMS,                    /* dpms */
-+    ATIDisable,                 /* disable */
-+    ATIRestore,                 /* restore */
-+    ATIScreenFini,              /* scrfini */
-+    ATICardFini,                /* cardfini */
-+
-+#define ATICursorInit 0
-+#define ATICursorEnable 0
-+#define ATICursorDisable 0
-+#define ATICursorFini 0
-+#define ATIRecolorCursor 0
-+    ATICursorInit,              /* initCursor */
-+    ATICursorEnable,            /* enableCursor */
-+    ATICursorDisable,           /* disableCursor */
-+    ATICursorFini,              /* finiCursor */
-+    ATIRecolorCursor,           /* recolorCursor */
-+
-+    ATIDrawInit,                /* initAccel */
-+    ATIDrawEnable,              /* enableAccel */
-+    ATIDrawDisable,             /* disableAccel */
-+    ATIDrawFini,                /* finiAccel */
-+
-+    ATIGetColors,               /* getColors */
-+    ATIPutColors,               /* putColors */
-+};
-Index: git/hw/kdrive/w100/ati_cursor.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati_cursor.c	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,93 @@
-+/*
-+ * Copyright � 2006 Alberto Mardegan <mardy@users.sourceforge.net>
-+ *
-+ * 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 Alberto Mardegan not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Alberto Mardegan makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ALBERTO MARDEGAN 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 "ati.h"
-+#include "cursorstr.h"
-+#include "ati_draw.h"
-+
-+static void
-+ATIMoveCursor(ScreenPtr pScreen, int x, int y)
-+{
-+}
-+
-+
-+static Bool
-+ATIRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
-+{
-+    return FALSE;
-+}
-+
-+
-+static Bool
-+ATIUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
-+{
-+    return TRUE;
-+}
-+
-+
-+static void
-+ATISetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
-+{
-+}
-+
-+
-+miPointerSpriteFuncRec ATIPointerSpriteFuncs = {
-+    ATIRealizeCursor,
-+    ATIUnrealizeCursor,
-+    ATISetCursor,
-+    ATIMoveCursor,
-+};
-+
-+
-+void
-+ATICursorEnable(ScreenPtr pScreen)
-+{
-+}
-+
-+
-+void
-+ATICursorDisable(ScreenPtr pScreen)
-+{
-+}
-+
-+
-+Bool
-+ATICursorInit(ScreenPtr pScreen)
-+{
-+    return FALSE;
-+}
-+
-+
-+void
-+ATIRecolorCursor(ScreenPtr pScreen, int ndef, xColorItem * pdef)
-+{
-+    return;
-+}
-+
-+
-+void
-+ATICursorFini(ScreenPtr pScreen)
-+{
-+}
-Index: git/hw/kdrive/w100/ati_dma.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati_dma.c	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,333 @@
-+/*
-+ * Copyright � 2006 Alberto Mardegan <mardy@users.sourceforge.net>
-+ *
-+ * 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 Alberto Mardegan not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Alberto Mardegan makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ALBERTO MARDEGAN 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.
-+ */
-+
-+#include <sys/time.h>
-+
-+#include "ati.h"
-+#include "w100_regs.h"
-+#include "w100_const.h"
-+#include "ati_dma.h"
-+#include "ati_draw.h"
-+
-+
-+#define DEBUG_FIFO 0
-+
-+extern CARD32 w100_microcode[][2];
-+
-+#if DEBUG_FIFO
-+static void
-+ATIDebugFifo(ATIScreenInfo * atis)
-+{
-+    ATICardInfo *atic = atis->atic;
-+    char *mmio = atic->reg_base;
-+
-+    ErrorF("mmCP_CSQ_CNTL: 0x%08x\n", MMIO_IN32(mmio, mmCP_CSQ_CNTL));
-+    ErrorF("mmCP_CSQ_STAT: 0x%08x\n", MMIO_IN32(mmio, mmCP_CSQ_STAT));
-+    ErrorF("mmRBBM_STATUS: 0x%08x\n", MMIO_IN32(mmio, mmRBBM_STATUS));
-+}
-+#endif
-+
-+static void
-+ATIUploadMicrocode(ATIScreenInfo * atis)
-+{
-+    ATICardInfo *atic = atis->atic;
-+    char *mmio = atic->reg_base;
-+    int i;
-+
-+    MMIO_OUT32(mmio, mmCP_ME_RAM_ADDR, 0);
-+    for (i = 0; i < 256; i++) {
-+        MMIO_OUT32(mmio, mmCP_ME_RAM_DATAH, w100_microcode[i][1]);
-+        MMIO_OUT32(mmio, mmCP_ME_RAM_DATAL, w100_microcode[i][0]);
-+    }
-+}
-+
-+/* Required when reading from video memory after acceleration to make sure all
-+ * data has been flushed to video memory from the pixel cache.
-+ */
-+static void
-+ATIFlushPixelCache(ATIScreenInfo * atis)
-+{
-+    ATICardInfo *atic = atis->atic;
-+    char *mmio = atic->reg_base;
-+    rbbm_status_u rs;
-+    TIMEOUT_LOCALS;
-+
-+    WHILE_NOT_TIMEOUT(.2) {
-+        rs.val = MMIO_IN32(mmio, mmRBBM_STATUS);
-+        if (!rs.f.gui_active)
-+            break;
-+    }
-+    if (TIMEDOUT())
-+        ErrorF("Timeout flushing pixel cache.\n");
-+}
-+
-+static void
-+ATIEngineReset(ATIScreenInfo * atis)
-+{
-+    ATICardInfo *atic = atis->atic;
-+    char *mmio = atic->reg_base;
-+    CARD32 sclk_cntl;
-+    sclk_cntl_u sc;
-+    rbbm_soft_reset_u rsr;
-+
-+#if DEBUG_FIFO
-+    ErrorF("Engine Reset!\n");
-+    ATIDebugFifo(atis);
-+#endif
-+
-+    ATIFlushPixelCache(atis);
-+
-+    sc.val = sclk_cntl = MMIO_IN32(mmio, mmSCLK_CNTL);
-+    sc.f.sclk_force_e2 = sc.f.sclk_force_e3 = sc.f.sclk_force_idct = 1;
-+    MMIO_OUT32(mmio, mmSCLK_CNTL, sc.val);
-+
-+    rsr.val = 0;
-+    rsr.f.soft_reset_e2 = 1;
-+    MMIO_OUT32(mmio, mmRBBM_SOFT_RESET, rsr.val);
-+    MMIO_OUT32(mmio, mmRBBM_SOFT_RESET, 0);
-+
-+    MMIO_OUT32(mmio, mmSCLK_CNTL, sclk_cntl);
-+}
-+
-+inline void
-+ATIWaitAvailMMIO(ATIScreenInfo * atis, int n)
-+{
-+    ATICardInfo *atic = atis->atic;
-+    char *mmio = atic->reg_base;
-+    rbbm_status_u rs;
-+    TIMEOUT_LOCALS;
-+
-+    if (atis->mmio_avail >= n) {
-+        atis->mmio_avail -= n;
-+        return;
-+    }
-+    WHILE_NOT_TIMEOUT(.2) {
-+        rs.val = MMIO_IN32(mmio, mmRBBM_STATUS);
-+        atis->mmio_avail = rs.f.cmdfifo_avail;
-+        if (atis->mmio_avail >= n)
-+            break;
-+        ErrorF("Available %d slots.\n", atis->mmio_avail);
-+    }
-+    if (TIMEDOUT()) {
-+        ErrorF("Timeout waiting for %d MMIO slots.\n", n);
-+        ATIEngineReset(atis);
-+        ATIDrawSetup(atis->screen->pScreen);
-+    }
-+    atis->mmio_avail -= n;
-+}
-+
-+
-+void
-+ATIWaitIdle(ATIScreenInfo * atis)
-+{
-+    ATICardInfo *atic = atis->atic;
-+    char *mmio = atic->reg_base;
-+    rbbm_status_u rs;
-+    TIMEOUT_LOCALS;
-+
-+    /* Empty the fifo */
-+    ATIWaitAvailMMIO(atis, 16);
-+
-+    WHILE_NOT_TIMEOUT(.2) {
-+        rs.val = MMIO_IN32(mmio, mmRBBM_STATUS);
-+        if (!rs.f.gui_active)
-+            break;
-+#if DEBUG_FIFO
-+        ATIDebugFifo(atis);
-+#endif
-+        /* don't know if this is needed, but it's in aticore */
-+        MMIO_IN32(mmio, mmCP_RB_RPTR);
-+    }
-+    if (TIMEDOUT()) {
-+        ErrorF("Timeout idling accelerator, resetting...\n");
-+        ATIEngineReset(atis);
-+        ATIDrawSetup(atis->screen->pScreen);
-+    }
-+
-+    ATIFlushPixelCache(atis);
-+
-+#if DEBUG_FIFO
-+    ErrorF("Idle?\n");
-+    ATIDebugFifo(atis);
-+#endif
-+}
-+
-+
-+static Bool
-+ATIDMAInit(ScreenPtr pScreen, Bool use_agp)
-+{
-+    KdScreenPriv(pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+    ATICardInfo(pScreenPriv);
-+    char *mmio = atic->reg_base;
-+    int dma_offset, rbsize = 10;
-+    wrap_start_dir_u wsd;
-+    wrap_buf_a_u wba;
-+    cp_rb_cntl_u rc;
-+    cp_csq_cntl_u cc;
-+    CARD32 mem_offset;
-+
-+    /* with rbsize = 10, DMA buffer will be of 0x2000 (8192) bytes */
-+    atis->ring_count = 1 << (rbsize + 1);
-+    atis->ring_mask = atis->ring_count - 1;
-+    atis->ring_len = atis->ring_count * 4;
-+    atis->dma_space = KdOffscreenAlloc(pScreen, atis->ring_len,
-+                                       16, TRUE, NULL, NULL);
-+    if (atis->dma_space == NULL)
-+        return FALSE;
-+
-+    wsd.val = MMIO_IN32(mmio, mmWRAP_START_DIR);
-+    atis->ring_addr =
-+        (CARD32 *) (atic->mem_base + (wsd.f.start_addr << 1));
-+    dma_offset = atis->dma_space->offset;
-+
-+    ATIUploadMicrocode(atis);
-+    ATIEngineReset(atis);
-+
-+    atis->ring_read = 0;
-+    atis->ring_write = 0;
-+    atis->ring_free = atis->ring_count;
-+
-+    mem_offset = atic->ext_mem_location + atis->dma_space->offset;
-+    MMIO_OUT32(mmio, mmCP_RB_BASE, mem_offset);
-+    MMIO_OUT32(mmio, mmCP_RB_WPTR, atis->ring_write);
-+    MMIO_OUT32(mmio, mmCP_RB_RPTR, atis->ring_read);
-+    MMIO_OUT32(mmio, mmCP_RB_RPTR_ADDR, 0);
-+
-+    wba.val = 0;
-+    wba.f.offset_addr_a = mem_offset;
-+    switch (rbsize) {
-+    case 9:
-+        wba.f.block_size_a = WB_BLOCK_SIZE_A_0;
-+        break;
-+    case 10:
-+        wba.f.block_size_a = WB_BLOCK_SIZE_A_1;
-+        break;
-+    case 11:
-+        wba.f.block_size_a = WB_BLOCK_SIZE_A_2;
-+        break;
-+    case 12:
-+        wba.f.block_size_a = WB_BLOCK_SIZE_A_3;
-+        break;
-+    case 13:
-+        wba.f.block_size_a = WB_BLOCK_SIZE_A_4;
-+        break;
-+    }
-+    MMIO_OUT32(mmio, mmWRAP_BUF_A, wba.val);
-+
-+    rc.val = 0;
-+    rc.f.rb_no_update = 1;
-+    rc.f.rb_bufsz = rbsize;
-+    MMIO_OUT32(mmio, mmCP_RB_CNTL, rc.val);
-+
-+    cc.val = 0;
-+    cc.f.csq_mode = CSQ_CNTL_MODE_FREERUN;
-+    MMIO_OUT32(mmio, mmCP_CSQ_CNTL, cc.val);
-+
-+    return TRUE;
-+}
-+
-+static Bool
-+ATIDMAFini(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+    ATICardInfo(pScreenPriv);
-+    char *mmio = atic->reg_base;
-+
-+    MMIO_OUT32(mmio, mmCP_CSQ_CNTL, 0);
-+
-+    ATIEngineReset(atis);
-+
-+    //KdOffscreenFree(pScreen, atis->dma_space);
-+
-+    return TRUE;
-+}
-+
-+void
-+ATIDMASetup(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+
-+    atis->using_dma = FALSE;
-+    atis->using_pio = FALSE;
-+    if (ATIDMAInit(pScreen, FALSE))
-+        atis->using_dma = TRUE;
-+
-+    if (atis->using_dma)
-+        ErrorF("Initialized DMA\n");
-+}
-+
-+void
-+ATIDMATeardown(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+
-+    ATIWaitIdle(atis);
-+
-+    if (atis->using_dma)
-+        ATIDMAFini(pScreen);
-+
-+    atis->using_pio = FALSE;
-+    atis->using_dma = FALSE;
-+}
-+
-+
-+CARD32 *
-+ATIRequestEntries(ATIScreenInfo * atis, int n)
-+{
-+    char *mmio = atis->atic->reg_base;
-+    CARD32 *ptr;
-+    TIMEOUT_LOCALS;
-+
-+    WHILE_NOT_TIMEOUT(1) {
-+        if (atis->ring_free > n) {
-+            ptr = atis->ring_addr + atis->ring_write;
-+            return ptr;
-+        }
-+        atis->ring_read = MMIO_IN32(mmio, mmCP_RB_RPTR);
-+        atis->ring_write = MMIO_IN32(mmio, mmCP_RB_WPTR);
-+
-+        if (atis->ring_read == atis->ring_write) {
-+            atis->ring_free = atis->ring_count;
-+        } else {
-+            atis->ring_free =
-+                (atis->ring_count +
-+                 atis->ring_read - atis->ring_write) & atis->ring_mask;
-+        }
-+    }
-+    if (TIMEDOUT())
-+        ErrorF("Timeout waiting for %d entries.\n", n);
-+    return NULL;
-+}
-+
-+void
-+ATISubmitEntries(ATIScreenInfo * atis, int n)
-+{
-+    char *mmio = atis->atic->reg_base;
-+    atis->ring_free -= n;
-+    atis->ring_write += n;
-+    atis->ring_write &= atis->ring_mask;
-+    MMIO_OUT32(mmio, mmCP_RB_WPTR, atis->ring_write);
-+}
-Index: git/hw/kdrive/w100/ati_dma.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati_dma.h	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,176 @@
-+/*
-+ * Copyright � 2004 Eric Anholt
-+ *
-+ * 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 Eric Anholt not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Eric Anholt makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ERIC ANHOLT 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.
-+ */
-+/* $Header: /cvs/xserver/xserver/hw/kdrive/ati/ati_dma.h,v 1.5 2005-01-27 05:25:57 anholt Exp $ */
-+
-+#ifndef _ATI_DMA_H_
-+#define _ATI_DMA_H_
-+
-+#define CCE_DEBUG 1
-+
-+/* CCE packet defines */
-+
-+#define ATI_CCE_PACKETTYPE_MASK			0xc0000000
-+#define ATI_CCE_PACKET0				0x00000000
-+#define ATI_CCE_PACKET0_COUNT_MASK		0x3fff0000
-+#define ATI_CCE_PACKET0_ONE_REG_WR		0x00008000
-+#define ATI_CCE_PACKET0_REG_MASK		0x000007ff
-+#define ATI_CCE_PACKET1				0x40000000
-+#define ATI_CCE_PACKET1_REG_1			0x000007ff
-+#define ATI_CCE_PACKET1_REG_2			0x003ff800
-+#define ATI_CCE_PACKET1_REG_2_SHIFT		10
-+#define ATI_CCE_PACKET2				0x80000000
-+#define ATI_CCE_PACKET3				0xc0000000
-+#define ATI_CCE_PACKET3_COUNT_MASK		0x3fff0000
-+#define ATI_CCE_PACKET3_IT_OPCODE_MASK		0x0000ff00
-+
-+
-+#if !CCE_DEBUG
-+#define DMA_PACKET0(reg, count)						\
-+	(ATI_CCE_PACKET0 | (((count) - 1) << 16) | ((reg) >> 2))
-+#else
-+#define DMA_PACKET0(reg, count)						\
-+	(__packet0count = (count), __reg = (reg),			\
-+	ATI_CCE_PACKET0 | (((count) - 1) << 16) | ((reg) >> 2))
-+#endif
-+#define DMA_PACKET1(reg1, reg2)						\
-+	(ATI_CCE_PACKET1 |						\
-+	(((reg2) >> 2) << ATI_CCE_PACKET1_REG_2_SHIFT) |  ((reg1) >> 2))
-+#define DMA_PACKET3(type, count)					\
-+	((type) | (((count) - 1) << 16))
-+
-+
-+
-+#ifdef USE_DMA
-+
-+#if !CCE_DEBUG
-+
-+#define RING_LOCALS	\
-+	CARD32 *__head; int __count
-+#define BEGIN_DMA(n) \
-+do {  \
-+    __head = ATIRequestEntries(atis, n);  \
-+	__count = 0;							\
-+} while (0)
-+#define END_DMA() do {							\
-+	ATISubmitEntries(atis, __count);    \
-+} while (0)
-+
-+#else /* CCE_DEBUG */
-+#define RING_LOCALS	\
-+	CARD32 *__head; int __count, __total, __reg, __packet0count
-+#define BEGIN_DMA(n) \
-+do {  \
-+    __head = ATIRequestEntries(atis, n);  \
-+	__count = 0;							\
-+	__total = n;							\
-+	__reg = 0;								\
-+	__packet0count = 0;								\
-+} while (0)
-+#define END_DMA() do {							\
-+	if (__count != __total)						\
-+		FatalError("count != total (%d vs %d) at %s:%d\n",	 \
-+		     __count, __total, __FILE__, __LINE__);		\
-+	ATISubmitEntries(atis, __count);    \
-+} while (0)
-+
-+#endif /* CCE_DEBUG */
-+
-+#define BEGIN_DMA_REG(n) BEGIN_DMA(n * 2)
-+#define END_DMA_REG() END_DMA()
-+
-+#define OUT_REG(reg, val)						\
-+do {									\
-+	OUT_RING(DMA_PACKET0(reg, 1));					\
-+	OUT_RING(val);							\
-+} while (0)
-+
-+
-+#else  /* USE_DMA */
-+
-+
-+#define RING_LOCALS	char *__mmio = atis->atic->reg_base
-+#define BEGIN_DMA_REG(n) \
-+do {  \
-+    ATIWaitAvailMMIO(atis, n); \
-+} while (0)
-+#define END_DMA_REG() do {} while (0)
-+#define OUT_REG(reg, val) MMIO_OUT32(__mmio, reg, val)
-+#endif  /* USE_DMA */
-+
-+
-+#define OUT_RING(val) do {						\
-+	__head[__count++] = (val);					\
-+} while (0)
-+
-+#define OUT_RING_REG(reg, val) do {					\
-+	if (__reg != reg)						\
-+		FatalError("unexpected reg (0x%x vs 0x%x) at %s:%d\n",	\
-+		    reg, __reg, __FILE__, __LINE__);			\
-+	if (__packet0count-- <= 0)					\
-+		FatalError("overrun of packet0 at %s:%d\n",		\
-+		    __FILE__, __LINE__);				\
-+	__head[__count++] = (val);					\
-+	__reg += 4;							\
-+} while (0)
-+
-+#define OUT_RING_F(x) OUT_RING(GET_FLOAT_BITS(x))
-+
-+#define TIMEOUT_LOCALS struct timeval _target, _curtime
-+
-+static inline Bool
-+tv_le(struct timeval *tv1, struct timeval *tv2)
-+{
-+	if (tv1->tv_sec < tv2->tv_sec ||
-+	    (tv1->tv_sec == tv2->tv_sec && tv1->tv_usec < tv2->tv_usec))
-+		return TRUE;
-+	else
-+		return FALSE;
-+}
-+
-+#define WHILE_NOT_TIMEOUT(_timeout)					\
-+	gettimeofday(&_target, NULL);					\
-+	_target.tv_usec += ((_timeout) * 1000000);			\
-+	_target.tv_sec += _target.tv_usec / 1000000;			\
-+	_target.tv_usec = _target.tv_usec % 1000000;			\
-+	while (gettimeofday(&_curtime, NULL), tv_le(&_curtime, &_target))
-+
-+#define TIMEDOUT()	(!tv_le(&_curtime, &_target))
-+
-+
-+void
-+ATIFlushIndirect(ATIScreenInfo *atis, Bool discard);
-+
-+void
-+ATIDMASetup(ScreenPtr pScreen);
-+
-+void
-+ATIDMATeardown(ScreenPtr pScreen);
-+
-+CARD32 *
-+ATIRequestEntries(ATIScreenInfo *atis, int n);
-+
-+void
-+ATISubmitEntries(ATIScreenInfo *atis, int n);
-+
-+inline void
-+ATIWaitAvailMMIO(ATIScreenInfo *atis, int n);
-+#endif /* _ATI_DMA_H_ */
-Index: git/hw/kdrive/w100/ati_draw.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati_draw.c	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,477 @@
-+/*
-+ * Copyright � 2006 Alberto Mardegan <mardy@users.sourceforge.net>
-+ *
-+ * 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 Alberto Mardegan not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Alberto Mardegan makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ALBERTO MARDEGAN 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.
-+ */
-+
-+#define USE_DMA
-+#define DRAW_USING_PACKET3
-+
-+#ifdef HAVE_CONFIG_H
-+#include <kdrive-config.h>
-+#endif
-+#include "ati.h"
-+#include "w100_regs.h"
-+#include "w100_const.h"
-+#include "ati_dma.h"
-+#include "ati_draw.h"
-+#include "kaa.h"
-+
-+
-+CARD8 ATISolidRop[16] = {
-+                                /* GXclear      */ 0x00,
-+                                /* 0 */
-+                                /* GXand        */ 0xa0,
-+                                /* src AND dst */
-+                                /* GXandReverse */ 0x50,
-+                                /* src AND NOT dst */
-+                                /* GXcopy       */ 0xf0,
-+                                /* src */
-+                                /* GXandInverted */ 0x0a,
-+                                /* NOT src AND dst */
-+                                /* GXnoop       */ 0xaa,
-+                                /* dst */
-+                                /* GXxor        */ 0x5a,
-+                                /* src XOR dst */
-+                                /* GXor         */ 0xfa,
-+                                /* src OR dst */
-+                                /* GXnor        */ 0x05,
-+                                /* NOT src AND NOT dst */
-+                                /* GXequiv      */ 0xa5,
-+                                /* NOT src XOR dst */
-+                                /* GXinvert     */ 0x55,
-+                                /* NOT dst */
-+                                /* GXorReverse  */ 0xf5,
-+                                /* src OR NOT dst */
-+                                /* GXcopyInverted */ 0x0f,
-+                                /* NOT src */
-+                                /* GXorInverted */ 0xaf,
-+                                /* NOT src OR dst */
-+                                /* GXnand       */ 0x5f,
-+                                /* NOT src OR NOT dst */
-+                                /* GXset        */ 0xff,
-+                                /* 1 */
-+};
-+
-+CARD8 ATIBltRop[16] = {
-+                                /* GXclear      */ 0x00,
-+                                /* 0 */
-+                                /* GXand        */ 0x88,
-+                                /* src AND dst */
-+                                /* GXandReverse */ 0x44,
-+                                /* src AND NOT dst */
-+                                /* GXcopy       */ 0xcc,
-+                                /* src */
-+                                /* GXandInverted */ 0x22,
-+                                /* NOT src AND dst */
-+                                /* GXnoop       */ 0xaa,
-+                                /* dst */
-+                                /* GXxor        */ 0x66,
-+                                /* src XOR dst */
-+                                /* GXor         */ 0xee,
-+                                /* src OR dst */
-+                                /* GXnor        */ 0x11,
-+                                /* NOT src AND NOT dst */
-+                                /* GXequiv      */ 0x99,
-+                                /* NOT src XOR dst */
-+                                /* GXinvert     */ 0x55,
-+                                /* NOT dst */
-+                                /* GXorReverse  */ 0xdd,
-+                                /* src OR NOT dst */
-+                                /* GXcopyInverted */ 0x33,
-+                                /* NOT src */
-+                                /* GXorInverted */ 0xbb,
-+                                /* NOT src OR dst */
-+                                /* GXnand       */ 0x77,
-+                                /* NOT src OR NOT dst */
-+                                /* GXset        */ 0xff,
-+                                /* 1 */
-+};
-+
-+static int copydx, copydy;
-+static ATIScreenInfo *accel_atis;
-+static char *accel_mmio;
-+
-+
-+void
-+ATIDrawSetup(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+    default_sc_bottom_right_u dsbr;
-+    RING_LOCALS;
-+
-+    dsbr.val = 0;
-+    dsbr.f.default_sc_right = dsbr.f.default_sc_bottom = W100_MAXINT;
-+
-+    BEGIN_DMA_REG(2);
-+    OUT_REG(mmDEFAULT_SC_BOTTOM_RIGHT, dsbr.val);
-+    OUT_REG(mmSRC_SC_BOTTOM_RIGHT, dsbr.val);
-+    END_DMA_REG();
-+}
-+
-+static void
-+ATIWaitMarker(ScreenPtr pScreen, int marker)
-+{
-+    KdScreenPriv(pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+
-+    ENTER_DRAW(0);
-+    ATIWaitIdle(atis);
-+    LEAVE_DRAW(0);
-+}
-+
-+
-+#if ATI_TRACE_DRAW
-+void
-+ATIEnterDraw(PixmapPtr pPix, const char *function)
-+{
-+    if (pPix != NULL) {
-+        KdScreenPriv(pPix->drawable.pScreen);
-+        CARD32 offset;
-+
-+        offset = ((CARD8 *) pPix->devPrivate.ptr -
-+                  pScreenPriv->screen->memory_base);
-+
-+        ErrorF("Enter %s 0x%x (%dx%dx%d/%d)\n", function, offset,
-+               pPix->drawable.width, pPix->drawable.height,
-+               pPix->drawable.depth, pPix->drawable.bitsPerPixel);
-+    } else
-+        ErrorF("Enter %s\n", function);
-+}
-+
-+void
-+ATILeaveDraw(PixmapPtr pPix, const char *function)
-+{
-+    if (pPix != NULL) {
-+        KdScreenPriv(pPix->drawable.pScreen);
-+        CARD32 offset;
-+
-+        offset = ((CARD8 *) pPix->devPrivate.ptr -
-+                  pScreenPriv->screen->memory_base);
-+
-+        ErrorF("Leave %s 0x%x\n", function, offset);
-+    } else
-+        ErrorF("Leave %s\n", function);
-+}
-+#endif
-+
-+/* Assumes that depth 15 and 16 can be used as depth 16, which is okay since we
-+ * require src and dest datatypes to be equal.
-+ */
-+static Bool
-+ATIGetDatatypeBpp(int bpp, CARD32 * type)
-+{
-+    switch (bpp) {
-+    case 8:
-+        *type = DATATYPE_8BPP;
-+        return TRUE;
-+    case 16:
-+        *type = DATATYPE_ARGB1555;
-+        return TRUE;
-+    default:
-+        ATI_FALLBACK(("Unsupported bpp: %d\n", bpp));
-+        return FALSE;
-+    }
-+}
-+
-+
-+Bool
-+ATIGetPixmapOffsetPitch(PixmapPtr pPix, CARD32 * pitch, CARD32 * offset)
-+{
-+    KdScreenPriv(pPix->drawable.pScreen);
-+    ATICardInfo(pScreenPriv);
-+
-+    /* XXX this only works for surfaces allocated in external memory */
-+    *offset = ((CARD8 *) pPix->devPrivate.ptr -
-+               pScreenPriv->screen->memory_base) + atic->ext_mem_location;
-+    *pitch = pPix->devKind >> 1;
-+
-+    return TRUE;
-+}
-+
-+
-+static Bool
-+ATIPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
-+{
-+    KdScreenPriv(pPix->drawable.pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+    ATICardInfo(pScreenPriv);
-+    CARD32 datatype, dst_pitch, dst_offset;
-+    dp_gui_master_cntl_u gmc;
-+    dp_cntl_u dp_cntl;
-+    RING_LOCALS;
-+
-+    accel_atis = atis;
-+    accel_mmio = atic->reg_base;
-+
-+    if (!ATIGetDatatypeBpp(pPix->drawable.bitsPerPixel, &datatype))
-+        return FALSE;
-+    if (!ATIGetPixmapOffsetPitch(pPix, &dst_pitch, &dst_offset))
-+        return FALSE;
-+
-+    ENTER_DRAW(pPix);
-+
-+    gmc.val = 0;
-+    gmc.f.gmc_dst_pitch_offset_cntl = 1;
-+    gmc.f.gmc_dst_clipping = 1;
-+    gmc.f.gmc_brush_datatype = BRUSH_SOLIDCOLOR;
-+    gmc.f.gmc_dst_datatype = datatype;
-+    gmc.f.gmc_src_datatype = datatype;
-+    gmc.f.gmc_byte_pix_order = 1;
-+    gmc.f.gmc_rop3 = ATISolidRop[alu];
-+    gmc.f.gmc_dp_src_source = SOURCE_MEM_RECTANGULAR;
-+    gmc.f.gmc_clr_cmp_fcn_dis = 1;
-+    gmc.f.gmc_dp_op = OP_ROP;
-+
-+    dp_cntl.val = 0;
-+    dp_cntl.f.dst_x_dir = 1;
-+    dp_cntl.f.dst_y_dir = 1;
-+
-+    BEGIN_DMA_REG(6);
-+    OUT_REG(mmDST_PITCH, dst_pitch);
-+    OUT_REG(mmDST_OFFSET, dst_offset);
-+    OUT_REG(mmDP_GUI_MASTER_CNTL, gmc.val);
-+    OUT_REG(mmDP_BRUSH_FRGD_CLR, fg);
-+    OUT_REG(mmDP_WRITE_MSK, pm);
-+    OUT_REG(mmDP_CNTL, dp_cntl.val);
-+    END_DMA_REG();
-+
-+    LEAVE_DRAW(pPix);
-+    return TRUE;
-+}
-+
-+static void
-+ATISolid(int x1, int y1, int x2, int y2)
-+{
-+    ENTER_DRAW(0);
-+    ATIScreenInfo *atis = accel_atis;
-+    RING_LOCALS;
-+
-+#ifdef DRAW_USING_PACKET3
-+    BEGIN_DMA(3);
-+    OUT_RING(DMA_PACKET3(W100_CCE_PACKET3_PAINT_MULTI, 2));
-+    OUT_RING((x1 << 16) | y1);
-+    OUT_RING(((x2 - x1) << 16) | (y2 - y1));
-+    END_DMA();
-+#elif defined DRAW_USING_PACKET0
-+    BEGIN_DMA(3);
-+    OUT_RING(DMA_PACKET0(mmDST_Y_X, 2));
-+    OUT_RING_REG(mmDST_Y_X, (y1 << 16) | x1);
-+    OUT_RING_REG(mmDST_HEIGHT_WIDTH, ((y2 - y1) << 16) | (x2 - x1));
-+    END_DMA();
-+#else
-+    BEGIN_DMA_REG(2);
-+    OUT_REG(mmDST_Y_X, (y1 << 16) | x1);
-+    OUT_REG(mmDST_HEIGHT_WIDTH, ((y2 - y1) << 16) | (x2 - x1));
-+    END_DMA_REG();
-+#endif
-+    LEAVE_DRAW(0);
-+}
-+
-+
-+static void
-+ATIDoneSolid(void)
-+{
-+    ENTER_DRAW(0);
-+    LEAVE_DRAW(0);
-+}
-+
-+
-+static Bool
-+ATIPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
-+               Pixel pm)
-+{
-+    KdScreenPriv(pDst->drawable.pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+    ATICardInfo(pScreenPriv);
-+    CARD32 datatype, src_pitch, src_offset, dst_pitch, dst_offset;
-+    dp_gui_master_cntl_u gmc;
-+    dp_cntl_u dp_cntl;
-+    dp_datatype_u dpdt;
-+    RING_LOCALS;
-+
-+    accel_mmio = atic->reg_base;
-+    copydx = dx;
-+    copydy = dy;
-+    accel_atis = atis;
-+
-+    if (!ATIGetDatatypeBpp(pDst->drawable.bitsPerPixel, &datatype))
-+        return FALSE;
-+    if (!ATIGetPixmapOffsetPitch(pSrc, &src_pitch, &src_offset))
-+        return FALSE;
-+    if (!ATIGetPixmapOffsetPitch(pDst, &dst_pitch, &dst_offset))
-+        return FALSE;
-+
-+    ENTER_DRAW(pDst);
-+
-+    gmc.val = 0;
-+    gmc.f.gmc_src_pitch_offset_cntl = 1;
-+    gmc.f.gmc_dst_pitch_offset_cntl = 1;
-+    gmc.f.gmc_src_clipping = 1;
-+    gmc.f.gmc_dst_clipping = 1;
-+    gmc.f.gmc_brush_datatype = BRUSH_NONE;
-+    gmc.f.gmc_dst_datatype = datatype;
-+    gmc.f.gmc_src_datatype = datatype;
-+    gmc.f.gmc_byte_pix_order = 1;
-+    gmc.f.gmc_rop3 = ATIBltRop[alu];
-+    gmc.f.gmc_dp_src_source = SOURCE_MEM_RECTANGULAR;
-+    gmc.f.gmc_clr_cmp_fcn_dis = 1;
-+    gmc.f.gmc_dp_op = OP_ROP;
-+
-+    dp_cntl.val = 0;
-+    if (dx >= 0)
-+        dp_cntl.f.dst_x_dir = 1;
-+    if (dy >= 0)
-+        dp_cntl.f.dst_y_dir = 1;
-+
-+    dpdt.val = 0;
-+    dpdt.f.dp_dst_datatype = datatype;
-+    dpdt.f.dp_src_datatype = datatype;
-+    dpdt.f.dp_byte_pix_order = 1;
-+
-+    BEGIN_DMA_REG(8);
-+    OUT_REG(mmSRC_PITCH, src_pitch);
-+    OUT_REG(mmSRC_OFFSET, src_offset);
-+    OUT_REG(mmDST_PITCH, dst_pitch);
-+    OUT_REG(mmDST_OFFSET, dst_offset);
-+    OUT_REG(mmDP_GUI_MASTER_CNTL, gmc.val);
-+    OUT_REG(mmDP_WRITE_MSK, pm);
-+    OUT_REG(mmDP_CNTL, dp_cntl.val);
-+    OUT_REG(mmDP_DATATYPE, dpdt.val);
-+    END_DMA_REG();
-+
-+    LEAVE_DRAW(pDst);
-+    return TRUE;
-+}
-+
-+static void
-+ATICopy(int srcX, int srcY, int dstX, int dstY, int w, int h)
-+{
-+    ATIScreenInfo *atis = accel_atis;
-+    RING_LOCALS;
-+
-+    ENTER_DRAW(0);
-+#ifndef DRAW_USING_PACKET3
-+    if (copydx < 0) {
-+        srcX += w - 1;
-+        dstX += w - 1;
-+    }
-+    if (copydy < 0) {
-+        srcY += h - 1;
-+        dstY += h - 1;
-+    }
-+#endif
-+
-+#ifdef DRAW_USING_PACKET3
-+    BEGIN_DMA(4);
-+    OUT_RING(DMA_PACKET3(W100_CCE_PACKET3_BITBLT_MULTI, 3));
-+    OUT_RING((srcX << 16) | srcY);
-+    OUT_RING((dstX << 16) | dstY);
-+    OUT_RING((w << 16) | h);
-+    END_DMA();
-+#elif defined DRAW_USING_PACKET0
-+    BEGIN_DMA(4);
-+    OUT_RING(DMA_PACKET0(mmSRC_Y_X, 3));
-+    OUT_RING_REG(mmSRC_Y_X, (srcY << 16) | srcX);
-+    OUT_RING_REG(mmDST_Y_X, (dstY << 16) | dstX);
-+    OUT_RING_REG(mmDST_HEIGHT_WIDTH, (h << 16) | w);
-+    END_DMA();
-+#else
-+    BEGIN_DMA_REG(3);
-+    OUT_REG(mmSRC_Y_X, (srcY << 16) | srcX);
-+    OUT_REG(mmDST_Y_X, (dstY << 16) | dstX);
-+    OUT_REG(mmDST_HEIGHT_WIDTH, (h << 16) | w);
-+    END_DMA_REG();
-+#endif
-+    LEAVE_DRAW(0);
-+}
-+
-+
-+static void
-+ATIDoneCopy(void)
-+{
-+    ENTER_DRAW(0);
-+    LEAVE_DRAW(0);
-+}
-+
-+
-+Bool
-+ATIDrawInit(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+
-+    ErrorF("Screen: %d/%d depth/bpp\n", pScreenPriv->screen->fb[0].depth,
-+           pScreenPriv->screen->fb[0].bitsPerPixel);
-+
-+    memset(&atis->kaa, 0, sizeof(KaaScreenInfoRec));
-+    atis->kaa.waitMarker = ATIWaitMarker;
-+    atis->kaa.PrepareSolid = ATIPrepareSolid;
-+    atis->kaa.Solid = ATISolid;
-+    atis->kaa.DoneSolid = ATIDoneSolid;
-+    atis->kaa.PrepareCopy = ATIPrepareCopy;
-+    atis->kaa.Copy = ATICopy;
-+    atis->kaa.DoneCopy = ATIDoneCopy;
-+    /* XXX if this flag isn't specified, Kdrive crashes in kaaPixmapUseMemory
-+     * or kaaPixmapUseScreen. But this is probably caused by some bug in this
-+     * driver...  */
-+    atis->kaa.flags |= KAA_OFFSCREEN_PIXMAPS;
-+    if (!kaaDrawInit(pScreen, &atis->kaa))
-+        return FALSE;
-+
-+    return TRUE;
-+}
-+
-+
-+void
-+ATIDrawEnable(ScreenPtr pScreen)
-+{
-+    KdScreenPriv(pScreen);
-+    ATIScreenInfo(pScreenPriv);
-+
-+    ATIDMASetup(pScreen);
-+    ATIDrawSetup(pScreen);
-+
-+    atis->scratch_area = NULL;
-+    atis->kaa.PrepareBlend = NULL;
-+    atis->kaa.Blend = NULL;
-+    atis->kaa.DoneBlend = NULL;
-+    atis->kaa.CheckComposite = NULL;
-+    atis->kaa.PrepareComposite = NULL;
-+    atis->kaa.Composite = NULL;
-+    atis->kaa.DoneComposite = NULL;
-+    atis->kaa.UploadToScreen = NULL;
-+    atis->kaa.UploadToScratch = NULL;
-+
-+
-+    kaaMarkSync(pScreen);
-+}
-+
-+void
-+ATIDrawDisable(ScreenPtr pScreen)
-+{
-+    ATIDMATeardown(pScreen);
-+}
-+
-+void
-+ATIDrawFini(ScreenPtr pScreen)
-+{
-+    kaaDrawFini(pScreen);
-+}
-Index: git/hw/kdrive/w100/ati_draw.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati_draw.h	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,107 @@
-+/*
-+ * Copyright � 2004 Eric Anholt
-+ *
-+ * 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 Eric Anholt not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Eric Anholt makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ERIC ANHOLT 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.
-+ */
-+/* $Header: /cvs/xserver/xserver/hw/kdrive/ati/ati_draw.h,v 1.9 2005-02-21 03:44:10 anholt Exp $ */
-+
-+#ifndef _ATI_DRAW_H_
-+#define _ATI_DRAW_H_
-+
-+Bool ATIGetOffsetPitch(ATIScreenInfo *atis, int bpp, CARD32 *pitch_offset,
-+    int offset, int pitch);
-+Bool ATIGetPixmapOffsetPitch(PixmapPtr pPix, CARD32 *pitch, CARD32 *offset);
-+
-+Bool R128CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
-+    PicturePtr pDstPicture);
-+Bool R128PrepareComposite(int op, PicturePtr pSrcPicture,
-+    PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc,
-+    PixmapPtr pMask, PixmapPtr pDst);
-+void R128Composite(int srcX, int srcY, int maskX, int maskY, int dstX, int dstY,
-+    int w, int h);
-+void R128DoneComposite(void);
-+
-+Bool R128PrepareTrapezoids(PicturePtr pDstPicture, PixmapPtr pDst);
-+void R128Trapezoids(KaaTrapezoid *traps, int ntraps);
-+void R128DoneTrapezoids(void);
-+
-+Bool R100CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
-+    PicturePtr pDstPicture);
-+Bool R100PrepareComposite(int op, PicturePtr pSrcPicture,
-+    PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc,
-+    PixmapPtr pMask, PixmapPtr pDst);
-+Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
-+    PicturePtr pDstPicture);
-+Bool R200PrepareComposite(int op, PicturePtr pSrcPicture,
-+    PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc,
-+    PixmapPtr pMask, PixmapPtr pDst);
-+void RadeonComposite(int srcX, int srcY, int maskX, int maskY, int dstX,
-+    int dstY, int w, int h);
-+void RadeonDoneComposite(void);
-+
-+Bool RadeonPrepareTrapezoids(PicturePtr pDstPicture, PixmapPtr pDst);
-+void RadeonTrapezoids(KaaTrapezoid *traps, int ntraps);
-+void RadeonDoneTrapezoids(void);
-+
-+void RadeonSwitchTo2D(ATIScreenInfo *atis);
-+void RadeonSwitchTo3D(ATIScreenInfo *atis);
-+void ATIWaitIdle(ATIScreenInfo *atis);
-+
-+#define ATI_TRACE_FALL 0
-+#define ATI_TRACE_DRAW 1
-+
-+#if ATI_TRACE_FALL
-+#define ATI_FALLBACK(x)			\
-+do {					\
-+	ErrorF("%s: ", __FUNCTION__);	\
-+	ErrorF x;			\
-+	return FALSE;			\
-+} while (0)
-+#else
-+#define ATI_FALLBACK(x) return FALSE
-+#endif
-+
-+#if ATI_TRACE_DRAW
-+#define ENTER_DRAW(pix) ATIEnterDraw(pix, __FUNCTION__)
-+#define LEAVE_DRAW(pix) ATILeaveDraw(pix, __FUNCTION__)
-+
-+void
-+ATIEnterDraw (PixmapPtr pPixmap, const char *function);
-+
-+void
-+ATILeaveDraw (PixmapPtr pPixmap, const char *function);
-+#else /* ATI_TRACE */
-+#define ENTER_DRAW(pix)
-+#define LEAVE_DRAW(pix)
-+#endif /* !ATI_TRACE */
-+
-+#ifndef USE_DMA
-+/* if DMA is not going to be used, drawing using PACKET3 or PACKET0 won't
-+ * be possible */
-+#ifdef DRAW_USING_PACKET3
-+#undef DRAW_USING_PACKET3
-+#endif
-+
-+#ifdef DRAW_USING_PACKET0
-+#undef DRAW_USING_PACKET0
-+#endif
-+
-+#endif /* USE_DMA */
-+
-+#endif /* _ATI_DRAW_H_ */
-Index: git/hw/kdrive/w100/ati.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati.h	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,256 @@
-+/*
-+ * $Id: ati.h,v 1.18 2005-06-10 02:14:44 anholt Exp $
-+ *
-+ * Copyright � 2003 Eric Anholt
-+ *
-+ * 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 Eric Anholt not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Eric Anholt makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ERIC ANHOLT 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.
-+ */
-+/* $Header: /cvs/xserver/xserver/hw/kdrive/ati/ati.h,v 1.18 2005-06-10 02:14:44 anholt Exp $ */
-+
-+#ifndef _ATI_H_
-+#define _ATI_H_
-+
-+#ifdef HAVE_CONFIG_H
-+#include <kdrive-config.h>
-+#endif
-+
-+#ifdef KDRIVEFBDEV
-+#include <fbdev.h>
-+#endif
-+#ifdef KDRIVEVESA
-+#include <vesa.h>
-+#endif
-+
-+#include "kxv.h"
-+
-+
-+#define ATI_MEM_BASE(c)    (0x08000000)
-+#define ATI_MEM_SIZE(c)    (0x01000000)
-+#define ATI_REG_BASE(c)		(ATI_MEM_BASE(c) + 0x10000) /* the 0x08000000 must be obtained from /proc/iomem, the 0x10000 from ReadCfgReg(cfgREG_BASE) << 16) & 0xff0000 */
-+#define ATI_REG_SIZE(c)		(0x2000)
-+
-+#ifdef __powerpc__
-+
-+static __inline__ void
-+MMIO_OUT32(__volatile__ void *base, const unsigned long offset,
-+	   const unsigned int val)
-+{
-+	__asm__ __volatile__(
-+			"stwbrx %1,%2,%3\n\t"
-+			"eieio"
-+			: "=m" (*((volatile unsigned char *)base+offset))
-+			: "r" (val), "b" (base), "r" (offset));
-+}
-+
-+static __inline__ CARD32
-+MMIO_IN32(__volatile__ void *base, const unsigned long offset)
-+{
-+	register unsigned int val;
-+	__asm__ __volatile__(
-+			"lwbrx %0,%1,%2\n\t"
-+			"eieio"
-+			: "=r" (val)
-+			: "b" (base), "r" (offset),
-+			"m" (*((volatile unsigned char *)base+offset)));
-+	return val;
-+}
-+
-+#else
-+
-+#define MMIO_OUT32(mmio, a, v)		(*(VOL32 *)((mmio) + (a)) = (v))
-+#define MMIO_IN32(mmio, a)		(*(VOL32 *)((mmio) + (a)))
-+
-+#endif
-+
-+#define MMIO_OUT8(mmio, a, v)		(*(VOL8 *)((mmio) + (a)) = (v))
-+#define MMIO_IN8(mmio, a, v)		(*(VOL8 *)((mmio) + (a)))
-+
-+
-+typedef volatile CARD8	VOL8;
-+typedef volatile CARD16	VOL16;
-+typedef volatile CARD32	VOL32;
-+
-+struct pci_id_entry {
-+	CARD16 vendor;
-+	CARD16 device;
-+	CARD8 caps;
-+	char *name;
-+};
-+
-+struct backend_funcs {
-+	void    (*cardfini)(KdCardInfo *);
-+	void    (*scrfini)(KdScreenInfo *);
-+	Bool    (*initScreen)(ScreenPtr);
-+	Bool    (*finishInitScreen)(ScreenPtr pScreen);
-+	Bool	(*createRes)(ScreenPtr);
-+	void    (*preserve)(KdCardInfo *);
-+	void    (*restore)(KdCardInfo *);
-+	Bool    (*dpms)(ScreenPtr, int);
-+	Bool    (*enable)(ScreenPtr);
-+	void    (*disable)(ScreenPtr);
-+	void    (*getColors)(ScreenPtr, int, int, xColorItem *);
-+	void    (*putColors)(ScreenPtr, int, int, xColorItem *);
-+#ifdef RANDR
-+	Bool	(*randrSetConfig) (ScreenPtr, Rotation, int, RRScreenSizePtr);
-+#endif
-+};
-+
-+typedef struct _ATICardInfo {
-+	union {
-+#ifdef KDRIVEFBDEV
-+		FbdevPriv fbdev;
-+#endif
-+#ifdef KDRIVEVESA
-+		VesaCardPrivRec vesa;
-+#endif
-+	} backend_priv;
-+	struct backend_funcs backend_funcs;
-+
-+	struct pci_id_entry *pci_id;
-+	CARD8 *mem_base;
-+	CARD8 *reg_base;
-+    CARD32  fb_location;
-+    CARD32  ext_mem_location;
-+	Bool use_fbdev, use_vesa;
-+} ATICardInfo;
-+
-+#define getATICardInfo(kd)	((ATICardInfo *) ((kd)->card->driver))
-+#define ATICardInfo(kd)		ATICardInfo *atic = getATICardInfo(kd)
-+
-+typedef struct _ATICursor {
-+	int		width, height;
-+	int		xhot, yhot;
-+	
-+	Bool		has_cursor;
-+	CursorPtr	pCursor;
-+	Pixel		source, mask;
-+	KdOffscreenArea *area;
-+} ATICursor;
-+
-+typedef struct _ATIPortPriv {
-+	int brightness;
-+	int saturation;
-+	RegionRec clip;
-+	CARD32 size;
-+	KdOffscreenArea *off_screen;
-+	DrawablePtr pDraw;
-+	PixmapPtr pPixmap;
-+
-+	CARD32 src_offset;
-+	CARD32 src_pitch;
-+	CARD8 *src_addr;
-+
-+	int id;
-+	int src_x1, src_y1, src_x2, src_y2;
-+	int dst_x1, dst_y1, dst_x2, dst_y2;
-+	int src_w, src_h, dst_w, dst_h;
-+} ATIPortPrivRec, *ATIPortPrivPtr;
-+
-+typedef struct _ATIScreenInfo {
-+	union {
-+#ifdef KDRIVEFBDEV
-+		FbdevScrPriv fbdev;
-+#endif
-+#ifdef KDRIVEVESA
-+		VesaScreenPrivRec vesa;
-+#endif
-+	} backend_priv;
-+	KaaScreenInfoRec kaa;
-+
-+	ATICardInfo *atic;
-+	KdScreenInfo *screen;
-+
-+	int		scratch_offset;
-+	int		scratch_next;
-+	KdOffscreenArea *scratch_area;
-+
-+	ATICursor	cursor;
-+
-+	KdVideoAdaptorPtr pAdaptor;
-+	int		num_texture_ports;
-+
-+	Bool		using_pio;	/* If we use decode DMA packets to MMIO. */
-+	Bool		using_dma;	/* If we use non-DRI DMA to submit packets. */
-+
-+	KdOffscreenArea *dma_space;	/* For "DMA" from framebuffer. */
-+	CARD32		*ring_addr;	/* Beginning of ring buffer. */
-+	int		ring_write;	/* Index of write ptr in ring. */
-+	int		ring_read;	/* Index of read ptr in ring. */
-+	int		ring_len;
-+	int		ring_mask;
-+	int		ring_count;
-+	int		ring_free;
-+
-+
-+	int		mmio_avail;
-+} ATIScreenInfo;
-+
-+#define getATIScreenInfo(kd)	((ATIScreenInfo *) ((kd)->screen->driver))
-+#define ATIScreenInfo(kd)	ATIScreenInfo *atis = getATIScreenInfo(kd)
-+
-+typedef union { float f; CARD32 i; } fi_type;
-+
-+
-+/* ati.c */
-+Bool
-+ATIMap(KdCardInfo *card, ATICardInfo *atic);
-+
-+void
-+ATIUnmap(KdCardInfo *card, ATICardInfo *atic);
-+
-+/* ati_draw.c */
-+void
-+ATIDrawSetup(ScreenPtr pScreen);
-+
-+Bool
-+ATIDrawInit(ScreenPtr pScreen);
-+
-+void
-+ATIDrawEnable(ScreenPtr pScreen);
-+
-+void
-+ATIDrawDisable(ScreenPtr pScreen);
-+
-+void
-+ATIDrawFini(ScreenPtr pScreen);
-+
-+
-+/* ati_cursor.c */
-+Bool
-+ATICursorInit(ScreenPtr pScreen);
-+
-+void
-+ATICursorEnable(ScreenPtr pScreen);
-+
-+void
-+ATICursorDisable(ScreenPtr pScreen);
-+
-+void
-+ATICursorFini(ScreenPtr pScreen);
-+
-+void
-+ATIRecolorCursor(ScreenPtr pScreen, int ndef, xColorItem *pdef);
-+
-+int
-+ATILog2(int val);
-+
-+
-+extern KdCardFuncs ATIFuncs;
-+
-+#endif /* _ATI_H_ */
-Index: git/hw/kdrive/w100/ati_microcode.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati_microcode.c	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,412 @@
-+/*
-+ * Copyright © 2006 Alberto Mardegan <mardy@users.sourceforge.net>
-+ *
-+ * 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 Alberto Mardegan not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Alberto Mardegan makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ALBERTO MARDEGAN 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.
-+ */
-+
-+/* CCE microcode (from ATI) */
-+
-+#include "ati.h"
-+
-+
-+CARD32 w100_microcode[][2] = {
-+    {0x21007000, 0x00000000}
-+    ,
-+    {0x20007000, 0x00000000}
-+    ,
-+    {0x00000098, 0x00000004}
-+    ,
-+    {0x0000009c, 0x00000004}
-+    ,
-+    {0x66544a49, 0x00000000}
-+    ,
-+    {0x49494174, 0x00000000}
-+    ,
-+    {0x54517d83, 0x00000000}
-+    ,
-+    {0x498d8b64, 0x00000000}
-+    ,
-+    {0x49494949, 0x00000000}
-+    ,
-+    {0x49b6493c, 0x00000000}
-+    ,
-+    {0x49494949, 0x00000000}
-+    ,
-+    {0x49494949, 0x00000000}
-+    ,
-+    {0x49490d10, 0x00000000}
-+    ,
-+    {0x000f0000, 0x00000016}
-+    ,
-+    {0x30292027, 0x00000000}
-+    ,
-+    {0x00000012, 0x00000004}
-+    ,
-+    {0x000f0000, 0x00000016}
-+    ,
-+    {0x30292427, 0x00000000}
-+    ,
-+    {0x0000730f, 0x00000002}
-+    ,                           /* mmIDCT_CONTROL */
-+    {0x00061000, 0x00000002}
-+    ,
-+    {0x0000001d, 0x0000001a}
-+    ,
-+    {0x00004000, 0x0000001e}
-+    ,
-+    {0x00061000, 0x00000002}
-+    ,
-+    {0x0000001d, 0x0000001a}
-+    ,
-+    {0x00004000, 0x0000001e}
-+    ,
-+    {0x00061000, 0x00000002}
-+    ,
-+    {0x0000001d, 0x0000001a}
-+    ,
-+    {0x00004000, 0x0000001e}
-+    ,
-+    {0x00000013, 0x00000004}
-+    ,
-+    {0x0003803a, 0x00000002}
-+    ,
-+    {0x04006300, 0x00000002}
-+    ,                           /* mmIDCT_RUNS */
-+    {0x00000013, 0x00000004}
-+    ,
-+    {0x00007300, 0x00000002}
-+    ,                           /* mmIDCT_RUNS */
-+    {0x00065000, 0x00000002}
-+    ,
-+    {0x00003301, 0x00000002}
-+    ,                           /* mmIDCT_LEVELS */
-+    {0x04006301, 0x00000006}
-+    ,                           /* mmIDCT_LEVELS */
-+    {0x00007300, 0x00000002}
-+    ,                           /* mmIDCT_RUNS */
-+    {0x00007301, 0x00000002}
-+    ,                           /* mmIDCT_LEVELS */
-+    {0x00007301, 0x00000006}
-+    ,                           /* mmIDCT_LEVELS */
-+    {0x0003803a, 0x00000002}
-+    ,
-+    {0x04006300, 0x00000006}
-+    ,                           /* mmIDCT_RUNS */
-+    {0x00a05000, 0x00000002}
-+    ,
-+    {0x00000039, 0x0000000c}
-+    ,
-+    {0x00000000, 0x00000002}
-+    ,
-+    {0x00007300, 0x00000002}
-+    ,                           /* mmIDCT_RUNS */
-+    {0x00007301, 0x00000002}
-+    ,                           /* mmIDCT_LEVELS */
-+    {0x00007301, 0x00000002}
-+    ,                           /* mmIDCT_LEVELS */
-+    {0x0060002a, 0x00000004}
-+    ,
-+    {0x00007488, 0x00000002}
-+    ,                           /* mmE2_ARITHMETIC_CNTL */
-+    {0x0003803b, 0x00000002}
-+    ,
-+    {0x00098000, 0x00000002}
-+    ,
-+    {0x00200000, 0x00000002}
-+    ,
-+    {0x00000039, 0x0000000c}
-+    ,
-+    {0x00007465, 0x00000002}
-+    ,                           /* mmDST_X_Y */
-+    {0x00007464, 0x00000002}
-+    ,                           /* mmSRC_X_Y */
-+    {0x00007478, 0x00000002}
-+    ,                           /* mmMVC_CNTL_START */
-+    {0x00600034, 0x00000004}
-+    ,
-+    {0x00000000, 0x00000006}
-+    ,
-+    {0xffffffff, 0x00000000}
-+    ,
-+    {0x00000006, 0x00000000}
-+    ,
-+    {0x01605000, 0x00000002}
-+    ,
-+    {0x00065000, 0x00000002}
-+    ,
-+    {0x00098000, 0x00000002}
-+    ,
-+    {0x00061000, 0x00000002}
-+    ,
-+    {0x64c0603d, 0x00000004}
-+    ,
-+    {0x00080000, 0x00000016}
-+    ,
-+    {0x00000000, 0x00000000}
-+    ,
-+    {0x0400241d, 0x00000002}
-+    ,                           /* mmBRUSH_Y_X */
-+    {0x00007424, 0x00000002}
-+    ,                           /* mmDST_LINE_START */
-+    {0x00067425, 0x00000002}
-+    ,                           /* mmDST_LINE_END */
-+    {0x04002424, 0x00000002}
-+    ,                           /* mmDST_LINE_START */
-+    {0x00067425, 0x00000002}
-+    ,                           /* mmDST_LINE_END */
-+    {0x00000046, 0x00000004}
-+    ,
-+    {0x00005000, 0x00000000}
-+    ,
-+    {0x00061000, 0x00000002}
-+    ,
-+    {0x0000740e, 0x00000002}
-+    ,                           /* mmDST_Y_X */
-+    {0x00019000, 0x00000002}
-+    ,
-+    {0x00011050, 0x00000014}
-+    ,
-+    {0x00000050, 0x00000012}
-+    ,
-+    {0x0400240f, 0x00000002}
-+    ,                           /* mmDST_HEIGHT_WIDTH */
-+    {0x0000504a, 0x00000004}
-+    ,
-+    {0x00007465, 0x00000002}
-+    ,                           /* mmDST_X_Y */
-+    {0x00007466, 0x00000002}
-+    ,                           /* mmDST_WIDTH_HEIGHT */
-+    {0x00000051, 0x00000004}
-+    ,
-+    {0x01e65473, 0x00000002}
-+    ,                           /* mmDP_CNTL_DST_DIR */
-+    {0x4401b0b9, 0x00000002}
-+    ,
-+    {0x01c110b9, 0x00000002}
-+    ,
-+    {0x2666705d, 0x00000018}
-+    ,
-+    {0x040c2465, 0x00000002}
-+    ,                           /* mmDST_X_Y */
-+    {0x0000005d, 0x00000018}
-+    ,
-+    {0x04002464, 0x00000002}
-+    ,                           /* mmSRC_X_Y */
-+    {0x00007466, 0x00000002}
-+    ,                           /* mmDST_WIDTH_HEIGHT */
-+    {0x00000054, 0x00000004}
-+    ,
-+    {0x00401060, 0x00000008}
-+    ,
-+    {0x00101000, 0x00000002}
-+    ,
-+    {0x000d80ff, 0x00000002}
-+    ,
-+    {0x00800063, 0x00000008}
-+    ,
-+    {0x000f9000, 0x00000002}
-+    ,
-+    {0x000e00ff, 0x00000002}
-+    ,
-+    {0x00000000, 0x00000006}
-+    ,
-+    {0x00000080, 0x00000018}
-+    ,
-+    {0x00000054, 0x00000004}
-+    ,
-+    {0x00007490, 0x00000002}
-+    ,                           /* mmDP_SRC_FRGD_CLR */
-+    {0x00065000, 0x00000002}
-+    ,
-+    {0x00009000, 0x00000002}
-+    ,
-+    {0x00041000, 0x00000002}
-+    ,
-+    {0x0c00340e, 0x00000002}
-+    ,                           /* mmDST_Y_X */
-+    {0x00049000, 0x00000002}
-+    ,
-+    {0x00051000, 0x00000002}
-+    ,
-+    {0x01e784f8, 0x00000002}
-+    ,
-+    {0x00200000, 0x00000002}
-+    ,
-+    {0x00600073, 0x0000000c}
-+    ,
-+    {0x00007463, 0x00000002}
-+    ,                           /* mmDST_HEIGHT_WIDTH_8 */
-+    {0x006074f0, 0x00000021}
-+    ,                           /* mmHOST_DATA0 */
-+    {0x20007068, 0x00000004}
-+    ,
-+    {0x00005068, 0x00000004}
-+    ,
-+    {0x00007490, 0x00000002}
-+    ,                           /* mmDP_SRC_FRGD_CLR */
-+    {0x00007491, 0x00000002}
-+    ,                           /* mmDP_SRC_BKGD_CLR */
-+    {0x0000740e, 0x00000002}
-+    ,                           /* mmDST_Y_X */
-+    {0x0000740f, 0x00000002}
-+    ,                           /* mmDST_HEIGHT_WIDTH */
-+    {0x00a05000, 0x00000002}
-+    ,
-+    {0x00600076, 0x0000000c}
-+    ,
-+    {0x006074f0, 0x00000021}
-+    ,                           /* mmHOST_DATA0 */
-+    {0x000074f8, 0x00000002}
-+    ,                           /* mmHOST_DATA_LAST */
-+    {0x00000076, 0x00000004}
-+    ,
-+    {0x000a740e, 0x00000002}
-+    ,                           /* mmDST_Y_X */
-+    {0x0020740f, 0x00000002}
-+    ,                           /* mmDST_HEIGHT_WIDTH */
-+    {0x00600079, 0x00000004}
-+    ,
-+    {0x0000748c, 0x00000002}
-+    ,                           /* mmCLR_CMP_CNTL */
-+    {0x0000748d, 0x00000002}
-+    ,                           /* mmCLR_CMP_CLR_SRC */
-+    {0x0000748e, 0x00000006}
-+    ,                           /* mmCLR_CMP_CLR_DST */
-+    {0x00005000, 0x00000002}
-+    ,
-+    {0x00a05000, 0x00000002}
-+    ,
-+    {0x00007468, 0x00000002}
-+    ,                           /* mmDST_HEIGHT_Y */
-+    {0x00061000, 0x00000002}
-+    ,
-+    {0x00000084, 0x0000000c}
-+    ,
-+    {0x00058000, 0x00000002}
-+    ,
-+    {0x0c607462, 0x00000002}
-+    ,                           /* mmDST_WIDTH_X */
-+    {0x00000086, 0x00000004}
-+    ,
-+    {0x00600085, 0x00000004}
-+    ,
-+    {0x400070ba, 0x00000000}
-+    ,
-+    {0x000380ba, 0x00000002}
-+    ,
-+    {0x00000093, 0x0000001c}
-+    ,
-+    {0x00065095, 0x00000018}
-+    ,
-+    {0x0400246f, 0x00000002}
-+    ,                           /* mmSC_TOP_LEFT */
-+    {0x00061096, 0x00000018}
-+    ,
-+    {0x04007470, 0x00000000}
-+    ,                           /* mmSC_BOTTOM_RIGHT */
-+    {0x0000746f, 0x00000002}
-+    ,                           /* mmSC_TOP_LEFT */
-+    {0x00007470, 0x00000000}
-+    ,                           /* mmSC_BOTTOM_RIGHT */
-+    {0x00090000, 0x00000006}
-+    ,
-+    {0x00090000, 0x00000002}
-+    ,
-+    {0x000d8002, 0x00000006}
-+    ,
-+    {0x01200000, 0x00000002}
-+    ,
-+    {0x20077000, 0x00000002}
-+    ,
-+    {0x01200000, 0x00000002}
-+    ,
-+    {0x20007000, 0x00000002}
-+    ,
-+    {0x00061000, 0x00000002}
-+    ,
-+    {0x0120741b, 0x00000002}
-+    ,                           /* mmDP_GUI_MASTER_CNTL */
-+    {0x8040740a, 0x00000002}
-+    ,                           /* mmSRC_PITCH_OFFSET */
-+    {0x8040740b, 0x00000002}
-+    ,                           /* mmDST_PITCH_OFFSET */
-+    {0x00110000, 0x00000002}
-+    ,
-+    {0x000380ba, 0x00000002}
-+    ,
-+    {0x000000aa, 0x0000001c}
-+    ,
-+    {0x00061096, 0x00000018}
-+    ,
-+    {0x84407471, 0x00000002}
-+    ,                           /* mmSRC_SC_BOTTOM_RIGHT */
-+    {0x00061095, 0x00000018}
-+    ,
-+    {0x8400746f, 0x00000002}
-+    ,                           /* mmSC_TOP_LEFT */
-+    {0x00061096, 0x00000018}
-+    ,
-+    {0x84407470, 0x00000002}
-+    ,                           /* mmSC_BOTTOM_RIGHT */
-+    {0x000000ad, 0x00000004}
-+    ,
-+    {0x80407471, 0x00000002}
-+    ,                           /* mmSRC_SC_BOTTOM_RIGHT */
-+    {0x8000746f, 0x00000002}
-+    ,                           /* mmSC_TOP_LEFT */
-+    {0x80407470, 0x00000002}
-+    ,                           /* mmSC_BOTTOM_RIGHT */
-+    {0x00108000, 0x00000002}
-+    ,
-+    {0x01400000, 0x00000002}
-+    ,
-+    {0x006000b1, 0x0000000c}
-+    ,
-+    {0x20c07000, 0x00000020}
-+    ,
-+    {0x000000b3, 0x00000012}
-+    ,
-+    {0x00800000, 0x00000006}
-+    ,
-+    {0x0080741d, 0x00000006}
-+    ,                           /* mmBRUSH_Y_X */
-+    {0x00000000, 0x00000000}
-+    ,
-+    {0x00000001, 0x00000000}
-+    ,
-+    {0x000380b5, 0x00000002}
-+    ,
-+    {0x04002054, 0x00000002}
-+    ,                           /* mmNQWAIT_UNTIL */
-+    {0x00005000, 0x00000000}
-+    ,
-+    {0x00000000, 0x00000000}
-+    ,
-+    {0x00000000, 0x00000000}
-+    ,
-+    {0x00000000, 0x00000000}
-+    ,
-+    {0x00000000, 0x00000000}
-+    ,
-+    {0x00000000, 0x00000000}
-+    ,
-+    {0x00000000, 0x00000000}
-+    ,
-+    {0x00000000, 0x00000000}
-+};
-Index: git/hw/kdrive/w100/ati_stub.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/ati_stub.c	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,103 @@
-+/*
-+ * Copyright � 2006 Alberto Mardegan <mardy@users.sourceforge.net>
-+ *
-+ * 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 Alberto Mardegan not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Alberto Mardegan makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * ALBERTO MARDEGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL ALBERTO MARDEGAN 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 "ati.h"
-+#include "w100_regs.h"
-+#include "klinux.h"
-+
-+extern struct pci_id_entry ati_pci_ids[];
-+
-+static Bool
-+FindW100(CARD16 vendor, CARD16 device, CARD32 count, KdCardAttr * attr)
-+{
-+    char *mmio;
-+    CARD32 chip_id;
-+    Bool found = FALSE;
-+
-+    mmio = KdMapDevice(ATI_REG_BASE(0), ATI_REG_SIZE(0));
-+    KdSetMappedMode((CARD32) mmio, ATI_REG_SIZE(0),
-+                    KD_MAPPED_MODE_REGISTERS);
-+
-+    chip_id = MMIO_IN32(mmio, mmCHIP_ID);
-+    if ((vendor | (device << 16)) == chip_id) {
-+        ErrorF("Found Chip ID: %08x\n\n", chip_id);
-+        attr->deviceID = device;
-+        attr->vendorID = vendor;
-+        found = TRUE;
-+    }
-+    KdUnmapDevice(mmio, ATI_REG_SIZE(0));
-+    return found;
-+}
-+
-+
-+void
-+InitCard(char *name)
-+{
-+    struct pci_id_entry *id;
-+    KdCardAttr attr;
-+
-+    for (id = ati_pci_ids; id->name != NULL; id++) {
-+        int j = 0;
-+        if (FindW100(id->vendor, id->device, j++, &attr))
-+            KdCardInfoAdd(&ATIFuncs, &attr, 0);
-+    }
-+}
-+
-+void
-+InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
-+{
-+    KdInitOutput(pScreenInfo, argc, argv);
-+}
-+
-+void
-+InitInput(int argc, char **argv)
-+{
-+    KdInitInput(&LinuxMouseFuncs, &LinuxKeyboardFuncs);
-+#ifdef TOUCHSCREEN
-+    KdAddMouseDriver(&TsFuncs);
-+#endif
-+}
-+
-+void
-+ddxUseMsg(void)
-+{
-+    KdUseMsg();
-+#ifdef KDRIVEVESA
-+    vesaUseMsg();
-+#endif
-+}
-+
-+int
-+ddxProcessArgument(int argc, char **argv, int i)
-+{
-+    int ret;
-+
-+#ifdef KDRIVEVESA
-+    if (!(ret = vesaProcessArgument(argc, argv, i)))
-+#endif
-+        ret = KdProcessArgument(argc, argv, i);
-+
-+    return ret;
-+}
-Index: git/hw/kdrive/w100/Makefile.am
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/Makefile.am	2006-09-02 12:42:38.000000000 +0200
-@@ -0,0 +1,56 @@
-+if KDRIVEFBDEV
-+FBDEV_INCLUDES =-I$(top_srcdir)/hw/kdrive/fbdev
-+FBDEV_LIBS = $(top_builddir)/hw/kdrive/fbdev/libfbdev.a
-+endif
-+
-+if KDRIVEVESA
-+VESA_INCLUDES = -I$(top_srcdir)/hw/kdrive/vesa
-+VESA_LIBS = $(top_builddir)/hw/kdrive/vesa/libvesa.a
-+endif
-+
-+INCLUDES = 					\
-+	@KDRIVE_INCS@				\
-+	$(FBDEV_INCLUDES)			\
-+	$(VESA_INCLUDES)			\
-+	@KDRIVE_CFLAGS@
-+
-+bin_PROGRAMS = Xw100
-+
-+if TSLIB
-+TSLIB_FLAG = -lts
-+endif
-+
-+noinst_LIBRARIES = libw100.a
-+
-+libw100_a_SOURCES = 	\
-+	ati_cursor.c	\
-+	ati_dma.c	\
-+	ati_dma.h	\
-+	ati_draw.c	\
-+	ati_draw.h	\
-+	ati_microcode.c	\
-+	ati.c		\
-+	ati.h		\
-+	w100_regs.h \
-+	w100_const.h
-+
-+Xw100_SOURCES = \
-+	ati_stub.c
-+
-+W100_LIBS =				\
-+	libw100.a 			\
-+	$(FBDEV_LIBS)			\
-+	$(VESA_LIBS)			\
-+	$(DRI_LIBS)			\
-+	@KDRIVE_LIBS@
-+
-+Xw100_LDADD = \
-+	$(W100_LIBS)			\
-+	@XSERVER_LIBS@			\
-+	$(TSLIB_FLAG)
-+
-+
-+Xw100_DEPENDENCIES =			\
-+        libw100.a                       \
-+        $(FBDEV_LIBS)                   \
-+        $(VESA_LIBS)
-Index: git/hw/kdrive/w100/w100_const.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/w100_const.h	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,25 @@
-+#define CSQ_CNTL_MODE_FREERUN   0x8
-+
-+#define WB_BLOCK_SIZE_A_0   0
-+#define WB_BLOCK_SIZE_A_1   1
-+#define WB_BLOCK_SIZE_A_2   2
-+#define WB_BLOCK_SIZE_A_3   3
-+#define WB_BLOCK_SIZE_A_4   4
-+
-+#define DATATYPE_8BPP      2
-+#define DATATYPE_ARGB1555  3
-+#define DATATYPE_ARGB4444  5
-+
-+#define BRUSH_SOLIDCOLOR    13
-+#define BRUSH_NONE          15
-+
-+#define OP_ROP                   0
-+#define OP_ARITHMETIC            1
-+
-+#define SOURCE_MEM_RECTANGULAR  2
-+
-+#define W100_MAXINT 0x1fff
-+
-+#define W100_CCE_PACKET3_PAINT_MULTI    0xc0001a00
-+#define W100_CCE_PACKET3_BITBLT_MULTI   0xc0001b00
-+
-Index: git/hw/kdrive/w100/w100_regs.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ git/hw/kdrive/w100/w100_regs.h	2006-09-02 12:12:14.000000000 +0200
-@@ -0,0 +1,3802 @@
-+#ifndef _W100_REGS_H_
-+#define _W100_REGS_H_
-+
-+/* Block CIF Start: */
-+#define mmCHIP_ID                                                    0x0000
-+#define mmREVISION_ID                                                0x0004
-+#define mmWRAP_BUF_A                                                 0x0008
-+#define mmWRAP_BUF_B                                                 0x000C
-+#define mmWRAP_TOP_DIR                                               0x0010
-+#define mmWRAP_START_DIR                                             0x0014
-+#define mmCIF_CNTL                                                   0x0018
-+#define mmCFGREG_BASE                                                0x001C
-+#define mmCIF_IO                                                     0x0020
-+#define mmCIF_READ_DBG                                               0x0024
-+#define mmCIF_WRITE_DBG                                              0x0028
-+#define cfgIND_ADDR_A_0                                              0x0000
-+#define cfgIND_ADDR_A_1                                              0x0001
-+#define cfgIND_ADDR_A_2                                              0x0002
-+#define cfgIND_DATA_A                                                0x0003
-+#define cfgREG_BASE                                                  0x0004
-+#define cfgINTF_CNTL                                                 0x0005
-+#define cfgSTATUS                                                    0x0006
-+#define cfgCPU_DEFAULTS                                              0x0007
-+#define cfgIND_ADDR_B_0                                              0x0008
-+#define cfgIND_ADDR_B_1                                              0x0009
-+#define cfgIND_ADDR_B_2                                              0x000A
-+#define cfgIND_DATA_B                                                0x000B
-+#define cfgPM4_RPTR                                                  0x000C
-+#define cfgSCRATCH                                                   0x000D
-+#define cfgPM4_WRPTR_0                                               0x000E
-+#define cfgPM4_WRPTR_1                                               0x000F
-+/* Block CIF End: */
-+
-+/* Block CP Start: */
-+#define mmCP_RB_CNTL                                                 0x0210
-+#define mmCP_RB_BASE                                                 0x0214
-+#define mmCP_RB_RPTR_ADDR                                            0x0218
-+#define mmCP_RB_RPTR                                                 0x021C
-+#define mmCP_RB_RPTR_WR                                              0x02F8
-+#define mmCP_RB_WPTR                                                 0x0220
-+#define mmCP_IB_BASE                                                 0x0228
-+#define mmCP_IB_BUFSZ                                                0x022C
-+#define mmCP_CSQ_CNTL                                                0x0230
-+#define mmCP_CSQ_APER_PRIMARY                                        0x0300
-+#define mmCP_CSQ_APER_INDIRECT                                       0x0340
-+#define mmCP_ME_CNTL                                                 0x0240
-+#define mmCP_ME_RAM_ADDR                                             0x0244
-+#define mmCP_ME_RAM_RADDR                                            0x0248
-+#define mmCP_ME_RAM_DATAH                                            0x024C
-+#define mmCP_ME_RAM_DATAL                                            0x0250
-+#define mmCP_DEBUG                                                   0x025C
-+#define mmSCRATCH_REG0                                               0x0260
-+#define mmSCRATCH_REG1                                               0x0264
-+#define mmSCRATCH_REG2                                               0x0268
-+#define mmSCRATCH_REG3                                               0x026C
-+#define mmSCRATCH_REG4                                               0x0270
-+#define mmSCRATCH_REG5                                               0x0274
-+#define mmSCRATCH_UMSK                                               0x0280
-+#define mmSCRATCH_ADDR                                               0x0284
-+#define mmCP_CSQ_ADDR                                                0x02E4
-+#define mmCP_CSQ_DATA                                                0x02E8
-+#define mmCP_CSQ_STAT                                                0x02EC
-+#define mmCP_STAT                                                    0x02F0
-+#define mmGEN_INT_CNTL                                               0x0200
-+#define mmGEN_INT_STATUS                                             0x0204
-+/* Block CP End: */
-+
-+/* Block DISPLAY Start: */
-+#define mmLCD_FORMAT                                                 0x0410
-+#define mmGRAPHIC_CTRL                                               0x0414
-+#define mmGRAPHIC_OFFSET                                             0x0418
-+#define mmGRAPHIC_PITCH                                              0x041C
-+#define mmCRTC_TOTAL                                                 0x0420
-+#define mmACTIVE_H_DISP                                              0x0424
-+#define mmACTIVE_V_DISP                                              0x0428
-+#define mmGRAPHIC_H_DISP                                             0x042C
-+#define mmGRAPHIC_V_DISP                                             0x0430
-+#define mmVIDEO_CTRL                                                 0x0434
-+#define mmGRAPHIC_KEY                                                0x0438
-+#define mmVIDEO_Y_OFFSET                                             0x043C
-+#define mmVIDEO_Y_PITCH                                              0x0440
-+#define mmVIDEO_U_OFFSET                                             0x0444
-+#define mmVIDEO_U_PITCH                                              0x0448
-+#define mmVIDEO_V_OFFSET                                             0x044C
-+#define mmVIDEO_V_PITCH                                              0x0450
-+#define mmVIDEO_H_POS                                                0x0454
-+#define mmVIDEO_V_POS                                                0x0458
-+#define mmBRIGHTNESS_CNTL                                            0x045C
-+#define mmCURSOR1_OFFSET                                             0x0460
-+#define mmCURSOR1_H_POS                                              0x0464
-+#define mmCURSOR1_V_POS                                              0x0468
-+#define mmCURSOR1_COLOR0                                             0x046C
-+#define mmCURSOR1_COLOR1                                             0x0470
-+#define mmCURSOR2_OFFSET                                             0x0474
-+#define mmCURSOR2_H_POS                                              0x0478
-+#define mmCURSOR2_V_POS                                              0x047C
-+#define mmCURSOR2_COLOR0                                             0x0480
-+#define mmCURSOR2_COLOR1                                             0x0484
-+#define mmDISP_INT_CNTL                                              0x0488
-+#define mmCRTC_SS                                                    0x048C
-+#define mmCRTC_LS                                                    0x0490
-+#define mmCRTC_REV                                                   0x0494
-+#define mmCRTC_DCLK                                                  0x049C
-+#define mmCRTC_GS                                                    0x04A0
-+#define mmCRTC_VPOS_GS                                               0x04A4
-+#define mmCRTC_GCLK                                                  0x04A8
-+#define mmCRTC_GOE                                                   0x04AC
-+#define mmCRTC_FRAME                                                 0x04B0
-+#define mmCRTC_FRAME_VPOS                                            0x04B4
-+#define mmGPIO_DATA                                                  0x04B8
-+#define mmGPIO_CNTL1                                                 0x04BC
-+#define mmGPIO_CNTL2                                                 0x04C0
-+#define mmLCDD_CNTL1                                                 0x04C4
-+#define mmLCDD_CNTL2                                                 0x04C8
-+#define mmGENLCD_CNTL1                                               0x04CC
-+#define mmGENLCD_CNTL2                                               0x04D0
-+#define mmDISP_DEBUG                                                 0x04D4
-+#define mmDISP_DB_BUF_CNTL                                           0x04D8
-+#define mmDISP_CRC_SIG                                               0x04DC
-+#define mmCRTC_DEFAULT_COUNT                                         0x04E0
-+#define mmLCD_BACKGROUND_COLOR                                       0x04E4
-+#define mmCRTC_PS2                                                   0x04E8
-+#define mmCRTC_PS2_VPOS                                              0x04EC
-+#define mmCRTC_PS1_ACTIVE                                            0x04F0
-+#define mmCRTC_PS1_NACTIVE                                           0x04F4
-+#define mmCRTC_GCLK_EXT                                              0x04F8
-+#define mmCRTC_ALW                                                   0x04FC
-+#define mmCRTC_ALW_VPOS                                              0x0500
-+#define mmCRTC_PSK                                                   0x0504
-+#define mmCRTC_PSK_HPOS                                              0x0508
-+#define mmCRTC_CV4_START                                             0x050C
-+#define mmCRTC_CV4_END                                               0x0510
-+#define mmCRTC_CV4_HPOS                                              0x0514
-+#define mmCRTC_ECK                                                   0x051C
-+#define mmREFRESH_CNTL                                               0x0520
-+#define mmGENLCD_CNTL3                                               0x0524
-+#define mmGPIO_DATA2                                                 0x0528
-+#define mmGPIO_CNTL3                                                 0x052C
-+#define mmGPIO_CNTL4                                                 0x0530
-+#define mmCHIP_STRAP                                                 0x0534
-+#define mmDISP_DEBUG2                                                0x0538
-+#define mmDEBUG_BUS_CNTL                                             0x053C
-+#define mmGAMMA_VALUE1                                               0x0540
-+#define mmGAMMA_VALUE2                                               0x0544
-+#define mmGAMMA_SLOPE                                                0x0548
-+#define mmGEN_STATUS                                                 0x054C
-+#define mmHW_INT                                                     0x0550
-+/* Block DISPLAY End: */
-+
-+/* Block GFX Start: */
-+#define mmDST_OFFSET                                                 0x1004
-+#define mmDST_PITCH                                                  0x1008
-+#define mmDST_PITCH_OFFSET                                           0x102C
-+#define mmDST_X                                                      0x101C
-+#define mmDST_Y                                                      0x1020
-+#define mmDST_X_Y                                                    0x1194
-+#define mmDST_Y_X                                                    0x1038
-+#define mmDST_WIDTH                                                  0x100C
-+#define mmDST_HEIGHT                                                 0x1010
-+#define mmDST_WIDTH_HEIGHT                                           0x1198
-+#define mmDST_HEIGHT_WIDTH                                           0x103C
-+#define mmDST_HEIGHT_WIDTH_8                                         0x118C
-+#define mmDST_HEIGHT_Y                                               0x11A0
-+#define mmDST_WIDTH_X                                                0x1188
-+#define mmDST_WIDTH_X_INCY                                           0x119C
-+#define mmDST_LINE_START                                             0x1090
-+#define mmDST_LINE_END                                               0x1094
-+#define mmBRUSH_OFFSET                                               0x108C
-+#define mmBRUSH_Y_X                                                  0x1074
-+#define mmDP_BRUSH_FRGD_CLR                                          0x107C
-+#define mmDP_BRUSH_BKGD_CLR                                          0x1078
-+#define mmSRC2_OFFSET                                                0x1060
-+#define mmSRC2_PITCH                                                 0x1064
-+#define mmSRC2_PITCH_OFFSET                                          0x1068
-+#define mmSRC2_X                                                     0x1050
-+#define mmSRC2_Y                                                     0x1054
-+#define mmSRC2_X_Y                                                   0x1058
-+#define mmSRC2_WIDTH                                                 0x1080
-+#define mmSRC2_HEIGHT                                                0x1084
-+#define mmSRC2_INC                                                   0x1088
-+#define mmSRC_OFFSET                                                 0x11AC
-+#define mmSRC_PITCH                                                  0x11B0
-+#define mmSRC_PITCH_OFFSET                                           0x1028
-+#define mmSRC_X                                                      0x1014
-+#define mmSRC_Y                                                      0x1018
-+#define mmSRC_X_Y                                                    0x1190
-+#define mmSRC_Y_X                                                    0x1034
-+#define mmSRC_WIDTH                                                  0x1040
-+#define mmSRC_HEIGHT                                                 0x1044
-+#define mmSRC_INC                                                    0x1048
-+#define mmHOST_DATA0                                                 0x13C0
-+#define mmHOST_DATA1                                                 0x13C4
-+#define mmHOST_DATA2                                                 0x13C8
-+#define mmHOST_DATA3                                                 0x13CC
-+#define mmHOST_DATA4                                                 0x13D0
-+#define mmHOST_DATA5                                                 0x13D4
-+#define mmHOST_DATA6                                                 0x13D8
-+#define mmHOST_DATA7                                                 0x13DC
-+#define mmHOST_DATA_LAST                                             0x13E0
-+#define mmDP_SRC_FRGD_CLR                                            0x1240
-+#define mmDP_SRC_BKGD_CLR                                            0x1244
-+#define mmSC_LEFT                                                    0x1140
-+#define mmSC_RIGHT                                                   0x1144
-+#define mmSC_TOP                                                     0x1148
-+#define mmSC_BOTTOM                                                  0x114C
-+#define mmSRC_SC_RIGHT                                               0x1154
-+#define mmSRC_SC_BOTTOM                                              0x115C
-+#define mmDP_CNTL                                                    0x11C8
-+#define mmDP_CNTL_DST_DIR                                            0x11CC
-+#define mmDP_DATATYPE                                                0x12C4
-+#define mmDP_MIX                                                     0x12C8
-+#define mmDP_WRITE_MSK                                               0x12CC
-+#define mmCLR_CMP_CLR_SRC                                            0x1234
-+#define mmCLR_CMP_CLR_DST                                            0x1238
-+#define mmCLR_CMP_CNTL                                               0x1230
-+#define mmCLR_CMP_MSK                                                0x123C
-+#define mmDEFAULT_PITCH_OFFSET                                       0x10A0
-+#define mmDEFAULT_SC_BOTTOM_RIGHT                                    0x10A8
-+#define mmDEFAULT2_SC_BOTTOM_RIGHT                                   0x10AC
-+#define mmREF1_PITCH_OFFSET                                          0x10B8
-+#define mmREF2_PITCH_OFFSET                                          0x10BC
-+#define mmREF3_PITCH_OFFSET                                          0x10C0
-+#define mmREF4_PITCH_OFFSET                                          0x10C4
-+#define mmREF5_PITCH_OFFSET                                          0x10C8
-+#define mmREF6_PITCH_OFFSET                                          0x10CC
-+#define mmDP_GUI_MASTER_CNTL                                         0x106C
-+#define mmSC_TOP_LEFT                                                0x11BC
-+#define mmSC_BOTTOM_RIGHT                                            0x11C0
-+#define mmSRC_SC_BOTTOM_RIGHT                                        0x11C4
-+#define mmGLOBAL_ALPHA                                               0x1210
-+#define mmFILTER_COEF                                                0x1214
-+#define mmMVC_CNTL_START                                             0x11E0
-+#define mmE2_ARITHMETIC_CNTL                                         0x1220
-+#define mmDEBUG0                                                     0x1280
-+#define mmDEBUG1                                                     0x1284
-+#define mmDEBUG2                                                     0x1288
-+#define mmDEBUG3                                                     0x128C
-+#define mmDEBUG4                                                     0x1290
-+#define mmDEBUG5                                                     0x1294
-+#define mmDEBUG6                                                     0x1298
-+#define mmDEBUG7                                                     0x129C
-+#define mmDEBUG8                                                     0x12A0
-+#define mmDEBUG9                                                     0x12A4
-+#define mmDEBUG10                                                    0x12A8
-+#define mmDEBUG11                                                    0x12AC
-+#define mmDEBUG12                                                    0x12B0
-+#define mmDEBUG13                                                    0x12B4
-+#define mmDEBUG14                                                    0x12B8
-+#define mmDEBUG15                                                    0x12BC
-+#define mmENG_CNTL                                                   0x13E8
-+#define mmENG_PERF_CNT                                               0x13F0
-+/* Block GFX End: */
-+
-+/* Block IDCT Start: */
-+#define mmIDCT_RUNS                                                  0x0C00
-+#define mmIDCT_LEVELS                                                0x0C04
-+#define mmIDCT_CONTROL                                               0x0C3C
-+#define mmIDCT_AUTH_CONTROL                                          0x0C08
-+#define mmIDCT_AUTH                                                  0x0C0C
-+/* Block IDCT End: */
-+
-+/* Block MC Start: */
-+#define mmMEM_CNTL                                                   0x0180
-+#define mmMEM_ARB                                                    0x0184
-+#define mmMC_FB_LOCATION                                             0x0188
-+#define mmMEM_EXT_CNTL                                               0x018C
-+#define mmMC_EXT_MEM_LOCATION                                        0x0190
-+#define mmMEM_EXT_TIMING_CNTL                                        0x0194
-+#define mmMEM_SDRAM_MODE_REG                                         0x0198
-+#define mmMEM_IO_CNTL                                                0x019C
-+#define mmMC_DEBUG                                                   0x01A0
-+#define mmMC_BIST_CTRL                                               0x01A4
-+#define mmMC_BIST_COLLAR_READ                                        0x01A8
-+#define mmTC_MISMATCH                                                0x01AC
-+#define mmMC_PERF_MON_CNTL                                           0x01B0
-+#define mmMC_PERF_COUNTERS                                           0x01B4
-+/* Block MC End: */
-+
-+/* Block RBBM Start: */
-+#define mmWAIT_UNTIL                                                 0x1400
-+#define mmISYNC_CNTL                                                 0x1404
-+#define mmRBBM_GUICNTL                                               0x1408
-+#define mmRBBM_STATUS                                                0x0140
-+#define mmRBBM_STATUS_alt_1                                          0x140C
-+#define mmRBBM_CNTL                                                  0x0144
-+#define mmRBBM_SOFT_RESET                                            0x0148
-+#define mmNQWAIT_UNTIL                                               0x0150
-+#define mmRBBM_DEBUG                                                 0x016C
-+#define mmRBBM_CMDFIFO_ADDR                                          0x0170
-+#define mmRBBM_CMDFIFO_DATAL                                         0x0174
-+#define mmRBBM_CMDFIFO_DATAH                                         0x0178
-+#define mmRBBM_CMDFIFO_STAT                                          0x017C
-+/* Block RBBM End: */
-+
-+/* Block CG Start: */
-+#define mmCLK_PIN_CNTL                                               0x0080
-+#define mmPLL_REF_FB_DIV                                             0x0084
-+#define mmPLL_CNTL                                                   0x0088
-+#define mmSCLK_CNTL                                                  0x008C
-+#define mmPCLK_CNTL                                                  0x0090
-+#define mmCLK_TEST_CNTL                                              0x0094
-+#define mmPWRMGT_CNTL                                                0x0098
-+#define mmPWRMGT_STATUS                                              0x009C
-+/* Block CG End: */
-+
-+
-+/* data structure definitions */
-+
-+typedef struct _chip_id_t {
-+     unsigned long vendor_id                      : 16;
-+     unsigned long device_id                      : 16;
-+     } chip_id_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     chip_id_t f;
-+} chip_id_u;
-+
-+typedef struct _revision_id_t {
-+     unsigned long minor_rev_id                   : 4;
-+     unsigned long major_rev_id                   : 4;
-+     unsigned long                                : 24;
-+     } revision_id_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     revision_id_t f;
-+} revision_id_u;
-+
-+typedef struct _wrap_buf_a_t {
-+     unsigned long offset_addr_a                  : 24;
-+     unsigned long block_size_a                   : 3;
-+     unsigned long                                : 5;
-+     } wrap_buf_a_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     wrap_buf_a_t f;
-+} wrap_buf_a_u;
-+
-+typedef struct _wrap_buf_b_t {
-+     unsigned long offset_addr_b                  : 24;
-+     unsigned long block_size_b                   : 3;
-+     unsigned long                                : 5;
-+     } wrap_buf_b_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     wrap_buf_b_t f;
-+} wrap_buf_b_u;
-+
-+typedef struct _wrap_top_dir_t {
-+     unsigned long top_addr                       : 23;
-+     unsigned long                                : 9;
-+     } wrap_top_dir_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     wrap_top_dir_t f;
-+} wrap_top_dir_u;
-+
-+typedef struct _wrap_start_dir_t {
-+     unsigned long start_addr                     : 23;
-+     unsigned long                                : 9;
-+     } wrap_start_dir_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     wrap_start_dir_t f;
-+} wrap_start_dir_u;
-+
-+typedef struct _cif_cntl_t {
-+     unsigned long swap_reg                       : 2;
-+     unsigned long swap_fbuf_1                    : 2;
-+     unsigned long swap_fbuf_2                    : 2;
-+     unsigned long swap_fbuf_3                    : 2;
-+     unsigned long pmi_int_disable                : 1;
-+     unsigned long pmi_schmen_disable             : 1;
-+     unsigned long intb_oe                        : 1;
-+     unsigned long en_wait_to_compensate_dq_prop_dly : 1;
-+     unsigned long compensate_wait_rd_size        : 2;
-+     unsigned long wait_asserted_timeout_val      : 2;
-+     unsigned long wait_masked_val                : 2;
-+     unsigned long en_wait_timeout                : 1;
-+     unsigned long en_one_clk_setup_before_wait   : 1;
-+     unsigned long interrupt_active_high          : 1;
-+     unsigned long en_overwrite_straps            : 1;
-+     unsigned long strap_wait_active_hi           : 1;
-+     unsigned long lat_busy_count                 : 2;
-+     unsigned long lat_rd_pm4_sclk_busy           : 1;
-+     unsigned long dis_system_bits                : 1;
-+     unsigned long dis_mr                         : 1;
-+     unsigned long cif_spare_1                    : 4;
-+     } cif_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cif_cntl_t f;
-+} cif_cntl_u;
-+
-+typedef struct _cfgreg_base_t {
-+     unsigned long cfgreg_base                    : 24;
-+     unsigned long                                : 8;
-+     } cfgreg_base_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cfgreg_base_t f;
-+} cfgreg_base_u;
-+
-+typedef struct _cif_io_t {
-+     unsigned long dq_srp                         : 1;
-+     unsigned long dq_srn                         : 1;
-+     unsigned long dq_sp                          : 4;
-+     unsigned long dq_sn                          : 4;
-+     unsigned long waitb_srp                      : 1;
-+     unsigned long waitb_srn                      : 1;
-+     unsigned long waitb_sp                       : 4;
-+     unsigned long waitb_sn                       : 4;
-+     unsigned long intb_srp                       : 1;
-+     unsigned long intb_srn                       : 1;
-+     unsigned long intb_sp                        : 4;
-+     unsigned long intb_sn                        : 4;
-+     unsigned long                                : 2;
-+     } cif_io_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cif_io_t f;
-+} cif_io_u;
-+
-+typedef struct _cif_read_dbg_t {
-+     unsigned long unpacker_pre_fetch_trig_gen    : 2;
-+     unsigned long dly_second_rd_fetch_trig       : 1;
-+     unsigned long rst_rd_burst_id                : 1;
-+     unsigned long dis_rd_burst_id                : 1;
-+     unsigned long en_block_rd_when_packer_is_not_emp : 1;
-+     unsigned long dis_pre_fetch_cntl_sm          : 1;
-+     unsigned long rbbm_chrncy_dis                : 1;
-+     unsigned long rbbm_rd_after_wr_lat           : 2;
-+     unsigned long dis_be_during_rd               : 1;
-+     unsigned long one_clk_invalidate_pulse       : 1;
-+     unsigned long dis_chnl_priority              : 1;
-+     unsigned long rst_read_path_a_pls            : 1;
-+     unsigned long rst_read_path_b_pls            : 1;
-+     unsigned long dis_reg_rd_fetch_trig          : 1;
-+     unsigned long dis_rd_fetch_trig_from_ind_addr : 1;
-+     unsigned long dis_rd_same_byte_to_trig_fetch : 1;
-+     unsigned long dis_dir_wrap                   : 1;
-+     unsigned long dis_ring_buf_to_force_dec      : 1;
-+     unsigned long dis_addr_comp_in_16bit         : 1;
-+     unsigned long clr_w                          : 1;
-+     unsigned long err_rd_tag_is_3                : 1;
-+     unsigned long err_load_when_ful_a            : 1;
-+     unsigned long err_load_when_ful_b            : 1;
-+     unsigned long                                : 7;
-+     } cif_read_dbg_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cif_read_dbg_t f;
-+} cif_read_dbg_u;
-+
-+typedef struct _cif_write_dbg_t {
-+     unsigned long packer_timeout_count           : 2;
-+     unsigned long en_upper_load_cond             : 1;
-+     unsigned long en_chnl_change_cond            : 1;
-+     unsigned long dis_addr_comp_cond             : 1;
-+     unsigned long dis_load_same_byte_addr_cond   : 1;
-+     unsigned long dis_timeout_cond               : 1;
-+     unsigned long dis_timeout_during_rbbm        : 1;
-+     unsigned long dis_packer_ful_during_rbbm_timeout : 1;
-+     unsigned long en_dword_split_to_rbbm         : 1;
-+     unsigned long en_dummy_val                   : 1;
-+     unsigned long dummy_val_sel                  : 1;
-+     unsigned long mask_pm4_wrptr_dec             : 1;
-+     unsigned long dis_mc_clean_cond              : 1;
-+     unsigned long err_two_reqi_during_ful        : 1;
-+     unsigned long err_reqi_during_idle_clk       : 1;
-+     unsigned long err_global                     : 1;
-+     unsigned long en_wr_buf_dbg_load             : 1;
-+     unsigned long en_wr_buf_dbg_path             : 1;
-+     unsigned long sel_wr_buf_byte                : 3;
-+     unsigned long dis_rd_flush_wr                : 1;
-+     unsigned long dis_packer_ful_cond            : 1;
-+     unsigned long dis_invalidate_by_ops_chnl     : 1;
-+     unsigned long en_halt_when_reqi_err          : 1;
-+     unsigned long cif_spare_2                    : 5;
-+     unsigned long                                : 1;
-+     } cif_write_dbg_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cif_write_dbg_t f;
-+} cif_write_dbg_u;
-+
-+typedef struct _ind_addr_a_0_t {
-+     unsigned char ind_addr_a_0                   : 8;
-+     } ind_addr_a_0_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     ind_addr_a_0_t f;
-+} ind_addr_a_0_u;
-+
-+typedef struct _ind_addr_a_1_t {
-+     unsigned char ind_addr_a_1                   : 8;
-+     } ind_addr_a_1_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     ind_addr_a_1_t f;
-+} ind_addr_a_1_u;
-+
-+typedef struct _ind_addr_a_2_t {
-+     unsigned char ind_addr_a_2                   : 8;
-+     } ind_addr_a_2_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     ind_addr_a_2_t f;
-+} ind_addr_a_2_u;
-+
-+typedef struct _ind_data_a_t {
-+     unsigned char ind_data_a                     : 8;
-+     } ind_data_a_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     ind_data_a_t f;
-+} ind_data_a_u;
-+
-+typedef struct _reg_base_t {
-+     unsigned char reg_base                       : 8;
-+     } reg_base_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     reg_base_t f;
-+} reg_base_u;
-+
-+typedef struct _intf_cntl_t {
-+     unsigned char ad_inc_a                       : 1;
-+     unsigned char ring_buf_a                     : 1;
-+     unsigned char rd_fetch_trigger_a             : 1;
-+     unsigned char rd_data_rdy_a                  : 1;
-+     unsigned char ad_inc_b                       : 1;
-+     unsigned char ring_buf_b                     : 1;
-+     unsigned char rd_fetch_trigger_b             : 1;
-+     unsigned char rd_data_rdy_b                  : 1;
-+     } intf_cntl_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     intf_cntl_t f;
-+} intf_cntl_u;
-+
-+typedef struct _status_t {
-+     unsigned char wr_fifo_available_space        : 2;
-+     unsigned char fbuf_wr_pipe_emp               : 1;
-+     unsigned char soft_reset                     : 1;
-+     unsigned char system_pwm_mode                : 2;
-+     unsigned char mem_access_dis                 : 1;
-+     unsigned char en_pre_fetch                   : 1;
-+     } status_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     status_t f;
-+} status_u;
-+
-+typedef struct _cpu_defaults_t {
-+     unsigned char unpack_rd_data                 : 1;
-+     unsigned char access_ind_addr_a              : 1;
-+     unsigned char access_ind_addr_b              : 1;
-+     unsigned char access_scratch_reg             : 1;
-+     unsigned char pack_wr_data                   : 1;
-+     unsigned char transition_size                : 1;
-+     unsigned char en_read_buf_mode               : 1;
-+     unsigned char rd_fetch_scratch               : 1;
-+     } cpu_defaults_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     cpu_defaults_t f;
-+} cpu_defaults_u;
-+
-+typedef struct _ind_addr_b_0_t {
-+     unsigned char ind_addr_b_0                   : 8;
-+     } ind_addr_b_0_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     ind_addr_b_0_t f;
-+} ind_addr_b_0_u;
-+
-+typedef struct _ind_addr_b_1_t {
-+     unsigned char ind_addr_b_1                   : 8;
-+     } ind_addr_b_1_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     ind_addr_b_1_t f;
-+} ind_addr_b_1_u;
-+
-+typedef struct _ind_addr_b_2_t {
-+     unsigned char ind_addr_b_2                   : 8;
-+     } ind_addr_b_2_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     ind_addr_b_2_t f;
-+} ind_addr_b_2_u;
-+
-+typedef struct _ind_data_b_t {
-+     unsigned char ind_data_b                     : 8;
-+     } ind_data_b_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     ind_data_b_t f;
-+} ind_data_b_u;
-+
-+typedef struct _pm4_rptr_t {
-+     unsigned char pm4_rptr                       : 8;
-+     } pm4_rptr_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     pm4_rptr_t f;
-+} pm4_rptr_u;
-+
-+typedef struct _scratch_t {
-+     unsigned char scratch                        : 8;
-+     } scratch_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     scratch_t f;
-+} scratch_u;
-+
-+typedef struct _pm4_wrptr_0_t {
-+     unsigned char pm4_wrptr_0                    : 8;
-+     } pm4_wrptr_0_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     pm4_wrptr_0_t f;
-+} pm4_wrptr_0_u;
-+
-+typedef struct _pm4_wrptr_1_t {
-+     unsigned char pm4_wrptr_1                    : 6;
-+     unsigned char rd_fetch_pm4_rptr              : 1;
-+     unsigned char wrptr_atomic_update_w          : 1;
-+     } pm4_wrptr_1_t;
-+
-+typedef union {
-+     unsigned char val : 8;
-+     pm4_wrptr_1_t f;
-+} pm4_wrptr_1_u;
-+
-+typedef struct _cp_rb_cntl_t {
-+     unsigned long rb_bufsz                       : 6;
-+     unsigned long                                : 2;
-+     unsigned long rb_blksz                       : 6;
-+     unsigned long                                : 2;
-+     unsigned long buf_swap                       : 2;
-+     unsigned long max_fetch                      : 2;
-+     unsigned long                                : 7;
-+     unsigned long rb_no_update                   : 1;
-+     unsigned long                                : 3;
-+     unsigned long rb_rptr_wr_ena                 : 1;
-+     } cp_rb_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_rb_cntl_t f;
-+} cp_rb_cntl_u;
-+
-+typedef struct _cp_rb_base_t {
-+     unsigned long                                : 2;
-+     unsigned long rb_base                        : 22;
-+     unsigned long                                : 8;
-+     } cp_rb_base_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_rb_base_t f;
-+} cp_rb_base_u;
-+
-+typedef struct _cp_rb_rptr_addr_t {
-+     unsigned long rb_rptr_swap                   : 2;
-+     unsigned long rb_rptr_addr                   : 22;
-+     unsigned long                                : 8;
-+     } cp_rb_rptr_addr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_rb_rptr_addr_t f;
-+} cp_rb_rptr_addr_u;
-+
-+typedef struct _cp_rb_rptr_t {
-+     unsigned long rb_rptr                        : 23;
-+     unsigned long                                : 9;
-+     } cp_rb_rptr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_rb_rptr_t f;
-+} cp_rb_rptr_u;
-+
-+typedef struct _cp_rb_rptr_wr_t {
-+     unsigned long rb_rptr_wr                     : 23;
-+     unsigned long                                : 9;
-+     } cp_rb_rptr_wr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_rb_rptr_wr_t f;
-+} cp_rb_rptr_wr_u;
-+
-+typedef struct _cp_rb_wptr_t {
-+     unsigned long rb_wptr                        : 23;
-+     unsigned long                                : 9;
-+     } cp_rb_wptr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_rb_wptr_t f;
-+} cp_rb_wptr_u;
-+
-+typedef struct _cp_ib_base_t {
-+     unsigned long                                : 2;
-+     unsigned long ib_base                        : 22;
-+     unsigned long                                : 8;
-+     } cp_ib_base_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_ib_base_t f;
-+} cp_ib_base_u;
-+
-+typedef struct _cp_ib_bufsz_t {
-+     unsigned long ib_bufsz                       : 23;
-+     unsigned long                                : 9;
-+     } cp_ib_bufsz_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_ib_bufsz_t f;
-+} cp_ib_bufsz_u;
-+
-+typedef struct _cp_csq_cntl_t {
-+     unsigned long csq_cnt_primary                : 8;
-+     unsigned long csq_cnt_indirect               : 8;
-+     unsigned long                                : 12;
-+     unsigned long csq_mode                       : 4;
-+     } cp_csq_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_csq_cntl_t f;
-+} cp_csq_cntl_u;
-+
-+typedef struct _cp_csq_aper_primary_t {
-+     unsigned long cp_csq_aper_primary            : 32;
-+     } cp_csq_aper_primary_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_csq_aper_primary_t f;
-+} cp_csq_aper_primary_u;
-+
-+typedef struct _cp_csq_aper_indirect_t {
-+     unsigned long cp_csq_aper_indirect           : 32;
-+     } cp_csq_aper_indirect_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_csq_aper_indirect_t f;
-+} cp_csq_aper_indirect_u;
-+
-+typedef struct _cp_me_cntl_t {
-+     unsigned long me_stat                        : 16;
-+     unsigned long me_statmux                     : 5;
-+     unsigned long                                : 8;
-+     unsigned long me_busy                        : 1;
-+     unsigned long me_mode                        : 1;
-+     unsigned long me_step                        : 1;
-+     } cp_me_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_me_cntl_t f;
-+} cp_me_cntl_u;
-+
-+typedef struct _cp_me_ram_addr_t {
-+     unsigned long me_ram_addr                    : 8;
-+     unsigned long                                : 24;
-+     } cp_me_ram_addr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_me_ram_addr_t f;
-+} cp_me_ram_addr_u;
-+
-+typedef struct _cp_me_ram_raddr_t {
-+     unsigned long me_ram_raddr                   : 8;
-+     unsigned long                                : 24;
-+     } cp_me_ram_raddr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_me_ram_raddr_t f;
-+} cp_me_ram_raddr_u;
-+
-+typedef struct _cp_me_ram_datah_t {
-+     unsigned long me_ram_datah                   : 6;
-+     unsigned long                                : 26;
-+     } cp_me_ram_datah_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_me_ram_datah_t f;
-+} cp_me_ram_datah_u;
-+
-+typedef struct _cp_me_ram_datal_t {
-+     unsigned long me_ram_datal                   : 32;
-+     } cp_me_ram_datal_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_me_ram_datal_t f;
-+} cp_me_ram_datal_u;
-+
-+typedef struct _cp_debug_t {
-+     unsigned long cp_debug                       : 32;
-+     } cp_debug_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_debug_t f;
-+} cp_debug_u;
-+
-+typedef struct _scratch_reg0_t {
-+     unsigned long scratch_reg0                   : 32;
-+     } scratch_reg0_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     scratch_reg0_t f;
-+} scratch_reg0_u;
-+
-+typedef struct _scratch_reg1_t {
-+     unsigned long scratch_reg1                   : 32;
-+     } scratch_reg1_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     scratch_reg1_t f;
-+} scratch_reg1_u;
-+
-+typedef struct _scratch_reg2_t {
-+     unsigned long scratch_reg2                   : 32;
-+     } scratch_reg2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     scratch_reg2_t f;
-+} scratch_reg2_u;
-+
-+typedef struct _scratch_reg3_t {
-+     unsigned long scratch_reg3                   : 32;
-+     } scratch_reg3_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     scratch_reg3_t f;
-+} scratch_reg3_u;
-+
-+typedef struct _scratch_reg4_t {
-+     unsigned long scratch_reg4                   : 32;
-+     } scratch_reg4_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     scratch_reg4_t f;
-+} scratch_reg4_u;
-+
-+typedef struct _scratch_reg5_t {
-+     unsigned long scratch_reg5                   : 32;
-+     } scratch_reg5_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     scratch_reg5_t f;
-+} scratch_reg5_u;
-+
-+typedef struct _scratch_umsk_t {
-+     unsigned long scratch_umsk                   : 6;
-+     unsigned long                                : 10;
-+     unsigned long scratch_swap                   : 2;
-+     unsigned long                                : 14;
-+     } scratch_umsk_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     scratch_umsk_t f;
-+} scratch_umsk_u;
-+
-+typedef struct _scratch_addr_t {
-+     unsigned long                                : 5;
-+     unsigned long scratch_addr                   : 27;
-+     } scratch_addr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     scratch_addr_t f;
-+} scratch_addr_u;
-+
-+typedef struct _cp_csq_addr_t {
-+     unsigned long                                : 2;
-+     unsigned long csq_addr                       : 8;
-+     unsigned long                                : 22;
-+     } cp_csq_addr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_csq_addr_t f;
-+} cp_csq_addr_u;
-+
-+typedef struct _cp_csq_data_t {
-+     unsigned long csq_data                       : 32;
-+     } cp_csq_data_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_csq_data_t f;
-+} cp_csq_data_u;
-+
-+typedef struct _cp_csq_stat_t {
-+     unsigned long csq_rptr_primary               : 8;
-+     unsigned long csq_wptr_primary               : 8;
-+     unsigned long csq_rptr_indirect              : 8;
-+     unsigned long csq_wptr_indirect              : 8;
-+     } cp_csq_stat_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_csq_stat_t f;
-+} cp_csq_stat_u;
-+
-+typedef struct _cp_stat_t {
-+     unsigned long mru_busy                       : 1;
-+     unsigned long mwu_busy                       : 1;
-+     unsigned long rsiu_busy                      : 1;
-+     unsigned long rciu_busy                      : 1;
-+     unsigned long                                : 5;
-+     unsigned long csf_primary_busy               : 1;
-+     unsigned long csf_indirect_busy              : 1;
-+     unsigned long csq_primary_busy               : 1;
-+     unsigned long csq_indirect_busy              : 1;
-+     unsigned long csi_busy                       : 1;
-+     unsigned long                                : 14;
-+     unsigned long guidma_busy                    : 1;
-+     unsigned long viddma_busy                    : 1;
-+     unsigned long cmdstrm_busy                   : 1;
-+     unsigned long cp_busy                        : 1;
-+     } cp_stat_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cp_stat_t f;
-+} cp_stat_u;
-+
-+typedef struct _gen_int_cntl_t {
-+     unsigned long crtc_vblank_mask               : 1;
-+     unsigned long crtc_vline_mask                : 1;
-+     unsigned long crtc_hwint1_mask               : 1;
-+     unsigned long crtc_hwint2_mask               : 1;
-+     unsigned long                                : 15;
-+     unsigned long gui_idle_mask                  : 1;
-+     unsigned long                                : 8;
-+     unsigned long pm4_idle_int_mask              : 1;
-+     unsigned long dvi_i2c_int_mask               : 1;
-+     unsigned long                                : 2;
-+     } gen_int_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gen_int_cntl_t f;
-+} gen_int_cntl_u;
-+
-+typedef struct _gen_int_status_rd_t {
-+     unsigned long crtc_vblank_stat               : 1;
-+     unsigned long crtc_vline_stat                : 1;
-+     unsigned long crtc_hwint1_stat               : 1;
-+     unsigned long crtc_hwint2_stat               : 1;
-+     unsigned long                                : 15;
-+     unsigned long gui_idle_stat                  : 1;
-+     unsigned long                                : 8;
-+     unsigned long pm4_idle_int_stat              : 1;
-+     unsigned long dvi_i2c_int_stat               : 1;
-+     unsigned long                                : 2;
-+     } gen_int_status_rd_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gen_int_status_rd_t f;
-+} gen_int_status_rd_u;
-+
-+typedef struct _gen_int_status_wr_t {
-+     unsigned long crtc_vblank_stat_ak            : 1;
-+     unsigned long crtc_vline_stat_ak             : 1;
-+     unsigned long crtc_hwint1_stat_ak            : 1;
-+     unsigned long crtc_hwint2_stat_ak            : 1;
-+     unsigned long                                : 15;
-+     unsigned long gui_idle_stat_ak               : 1;
-+     unsigned long                                : 8;
-+     unsigned long pm4_idle_int_ak                : 1;
-+     unsigned long dvi_i2c_int_ak                 : 1;
-+     unsigned long                                : 2;
-+     } gen_int_status_wr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gen_int_status_wr_t f;
-+} gen_int_status_wr_u;
-+
-+typedef struct _lcd_format_t {
-+     unsigned long lcd_type                       : 4;
-+     unsigned long color_to_mono                  : 1;
-+     unsigned long data_inv                       : 1;
-+     unsigned long stn_fm                         : 2;
-+     unsigned long tft_fm                         : 2;
-+     unsigned long scan_lr_en                     : 1;
-+     unsigned long scan_ud_en                     : 1;
-+     unsigned long pol_inv                        : 1;
-+     unsigned long rst_fm                         : 1;
-+     unsigned long yuv_to_rgb                     : 1;
-+     unsigned long hr_tft                         : 1;
-+     unsigned long ulc_panel                      : 1;
-+     unsigned long                                : 15;
-+     } lcd_format_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     lcd_format_t f;
-+} lcd_format_u;
-+
-+typedef struct _graphic_ctrl_t {
-+     unsigned long color_depth                    : 3;
-+     unsigned long portrait_mode                  : 2;
-+     unsigned long low_power_on                   : 1;
-+     unsigned long req_freq                       : 4;
-+     unsigned long en_crtc                        : 1;
-+     unsigned long en_graphic_req                 : 1;
-+     unsigned long en_graphic_crtc                : 1;
-+     unsigned long total_req_graphic              : 9;
-+     unsigned long lcd_pclk_on                    : 1;
-+     unsigned long lcd_sclk_on                    : 1;
-+     unsigned long pclk_running                   : 1;
-+     unsigned long sclk_running                   : 1;
-+     unsigned long                                : 6;
-+     } graphic_ctrl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     graphic_ctrl_t f;
-+} graphic_ctrl_u;
-+
-+typedef struct _graphic_offset_t {
-+     unsigned long graphic_offset                 : 24;
-+     unsigned long                                : 8;
-+     } graphic_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     graphic_offset_t f;
-+} graphic_offset_u;
-+
-+typedef struct _graphic_pitch_t {
-+     unsigned long graphic_pitch                  : 11;
-+     unsigned long                                : 21;
-+     } graphic_pitch_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     graphic_pitch_t f;
-+} graphic_pitch_u;
-+
-+typedef struct _crtc_total_t {
-+     unsigned long crtc_h_total                   : 10;
-+     unsigned long                                : 6;
-+     unsigned long crtc_v_total                   : 10;
-+     unsigned long                                : 6;
-+     } crtc_total_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_total_t f;
-+} crtc_total_u;
-+
-+typedef struct _active_h_disp_t {
-+     unsigned long active_h_start                 : 10;
-+     unsigned long                                : 6;
-+     unsigned long active_h_end                   : 10;
-+     unsigned long                                : 6;
-+     } active_h_disp_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     active_h_disp_t f;
-+} active_h_disp_u;
-+
-+typedef struct _active_v_disp_t {
-+     unsigned long active_v_start                 : 10;
-+     unsigned long                                : 6;
-+     unsigned long active_v_end                   : 10;
-+     unsigned long                                : 6;
-+     } active_v_disp_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     active_v_disp_t f;
-+} active_v_disp_u;
-+
-+typedef struct _graphic_h_disp_t {
-+     unsigned long graphic_h_start                : 10;
-+     unsigned long                                : 6;
-+     unsigned long graphic_h_end                  : 10;
-+     unsigned long                                : 6;
-+     } graphic_h_disp_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     graphic_h_disp_t f;
-+} graphic_h_disp_u;
-+
-+typedef struct _graphic_v_disp_t {
-+     unsigned long graphic_v_start                : 10;
-+     unsigned long                                : 6;
-+     unsigned long graphic_v_end                  : 10;
-+     unsigned long                                : 6;
-+     } graphic_v_disp_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     graphic_v_disp_t f;
-+} graphic_v_disp_u;
-+
-+typedef struct _video_ctrl_t {
-+     unsigned long video_mode                     : 1;
-+     unsigned long keyer_en                       : 1;
-+     unsigned long en_video_req                   : 1;
-+     unsigned long en_graphic_req_video           : 1;
-+     unsigned long en_video_crtc                  : 1;
-+     unsigned long video_hor_exp                  : 2;
-+     unsigned long video_ver_exp                  : 2;
-+     unsigned long uv_combine                     : 1;
-+     unsigned long total_req_video                : 9;
-+     unsigned long video_ch_sel                   : 1;
-+     unsigned long video_portrait                 : 2;
-+     unsigned long yuv2rgb_en                     : 1;
-+     unsigned long yuv2rgb_option                 : 1;
-+     unsigned long video_inv_hor                  : 1;
-+     unsigned long video_inv_ver                  : 1;
-+     unsigned long gamma_sel                      : 2;
-+     unsigned long dis_limit                      : 1;
-+     unsigned long en_uv_hblend                   : 1;
-+     unsigned long rgb_gamma_sel                  : 2;
-+     } video_ctrl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_ctrl_t f;
-+} video_ctrl_u;
-+
-+typedef struct _graphic_key_t {
-+     unsigned long keyer_color                    : 16;
-+     unsigned long keyer_mask                     : 16;
-+     } graphic_key_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     graphic_key_t f;
-+} graphic_key_u;
-+
-+typedef struct _video_y_offset_t {
-+     unsigned long y_offset                       : 24;
-+     unsigned long                                : 8;
-+     } video_y_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_y_offset_t f;
-+} video_y_offset_u;
-+
-+typedef struct _video_y_pitch_t {
-+     unsigned long y_pitch                        : 11;
-+     unsigned long                                : 21;
-+     } video_y_pitch_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_y_pitch_t f;
-+} video_y_pitch_u;
-+
-+typedef struct _video_u_offset_t {
-+     unsigned long u_offset                       : 24;
-+     unsigned long                                : 8;
-+     } video_u_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_u_offset_t f;
-+} video_u_offset_u;
-+
-+typedef struct _video_u_pitch_t {
-+     unsigned long u_pitch                        : 11;
-+     unsigned long                                : 21;
-+     } video_u_pitch_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_u_pitch_t f;
-+} video_u_pitch_u;
-+
-+typedef struct _video_v_offset_t {
-+     unsigned long v_offset                       : 24;
-+     unsigned long                                : 8;
-+     } video_v_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_v_offset_t f;
-+} video_v_offset_u;
-+
-+typedef struct _video_v_pitch_t {
-+     unsigned long v_pitch                        : 11;
-+     unsigned long                                : 21;
-+     } video_v_pitch_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_v_pitch_t f;
-+} video_v_pitch_u;
-+
-+typedef struct _video_h_pos_t {
-+     unsigned long video_h_start                  : 10;
-+     unsigned long                                : 6;
-+     unsigned long video_h_end                    : 10;
-+     unsigned long                                : 6;
-+     } video_h_pos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_h_pos_t f;
-+} video_h_pos_u;
-+
-+typedef struct _video_v_pos_t {
-+     unsigned long video_v_start                  : 10;
-+     unsigned long                                : 6;
-+     unsigned long video_v_end                    : 10;
-+     unsigned long                                : 6;
-+     } video_v_pos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     video_v_pos_t f;
-+} video_v_pos_u;
-+
-+typedef struct _brightness_cntl_t {
-+     unsigned long brightness                     : 7;
-+     unsigned long                                : 25;
-+     } brightness_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     brightness_cntl_t f;
-+} brightness_cntl_u;
-+
-+typedef struct _cursor1_offset_t {
-+     unsigned long cur1_offset                    : 24;
-+     unsigned long cur1_x_offset                  : 4;
-+     unsigned long cur1_y_offset                  : 4;
-+     } cursor1_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor1_offset_t f;
-+} cursor1_offset_u;
-+
-+typedef struct _cursor1_h_pos_t {
-+     unsigned long cur1_h_start                   : 10;
-+     unsigned long                                : 6;
-+     unsigned long cur1_h_end                     : 10;
-+     unsigned long                                : 5;
-+     unsigned long cur1_en                        : 1;
-+     } cursor1_h_pos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor1_h_pos_t f;
-+} cursor1_h_pos_u;
-+
-+typedef struct _cursor1_v_pos_t {
-+     unsigned long cur1_v_start                   : 10;
-+     unsigned long                                : 6;
-+     unsigned long cur1_v_end                     : 10;
-+     unsigned long                                : 6;
-+     } cursor1_v_pos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor1_v_pos_t f;
-+} cursor1_v_pos_u;
-+
-+typedef struct _cursor1_color0_t {
-+     unsigned long cur1_color0_r                  : 8;
-+     unsigned long cur1_color0_g                  : 8;
-+     unsigned long cur1_color0_b                  : 8;
-+     unsigned long                                : 8;
-+     } cursor1_color0_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor1_color0_t f;
-+} cursor1_color0_u;
-+
-+typedef struct _cursor1_color1_t {
-+     unsigned long cur1_color1_r                  : 8;
-+     unsigned long cur1_color1_g                  : 8;
-+     unsigned long cur1_color1_b                  : 8;
-+     unsigned long                                : 8;
-+     } cursor1_color1_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor1_color1_t f;
-+} cursor1_color1_u;
-+
-+typedef struct _cursor2_offset_t {
-+     unsigned long cur2_offset                    : 24;
-+     unsigned long cur2_x_offset                  : 4;
-+     unsigned long cur2_y_offset                  : 4;
-+     } cursor2_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor2_offset_t f;
-+} cursor2_offset_u;
-+
-+typedef struct _cursor2_h_pos_t {
-+     unsigned long cur2_h_start                   : 10;
-+     unsigned long                                : 6;
-+     unsigned long cur2_h_end                     : 10;
-+     unsigned long                                : 5;
-+     unsigned long cur2_en                        : 1;
-+     } cursor2_h_pos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor2_h_pos_t f;
-+} cursor2_h_pos_u;
-+
-+typedef struct _cursor2_v_pos_t {
-+     unsigned long cur2_v_start                   : 10;
-+     unsigned long                                : 6;
-+     unsigned long cur2_v_end                     : 10;
-+     unsigned long                                : 6;
-+     } cursor2_v_pos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor2_v_pos_t f;
-+} cursor2_v_pos_u;
-+
-+typedef struct _cursor2_color0_t {
-+     unsigned long cur2_color0_r                  : 8;
-+     unsigned long cur2_color0_g                  : 8;
-+     unsigned long cur2_color0_b                  : 8;
-+     unsigned long                                : 8;
-+     } cursor2_color0_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor2_color0_t f;
-+} cursor2_color0_u;
-+
-+typedef struct _cursor2_color1_t {
-+     unsigned long cur2_color1_r                  : 8;
-+     unsigned long cur2_color1_g                  : 8;
-+     unsigned long cur2_color1_b                  : 8;
-+     unsigned long                                : 8;
-+     } cursor2_color1_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     cursor2_color1_t f;
-+} cursor2_color1_u;
-+
-+typedef struct _disp_int_cntl_t {
-+     unsigned long vline_int_pos                  : 10;
-+     unsigned long                                : 6;
-+     unsigned long hpos_int_pos                   : 10;
-+     unsigned long                                : 4;
-+     unsigned long vblank_int_pol                 : 1;
-+     unsigned long frame_int_pol                  : 1;
-+     } disp_int_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     disp_int_cntl_t f;
-+} disp_int_cntl_u;
-+
-+typedef struct _crtc_ss_t {
-+     unsigned long ss_start                       : 10;
-+     unsigned long                                : 6;
-+     unsigned long ss_end                         : 10;
-+     unsigned long                                : 2;
-+     unsigned long ss_align                       : 1;
-+     unsigned long ss_pol                         : 1;
-+     unsigned long ss_run_mode                    : 1;
-+     unsigned long ss_en                          : 1;
-+     } crtc_ss_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_ss_t f;
-+} crtc_ss_u;
-+
-+typedef struct _crtc_ls_t {
-+     unsigned long ls_start                       : 10;
-+     unsigned long                                : 6;
-+     unsigned long ls_end                         : 10;
-+     unsigned long                                : 2;
-+     unsigned long ls_align                       : 1;
-+     unsigned long ls_pol                         : 1;
-+     unsigned long ls_run_mode                    : 1;
-+     unsigned long ls_en                          : 1;
-+     } crtc_ls_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_ls_t f;
-+} crtc_ls_u;
-+
-+typedef struct _crtc_rev_t {
-+     unsigned long rev_pos                        : 10;
-+     unsigned long                                : 6;
-+     unsigned long rev_align                      : 1;
-+     unsigned long rev_freq_nref                  : 5;
-+     unsigned long rev_en                         : 1;
-+     unsigned long                                : 9;
-+     } crtc_rev_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_rev_t f;
-+} crtc_rev_u;
-+
-+typedef struct _crtc_dclk_t {
-+     unsigned long dclk_start                     : 10;
-+     unsigned long                                : 6;
-+     unsigned long dclk_end                       : 10;
-+     unsigned long                                : 1;
-+     unsigned long dclk_run_mode                  : 2;
-+     unsigned long dclk_pol                       : 1;
-+     unsigned long dclk_align                     : 1;
-+     unsigned long dclk_en                        : 1;
-+     } crtc_dclk_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_dclk_t f;
-+} crtc_dclk_u;
-+
-+typedef struct _crtc_gs_t {
-+     unsigned long gs_start                       : 10;
-+     unsigned long                                : 6;
-+     unsigned long gs_end                         : 10;
-+     unsigned long                                : 3;
-+     unsigned long gs_align                       : 1;
-+     unsigned long gs_pol                         : 1;
-+     unsigned long gs_en                          : 1;
-+     } crtc_gs_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_gs_t f;
-+} crtc_gs_u;
-+
-+typedef struct _crtc_vpos_gs_t {
-+     unsigned long gs_vpos_start                  : 10;
-+     unsigned long                                : 6;
-+     unsigned long gs_vpos_end                    : 10;
-+     unsigned long                                : 6;
-+     } crtc_vpos_gs_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_vpos_gs_t f;
-+} crtc_vpos_gs_u;
-+
-+typedef struct _crtc_gclk_t {
-+     unsigned long gclk_start                     : 10;
-+     unsigned long                                : 6;
-+     unsigned long gclk_end                       : 10;
-+     unsigned long                                : 3;
-+     unsigned long gclk_align                     : 1;
-+     unsigned long gclk_pol                       : 1;
-+     unsigned long gclk_en                        : 1;
-+     } crtc_gclk_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_gclk_t f;
-+} crtc_gclk_u;
-+
-+typedef struct _crtc_goe_t {
-+     unsigned long goe_start                      : 10;
-+     unsigned long                                : 6;
-+     unsigned long goe_end                        : 10;
-+     unsigned long                                : 3;
-+     unsigned long goe_align                      : 1;
-+     unsigned long goe_pol                        : 1;
-+     unsigned long goe_en                         : 1;
-+     } crtc_goe_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_goe_t f;
-+} crtc_goe_u;
-+
-+typedef struct _crtc_frame_t {
-+     unsigned long crtc_fr_start                  : 10;
-+     unsigned long                                : 6;
-+     unsigned long crtc_fr_end                    : 10;
-+     unsigned long                                : 4;
-+     unsigned long crtc_frame_en                  : 1;
-+     unsigned long crtc_frame_align               : 1;
-+     } crtc_frame_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_frame_t f;
-+} crtc_frame_u;
-+
-+typedef struct _crtc_frame_vpos_t {
-+     unsigned long crtc_fr_vpos                   : 10;
-+     unsigned long                                : 22;
-+     } crtc_frame_vpos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_frame_vpos_t f;
-+} crtc_frame_vpos_u;
-+
-+typedef struct _gpio_data_t {
-+     unsigned long gio_out                        : 16;
-+     unsigned long gio_in                         : 16;
-+     } gpio_data_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gpio_data_t f;
-+} gpio_data_u;
-+
-+typedef struct _gpio_cntl1_t {
-+     unsigned long gio_pd                         : 16;
-+     unsigned long gio_schmen                     : 16;
-+     } gpio_cntl1_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gpio_cntl1_t f;
-+} gpio_cntl1_u;
-+
-+typedef struct _gpio_cntl2_t {
-+     unsigned long gio_oe                         : 16;
-+     unsigned long gio_srp                        : 1;
-+     unsigned long gio_srn                        : 1;
-+     unsigned long gio_sp                         : 4;
-+     unsigned long gio_sn                         : 4;
-+     unsigned long                                : 6;
-+     } gpio_cntl2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gpio_cntl2_t f;
-+} gpio_cntl2_u;
-+
-+typedef struct _lcdd_cntl1_t {
-+     unsigned long lcdd_pd                        : 18;
-+     unsigned long lcdd_srp                       : 1;
-+     unsigned long lcdd_srn                       : 1;
-+     unsigned long lcdd_sp                        : 4;
-+     unsigned long lcdd_sn                        : 4;
-+     unsigned long lcdd_align                     : 1;
-+     unsigned long                                : 3;
-+     } lcdd_cntl1_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     lcdd_cntl1_t f;
-+} lcdd_cntl1_u;
-+
-+typedef struct _lcdd_cntl2_t {
-+     unsigned long lcdd_oe                        : 18;
-+     unsigned long                                : 14;
-+     } lcdd_cntl2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     lcdd_cntl2_t f;
-+} lcdd_cntl2_u;
-+
-+typedef struct _genlcd_cntl1_t {
-+     unsigned long dclk_oe                        : 1;
-+     unsigned long dclk_pd                        : 1;
-+     unsigned long dclk_srp                       : 1;
-+     unsigned long dclk_srn                       : 1;
-+     unsigned long dclk_sp                        : 4;
-+     unsigned long dclk_sn                        : 4;
-+     unsigned long ss_oe                          : 1;
-+     unsigned long ss_pd                          : 1;
-+     unsigned long ls_oe                          : 1;
-+     unsigned long ls_pd                          : 1;
-+     unsigned long gs_oe                          : 1;
-+     unsigned long gs_pd                          : 1;
-+     unsigned long goe_oe                         : 1;
-+     unsigned long goe_pd                         : 1;
-+     unsigned long rev_oe                         : 1;
-+     unsigned long rev_pd                         : 1;
-+     unsigned long frame_oe                       : 1;
-+     unsigned long frame_pd                       : 1;
-+     unsigned long                                : 8;
-+     } genlcd_cntl1_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     genlcd_cntl1_t f;
-+} genlcd_cntl1_u;
-+
-+typedef struct _genlcd_cntl2_t {
-+     unsigned long gclk_oe                        : 1;
-+     unsigned long gclk_pd                        : 1;
-+     unsigned long gclk_srp                       : 1;
-+     unsigned long gclk_srn                       : 1;
-+     unsigned long gclk_sp                        : 4;
-+     unsigned long gclk_sn                        : 4;
-+     unsigned long genlcd_srp                     : 1;
-+     unsigned long genlcd_srn                     : 1;
-+     unsigned long genlcd_sp                      : 4;
-+     unsigned long genlcd_sn                      : 4;
-+     unsigned long                                : 10;
-+     } genlcd_cntl2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     genlcd_cntl2_t f;
-+} genlcd_cntl2_u;
-+
-+typedef struct _disp_debug_t {
-+     unsigned long disp_debug                     : 32;
-+     } disp_debug_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     disp_debug_t f;
-+} disp_debug_u;
-+
-+typedef struct _disp_db_buf_cntl_rd_t {
-+     unsigned long en_db_buf                      : 1;
-+     unsigned long update_db_buf_done             : 1;
-+     unsigned long db_buf_cntl                    : 6;
-+     unsigned long                                : 24;
-+     } disp_db_buf_cntl_rd_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     disp_db_buf_cntl_rd_t f;
-+} disp_db_buf_cntl_rd_u;
-+
-+typedef struct _disp_db_buf_cntl_wr_t {
-+     unsigned long en_db_buf                      : 1;
-+     unsigned long update_db_buf                  : 1;
-+     unsigned long db_buf_cntl                    : 6;
-+     unsigned long                                : 24;
-+     } disp_db_buf_cntl_wr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     disp_db_buf_cntl_wr_t f;
-+} disp_db_buf_cntl_wr_u;
-+
-+typedef struct _disp_crc_sig_t {
-+     unsigned long crc_sig_r                      : 6;
-+     unsigned long crc_sig_g                      : 6;
-+     unsigned long crc_sig_b                      : 6;
-+     unsigned long crc_cont_en                    : 1;
-+     unsigned long crc_en                         : 1;
-+     unsigned long crc_mask_en                    : 1;
-+     unsigned long crc_sig_cntl                   : 6;
-+     unsigned long                                : 5;
-+     } disp_crc_sig_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     disp_crc_sig_t f;
-+} disp_crc_sig_u;
-+
-+typedef struct _crtc_default_count_t {
-+     unsigned long crtc_hcount_def                : 10;
-+     unsigned long                                : 6;
-+     unsigned long crtc_vcount_def                : 10;
-+     unsigned long                                : 6;
-+     } crtc_default_count_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_default_count_t f;
-+} crtc_default_count_u;
-+
-+typedef struct _lcd_background_color_t {
-+     unsigned long lcd_bg_red                     : 8;
-+     unsigned long lcd_bg_green                   : 8;
-+     unsigned long lcd_bg_blue                    : 8;
-+     unsigned long                                : 8;
-+     } lcd_background_color_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     lcd_background_color_t f;
-+} lcd_background_color_u;
-+
-+typedef struct _crtc_ps2_t {
-+     unsigned long ps2_start                      : 10;
-+     unsigned long                                : 6;
-+     unsigned long ps2_end                        : 10;
-+     unsigned long                                : 4;
-+     unsigned long ps2_pol                        : 1;
-+     unsigned long ps2_en                         : 1;
-+     } crtc_ps2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_ps2_t f;
-+} crtc_ps2_u;
-+
-+typedef struct _crtc_ps2_vpos_t {
-+     unsigned long ps2_vpos_start                 : 10;
-+     unsigned long                                : 6;
-+     unsigned long ps2_vpos_end                   : 10;
-+     unsigned long                                : 6;
-+     } crtc_ps2_vpos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_ps2_vpos_t f;
-+} crtc_ps2_vpos_u;
-+
-+typedef struct _crtc_ps1_active_t {
-+     unsigned long ps1_h_start                    : 10;
-+     unsigned long                                : 6;
-+     unsigned long ps1_h_end                      : 10;
-+     unsigned long                                : 3;
-+     unsigned long ps1_pol                        : 1;
-+     unsigned long ps1_en                         : 1;
-+     unsigned long ps1_use_nactive                : 1;
-+     } crtc_ps1_active_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_ps1_active_t f;
-+} crtc_ps1_active_u;
-+
-+typedef struct _crtc_ps1_nactive_t {
-+     unsigned long ps1_h_start_na                 : 10;
-+     unsigned long                                : 6;
-+     unsigned long ps1_h_end_na                   : 10;
-+     unsigned long                                : 5;
-+     unsigned long ps1_en_na                      : 1;
-+     } crtc_ps1_nactive_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_ps1_nactive_t f;
-+} crtc_ps1_nactive_u;
-+
-+typedef struct _crtc_gclk_ext_t {
-+     unsigned long gclk_alter_start               : 10;
-+     unsigned long                                : 6;
-+     unsigned long gclk_alter_width               : 2;
-+     unsigned long gclk_en_alter                  : 1;
-+     unsigned long gclk_db_width                  : 2;
-+     unsigned long                                : 11;
-+     } crtc_gclk_ext_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_gclk_ext_t f;
-+} crtc_gclk_ext_u;
-+
-+typedef struct _crtc_alw_t {
-+     unsigned long alw_hstart                     : 10;
-+     unsigned long                                : 6;
-+     unsigned long alw_hend                       : 10;
-+     unsigned long                                : 4;
-+     unsigned long alw_delay                      : 1;
-+     unsigned long alw_en                         : 1;
-+     } crtc_alw_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_alw_t f;
-+} crtc_alw_u;
-+
-+typedef struct _crtc_alw_vpos_t {
-+     unsigned long alw_vstart                     : 10;
-+     unsigned long                                : 6;
-+     unsigned long alw_vend                       : 10;
-+     unsigned long                                : 6;
-+     } crtc_alw_vpos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_alw_vpos_t f;
-+} crtc_alw_vpos_u;
-+
-+typedef struct _crtc_psk_t {
-+     unsigned long psk_vstart                     : 10;
-+     unsigned long                                : 6;
-+     unsigned long psk_vend                       : 10;
-+     unsigned long                                : 4;
-+     unsigned long psk_pol                        : 1;
-+     unsigned long psk_en                         : 1;
-+     } crtc_psk_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_psk_t f;
-+} crtc_psk_u;
-+
-+typedef struct _crtc_psk_hpos_t {
-+     unsigned long psk_hstart                     : 10;
-+     unsigned long                                : 6;
-+     unsigned long psk_hend                       : 10;
-+     unsigned long                                : 6;
-+     } crtc_psk_hpos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_psk_hpos_t f;
-+} crtc_psk_hpos_u;
-+
-+typedef struct _crtc_cv4_start_t {
-+     unsigned long cv4_vstart                     : 10;
-+     unsigned long                                : 20;
-+     unsigned long cv4_pol                        : 1;
-+     unsigned long cv4_en                         : 1;
-+     } crtc_cv4_start_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_cv4_start_t f;
-+} crtc_cv4_start_u;
-+
-+typedef struct _crtc_cv4_end_t {
-+     unsigned long cv4_vend1                      : 10;
-+     unsigned long                                : 6;
-+     unsigned long cv4_vend2                      : 10;
-+     unsigned long                                : 6;
-+     } crtc_cv4_end_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_cv4_end_t f;
-+} crtc_cv4_end_u;
-+
-+typedef struct _crtc_cv4_hpos_t {
-+     unsigned long cv4_hstart                     : 10;
-+     unsigned long                                : 6;
-+     unsigned long cv4_hend                       : 10;
-+     unsigned long                                : 6;
-+     } crtc_cv4_hpos_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_cv4_hpos_t f;
-+} crtc_cv4_hpos_u;
-+
-+typedef struct _crtc_eck_t {
-+     unsigned long eck_freq1                      : 3;
-+     unsigned long eck_en                         : 1;
-+     unsigned long                                : 28;
-+     } crtc_eck_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     crtc_eck_t f;
-+} crtc_eck_u;
-+
-+typedef struct _refresh_cntl_t {
-+     unsigned long ref_frame                      : 3;
-+     unsigned long nref_frame                     : 5;
-+     unsigned long ref_cntl                       : 1;
-+     unsigned long stop_sm_nref                   : 1;
-+     unsigned long stop_req_nref                  : 1;
-+     unsigned long                                : 21;
-+     } refresh_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     refresh_cntl_t f;
-+} refresh_cntl_u;
-+
-+typedef struct _genlcd_cntl3_t {
-+     unsigned long ps1_oe                         : 1;
-+     unsigned long ps1_pd                         : 1;
-+     unsigned long ps2_oe                         : 1;
-+     unsigned long ps2_pd                         : 1;
-+     unsigned long rev2_oe                        : 1;
-+     unsigned long rev2_pd                        : 1;
-+     unsigned long awl_oe                         : 1;
-+     unsigned long awl_pd                         : 1;
-+     unsigned long dinv_oe                        : 1;
-+     unsigned long dinv_pd                        : 1;
-+     unsigned long psk_out                        : 1;
-+     unsigned long psd_out                        : 1;
-+     unsigned long eck_out                        : 1;
-+     unsigned long cv4_out                        : 1;
-+     unsigned long ps1_out                        : 1;
-+     unsigned long ps2_out                        : 1;
-+     unsigned long rev_out                        : 1;
-+     unsigned long rev2_out                       : 1;
-+     unsigned long                                : 14;
-+     } genlcd_cntl3_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     genlcd_cntl3_t f;
-+} genlcd_cntl3_u;
-+
-+typedef struct _gpio_data2_t {
-+     unsigned long gio2_out                       : 16;
-+     unsigned long gio2_in                        : 16;
-+     } gpio_data2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gpio_data2_t f;
-+} gpio_data2_u;
-+
-+typedef struct _gpio_cntl3_t {
-+     unsigned long gio2_pd                        : 16;
-+     unsigned long gio2_schmen                    : 16;
-+     } gpio_cntl3_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gpio_cntl3_t f;
-+} gpio_cntl3_u;
-+
-+typedef struct _gpio_cntl4_t {
-+     unsigned long gio2_oe                        : 16;
-+     unsigned long                                : 16;
-+     } gpio_cntl4_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gpio_cntl4_t f;
-+} gpio_cntl4_u;
-+
-+typedef struct _chip_strap_t {
-+     unsigned long config_strap                   : 8;
-+     unsigned long pkg_strap                      : 1;
-+     unsigned long                                : 23;
-+     } chip_strap_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     chip_strap_t f;
-+} chip_strap_u;
-+
-+typedef struct _disp_debug2_t {
-+     unsigned long disp_debug2                    : 32;
-+     } disp_debug2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     disp_debug2_t f;
-+} disp_debug2_u;
-+
-+typedef struct _debug_bus_cntl_t {
-+     unsigned long debug_testmux                  : 4;
-+     unsigned long debug_testsel                  : 4;
-+     unsigned long debug_gioa_sel                 : 2;
-+     unsigned long debug_giob_sel                 : 2;
-+     unsigned long debug_clk_sel                  : 1;
-+     unsigned long debug_clk_inv                  : 1;
-+     unsigned long                                : 2;
-+     unsigned long debug_bus                      : 16;
-+     } debug_bus_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     debug_bus_cntl_t f;
-+} debug_bus_cntl_u;
-+
-+typedef struct _gamma_value1_t {
-+     unsigned long gamma1                         : 8;
-+     unsigned long gamma2                         : 8;
-+     unsigned long gamma3                         : 8;
-+     unsigned long gamma4                         : 8;
-+     } gamma_value1_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gamma_value1_t f;
-+} gamma_value1_u;
-+
-+typedef struct _gamma_value2_t {
-+     unsigned long gamma5                         : 8;
-+     unsigned long gamma6                         : 8;
-+     unsigned long gamma7                         : 8;
-+     unsigned long gamma8                         : 8;
-+     } gamma_value2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gamma_value2_t f;
-+} gamma_value2_u;
-+
-+typedef struct _gamma_slope_t {
-+     unsigned long slope1                         : 3;
-+     unsigned long slope2                         : 3;
-+     unsigned long slope3                         : 3;
-+     unsigned long slope4                         : 3;
-+     unsigned long slope5                         : 3;
-+     unsigned long slope6                         : 3;
-+     unsigned long slope7                         : 3;
-+     unsigned long slope8                         : 3;
-+     unsigned long                                : 8;
-+     } gamma_slope_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gamma_slope_t f;
-+} gamma_slope_u;
-+
-+typedef struct _gen_status_t {
-+     unsigned long status                         : 16;
-+     unsigned long                                : 16;
-+     } gen_status_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     gen_status_t f;
-+} gen_status_u;
-+
-+typedef struct _hw_int_t {
-+     unsigned long hwint1_pos                     : 5;
-+     unsigned long hwint2_pos                     : 5;
-+     unsigned long hwint1_pol                     : 1;
-+     unsigned long hwint2_pol                     : 1;
-+     unsigned long hwint1_en_db                   : 1;
-+     unsigned long hwint2_en_db                   : 1;
-+     unsigned long                                : 18;
-+     } hw_int_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     hw_int_t f;
-+} hw_int_u;
-+
-+typedef struct _dst_offset_t {
-+     unsigned long dst_offset                     : 24;
-+     unsigned long                                : 8;
-+     } dst_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_offset_t f;
-+} dst_offset_u;
-+
-+typedef struct _dst_pitch_t {
-+     unsigned long dst_pitch                      : 14;
-+     unsigned long mc_dst_pitch_mul               : 2;
-+     unsigned long                                : 16;
-+     } dst_pitch_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_pitch_t f;
-+} dst_pitch_u;
-+
-+typedef struct _dst_pitch_offset_t {
-+     unsigned long dst_offset                     : 20;
-+     unsigned long dst_pitch                      : 10;
-+     unsigned long mc_dst_pitch_mul               : 2;
-+     } dst_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_pitch_offset_t f;
-+} dst_pitch_offset_u;
-+
-+typedef struct _dst_x_t {
-+     unsigned long dst_x                          : 14;
-+     unsigned long                                : 18;
-+     } dst_x_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_x_t f;
-+} dst_x_u;
-+
-+typedef struct _dst_y_t {
-+     unsigned long dst_y                          : 14;
-+     unsigned long                                : 18;
-+     } dst_y_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_y_t f;
-+} dst_y_u;
-+
-+typedef struct _dst_x_y_t {
-+     unsigned long dst_y                          : 14;
-+     unsigned long                                : 2;
-+     unsigned long dst_x                          : 14;
-+     unsigned long                                : 2;
-+     } dst_x_y_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_x_y_t f;
-+} dst_x_y_u;
-+
-+typedef struct _dst_y_x_t {
-+     unsigned long dst_x                          : 14;
-+     unsigned long                                : 2;
-+     unsigned long dst_y                          : 14;
-+     unsigned long                                : 2;
-+     } dst_y_x_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_y_x_t f;
-+} dst_y_x_u;
-+
-+typedef struct _dst_width_t {
-+     unsigned long dst_width_b0                   : 8;
-+     unsigned long dst_width_b1                   : 6;
-+     unsigned long                                : 18;
-+     } dst_width_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_width_t f;
-+} dst_width_u;
-+
-+typedef struct _dst_height_t {
-+     unsigned long dst_height                     : 14;
-+     unsigned long                                : 18;
-+     } dst_height_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_height_t f;
-+} dst_height_u;
-+
-+typedef struct _dst_width_height_t {
-+     unsigned long dst_height                     : 14;
-+     unsigned long                                : 2;
-+     unsigned long dst_width_b0                   : 8;
-+     unsigned long dst_width_b1                   : 6;
-+     unsigned long                                : 2;
-+     } dst_width_height_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_width_height_t f;
-+} dst_width_height_u;
-+
-+typedef struct _dst_height_width_t {
-+     unsigned long dst_width_b0                   : 8;
-+     unsigned long dst_width_b1                   : 6;
-+     unsigned long                                : 2;
-+     unsigned long dst_height                     : 14;
-+     unsigned long                                : 2;
-+     } dst_height_width_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_height_width_t f;
-+} dst_height_width_u;
-+
-+typedef struct _dst_height_width_8_t {
-+     unsigned long                                : 16;
-+     unsigned long dst_width_b0                   : 8;
-+     unsigned long dst_height                     : 8;
-+     } dst_height_width_8_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_height_width_8_t f;
-+} dst_height_width_8_u;
-+
-+typedef struct _dst_height_y_t {
-+     unsigned long dst_y                          : 14;
-+     unsigned long                                : 2;
-+     unsigned long dst_height                     : 14;
-+     unsigned long                                : 2;
-+     } dst_height_y_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_height_y_t f;
-+} dst_height_y_u;
-+
-+typedef struct _dst_width_x_t {
-+     unsigned long dst_x                          : 14;
-+     unsigned long                                : 2;
-+     unsigned long dst_width_b0                   : 8;
-+     unsigned long dst_width_b1                   : 6;
-+     unsigned long                                : 2;
-+     } dst_width_x_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_width_x_t f;
-+} dst_width_x_u;
-+
-+typedef struct _dst_width_x_incy_t {
-+     unsigned long dst_x                          : 14;
-+     unsigned long                                : 2;
-+     unsigned long dst_width_b0                   : 8;
-+     unsigned long dst_width_b1                   : 6;
-+     unsigned long                                : 2;
-+     } dst_width_x_incy_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_width_x_incy_t f;
-+} dst_width_x_incy_u;
-+
-+typedef struct _dst_line_start_t {
-+     unsigned long dst_start_x                    : 14;
-+     unsigned long                                : 2;
-+     unsigned long dst_start_y                    : 14;
-+     unsigned long                                : 2;
-+     } dst_line_start_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_line_start_t f;
-+} dst_line_start_u;
-+
-+typedef struct _dst_line_end_t {
-+     unsigned long dst_end_x                      : 14;
-+     unsigned long                                : 2;
-+     unsigned long dst_end_y_b0                   : 8;
-+     unsigned long dst_end_y_b1                   : 6;
-+     unsigned long                                : 2;
-+     } dst_line_end_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dst_line_end_t f;
-+} dst_line_end_u;
-+
-+typedef struct _brush_offset_t {
-+     unsigned long brush_offset                   : 24;
-+     unsigned long                                : 8;
-+     } brush_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     brush_offset_t f;
-+} brush_offset_u;
-+
-+typedef struct _brush_y_x_t {
-+     unsigned long brush_x                        : 5;
-+     unsigned long                                : 3;
-+     unsigned long brush_y                        : 3;
-+     unsigned long                                : 21;
-+     } brush_y_x_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     brush_y_x_t f;
-+} brush_y_x_u;
-+
-+typedef struct _dp_brush_frgd_clr_t {
-+     unsigned long dp_brush_frgd_clr              : 32;
-+     } dp_brush_frgd_clr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_brush_frgd_clr_t f;
-+} dp_brush_frgd_clr_u;
-+
-+typedef struct _dp_brush_bkgd_clr_t {
-+     unsigned long dp_brush_bkgd_clr              : 32;
-+     } dp_brush_bkgd_clr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_brush_bkgd_clr_t f;
-+} dp_brush_bkgd_clr_u;
-+
-+typedef struct _src2_offset_t {
-+     unsigned long src2_offset                    : 24;
-+     unsigned long                                : 8;
-+     } src2_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_offset_t f;
-+} src2_offset_u;
-+
-+typedef struct _src2_pitch_t {
-+     unsigned long src2_pitch                     : 14;
-+     unsigned long src2_pitch_mul                 : 2;
-+     unsigned long                                : 16;
-+     } src2_pitch_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_pitch_t f;
-+} src2_pitch_u;
-+
-+typedef struct _src2_pitch_offset_t {
-+     unsigned long src2_offset                    : 20;
-+     unsigned long                                : 2;
-+     unsigned long src2_pitch                     : 8;
-+     unsigned long src2_pitch_mul                 : 2;
-+     } src2_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_pitch_offset_t f;
-+} src2_pitch_offset_u;
-+
-+typedef struct _src2_x_t {
-+     unsigned long src_x                          : 14;
-+     unsigned long                                : 18;
-+     } src2_x_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_x_t f;
-+} src2_x_u;
-+
-+typedef struct _src2_y_t {
-+     unsigned long src_y                          : 14;
-+     unsigned long                                : 18;
-+     } src2_y_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_y_t f;
-+} src2_y_u;
-+
-+typedef struct _src2_x_y_t {
-+     unsigned long src_y                          : 14;
-+     unsigned long                                : 2;
-+     unsigned long src_x                          : 14;
-+     unsigned long                                : 2;
-+     } src2_x_y_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_x_y_t f;
-+} src2_x_y_u;
-+
-+typedef struct _src2_width_t {
-+     unsigned long src2_width                     : 14;
-+     unsigned long                                : 18;
-+     } src2_width_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_width_t f;
-+} src2_width_u;
-+
-+typedef struct _src2_height_t {
-+     unsigned long src2_height                    : 14;
-+     unsigned long                                : 18;
-+     } src2_height_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_height_t f;
-+} src2_height_u;
-+
-+typedef struct _src2_inc_t {
-+     unsigned long src2_xinc                      : 6;
-+     unsigned long                                : 2;
-+     unsigned long src2_yinc                      : 6;
-+     unsigned long                                : 18;
-+     } src2_inc_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src2_inc_t f;
-+} src2_inc_u;
-+
-+typedef struct _src_offset_t {
-+     unsigned long src_offset                     : 24;
-+     unsigned long                                : 8;
-+     } src_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_offset_t f;
-+} src_offset_u;
-+
-+typedef struct _src_pitch_t {
-+     unsigned long src_pitch                      : 14;
-+     unsigned long src_pitch_mul                  : 2;
-+     unsigned long                                : 16;
-+     } src_pitch_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_pitch_t f;
-+} src_pitch_u;
-+
-+typedef struct _src_pitch_offset_t {
-+     unsigned long src_offset                     : 20;
-+     unsigned long src_pitch                      : 10;
-+     unsigned long src_pitch_mul                  : 2;
-+     } src_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_pitch_offset_t f;
-+} src_pitch_offset_u;
-+
-+typedef struct _src_x_t {
-+     unsigned long src_x                          : 14;
-+     unsigned long                                : 18;
-+     } src_x_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_x_t f;
-+} src_x_u;
-+
-+typedef struct _src_y_t {
-+     unsigned long src_y                          : 14;
-+     unsigned long                                : 18;
-+     } src_y_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_y_t f;
-+} src_y_u;
-+
-+typedef struct _src_x_y_t {
-+     unsigned long src_y                          : 14;
-+     unsigned long                                : 2;
-+     unsigned long src_x                          : 14;
-+     unsigned long                                : 2;
-+     } src_x_y_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_x_y_t f;
-+} src_x_y_u;
-+
-+typedef struct _src_y_x_t {
-+     unsigned long src_x                          : 14;
-+     unsigned long                                : 2;
-+     unsigned long src_y                          : 14;
-+     unsigned long                                : 2;
-+     } src_y_x_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_y_x_t f;
-+} src_y_x_u;
-+
-+typedef struct _src_width_t {
-+     unsigned long src_width                      : 14;
-+     unsigned long                                : 18;
-+     } src_width_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_width_t f;
-+} src_width_u;
-+
-+typedef struct _src_height_t {
-+     unsigned long src_height                     : 14;
-+     unsigned long                                : 18;
-+     } src_height_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_height_t f;
-+} src_height_u;
-+
-+typedef struct _src_inc_t {
-+     unsigned long src_xinc                       : 6;
-+     unsigned long                                : 2;
-+     unsigned long src_yinc                       : 6;
-+     unsigned long                                : 18;
-+     } src_inc_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_inc_t f;
-+} src_inc_u;
-+
-+typedef struct _host_data0_t {
-+     unsigned long host_data                      : 32;
-+     } host_data0_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data0_t f;
-+} host_data0_u;
-+
-+typedef struct _host_data1_t {
-+     unsigned long host_data                      : 32;
-+     } host_data1_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data1_t f;
-+} host_data1_u;
-+
-+typedef struct _host_data2_t {
-+     unsigned long host_data                      : 32;
-+     } host_data2_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data2_t f;
-+} host_data2_u;
-+
-+typedef struct _host_data3_t {
-+     unsigned long host_data                      : 32;
-+     } host_data3_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data3_t f;
-+} host_data3_u;
-+
-+typedef struct _host_data4_t {
-+     unsigned long host_data                      : 32;
-+     } host_data4_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data4_t f;
-+} host_data4_u;
-+
-+typedef struct _host_data5_t {
-+     unsigned long host_data                      : 32;
-+     } host_data5_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data5_t f;
-+} host_data5_u;
-+
-+typedef struct _host_data6_t {
-+     unsigned long host_data                      : 32;
-+     } host_data6_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data6_t f;
-+} host_data6_u;
-+
-+typedef struct _host_data7_t {
-+     unsigned long host_data                      : 32;
-+     } host_data7_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data7_t f;
-+} host_data7_u;
-+
-+typedef struct _host_data_last_t {
-+     unsigned long host_data_last                 : 32;
-+     } host_data_last_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     host_data_last_t f;
-+} host_data_last_u;
-+
-+typedef struct _dp_src_frgd_clr_t {
-+     unsigned long dp_src_frgd_clr                : 32;
-+     } dp_src_frgd_clr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_src_frgd_clr_t f;
-+} dp_src_frgd_clr_u;
-+
-+typedef struct _dp_src_bkgd_clr_t {
-+     unsigned long dp_src_bkgd_clr                : 32;
-+     } dp_src_bkgd_clr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_src_bkgd_clr_t f;
-+} dp_src_bkgd_clr_u;
-+
-+typedef struct _sc_left_t {
-+     unsigned long sc_left                        : 14;
-+     unsigned long                                : 18;
-+     } sc_left_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     sc_left_t f;
-+} sc_left_u;
-+
-+typedef struct _sc_right_t {
-+     unsigned long sc_right                       : 14;
-+     unsigned long                                : 18;
-+     } sc_right_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     sc_right_t f;
-+} sc_right_u;
-+
-+typedef struct _sc_top_t {
-+     unsigned long sc_top                         : 14;
-+     unsigned long                                : 18;
-+     } sc_top_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     sc_top_t f;
-+} sc_top_u;
-+
-+typedef struct _sc_bottom_t {
-+     unsigned long sc_bottom                      : 14;
-+     unsigned long                                : 18;
-+     } sc_bottom_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     sc_bottom_t f;
-+} sc_bottom_u;
-+
-+typedef struct _src_sc_right_t {
-+     unsigned long sc_right                       : 14;
-+     unsigned long                                : 18;
-+     } src_sc_right_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_sc_right_t f;
-+} src_sc_right_u;
-+
-+typedef struct _src_sc_bottom_t {
-+     unsigned long sc_bottom                      : 14;
-+     unsigned long                                : 18;
-+     } src_sc_bottom_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_sc_bottom_t f;
-+} src_sc_bottom_u;
-+
-+typedef struct _dp_cntl_t {
-+     unsigned long dst_x_dir                      : 1;
-+     unsigned long dst_y_dir                      : 1;
-+     unsigned long src_x_dir                      : 1;
-+     unsigned long src_y_dir                      : 1;
-+     unsigned long dst_major_x                    : 1;
-+     unsigned long src_major_x                    : 1;
-+     unsigned long                                : 26;
-+     } dp_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_cntl_t f;
-+} dp_cntl_u;
-+
-+typedef struct _dp_cntl_dst_dir_t {
-+     unsigned long                                : 15;
-+     unsigned long dst_y_dir                      : 1;
-+     unsigned long                                : 15;
-+     unsigned long dst_x_dir                      : 1;
-+     } dp_cntl_dst_dir_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_cntl_dst_dir_t f;
-+} dp_cntl_dst_dir_u;
-+
-+typedef struct _dp_datatype_t {
-+     unsigned long dp_dst_datatype                : 4;
-+     unsigned long                                : 4;
-+     unsigned long dp_brush_datatype              : 4;
-+     unsigned long dp_src2_type                   : 1;
-+     unsigned long dp_src2_datatype               : 3;
-+     unsigned long dp_src_datatype                : 3;
-+     unsigned long                                : 11;
-+     unsigned long dp_byte_pix_order              : 1;
-+     unsigned long                                : 1;
-+     } dp_datatype_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_datatype_t f;
-+} dp_datatype_u;
-+
-+typedef struct _dp_mix_t {
-+     unsigned long                                : 8;
-+     unsigned long dp_src_source                  : 3;
-+     unsigned long dp_src2_source                 : 3;
-+     unsigned long                                : 2;
-+     unsigned long dp_rop3                        : 8;
-+     unsigned long dp_op                          : 1;
-+     unsigned long                                : 7;
-+     } dp_mix_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_mix_t f;
-+} dp_mix_u;
-+
-+typedef struct _dp_write_msk_t {
-+     unsigned long dp_write_msk                   : 32;
-+     } dp_write_msk_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_write_msk_t f;
-+} dp_write_msk_u;
-+
-+typedef struct _clr_cmp_clr_src_t {
-+     unsigned long clr_cmp_clr_src                : 32;
-+     } clr_cmp_clr_src_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     clr_cmp_clr_src_t f;
-+} clr_cmp_clr_src_u;
-+
-+typedef struct _clr_cmp_clr_dst_t {
-+     unsigned long clr_cmp_clr_dst                : 32;
-+     } clr_cmp_clr_dst_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     clr_cmp_clr_dst_t f;
-+} clr_cmp_clr_dst_u;
-+
-+typedef struct _clr_cmp_cntl_t {
-+     unsigned long clr_cmp_fcn_src                : 3;
-+     unsigned long                                : 5;
-+     unsigned long clr_cmp_fcn_dst                : 3;
-+     unsigned long                                : 13;
-+     unsigned long clr_cmp_src                    : 2;
-+     unsigned long                                : 6;
-+     } clr_cmp_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     clr_cmp_cntl_t f;
-+} clr_cmp_cntl_u;
-+
-+typedef struct _clr_cmp_msk_t {
-+     unsigned long clr_cmp_msk                    : 32;
-+     } clr_cmp_msk_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     clr_cmp_msk_t f;
-+} clr_cmp_msk_u;
-+
-+typedef struct _default_pitch_offset_t {
-+     unsigned long default_offset                 : 20;
-+     unsigned long default_pitch                  : 10;
-+     unsigned long                                : 2;
-+     } default_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     default_pitch_offset_t f;
-+} default_pitch_offset_u;
-+
-+typedef struct _default_sc_bottom_right_t {
-+     unsigned long default_sc_right               : 14;
-+     unsigned long                                : 2;
-+     unsigned long default_sc_bottom              : 14;
-+     unsigned long                                : 2;
-+     } default_sc_bottom_right_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     default_sc_bottom_right_t f;
-+} default_sc_bottom_right_u;
-+
-+typedef struct _default2_sc_bottom_right_t {
-+     unsigned long default_sc_right               : 14;
-+     unsigned long                                : 2;
-+     unsigned long default_sc_bottom              : 14;
-+     unsigned long                                : 2;
-+     } default2_sc_bottom_right_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     default2_sc_bottom_right_t f;
-+} default2_sc_bottom_right_u;
-+
-+typedef struct _ref1_pitch_offset_t {
-+     unsigned long offset                         : 20;
-+     unsigned long                                : 2;
-+     unsigned long pitch                          : 8;
-+     unsigned long                                : 2;
-+     } ref1_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     ref1_pitch_offset_t f;
-+} ref1_pitch_offset_u;
-+
-+typedef struct _ref2_pitch_offset_t {
-+     unsigned long offset                         : 20;
-+     unsigned long                                : 2;
-+     unsigned long pitch                          : 8;
-+     unsigned long                                : 2;
-+     } ref2_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     ref2_pitch_offset_t f;
-+} ref2_pitch_offset_u;
-+
-+typedef struct _ref3_pitch_offset_t {
-+     unsigned long offset                         : 20;
-+     unsigned long                                : 2;
-+     unsigned long pitch                          : 8;
-+     unsigned long                                : 2;
-+     } ref3_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     ref3_pitch_offset_t f;
-+} ref3_pitch_offset_u;
-+
-+typedef struct _ref4_pitch_offset_t {
-+     unsigned long offset                         : 20;
-+     unsigned long                                : 2;
-+     unsigned long pitch                          : 8;
-+     unsigned long                                : 2;
-+     } ref4_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     ref4_pitch_offset_t f;
-+} ref4_pitch_offset_u;
-+
-+typedef struct _ref5_pitch_offset_t {
-+     unsigned long offset                         : 20;
-+     unsigned long                                : 2;
-+     unsigned long pitch                          : 8;
-+     unsigned long                                : 2;
-+     } ref5_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     ref5_pitch_offset_t f;
-+} ref5_pitch_offset_u;
-+
-+typedef struct _ref6_pitch_offset_t {
-+     unsigned long offset                         : 20;
-+     unsigned long                                : 2;
-+     unsigned long pitch                          : 8;
-+     unsigned long                                : 2;
-+     } ref6_pitch_offset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     ref6_pitch_offset_t f;
-+} ref6_pitch_offset_u;
-+
-+typedef struct _dp_gui_master_cntl_t {
-+     unsigned long gmc_src_pitch_offset_cntl      : 1;
-+     unsigned long gmc_dst_pitch_offset_cntl      : 1;
-+     unsigned long gmc_src_clipping               : 1;
-+     unsigned long gmc_dst_clipping               : 1;
-+     unsigned long gmc_brush_datatype             : 4;
-+     unsigned long gmc_dst_datatype               : 4;
-+     unsigned long gmc_src_datatype               : 3;
-+     unsigned long gmc_byte_pix_order             : 1;
-+     unsigned long gmc_default_sel                : 1;
-+     unsigned long gmc_rop3                       : 8;
-+     unsigned long gmc_dp_src_source              : 3;
-+     unsigned long gmc_clr_cmp_fcn_dis            : 1;
-+     unsigned long                                : 1;
-+     unsigned long gmc_wr_msk_dis                 : 1;
-+     unsigned long gmc_dp_op                      : 1;
-+     } dp_gui_master_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     dp_gui_master_cntl_t f;
-+} dp_gui_master_cntl_u;
-+
-+typedef struct _sc_top_left_t {
-+     unsigned long sc_left                        : 14;
-+     unsigned long                                : 2;
-+     unsigned long sc_top                         : 14;
-+     unsigned long                                : 2;
-+     } sc_top_left_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     sc_top_left_t f;
-+} sc_top_left_u;
-+
-+typedef struct _sc_bottom_right_t {
-+     unsigned long sc_right                       : 14;
-+     unsigned long                                : 2;
-+     unsigned long sc_bottom                      : 14;
-+     unsigned long                                : 2;
-+     } sc_bottom_right_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    sc_bottom_right_t f;
-+} sc_bottom_right_u;
-+
-+typedef struct _src_sc_top_left_t {
-+    unsigned short sc_left;
-+    unsigned short sc_top;
-+} src_sc_top_left_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    src_sc_top_left_t f;
-+} src_sc_top_left_u;
-+
-+typedef struct _src_sc_bottom_right_t {
-+     unsigned long sc_right                       : 14;
-+     unsigned long                                : 2;
-+     unsigned long sc_bottom                      : 14;
-+     unsigned long                                : 2;
-+     } src_sc_bottom_right_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     src_sc_bottom_right_t f;
-+} src_sc_bottom_right_u;
-+
-+typedef struct _global_alpha_t {
-+    unsigned long alpha_r                        : 8;
-+    unsigned long alpha_g                        : 8;
-+    unsigned long alpha_b                        : 8;
-+    unsigned long alpha_a                        : 8;
-+} global_alpha_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    global_alpha_t f;
-+} global_alpha_u;
-+
-+typedef struct _filter_coef_t {
-+    unsigned long c_4                            : 4;
-+    unsigned long c_3                            : 4;
-+    unsigned long c_2                            : 4;
-+    unsigned long c_1                            : 4;
-+    unsigned long c1                             : 4;
-+    unsigned long c2                             : 4;
-+    unsigned long c3                             : 4;
-+    unsigned long c4                             : 4;
-+} filter_coef_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    filter_coef_t f;
-+} filter_coef_u;
-+
-+typedef struct _mvc_cntl_start_t {
-+    unsigned long mc_cntl_src_1_index            : 4;
-+    unsigned long mc_cntl_dst_offset             : 20;
-+    unsigned long mc_dst_pitch_mul               : 2;
-+    unsigned long mc_cntl_src_2_index            : 3;
-+    unsigned long mc_cntl_width_height_sel       : 3;
-+} mvc_cntl_start_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    mvc_cntl_start_t f;
-+} mvc_cntl_start_u;
-+
-+typedef struct _e2_arithmetic_cntl_t {
-+    unsigned long opcode                         : 5;
-+    unsigned long shiftright                     : 4;
-+    unsigned long clamp                          : 1;
-+    unsigned long rounding                       : 2;
-+    unsigned long filter_n                       : 3;
-+    unsigned long                                : 1;
-+    unsigned long srcblend_inv                   : 1;
-+    unsigned long srcblend                       : 4;
-+    unsigned long                                : 3;
-+    unsigned long dstblend_inv                   : 1;
-+    unsigned long dstblend                       : 4;
-+    unsigned long dst_signed                     : 1;
-+    unsigned long autoinc                        : 1;
-+    unsigned long                                : 1;
-+} e2_arithmetic_cntl_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    e2_arithmetic_cntl_t f;
-+} e2_arithmetic_cntl_u;
-+
-+typedef struct _debug0_t {
-+    unsigned long debug0_r                       : 8;
-+    unsigned long                                : 8;
-+    unsigned long debug0_rw                      : 8;
-+    unsigned long                                : 8;
-+} debug0_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+     debug0_t f;
-+} debug0_u;
-+
-+typedef struct _debug1_t {
-+    unsigned long debug1_r                       : 8;
-+    unsigned long                                : 8;
-+    unsigned long debug1_rw                      : 8;
-+    unsigned long                                : 8;
-+} debug1_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug1_t f;
-+} debug1_u;
-+
-+typedef struct _debug2_t {
-+    unsigned long debug2_r                       : 8;
-+    unsigned long                                : 8;
-+    unsigned long debug2_rw                      : 8;
-+    unsigned long                                : 8;
-+} debug2_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug2_t f;
-+} debug2_u;
-+
-+typedef struct _debug3_t {
-+    unsigned long                                : 32;
-+} debug3_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug3_t f;
-+} debug3_u;
-+
-+typedef struct _debug4_t {
-+    unsigned long                                : 32;
-+} debug4_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug4_t f;
-+} debug4_u;
-+
-+typedef struct _debug5_t {
-+    unsigned long                                : 32;
-+} debug5_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug5_t f;
-+} debug5_u;
-+
-+typedef struct _debug6_t {
-+    unsigned long                                : 32;
-+} debug6_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug6_t f;
-+} debug6_u;
-+
-+typedef struct _debug7_t {
-+    unsigned long                                : 32;
-+} debug7_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug7_t f;
-+} debug7_u;
-+
-+typedef struct _debug8_t {
-+     unsigned long                                : 32;
-+} debug8_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug8_t f;
-+} debug8_u;
-+
-+typedef struct _debug9_t {
-+    unsigned long                                : 32;
-+} debug9_t;
-+
-+typedef union {
-+    unsigned long val : 32;
-+    debug9_t f;
-+} debug9_u;
-+
-+typedef struct _debug10_t {
-+     unsigned long                                : 32;
-+     } debug10_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     debug10_t f;
-+} debug10_u;
-+
-+typedef struct _debug11_t {
-+     unsigned long                                : 32;
-+     } debug11_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     debug11_t f;
-+} debug11_u;
-+
-+typedef struct _debug12_t {
-+     unsigned long                                : 32;
-+     } debug12_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     debug12_t f;
-+} debug12_u;
-+
-+typedef struct _debug13_t {
-+     unsigned long                                : 32;
-+     } debug13_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     debug13_t f;
-+} debug13_u;
-+
-+typedef struct _debug14_t {
-+     unsigned long                                : 32;
-+     } debug14_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     debug14_t f;
-+} debug14_u;
-+
-+typedef struct _debug15_t {
-+     unsigned long                                : 32;
-+     } debug15_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     debug15_t f;
-+} debug15_u;
-+
-+typedef struct _eng_cntl_t {
-+     unsigned long erc_reg_rd_ws                  : 1;
-+     unsigned long erc_reg_wr_ws                  : 1;
-+     unsigned long erc_idle_reg_wr                : 1;
-+     unsigned long dis_engine_triggers            : 1;
-+     unsigned long dis_rop_src_uses_dst_w_h       : 1;
-+     unsigned long dis_src_uses_dst_dirmaj        : 1;
-+     unsigned long                                : 6;
-+     unsigned long force_3dclk_when_2dclk         : 1;
-+     unsigned long                                : 19;
-+     } eng_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     eng_cntl_t f;
-+} eng_cntl_u;
-+
-+typedef struct _eng_perf_cnt_t {
-+     unsigned long perf_cnt                       : 20;
-+     unsigned long perf_sel                       : 4;
-+     unsigned long perf_en                        : 1;
-+     unsigned long                                : 3;
-+     unsigned long perf_clr                       : 1;
-+     unsigned long                                : 3;
-+     } eng_perf_cnt_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     eng_perf_cnt_t f;
-+} eng_perf_cnt_u;
-+
-+typedef struct _idct_runs_t {
-+     unsigned long idct_runs_3                    : 8;
-+     unsigned long idct_runs_2                    : 8;
-+     unsigned long idct_runs_1                    : 8;
-+     unsigned long idct_runs_0                    : 8;
-+     } idct_runs_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     idct_runs_t f;
-+} idct_runs_u;
-+
-+typedef struct _idct_levels_t {
-+     unsigned long idct_level_hi                  : 16;
-+     unsigned long idct_level_lo                  : 16;
-+     } idct_levels_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     idct_levels_t f;
-+} idct_levels_u;
-+
-+typedef struct _idct_control_t {
-+     unsigned long idct_ctl_luma_rd_format        : 2;
-+     unsigned long idct_ctl_chroma_rd_format      : 2;
-+     unsigned long idct_ctl_scan_pattern          : 1;
-+     unsigned long idct_ctl_intra                 : 1;
-+     unsigned long idct_ctl_flush                 : 1;
-+     unsigned long idct_ctl_passthru              : 1;
-+     unsigned long idct_ctl_sw_reset              : 1;
-+     unsigned long idct_ctl_constreq              : 1;
-+     unsigned long idct_ctl_scramble              : 1;
-+     unsigned long idct_ctl_alt_scan              : 1;
-+     unsigned long                                : 20;
-+     } idct_control_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     idct_control_t f;
-+} idct_control_u;
-+
-+typedef struct _idct_auth_control_t {
-+     unsigned long control_bits                   : 32;
-+     } idct_auth_control_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     idct_auth_control_t f;
-+} idct_auth_control_u;
-+
-+typedef struct _idct_auth_t {
-+     unsigned long auth                           : 32;
-+     } idct_auth_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     idct_auth_t f;
-+} idct_auth_u;
-+
-+typedef struct _mem_cntl_t {
-+     unsigned long                                : 1;
-+     unsigned long en_mem_ch1                     : 1;
-+     unsigned long en_mem_ch2                     : 1;
-+     unsigned long int_mem_mapping                : 1;
-+     unsigned long                                : 28;
-+     } mem_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mem_cntl_t f;
-+} mem_cntl_u;
-+
-+typedef struct _mem_arb_t {
-+     unsigned long disp_time_slot                 : 4;
-+     unsigned long disp_timer                     : 4;
-+     unsigned long arb_option                     : 1;
-+     unsigned long                                : 23;
-+     } mem_arb_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mem_arb_t f;
-+} mem_arb_u;
-+
-+typedef struct _mc_fb_location_t {
-+     unsigned long mc_fb_start                    : 16;
-+     unsigned long mc_fb_top                      : 16;
-+     } mc_fb_location_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mc_fb_location_t f;
-+} mc_fb_location_u;
-+
-+typedef struct _mem_ext_cntl_t {
-+     unsigned long mem_ext_enable                 : 1;
-+     unsigned long mem_ap_enable                  : 1;
-+     unsigned long mem_addr_mapping               : 2;
-+     unsigned long mem_wdoe_cntl                  : 2;
-+     unsigned long mem_wdoe_extend                : 1;
-+     unsigned long                                : 1;
-+     unsigned long mem_page_timer                 : 8;
-+     unsigned long mem_dynamic_cke                : 1;
-+     unsigned long mem_sdram_tri_en               : 1;
-+     unsigned long mem_self_refresh_en            : 1;
-+     unsigned long mem_power_down                 : 1;
-+     unsigned long mem_hw_power_down_en           : 1;
-+     unsigned long mem_power_down_stat            : 1;
-+     unsigned long                                : 3;
-+     unsigned long mem_pd_mck                     : 1;
-+     unsigned long mem_pd_ma                      : 1;
-+     unsigned long mem_pd_mdq                     : 1;
-+     unsigned long mem_tristate_mck               : 1;
-+     unsigned long mem_tristate_ma                : 1;
-+     unsigned long mem_tristate_mcke              : 1;
-+     unsigned long mem_invert_mck                 : 1;
-+     } mem_ext_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mem_ext_cntl_t f;
-+} mem_ext_cntl_u;
-+
-+typedef struct _mc_ext_mem_location_t {
-+     unsigned long mc_ext_mem_start               : 16;
-+     unsigned long mc_ext_mem_top                 : 16;
-+     } mc_ext_mem_location_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mc_ext_mem_location_t f;
-+} mc_ext_mem_location_u;
-+
-+typedef struct _mem_ext_timing_cntl_t {
-+     unsigned long mem_trp                        : 2;
-+     unsigned long mem_trcd                       : 2;
-+     unsigned long mem_tras                       : 3;
-+     unsigned long                                : 1;
-+     unsigned long mem_trrd                       : 2;
-+     unsigned long mem_tr2w                       : 2;
-+     unsigned long mem_twr                        : 2;
-+     unsigned long                                : 4;
-+     unsigned long mem_twr_mode                   : 1;
-+     unsigned long                                : 1;
-+     unsigned long mem_refresh_dis                : 1;
-+     unsigned long                                : 3;
-+     unsigned long mem_refresh_rate               : 8;
-+     } mem_ext_timing_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mem_ext_timing_cntl_t f;
-+} mem_ext_timing_cntl_u;
-+
-+typedef struct _mem_sdram_mode_reg_t {
-+     unsigned long mem_mode_reg                   : 14;
-+     unsigned long                                : 2;
-+     unsigned long mem_read_latency               : 2;
-+     unsigned long mem_schmen_latency             : 2;
-+     unsigned long mem_cas_latency                : 2;
-+     unsigned long mem_schmen_extend              : 1;
-+     unsigned long                                : 8;
-+     unsigned long mem_sdram_reset                : 1;
-+     } mem_sdram_mode_reg_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mem_sdram_mode_reg_t f;
-+} mem_sdram_mode_reg_u;
-+
-+typedef struct _mem_io_cntl_t {
-+     unsigned long mem_sn_mck                     : 4;
-+     unsigned long mem_sn_ma                      : 4;
-+     unsigned long mem_sn_mdq                     : 4;
-+     unsigned long mem_srn_mck                    : 1;
-+     unsigned long mem_srn_ma                     : 1;
-+     unsigned long mem_srn_mdq                    : 1;
-+     unsigned long                                : 1;
-+     unsigned long mem_sp_mck                     : 4;
-+     unsigned long mem_sp_ma                      : 4;
-+     unsigned long mem_sp_mdq                     : 4;
-+     unsigned long mem_srp_mck                    : 1;
-+     unsigned long mem_srp_ma                     : 1;
-+     unsigned long mem_srp_mdq                    : 1;
-+     unsigned long                                : 1;
-+     } mem_io_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mem_io_cntl_t f;
-+} mem_io_cntl_u;
-+
-+typedef struct _mc_debug_t {
-+     unsigned long mc_debug                       : 32;
-+     } mc_debug_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mc_debug_t f;
-+} mc_debug_u;
-+
-+typedef struct _mc_bist_ctrl_t {
-+     unsigned long mc_bist_ctrl                   : 32;
-+     } mc_bist_ctrl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mc_bist_ctrl_t f;
-+} mc_bist_ctrl_u;
-+
-+typedef struct _mc_bist_collar_read_t {
-+     unsigned long mc_bist_collar_read            : 32;
-+     } mc_bist_collar_read_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mc_bist_collar_read_t f;
-+} mc_bist_collar_read_u;
-+
-+typedef struct _tc_mismatch_t {
-+     unsigned long tc_mismatch                    : 24;
-+     unsigned long                                : 8;
-+     } tc_mismatch_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     tc_mismatch_t f;
-+} tc_mismatch_u;
-+
-+typedef struct _mc_perf_mon_cntl_t {
-+     unsigned long clr_perf                       : 1;
-+     unsigned long en_perf                        : 1;
-+     unsigned long                                : 2;
-+     unsigned long perf_op_a                      : 2;
-+     unsigned long perf_op_b                      : 2;
-+     unsigned long                                : 8;
-+     unsigned long monitor_period                 : 8;
-+     unsigned long perf_count_a_overflow          : 1;
-+     unsigned long perf_count_b_overflow          : 1;
-+     unsigned long                                : 6;
-+     } mc_perf_mon_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mc_perf_mon_cntl_t f;
-+} mc_perf_mon_cntl_u;
-+
-+typedef struct _mc_perf_counters_t {
-+     unsigned long mc_perf_counter_a              : 16;
-+     unsigned long mc_perf_counter_b              : 16;
-+     } mc_perf_counters_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     mc_perf_counters_t f;
-+} mc_perf_counters_u;
-+
-+typedef struct _wait_until_t {
-+     unsigned long wait_crtc_pflip                : 1;
-+     unsigned long wait_re_crtc_vline             : 1;
-+     unsigned long wait_fe_crtc_vline             : 1;
-+     unsigned long wait_crtc_vline                : 1;
-+     unsigned long wait_dma_viph0_idle            : 1;
-+     unsigned long wait_dma_viph1_idle            : 1;
-+     unsigned long wait_dma_viph2_idle            : 1;
-+     unsigned long wait_dma_viph3_idle            : 1;
-+     unsigned long wait_dma_vid_idle              : 1;
-+     unsigned long wait_dma_gui_idle              : 1;
-+     unsigned long wait_cmdfifo                   : 1;
-+     unsigned long wait_ov0_flip                  : 1;
-+     unsigned long wait_ov0_slicedone             : 1;
-+     unsigned long                                : 1;
-+     unsigned long wait_2d_idle                   : 1;
-+     unsigned long wait_3d_idle                   : 1;
-+     unsigned long wait_2d_idleclean              : 1;
-+     unsigned long wait_3d_idleclean              : 1;
-+     unsigned long wait_host_idleclean            : 1;
-+     unsigned long wait_extern_sig                : 1;
-+     unsigned long cmdfifo_entries                : 7;
-+     unsigned long                                : 3;
-+     unsigned long wait_both_crtc_pflip           : 1;
-+     unsigned long eng_display_select             : 1;
-+     } wait_until_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     wait_until_t f;
-+} wait_until_u;
-+
-+typedef struct _isync_cntl_t {
-+     unsigned long isync_any2d_idle3d             : 1;
-+     unsigned long isync_any3d_idle2d             : 1;
-+     unsigned long isync_trig2d_idle3d            : 1;
-+     unsigned long isync_trig3d_idle2d            : 1;
-+     unsigned long isync_wait_idlegui             : 1;
-+     unsigned long isync_cpscratch_idlegui        : 1;
-+     unsigned long                                : 26;
-+     } isync_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     isync_cntl_t f;
-+} isync_cntl_u;
-+
-+typedef struct _rbbm_guicntl_t {
-+     unsigned long host_data_swap                 : 2;
-+     unsigned long                                : 30;
-+     } rbbm_guicntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_guicntl_t f;
-+} rbbm_guicntl_u;
-+
-+typedef struct _rbbm_status_t {
-+     unsigned long cmdfifo_avail                  : 7;
-+     unsigned long                                : 1;
-+     unsigned long hirq_on_rbb                    : 1;
-+     unsigned long cprq_on_rbb                    : 1;
-+     unsigned long cfrq_on_rbb                    : 1;
-+     unsigned long hirq_in_rtbuf                  : 1;
-+     unsigned long cprq_in_rtbuf                  : 1;
-+     unsigned long cfrq_in_rtbuf                  : 1;
-+     unsigned long cf_pipe_busy                   : 1;
-+     unsigned long eng_ev_busy                    : 1;
-+     unsigned long cp_cmdstrm_busy                : 1;
-+     unsigned long e2_busy                        : 1;
-+     unsigned long rb2d_busy                      : 1;
-+     unsigned long rb3d_busy                      : 1;
-+     unsigned long se_busy                        : 1;
-+     unsigned long re_busy                        : 1;
-+     unsigned long tam_busy                       : 1;
-+     unsigned long tdm_busy                       : 1;
-+     unsigned long pb_busy                        : 1;
-+     unsigned long                                : 6;
-+     unsigned long gui_active                     : 1;
-+     } rbbm_status_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_status_t f;
-+} rbbm_status_u;
-+
-+typedef struct _rbbm_cntl_t {
-+     unsigned long rb_settle                      : 4;
-+     unsigned long abortclks_hi                   : 3;
-+     unsigned long                                : 1;
-+     unsigned long abortclks_cp                   : 3;
-+     unsigned long                                : 1;
-+     unsigned long abortclks_cfifo                : 3;
-+     unsigned long                                : 2;
-+     unsigned long cpq_data_swap                  : 1;
-+     unsigned long                                : 3;
-+     unsigned long no_abort_idct                  : 1;
-+     unsigned long no_abort_bios                  : 1;
-+     unsigned long no_abort_fb                    : 1;
-+     unsigned long no_abort_cp                    : 1;
-+     unsigned long no_abort_hi                    : 1;
-+     unsigned long no_abort_hdp                   : 1;
-+     unsigned long no_abort_mc                    : 1;
-+     unsigned long no_abort_aic                   : 1;
-+     unsigned long no_abort_vip                   : 1;
-+     unsigned long no_abort_disp                  : 1;
-+     unsigned long no_abort_cg                    : 1;
-+     } rbbm_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_cntl_t f;
-+} rbbm_cntl_u;
-+
-+typedef struct _rbbm_soft_reset_t {
-+     unsigned long soft_reset_cp                  : 1;
-+     unsigned long soft_reset_hi                  : 1;
-+     unsigned long reserved3                      : 3;
-+     unsigned long soft_reset_e2                  : 1;
-+     unsigned long reserved2                      : 2;
-+     unsigned long soft_reset_mc                  : 1;
-+     unsigned long reserved1                      : 2;
-+     unsigned long soft_reset_disp                : 1;
-+     unsigned long soft_reset_cg                  : 1;
-+     unsigned long                                : 19;
-+     } rbbm_soft_reset_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_soft_reset_t f;
-+} rbbm_soft_reset_u;
-+
-+typedef struct _nqwait_until_t {
-+     unsigned long wait_gui_idle                  : 1;
-+     unsigned long                                : 31;
-+     } nqwait_until_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     nqwait_until_t f;
-+} nqwait_until_u;
-+
-+typedef struct _rbbm_debug_t {
-+     unsigned long rbbm_debug                     : 32;
-+     } rbbm_debug_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_debug_t f;
-+} rbbm_debug_u;
-+
-+typedef struct _rbbm_cmdfifo_addr_t {
-+     unsigned long cmdfifo_addr                   : 6;
-+     unsigned long                                : 26;
-+     } rbbm_cmdfifo_addr_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_cmdfifo_addr_t f;
-+} rbbm_cmdfifo_addr_u;
-+
-+typedef struct _rbbm_cmdfifo_datal_t {
-+     unsigned long cmdfifo_datal                  : 32;
-+     } rbbm_cmdfifo_datal_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_cmdfifo_datal_t f;
-+} rbbm_cmdfifo_datal_u;
-+
-+typedef struct _rbbm_cmdfifo_datah_t {
-+     unsigned long cmdfifo_datah                  : 12;
-+     unsigned long                                : 20;
-+     } rbbm_cmdfifo_datah_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_cmdfifo_datah_t f;
-+} rbbm_cmdfifo_datah_u;
-+
-+typedef struct _rbbm_cmdfifo_stat_t {
-+     unsigned long cmdfifo_rptr                   : 6;
-+     unsigned long                                : 2;
-+     unsigned long cmdfifo_wptr                   : 6;
-+     unsigned long                                : 18;
-+     } rbbm_cmdfifo_stat_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     rbbm_cmdfifo_stat_t f;
-+} rbbm_cmdfifo_stat_u;
-+
-+typedef struct _clk_pin_cntl_t {
-+     unsigned long osc_en                         : 1;
-+     unsigned long osc_gain                       : 5;
-+     unsigned long dont_use_xtalin                : 1;
-+     unsigned long xtalin_pm_en                   : 1;
-+     unsigned long xtalin_dbl_en                  : 1;
-+     unsigned long                                : 7;
-+     unsigned long cg_debug                       : 16;
-+     } clk_pin_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     clk_pin_cntl_t f;
-+} clk_pin_cntl_u;
-+
-+typedef struct _pll_ref_fb_div_t {
-+     unsigned long pll_ref_div                    : 4;
-+     unsigned long                                : 4;
-+     unsigned long pll_fb_div_int                 : 6;
-+     unsigned long                                : 2;
-+     unsigned long pll_fb_div_frac                : 3;
-+     unsigned long                                : 1;
-+     unsigned long pll_reset_time                 : 4;
-+     unsigned long pll_lock_time                  : 8;
-+     } pll_ref_fb_div_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     pll_ref_fb_div_t f;
-+} pll_ref_fb_div_u;
-+
-+typedef struct _pll_cntl_t {
-+     unsigned long pll_pwdn                       : 1;
-+     unsigned long pll_reset                      : 1;
-+     unsigned long pll_pm_en                      : 1;
-+     unsigned long pll_mode                       : 1;
-+     unsigned long pll_refclk_sel                 : 1;
-+     unsigned long pll_fbclk_sel                  : 1;
-+     unsigned long pll_tcpoff                     : 1;
-+     unsigned long pll_pcp                        : 3;
-+     unsigned long pll_pvg                        : 3;
-+     unsigned long pll_vcofr                      : 1;
-+     unsigned long pll_ioffset                    : 2;
-+     unsigned long pll_pecc_mode                  : 2;
-+     unsigned long pll_pecc_scon                  : 2;
-+     unsigned long pll_dactal                     : 4;
-+     unsigned long pll_cp_clip                    : 2;
-+     unsigned long pll_conf                       : 3;
-+     unsigned long pll_mbctrl                     : 2;
-+     unsigned long pll_ring_off                   : 1;
-+     } pll_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     pll_cntl_t f;
-+} pll_cntl_u;
-+
-+typedef struct _sclk_cntl_t {
-+     unsigned long sclk_src_sel                   : 2;
-+     unsigned long                                : 2;
-+     unsigned long sclk_post_div_fast             : 4;
-+     unsigned long sclk_clkon_hys                 : 3;
-+     unsigned long sclk_post_div_slow             : 4;
-+     unsigned long disp_cg_ok2switch_en           : 1;
-+     unsigned long sclk_force_reg                 : 1;
-+     unsigned long sclk_force_disp                : 1;
-+     unsigned long sclk_force_mc                  : 1;
-+     unsigned long sclk_force_extmc               : 1;
-+     unsigned long sclk_force_cp                  : 1;
-+     unsigned long sclk_force_e2                  : 1;
-+     unsigned long sclk_force_e3                  : 1;
-+     unsigned long sclk_force_idct                : 1;
-+     unsigned long sclk_force_bist                : 1;
-+     unsigned long busy_extend_cp                 : 1;
-+     unsigned long busy_extend_e2                 : 1;
-+     unsigned long busy_extend_e3                 : 1;
-+     unsigned long busy_extend_idct               : 1;
-+     unsigned long                                : 3;
-+     } sclk_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     sclk_cntl_t f;
-+} sclk_cntl_u;
-+
-+typedef struct _pclk_cntl_t {
-+     unsigned long pclk_src_sel                   : 2;
-+     unsigned long                                : 2;
-+     unsigned long pclk_post_div                  : 4;
-+     unsigned long                                : 8;
-+     unsigned long pclk_force_disp                : 1;
-+     unsigned long                                : 15;
-+     } pclk_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     pclk_cntl_t f;
-+} pclk_cntl_u;
-+
-+typedef struct _clk_test_cntl_t {
-+     unsigned long testclk_sel                    : 4;
-+     unsigned long                                : 3;
-+     unsigned long start_check_freq               : 1;
-+     unsigned long tstcount_rst                   : 1;
-+     unsigned long                                : 15;
-+     unsigned long test_count                     : 8;
-+     } clk_test_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     clk_test_cntl_t f;
-+} clk_test_cntl_u;
-+
-+typedef struct _pwrmgt_cntl_t {
-+     unsigned long pwm_enable                     : 1;
-+     unsigned long                                : 1;
-+     unsigned long pwm_mode_req                   : 2;
-+     unsigned long pwm_wakeup_cond                : 2;
-+     unsigned long pwm_fast_noml_hw_en            : 1;
-+     unsigned long pwm_noml_fast_hw_en            : 1;
-+     unsigned long pwm_fast_noml_cond             : 4;
-+     unsigned long pwm_noml_fast_cond             : 4;
-+     unsigned long pwm_idle_timer                 : 8;
-+     unsigned long pwm_busy_timer                 : 8;
-+     } pwrmgt_cntl_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     pwrmgt_cntl_t f;
-+} pwrmgt_cntl_u;
-+
-+typedef struct _pwrmgt_status_t {
-+     unsigned long pwm_mode                       : 2;
-+     unsigned long                                : 30;
-+     } pwrmgt_status_t;
-+
-+typedef union {
-+     unsigned long val : 32;
-+     pwrmgt_status_t f;
-+} pwrmgt_status_u;
-+
-+
-+#endif //_W100_REGS_H_
-Index: git/hw/kdrive/Makefile.am
-===================================================================
---- git.orig/hw/kdrive/Makefile.am	2006-09-02 12:12:13.000000000 +0200
-+++ git/hw/kdrive/Makefile.am	2006-09-02 12:12:14.000000000 +0200
-@@ -7,6 +7,10 @@
- FBDEV_SUBDIRS = fbdev epson
- endif
- 
-+if KDRIVEW100
-+W100_SUBDIRS = w100
-+endif
-+
- if XSDLSERVER
- XSDL_SUBDIRS = sdl
- endif
-@@ -20,6 +24,7 @@
- 	linux			\
- 	$(XSDL_SUBDIRS)		\
- 	$(FBDEV_SUBDIRS)	\
-+	$(W100_SUBDIRS)		\
- 	$(VESA_SUBDIRS)		\
- 	$(XEPHYR_SUBDIRS)       \
- 	fake
-Index: git/configure.ac
-===================================================================
---- git.orig/configure.ac	2006-09-02 12:12:14.000000000 +0200
-+++ git/configure.ac	2006-09-02 12:12:14.000000000 +0200
-@@ -442,6 +442,7 @@
- AC_ARG_ENABLE(kdrive,         AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])
- AC_ARG_ENABLE(xephyr,         AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
- AC_ARG_ENABLE(xsdl,           AS_HELP_STRING([--enable-xsdl], [Build the kdrive Xsdl server (default: auto)]), [XSDL=$enableval], [XSDL=auto])
-+AC_ARG_ENABLE(w100,           AS_HELP_STRING([--enable-w100], [Build the kdrive Xw100 server (default: no)]), [KDRIVEW100=$enableval], [KDRIVEW100=no])
- dnl xprint
- AC_ARG_ENABLE(freetype,       AS_HELP_STRING([ --enable-freetype], [Build Xprint FreeType backend (default: yes)]), [XP_USE_FREETYPE=$enableval],[XP_USE_FREETYPE=no])
- AC_ARG_WITH(freetype-config,  AS_HELP_STRING([ --with-freetype-config=PROG], [Use FreeType configuration program PROG (default: auto)]), freetype_config=$withval, freetype_config=auto)
-@@ -1519,6 +1520,10 @@
- AC_SUBST([XSDL_LIBS])
- AC_SUBST([XSDL_INCS])
- 
-+AM_CONDITIONAL(KDRIVEW100, [test "x$KDRIVEW100" = xyes])
-+if test "x$KDRIVEW100" = xyes; then
-+        AC_DEFINE(KDRIVEW100, 1, [Build Xw100 server])
-+fi
- 
- dnl these only go in xkb-config.h (which is shared by the Xorg and Xnest servers)
- AC_DEFINE(__XKBDEFRULES__, "xorg", [Default XKB rules])
-@@ -1753,6 +1758,7 @@
- hw/kdrive/epson/Makefile
- hw/kdrive/fake/Makefile
- hw/kdrive/fbdev/Makefile
-+hw/kdrive/w100/Makefile
- hw/kdrive/i810/Makefile
- hw/kdrive/linux/Makefile
- hw/kdrive/mach64/Makefile
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/xcalibrate.patch b/meta/packages/xorg-xserver/xserver-kdrive/xcalibrate.patch
deleted file mode 100644
index 5d44dd679..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/xcalibrate.patch
+++ /dev/null
@@ -1,351 +0,0 @@
---- xorg-server-X11R7.1-1.1.0/mi/miinitext.c.orig	2006-06-22 14:11:46.000000000 +0200
-+++ xorg-server-X11R7.1-1.1.0/mi/miinitext.c	2006-06-22 15:26:17.000000000 +0200
-@@ -385,6 +385,9 @@
- #ifdef DMXEXT
- extern void DMXExtensionInit(INITARGS);
- #endif
-+#ifdef XCALIBRATE
-+extern void XCalibrateExtensionInit(INITARGS);
-+#endif
- #ifdef XEVIE
- extern void XevieExtensionInit(INITARGS);
- #endif
-@@ -679,6 +682,9 @@
- #ifdef DAMAGE
-     if (!noDamageExtension) DamageExtensionInit();
- #endif
-+#ifdef  XCALIBRATE
-+    XCalibrateExtensionInit ();
-+#endif
- }
- 
- void
---- xorg-server-X11R7.1-1.1.0/configure.ac.orig	2006-06-15 17:03:14.000000000 +0200
-+++ xorg-server-X11R7.1-1.1.0/configure.ac	2006-06-24 08:21:25.000000000 +0200
-@@ -407,6 +407,7 @@
- AC_ARG_ENABLE(xf86vidmode,    AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: enabled)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=yes])
- AC_ARG_ENABLE(xf86misc,       AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: enabled)]), [XF86MISC=$enableval], [XF86MISC=yes])
- AC_ARG_ENABLE(xcsecurity,     AS_HELP_STRING([--disable-xcsecurity], [Build Security extension (default: enabled)]), [XCSECURITY=$enableval], [XCSECURITY=yes])
-+AC_ARG_ENABLE(xcalibrate,     AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])
- AC_ARG_ENABLE(xevie,          AS_HELP_STRING([--disable-xevie], [Build XEvIE extension (default: enabled)]), [XEVIE=$enableval], [XEVIE=yes])
- AC_ARG_ENABLE(lbx,            AS_HELP_STRING([--disable-lbx], [Build LBX extension (default: no)]), [LBX=$enableval], [LBX=no])
- AC_ARG_ENABLE(appgroup,       AS_HELP_STRING([--disable-appgroup], [Build XC-APPGROUP extension (default: enabled)]), [APPGROUP=$enableval], [APPGROUP=yes])
-@@ -641,6 +642,12 @@
- 	AC_DEFINE(XCSECURITY, 1, [Build Security extension])
- fi
- 
-+AM_CONDITIONAL(XCALIBRATE, [test "x$XCALIBRATE" = xyes])
-+if test "x$XCALIBRATE" = xyes; then
-+	AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension])
-+	REQUIRED_MODULES="$REQUIRED_MODULES xcalibrateproto"
-+fi
-+
- AM_CONDITIONAL(XEVIE, [test "x$XEVIE" = xyes])
- if test "x$XEVIE" = xyes; then
- 	AC_DEFINE(XEVIE, 1, [Build XEvIE extension])
-@@ -1466,7 +1473,7 @@
-     KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a'
-     KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.a'
-     KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.a'
--    KDRIVE_LIBS="$DIX_LIB $KDRIVE_LIB $KDRIVE_OS_LIB $KDRIVE_PURE_LIBS $KDRIVE_STUB_LIB"
-+    KDRIVE_LIBS="$DIX_LIB $KDRIVE_LIB $KDRIVE_PURE_LIBS $KDRIVE_OS_LIB $KDRIVE_STUB_LIB"
- 
-     # check if we can build Xephyr
-     PKG_CHECK_MODULES(XEPHYR, x11 xext xfont xau xdmcp, [xephyr="yes"], [xephyr="no"])
---- xorg-server-X11R7.1-1.1.0/include/kdrive-config.h.in.orig	2006-06-22 14:22:07.000000000 +0200
-+++ xorg-server-X11R7.1-1.1.0/include/kdrive-config.h.in	2006-06-22 14:33:29.000000000 +0200
-@@ -22,4 +22,7 @@
- /* Support tslib touchscreen abstraction library */
- #undef TSLIB
- 
-+/* Enable XCalibrate extension */
-+#undef XCALIBRATE
-+
- #endif /* _KDRIVE_CONFIG_H_ */
---- xorg-server-X11R7.1-1.1.0/Xext/Makefile.am.orig	2006-06-15 17:06:43.000000000 +0200
-+++ xorg-server-X11R7.1-1.1.0/Xext/Makefile.am	2006-06-15 18:12:40.000000000 +0200
-@@ -78,6 +78,11 @@
- AM_CFLAGS += -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGdir)/SecurityPolicy\"
- endif
- 
-+XCALIBRATE_SRCS = xcalibrate.c
-+if XCALIBRATE
-+BUILTIN_SRCS += $(XCALIBRATE_SRCS)
-+endif
-+
- # X EVent Interception Extension: allows accessibility helpers & composite
- # managers to intercept events from input devices and transform as needed
- # before the clients see them.
-@@ -155,6 +160,7 @@
- 	$(SCREENSAVER_SRCS) \
- 	$(XCSECURITY_SRCS) \
- 	$(XINERAMA_SRCS) \
-+	$(XCALIBRATE_SRCS) \
- 	$(XEVIE_SRCS) \
- 	$(XPRINT_SRCS) \
- 	$(APPGROUP_SRCS) \
---- xorg-server-X11R7.1-1.1.0/Xext/xcalibrate.c.orig	2006-06-15 17:05:19.000000000 +0200
-+++ xorg-server-X11R7.1-1.1.0/Xext/xcalibrate.c	2006-06-22 15:15:09.000000000 +0200
-@@ -0,0 +1,262 @@
-+/*
-+ * $Id: xcalibrate.c,v 3.1 2004/06/02 20:49:50 pb Exp $
-+ *
-+ * Copyright © 2003 Philip Blundell
-+ *
-+ * 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 Philip Blundell not be used in
-+ * advertising or publicity pertaining to distribution of the software without
-+ * specific, written prior permission.  Philip Blundell makes no
-+ * representations about the suitability of this software for any purpose.  It
-+ * is provided "as is" without express or implied warranty.
-+ *
-+ * PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL PHILIP BLUNDELL 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_KDRIVE_CONFIG_H
-+#include <kdrive-config.h>
-+#endif
-+
-+#define NEED_EVENTS
-+#define NEED_REPLIES
-+
-+#include <X11/X.h>
-+#include <X11/Xproto.h>
-+#include "misc.h"
-+#include "os.h"
-+#include "dixstruct.h"
-+#include "extnsionst.h"
-+#include "swaprep.h"
-+
-+#include <X11/extensions/xcalibrateproto.h>
-+#include <X11/extensions/xcalibratewire.h>
-+
-+extern void (*tslib_raw_event_hook)(int x, int y, int pressure, void *closure);
-+extern void *tslib_raw_event_closure;
-+
-+static CARD8	XCalibrateReqCode;
-+int		XCalibrateEventBase;
-+int		XCalibrateReqBase;
-+int		XCalibrateErrorBase;
-+
-+static ClientPtr xcalibrate_client;
-+
-+static void
-+xcalibrate_event_hook (int x, int y, int pressure, void *closure)
-+{
-+  ClientPtr pClient = (ClientPtr) closure;
-+  xXCalibrateRawTouchscreenEvent	ev;
-+
-+  ev.type = XCalibrateEventBase + X_XCalibrateRawTouchscreen;
-+  ev.sequenceNumber = pClient->sequence;
-+  ev.x = x;
-+  ev.y = y;
-+  ev.pressure = pressure;
-+
-+  if (!pClient->clientGone)
-+    WriteEventsToClient (pClient, 1, (xEvent *) &ev);
-+}
-+
-+static int
-+ProcXCalibrateQueryVersion (ClientPtr client)
-+{
-+  REQUEST(xXCalibrateQueryVersionReq);
-+  xXCalibrateQueryVersionReply rep;
-+  CARD16 client_major, client_minor;  /* not used */
-+
-+  REQUEST_SIZE_MATCH (xXCalibrateQueryVersionReq);
-+
-+  client_major = stuff->majorVersion;
-+  client_minor = stuff->minorVersion;
-+
-+  fprintf(stderr, "%s(): called\n", __func__); 
-+
-+  rep.type = X_Reply;
-+  rep.length = 0;
-+  rep.sequenceNumber = client->sequence;
-+  rep.majorVersion = XCALIBRATE_MAJOR_VERSION;
-+  rep.minorVersion = XCALIBRATE_MINOR_VERSION;   
-+  if (client->swapped) { 
-+    int n;
-+    swaps(&rep.sequenceNumber, n);
-+    swapl(&rep.length, n);     
-+    swaps(&rep.majorVersion, n);
-+    swaps(&rep.minorVersion, n);
-+  }
-+  WriteToClient(client, sizeof (xXCalibrateQueryVersionReply), (char *)&rep);
-+  return (client->noClientException);
-+}
-+
-+static int
-+SProcXCalibrateQueryVersion (ClientPtr client)
-+{
-+    REQUEST(xXCalibrateQueryVersionReq);
-+    int n;
-+
-+    REQUEST_SIZE_MATCH (xXCalibrateQueryVersionReq);
-+    swaps(&stuff->majorVersion,n);
-+    swaps(&stuff->minorVersion,n);
-+    return ProcXCalibrateQueryVersion(client);
-+}
-+
-+static int
-+ProcXCalibrateSetRawMode (ClientPtr client)
-+{
-+  REQUEST(xXCalibrateRawModeReq);
-+  xXCalibrateRawModeReply rep;
-+
-+  REQUEST_SIZE_MATCH (xXCalibrateRawModeReq);
-+
-+  memset (&rep, 0, sizeof (rep));
-+  rep.type = X_Reply;
-+  rep.sequenceNumber = client->sequence;
-+
-+  if (stuff->on)
-+    {
-+      if (xcalibrate_client == NULL)
-+	{
-+	  /* Start calibrating.  */
-+	  xcalibrate_client = client;
-+	  tslib_raw_event_hook = xcalibrate_event_hook;
-+	  tslib_raw_event_closure = client;
-+	  rep.status = GrabSuccess;
-+	}
-+      else
-+	{
-+	  rep.status = AlreadyGrabbed;
-+	}
-+    }
-+  else
-+    {
-+      if (xcalibrate_client == client)
-+	{
-+	  /* Stop calibrating.  */
-+	  xcalibrate_client = NULL;
-+	  tslib_raw_event_hook = NULL;
-+	  tslib_raw_event_closure = NULL;
-+	  rep.status = GrabSuccess;
-+
-+	  /* Cycle input off and on to reload configuration.  */
-+	  KdDisableInput ();
-+	  KdEnableInput ();
-+	}
-+      else
-+	{
-+	  rep.status = AlreadyGrabbed;
-+	}
-+    }
-+
-+  if (client->swapped)
-+    {
-+      int n;
-+
-+      swaps (&rep.sequenceNumber, n);
-+      swaps (&rep.status, n);
-+    }
-+  WriteToClient(client, sizeof (rep), (char *) &rep);
-+  return (client->noClientException);
-+}
-+
-+
-+static int
-+SProcXCalibrateSetRawMode (ClientPtr client)
-+{
-+  REQUEST(xXCalibrateRawModeReq);
-+  int n;
-+
-+  REQUEST_SIZE_MATCH (xXCalibrateRawModeReq);
-+
-+  swaps(&stuff->on, n);
-+
-+  return ProcXCalibrateSetRawMode(client);
-+}
-+
-+static void
-+XCalibrateResetProc (ExtensionEntry *extEntry) 
-+{ 
-+}
-+
-+static int
-+ProcXCalibrateDispatch (ClientPtr client)
-+{
-+    REQUEST(xReq);
-+    switch (stuff->data) {
-+    case X_XCalibrateQueryVersion:
-+        return ProcXCalibrateQueryVersion(client);
-+    case X_XCalibrateRawMode:
-+        return ProcXCalibrateSetRawMode(client);
-+    default: break;
-+    }
-+
-+    return BadRequest;
-+}
-+
-+static int
-+SProcXCalibrateDispatch (ClientPtr client)
-+{
-+    REQUEST(xReq);
-+    int n;
-+
-+    swaps(&stuff->length,n);
-+
-+    switch (stuff->data) {
-+    case X_XCalibrateQueryVersion:
-+        return SProcXCalibrateQueryVersion(client);
-+    case X_XCalibrateRawMode:
-+        return SProcXCalibrateSetRawMode(client);
-+
-+    default: break;
-+    }
-+
-+    return BadRequest;
-+}
-+
-+static void
-+XCalibrateClientCallback (CallbackListPtr	*list,
-+			  pointer		closure,
-+			  pointer		data)
-+{
-+    NewClientInfoRec	*clientinfo = (NewClientInfoRec *) data;
-+    ClientPtr		pClient = clientinfo->client;
-+
-+    if (clientinfo->setup == NULL
-+	&& xcalibrate_client != NULL
-+	&& xcalibrate_client == pClient)
-+      {
-+	/* Stop calibrating.  */
-+	xcalibrate_client = NULL;
-+	tslib_raw_event_hook = NULL;
-+	tslib_raw_event_closure = NULL;
-+      }
-+}
-+
-+void
-+XCalibrateExtensionInit(void)
-+{
-+  ExtensionEntry *extEntry;
-+
-+  if (!AddCallback (&ClientStateCallback, XCalibrateClientCallback, 0))
-+    return;  
-+
-+  extEntry = AddExtension(XCALIBRATE_NAME, XCalibrateNumberEvents, XCalibrateNumberErrors,
-+			  ProcXCalibrateDispatch, SProcXCalibrateDispatch,
-+			  XCalibrateResetProc, StandardMinorOpcode);
-+
-+  if (!extEntry)
-+    return;
-+
-+  XCalibrateReqCode = (unsigned char)extEntry->base;
-+  XCalibrateEventBase = extEntry->eventBase;
-+  XCalibrateErrorBase = extEntry->errorBase;
-+
-+  xcalibrate_client = 0;
-+}
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/xfbdev-fb-opt.patch b/meta/packages/xorg-xserver/xserver-kdrive/xfbdev-fb-opt.patch
deleted file mode 100644
index a8f002ea2..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/xfbdev-fb-opt.patch
+++ /dev/null
@@ -1,82 +0,0 @@
----
- hw/kdrive/fbdev/fbdev.c  |   17 ++++++++++++-----
- hw/kdrive/fbdev/fbdev.h  |    1 +
- hw/kdrive/fbdev/fbinit.c |   20 ++++++++++++++++----
- 3 files changed, 29 insertions(+), 9 deletions(-)
-
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/fbdev/fbdev.c
-+++ xorg-server-X11R7.1-1.1.0/hw/kdrive/fbdev/fbdev.c
-@@ -33,16 +33,23 @@
- 
- extern int KdTsPhyScreen;
- 
-+char     *fbdevDevicePath = NULL;
- Bool
- fbdevInitialize (KdCardInfo *card, FbdevPriv *priv)
- {
-     int		    k;
-     unsigned long   off;
--    if ((priv->fd = open("/dev/fb0", O_RDWR)) < 0 && \
--        (priv->fd = open("/dev/fb/0", O_RDWR)) < 0) {
--	perror("Error opening /dev/fb0");
--	return FALSE;
--    }
-+
-+    if (fbdevDevicePath == NULL) 
-+      fbdevDevicePath = "/dev/fb0";
-+
-+    if ((priv->fd = open(fbdevDevicePath, O_RDWR)) < 0)
-+      {
-+	ErrorF("Error opening framebuffer %s: %s\n", 
-+	       fbdevDevicePath, strerror(errno));
-+        return FALSE;
-+      }
-+
-     /* quiet valgrind */
-     memset (&priv->fix, '\0', sizeof (priv->fix));
-     if ((k=ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix)) < 0) {
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/fbdev/fbdev.h
-+++ xorg-server-X11R7.1-1.1.0/hw/kdrive/fbdev/fbdev.h
-@@ -53,6 +53,7 @@ typedef struct _fbdevScrPriv {
- } FbdevScrPriv;
- 
- extern KdCardFuncs  fbdevFuncs;
-+extern char*        fbdevDevicePath;
- 
- Bool
- fbdevInitialize (KdCardInfo *card, FbdevPriv *priv);
---- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/fbdev/fbinit.c
-+++ xorg-server-X11R7.1-1.1.0/hw/kdrive/fbdev/fbinit.c
-@@ -59,16 +59,28 @@ InitInput (int argc, char **argv)
- void
- ddxUseMsg (void)
- {
--    KdUseMsg();
-+  KdUseMsg();
-+  ErrorF("\nXfbdev Device Usage:\n");
-+  ErrorF("-fb path         Framebuffer device to use. Defaults to /dev/fb0\n");
-+  ErrorF("\n");
- }
- 
- int
- ddxProcessArgument (int argc, char **argv, int i)
- {
--    return KdProcessArgument (argc, argv, i);
--}
--
-+  if (!strcmp (argv[i], "-fb"))
-+    {
-+      if (i+1 < argc) 
-+	{
-+	  fbdevDevicePath = argv[i+1];
-+	  return 2;
-+	} 
-+      UseMsg();
-+      exit(1);
-+    }
- 
-+  return KdProcessArgument (argc, argv, i);
-+}
- 
- KdCardFuncs	fbdevFuncs = {
-     fbdevCardInit,	    /* cardinit */
diff --git a/meta/packages/xorg-xserver/xserver-kdrive/xserver-kdrive-poodle.patch b/meta/packages/xorg-xserver/xserver-kdrive/xserver-kdrive-poodle.patch
deleted file mode 100644
index ce80a7e38..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive/xserver-kdrive-poodle.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- xserver/hw/kdrive/fbdev/fbdev.c~xserver-kdrive-poodle.patch
-+++ xserver/hw/kdrive/fbdev/fbdev.c
-@@ -190,6 +190,7 @@
-     var.nonstd = 0;
-     var.grayscale = 0;
- 
-+    /* commented out for poodle 
-     k = ioctl (priv->fd, FBIOPUT_VSCREENINFO, &var);
- 
-     if (k < 0)
-@@ -198,10 +199,11 @@
- 	return FALSE;
-     }
- 
--    /* Re-get the "fixed" parameters since they might have changed */
-+    // Re-get the "fixed" parameters since they might have changed
-     k = ioctl (priv->fd, FBIOGET_FSCREENINFO, &priv->fix);
-     if (k < 0)
-         perror ("FBIOGET_FSCREENINFO");
-+    */
- 
-     /* Now get the new screeninfo */
-     ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var);
-@@ -659,13 +661,14 @@
-     priv->var.activate = FB_ACTIVATE_NOW|FB_CHANGE_CMAP_VBL;
-     
-     /* display it on the LCD */
-+    /* commented out for poodle
-     k = ioctl (priv->fd, FBIOPUT_VSCREENINFO, &priv->var);
-     if (k < 0)
-     {
- 	perror ("FBIOPUT_VSCREENINFO");
- 	return FALSE;
-     }
--    
-+    */
-     if (priv->fix.visual == FB_VISUAL_DIRECTCOLOR)
-     {
- 	struct fb_cmap	cmap;
diff --git a/meta/packages/xorg-xserver/xserver-kdrive_git.bb b/meta/packages/xorg-xserver/xserver-kdrive_git.bb
deleted file mode 100644
index 74323cd32..000000000
--- a/meta/packages/xorg-xserver/xserver-kdrive_git.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-PV = "1.1.0+git${SRCDATE}"
-DEFAULT_PREFERENCE = "-2"
-
-LICENSE = "MIT"
-DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto libxfont resourceproto compositeproto calibrateproto recordproto videoproto scrnsaverproto"
-
-PROVIDES = "virtual/xserver"
-RPROVIDES = "virtual/xserver"
-PACKAGES = "xserver-kdrive-fbdev xserver-kdrive-fake xserver-kdrive-xephyr ${PN}-doc ${PN}-dev ${PN}-locale"
-SECTION = "x11/base"
-DESCRIPTION = "X server from freedesktop.org"
-DESCRIPTION_xserver-kdrive-fbdev = "X server from freedesktop.org, supporting generic framebuffer devices"
-DESCRIPTION_xserver-kdrive-fake = "Fake X server"
-DESCRIPTION_xserver-kdrive-xephyr = "X server in an X window"
-
-FILES_xserver-kdrive-fbdev = "${bindir}/Xfbdev"
-FILES_xserver-kdrive-fake = "${bindir}/Xfake"
-FILES_xserver-kdrive-xephyr = "${bindir}/Xephyr"
-
-SRC_URI = "git://anongit.freedesktop.org/xorg/xserver;protocol=git \
-	file://kmode.patch;patch=1 \
-	file://disable-apm.patch;patch=1 \
-	file://no-serial-probing.patch;patch=1 \
-	file://kdrive-evdev.patch;patch=1  \
-	file://kdrive-use-evdev.patch;patch=1  \
-	file://fbdev-not-fix.patch;patch=1  \
-	file://enable-builtin-fonts.patch;patch=1 \
-	file://optional-xkb.patch;patch=1 \
-#	file://disable-xf86-dga-xorgcfg.patch;patch=1 \
-	file://enable-tslib.patch;patch=1"
-
-SRC_URI_append_mnci   = " file://onlyfb.patch;patch=1"
-SRC_URI_append_poodle = " file://xserver-kdrive-poodle.patch;patch=1"
-PACKAGE_ARCH_poodle = "poodle"
-
-S = "${WORKDIR}/git"
-
-inherit autotools pkgconfig 
-
-EXTRA_OECONF = "--enable-composite --enable-kdrive \
-		--disable-dga --disable-dri --disable-xinerama \
-		--disable-xf86misc --disable-xf86vidmode \
-		--disable-xorg --disable-xorgcfg \
-		--disable-xkb --disable-xnest --disable-xvfb \
-		--disable-xevie --disable-xprint --disable-xtrap \
-		--disable-dmx \
-		--with-default-font-path=built-ins \
-		ac_cv_file__usr_share_X11_sgml_defs_ent=no"
-- 
cgit v1.2.3