summaryrefslogtreecommitdiff
path: root/recipes/xorg-xserver/xserver-kdrive-1.3.0.0
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/xorg-xserver/xserver-kdrive-1.3.0.0')
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/disable-xf86-dga-xorgcfg.patch39
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-epson.patch11
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-tslib.patch12
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-xcalibrate.patch101
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-1.3-18bpp.patch419
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/linux-keyboard-mediumraw.patch83
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/optional-xkb.patch58
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/tosa-fbdev.patch13
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch122
9 files changed, 858 insertions, 0 deletions
diff --git a/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/disable-xf86-dga-xorgcfg.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/disable-xf86-dga-xorgcfg.patch
new file mode 100644
index 0000000000..ccc19139c8
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/disable-xf86-dga-xorgcfg.patch
@@ -0,0 +1,39 @@
+Index: xorg-server-1.3.0.0/configure.ac
+===================================================================
+--- xorg-server-1.3.0.0.orig/configure.ac 2007-04-20 03:23:40.000000000 +0200
++++ xorg-server-1.3.0.0/configure.ac 2007-05-09 16:51:34.000000000 +0200
+@@ -520,7 +520,11 @@
+ XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
+
+ dnl Core modules for most extensions, et al.
++if test "$KDRIVE" = yes; then
++REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto [kbproto >= 1.0.3]"
++else
+ REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans xf86miscproto xf86vidmodeproto xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto xf86dgaproto [kbproto >= 1.0.3]"
++fi
+ REQUIRED_LIBS="xfont xau fontenc"
+
+ AM_CONDITIONAL(XV, [test "x$XV" = xyes])
+@@ -1603,7 +1607,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])
+
+ AC_TRY_COMPILE([
+@@ -1616,10 +1622,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/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-epson.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-epson.patch
new file mode 100644
index 0000000000..8ec3a37c78
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-epson.patch
@@ -0,0 +1,11 @@
+Index: xorg-server-1.2.0/hw/kdrive/Makefile.am
+===================================================================
+--- xorg-server-1.2.0.orig/hw/kdrive/Makefile.am 2007-03-28 17:11:38.000000000 +0200
++++ xorg-server-1.2.0/hw/kdrive/Makefile.am 2007-03-28 17:12:28.000000000 +0200
+@@ -1,5 +1,5 @@
+ if KDRIVEFBDEV
+-FBDEV_SUBDIRS = fbdev
++FBDEV_SUBDIRS = fbdev epson
+ endif
+
+ if KDRIVEIMAGEON
diff --git a/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-tslib.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-tslib.patch
new file mode 100644
index 0000000000..9a59530ed3
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-tslib.patch
@@ -0,0 +1,12 @@
+Index: xorg-server-1.2.0/configure.ac
+===================================================================
+--- xorg-server-1.2.0.orig/configure.ac 2007-03-29 13:28:10.000000000 +0200
++++ xorg-server-1.2.0/configure.ac 2007-03-29 13:28:35.000000000 +0200
+@@ -1517,6 +1517,7 @@
+ AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/])
+ fi
+ AC_DEFINE(TSLIB, 1, [Have tslib support])
++ AC_DEFINE(TOUCHSCREEN, 1, [Have touchscreen support])
+ fi
+
+ # damage shadow extension glx (NOTYET) fb mi
diff --git a/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-xcalibrate.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-xcalibrate.patch
new file mode 100644
index 0000000000..717e72f93f
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/enable-xcalibrate.patch
@@ -0,0 +1,101 @@
+---
+ Xext/Makefile.am | 6 ++++++
+ configure.ac | 9 ++++++++-
+ include/kdrive-config.h.in | 3 +++
+ mi/miinitext.c | 6 ++++++
+ 4 files changed, 23 insertions(+), 1 deletion(-)
+
+Index: xorg-server-1.3.0.0/mi/miinitext.c
+===================================================================
+--- xorg-server-1.3.0.0.orig/mi/miinitext.c 2007-05-15 16:05:34.000000000 +0100
++++ xorg-server-1.3.0.0/mi/miinitext.c 2007-05-15 16:05:39.000000000 +0100
+@@ -372,6 +372,9 @@ extern void ResExtensionInit(INITARGS);
+ #ifdef DMXEXT
+ extern void DMXExtensionInit(INITARGS);
+ #endif
++#ifdef XCALIBRATE
++extern void XCalibrateExtensionInit(INITARGS);
++#endif
+ #ifdef XEVIE
+ extern void XevieExtensionInit(INITARGS);
+ #endif
+@@ -663,6 +666,9 @@ InitExtensions(argc, argv)
+ #ifdef DAMAGE
+ if (!noDamageExtension) DamageExtensionInit();
+ #endif
++#ifdef XCALIBRATE
++ XCalibrateExtensionInit ();
++#endif
+ }
+
+ void
+Index: xorg-server-1.3.0.0/configure.ac
+===================================================================
+--- xorg-server-1.3.0.0.orig/configure.ac 2007-05-15 16:05:34.000000000 +0100
++++ xorg-server-1.3.0.0/configure.ac 2007-05-15 16:17:54.000000000 +0100
+@@ -421,6 +421,7 @@ AC_ARG_ENABLE(xf86vidmode, AS_HELP_ST
+ AC_ARG_ENABLE(xf86misc, AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: enabled)]), [XF86MISC=$enableval], [XF86MISC=yes])
+ AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
+ AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--disable-xcsecurity], [Build Security extension (default: enabled)]), [XCSECURITY=$enableval], [XCSECURITY=$XACE])
++AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])
+ AC_ARG_ENABLE(appgroup, AS_HELP_STRING([--disable-appgroup], [Build XC-APPGROUP extension (default: enabled)]), [APPGROUP=$enableval], [APPGROUP=$XCSECURITY])
+ AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])
+ AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no])
+@@ -653,6 +654,12 @@ if test "x$XCSECURITY" = xyes; then
+ 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])
+@@ -1547,7 +1554,7 @@ if test "$KDRIVE" = yes; then
+ ;;
+ esac
+ 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 $TSLIB_LIBS"
++ KDRIVE_LIBS="$DIX_LIB $KDRIVE_LIB $KDRIVE_PURE_LIBS $KDRIVE_OS_LIB $KDRIVE_STUB_LIB $TSLIB_LIBS"
+
+ # check if we can build Xephyr
+ PKG_CHECK_MODULES(XEPHYR, x11 xext xfont xau xdmcp, [xephyr="yes"], [xephyr="no"])
+Index: xorg-server-1.3.0.0/include/kdrive-config.h.in
+===================================================================
+--- xorg-server-1.3.0.0.orig/include/kdrive-config.h.in 2007-05-15 16:05:34.000000000 +0100
++++ xorg-server-1.3.0.0/include/kdrive-config.h.in 2007-05-15 16:05:39.000000000 +0100
+@@ -25,4 +25,7 @@
+ /* Verbose debugging output hilarity */
+ #undef DEBUG
+
++/* Enable XCalibrate extension */
++#undef XCALIBRATE
++
+ #endif /* _KDRIVE_CONFIG_H_ */
+Index: xorg-server-1.3.0.0/Xext/Makefile.am
+===================================================================
+--- xorg-server-1.3.0.0.orig/Xext/Makefile.am 2007-05-15 16:05:34.000000000 +0100
++++ xorg-server-1.3.0.0/Xext/Makefile.am 2007-05-15 16:05:39.000000000 +0100
+@@ -91,6 +91,11 @@ BUILTIN_SRCS += $(XCALIBRATE_SRCS)
+ # XCalibrare needs tslib
+ 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.
+@@ -169,6 +174,7 @@ EXTRA_DIST = \
+ $(XCSECURITY_SRCS) \
+ $(XCALIBRATE_SRCS) \
+ $(XINERAMA_SRCS) \
++ $(XCALIBRATE_SRCS) \
+ $(XEVIE_SRCS) \
+ $(XPRINT_SRCS) \
+ $(APPGROUP_SRCS) \
diff --git a/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-1.3-18bpp.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-1.3-18bpp.patch
new file mode 100644
index 0000000000..714536934c
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-1.3-18bpp.patch
@@ -0,0 +1,419 @@
+diff -Nurd xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.c xorg-server-1.3.0.0.patched/hw/kdrive/fbdev/fbdev.c
+--- xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.c 2006-11-16 19:01:23.000000000 +0100
++++ xorg-server-1.3.0.0.patched/hw/kdrive/fbdev/fbdev.c 2007-09-15 16:53:20.152045000 +0200
+@@ -213,6 +213,24 @@
+
+ /* Now get the new screeninfo */
+ ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var);
++ /* Special treatment of 18bpp */
++ if ((priv->var.red.length == 6) && (priv->var.green.length == 6) &&
++ (priv->var.blue.length == 6))
++ {
++ priv->var.red.length = 8;
++ if (priv->var.red.offset != 0)
++ priv->var.red.offset = 16;
++ priv->var.green.length = 8;
++ priv->var.green.offset = 8;
++ priv->var.blue.length = 8;
++ if (priv->var.blue.offset != 0)
++ priv->var.blue.offset = 16;
++ priv->var.bits_per_pixel = 32;
++ priv->Have18Bpp = TRUE;
++ }
++ else
++ priv->Have18Bpp = FALSE;
++
+ depth = priv->var.bits_per_pixel;
+ gray = priv->var.grayscale;
+
+@@ -334,7 +352,7 @@
+ KdMouseMatrix m;
+ FbdevPriv *priv = screen->card->driver;
+
+- if (scrpriv->randr != RR_Rotate_0)
++ if (scrpriv->randr != RR_Rotate_0 || priv->Have18Bpp)
+ scrpriv->shadow = TRUE;
+ else
+ scrpriv->shadow = FALSE;
+@@ -398,6 +416,354 @@
+ return TRUE;
+ }
+
++void
++shadowUpdatePacked18 (ScreenPtr pScreen,
++ shadowBufPtr pBuf)
++{
++ RegionPtr damage = shadowDamage (pBuf);
++ PixmapPtr pShadow = pBuf->pPixmap;
++ int nbox = REGION_NUM_RECTS (damage);
++ BoxPtr pbox = REGION_RECTS (damage);
++ FbBits *shaBase, *shaLine, *sha;
++ FbStride shaStride;
++ int scrBase, scrLine, scr;
++ int shaBpp;
++ int shaXoff, shaYoff; /* XXX assumed to be zero */
++ int x, y, w, h, width;
++ int i;
++ char *winBase = NULL, *win;
++ CARD32 winSize;
++
++ fbGetDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff);
++ while (nbox--)
++ {
++ x = pbox->x1 * shaBpp;
++ y = pbox->y1;
++ w = (pbox->x2 - pbox->x1) * shaBpp;
++ h = pbox->y2 - pbox->y1;
++
++ scrLine = (x >> FB_SHIFT);
++ shaLine = shaBase + y * shaStride + (x >> FB_SHIFT);
++
++ x &= FB_MASK;
++ w = (w + x + FB_MASK) >> FB_SHIFT;
++
++ while (h--)
++ {
++ winSize = 0;
++ scrBase = 0;
++ width = w;
++ scr = scrLine;
++ sha = shaLine;
++ while (width) {
++ /* how much remains in this window */
++ i = scrBase + winSize - scr;
++ if (i <= 0 || scr < scrBase)
++ {
++ winBase = (char *) (*pBuf->window) (pScreen,
++ y,
++ scr * 3,
++ SHADOW_WINDOW_WRITE,
++ &winSize,
++ pBuf->closure);
++ if(!winBase)
++ return;
++ scrBase = scr;
++ winSize /= 3;
++ i = winSize;
++ }
++ win = winBase + (scr - scrBase);
++ if (i > width)
++ i = width;
++ width -= i;
++ scr += i;
++#define PickBit(a,i) (((a) >> (i)) & 1)
++ while (i--)
++ {
++ FbBits bits = *sha++;
++ *win++ = ((bits & 0xFC) >> 2) |
++ ((bits & 0xC00) >> 4);
++ *win++ = ((bits & 0xF000) >> 12) |
++ ((bits & 0x3C0000) >> 14);
++ *win++ = (bits & 0xC00000) >> 22;
++ }
++ }
++ shaLine += shaStride;
++ y++;
++ }
++ pbox++;
++ }
++}
++
++#define LEFT_TO_RIGHT 1
++#define RIGHT_TO_LEFT -1
++#define TOP_TO_BOTTOM 2
++#define BOTTOM_TO_TOP -2
++
++void
++shadowUpdateRotatePacked18 (ScreenPtr pScreen,
++ shadowBufPtr pBuf)
++{
++ RegionPtr damage = shadowDamage (pBuf);
++ PixmapPtr pShadow = pBuf->pPixmap;
++ int nbox = REGION_NUM_RECTS (damage);
++ BoxPtr pbox = REGION_RECTS (damage);
++ FbBits *shaBits;
++ FbStride shaStride;
++ int shaBpp;
++ int shaXoff, shaYoff;
++ int box_x1, box_x2, box_y1, box_y2;
++ 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;
++ FbStride shaStepOverX = 0, shaStepDownX = 0;
++ FbBits *shaLine, *sha;
++ int shaHeight = pShadow->drawable.height;
++ int shaWidth = pShadow->drawable.width;
++ FbBits shaMask;
++ int shaFirstShift, shaShift;
++ int o_x_dir;
++ int o_y_dir;
++ int x_dir;
++ int y_dir;
++
++ fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff);
++ pixelsPerBits = (sizeof (FbBits) * 8) / shaBpp;
++ pixelsMask = ~(pixelsPerBits - 1);
++ shaMask = FbBitsMask (FB_UNIT-shaBpp, shaBpp);
++ /*
++ * Compute rotation related constants to walk the shadow
++ */
++ o_x_dir = LEFT_TO_RIGHT;
++ o_y_dir = TOP_TO_BOTTOM;
++ if (pBuf->randr & SHADOW_REFLECT_X)
++ o_x_dir = -o_x_dir;
++ if (pBuf->randr & SHADOW_REFLECT_Y)
++ o_y_dir = -o_y_dir;
++ switch (pBuf->randr & (SHADOW_ROTATE_ALL)) {
++ case SHADOW_ROTATE_0: /* upper left shadow -> upper left screen */
++ default:
++ x_dir = o_x_dir;
++ y_dir = o_y_dir;
++ break;
++ case SHADOW_ROTATE_90: /* upper right shadow -> upper left screen */
++ x_dir = o_y_dir;
++ y_dir = -o_x_dir;
++ break;
++ case SHADOW_ROTATE_180: /* lower right shadow -> upper left screen */
++ x_dir = -o_x_dir;
++ y_dir = -o_y_dir;
++ break;
++ case SHADOW_ROTATE_270: /* lower left shadow -> upper left screen */
++ x_dir = -o_y_dir;
++ y_dir = o_x_dir;
++ break;
++ }
++ switch (x_dir) {
++ case LEFT_TO_RIGHT:
++ shaStepOverX = shaBpp;
++ shaStepOverY = 0;
++ break;
++ case TOP_TO_BOTTOM:
++ shaStepOverX = 0;
++ shaStepOverY = shaStride;
++ break;
++ case RIGHT_TO_LEFT:
++ shaStepOverX = -shaBpp;
++ shaStepOverY = 0;
++ break;
++ case BOTTOM_TO_TOP:
++ shaStepOverX = 0;
++ shaStepOverY = -shaStride;
++ break;
++ }
++ switch (y_dir) {
++ case TOP_TO_BOTTOM:
++ shaStepDownX = 0;
++ shaStepDownY = shaStride;
++ break;
++ case RIGHT_TO_LEFT:
++ shaStepDownX = -shaBpp;
++ shaStepDownY = 0;
++ break;
++ case BOTTOM_TO_TOP:
++ shaStepDownX = 0;
++ shaStepDownY = -shaStride;
++ break;
++ case LEFT_TO_RIGHT:
++ shaStepDownX = shaBpp;
++ shaStepDownY = 0;
++ break;
++ }
++
++ while (nbox--)
++ {
++ box_x1 = pbox->x1;
++ box_y1 = pbox->y1;
++ box_x2 = pbox->x2;
++ box_y2 = pbox->y2;
++ pbox++;
++
++ /*
++ * Compute screen and shadow locations for this box
++ */
++ switch (x_dir) {
++ case LEFT_TO_RIGHT:
++ scr_x1 = box_x1 & pixelsMask;
++ scr_x2 = (box_x2 + pixelsPerBits - 1) & pixelsMask;
++
++ sha_x1 = scr_x1;
++ break;
++ case TOP_TO_BOTTOM:
++ scr_x1 = box_y1 & pixelsMask;
++ scr_x2 = (box_y2 + pixelsPerBits - 1) & pixelsMask;
++
++ sha_y1 = scr_x1;
++ break;
++ case RIGHT_TO_LEFT:
++ scr_x1 = (shaWidth - box_x2) & pixelsMask;
++ scr_x2 = (shaWidth - box_x1 + pixelsPerBits - 1) & pixelsMask;
++
++ sha_x1 = (shaWidth - scr_x1 - 1);
++ break;
++ case BOTTOM_TO_TOP:
++ scr_x1 = (shaHeight - box_y2) & pixelsMask;
++ scr_x2 = (shaHeight - box_y1 + pixelsPerBits - 1) & pixelsMask;
++
++ sha_y1 = (shaHeight - scr_x1 - 1);
++ break;
++ }
++ switch (y_dir) {
++ case TOP_TO_BOTTOM:
++ scr_y1 = box_y1;
++ scr_y2 = box_y2;
++
++ sha_y1 = scr_y1;
++ break;
++ case RIGHT_TO_LEFT:
++ scr_y1 = (shaWidth - box_x2);
++ scr_y2 = (shaWidth - box_x1);
++
++ sha_x1 = box_x2 - 1;
++ break;
++ case BOTTOM_TO_TOP:
++ scr_y1 = shaHeight - box_y2;
++ scr_y2 = shaHeight - box_y1;
++
++ sha_y1 = box_y2 - 1;
++ break;
++ case LEFT_TO_RIGHT:
++ scr_y1 = box_x1;
++ scr_y2 = box_x2;
++
++ sha_x1 = box_x1;
++ break;
++ }
++ scr_w = ((scr_x2 - scr_x1) * shaBpp) >> FB_SHIFT;
++ scr_h = scr_y2 - scr_y1;
++ scr_y = scr_y1;
++
++ /* shift amount for first pixel on screen */
++ shaFirstShift = FB_UNIT - ((sha_x1 * shaBpp) & FB_MASK) - shaBpp;
++
++ /* pointer to shadow data first placed on screen */
++ shaLine = (shaBits +
++ sha_y1 * shaStride +
++ ((sha_x1 * shaBpp) >> FB_SHIFT));
++
++ /*
++ * Copy the bits, always write across the physical frame buffer
++ * to take advantage of write combining.
++ */
++ while (scr_h--)
++ {
++ int p;
++ FbBits bits;
++ char *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 = (char *) (*pBuf->window) (pScreen,
++ scr_y,
++ scr_x * 3,
++ SHADOW_WINDOW_WRITE,
++ &winSize,
++ pBuf->closure);
++ i = winSize / 3;
++ 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;
++
++ shaShift -= shaStepOverX;
++ if (shaShift >= FB_UNIT)
++ {
++ shaShift -= FB_UNIT;
++ sha--;
++ }
++ else if (shaShift < 0)
++ {
++ shaShift += FB_UNIT;
++ sha++;
++ }
++ sha += shaStepOverY;
++ }
++ *win++ = ((bits & 0xFC) >> 2) |
++ ((bits & 0xC00) >> 4);
++ *win++ = ((bits & 0xF000) >> 12) |
++ ((bits & 0x3C0000) >> 14);
++ *win++ = (bits & 0xC00000) >> 22;
++ }
++ }
++ scr_y++;
++ shaFirstShift -= shaStepDownX;
++ if (shaFirstShift >= FB_UNIT)
++ {
++ shaFirstShift -= FB_UNIT;
++ shaLine--;
++ }
++ else if (shaFirstShift < 0)
++ {
++ shaFirstShift += FB_UNIT;
++ shaLine++;
++ }
++ shaLine += shaStepDownY;
++ }
++ }
++}
++
+ Bool
+ fbdevSetShadow (ScreenPtr pScreen)
+ {
+@@ -418,7 +784,14 @@
+
+ window = fbdevWindowLinear;
+ update = 0;
+- if (scrpriv->randr)
++ if (priv->Have18Bpp)
++ {
++ if (scrpriv->randr != RR_Rotate_0)
++ update = shadowUpdateRotatePacked18;
++ else
++ update = shadowUpdatePacked18;
++ }
++ else if (scrpriv->randr)
+ if (priv->var.bits_per_pixel == 16) {
+ switch (scrpriv->randr) {
+ case RR_Rotate_90:
+diff -Nurd xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.h xorg-server-1.3.0.0.patched/hw/kdrive/fbdev/fbdev.h
+--- xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.h 2006-09-18 08:04:17.000000000 +0200
++++ xorg-server-1.3.0.0.patched/hw/kdrive/fbdev/fbdev.h 2007-09-15 16:45:07.362045000 +0200
+@@ -44,6 +44,7 @@
+ int fd;
+ char *fb;
+ char *fb_base;
++ Bool Have18Bpp;
+ } FbdevPriv;
+
+ typedef struct _fbdevScrPriv {
diff --git a/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/linux-keyboard-mediumraw.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/linux-keyboard-mediumraw.patch
new file mode 100644
index 0000000000..997028ad8d
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/linux-keyboard-mediumraw.patch
@@ -0,0 +1,83 @@
+Index: xorg-server-1.3.0.0/hw/kdrive/linux/keyboard.c
+===================================================================
+--- xorg-server-1.3.0.0.orig/hw/kdrive/linux/keyboard.c 2006-11-16 18:01:23.000000000 +0000
++++ xorg-server-1.3.0.0/hw/kdrive/linux/keyboard.c 2007-08-12 12:14:29.000000000 +0000
+@@ -384,14 +384,35 @@
+ LinuxKeyboardRead (int fd, void *closure)
+ {
+ unsigned char buf[256], *b;
+- int n;
++ int n, mediumraw_data, mediumraw_event;
++ static enum { LOWKEY, BYTE1, BYTE2 } mediumraw_state = LOWKEY;
+
+ while ((n = read (fd, buf, sizeof (buf))) > 0)
+ {
+ b = buf;
+ while (n--)
+ {
+- KdEnqueueKeyboardEvent (b[0] & 0x7f, b[0] & 0x80);
++ switch (mediumraw_state)
++ {
++ case LOWKEY:
++ if ( (b[0] & 0x7f) == 0)
++ {
++ mediumraw_state = BYTE1;
++ mediumraw_event = b[0] & 0x80;
++ }
++ else
++ KdEnqueueKeyboardEvent (b[0] & 0x7f, b[0] & 0x80);
++ break;
++ case BYTE1:
++ mediumraw_data = (b[0] & 0x7f) << 7;
++ mediumraw_state = BYTE2;
++ break;
++ case BYTE2:
++ /* FIXME: KdEnqueueKeyboardEvent should accept word size */
++ KdEnqueueKeyboardEvent ( mediumraw_data | (b[0] & 0x7f), mediumraw_event);
++ mediumraw_state = LOWKEY;
++ break;
++ }
+ b++;
+ }
+ }
+Index: xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_kbd.c
+===================================================================
+--- xorg-server-1.3.0.0.orig/hw/xfree86/os-support/linux/lnx_kbd.c 2006-11-16 18:01:25.000000000 +0000
++++ xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_kbd.c 2007-08-12 12:14:29.000000000 +0000
+@@ -430,12 +430,32 @@
+ {
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ unsigned char rBuf[64];
+- int nBytes, i;
++ int nBytes, i, mediumraw_data, mediumraw_event;
++ static enum { LOWKEY, BYTE1, BYTE2 } mediumraw_state = LOWKEY;
+ if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) {
+- for (i = 0; i < nBytes; i++)
+- pKbd->PostEvent(pInfo, rBuf[i] & 0x7f,
+- rBuf[i] & 0x80 ? FALSE : TRUE);
++ for (i = 0; i < nBytes; i++) {
++ switch (mediumraw_state) {
++ case LOWKEY:
++ if ( (rBuf[i] & 0x7f) == 0) {
++ mediumraw_state = BYTE1;
++ mediumraw_event = rBuf[i] & 0x80;
++ }
++ else
++ pKbd->PostEvent(pInfo, rBuf[i] & 0x7f,
++ rBuf[i] & 0x80 ? FALSE : TRUE);
++ break;
++ case BYTE1:
++ mediumraw_data = (rBuf[i] & 0x7f) << 7;
++ mediumraw_state = BYTE2;
++ break;
++ case BYTE2:
++ pKbd->PostEvent(pInfo, mediumraw_data | (rBuf[i] & 0x7f),
++ mediumraw_event ? FALSE : TRUE);
++ mediumraw_state = LOWKEY;
++ break;
++ }
+ }
++ }
+ }
+
+ static Bool
diff --git a/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/optional-xkb.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/optional-xkb.patch
new file mode 100644
index 0000000000..a580b500b7
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/optional-xkb.patch
@@ -0,0 +1,58 @@
+Index: xorg-server-1.2.0/Makefile.am
+===================================================================
+--- xorg-server-1.2.0.orig/Makefile.am 2007-01-23 06:39:15.000000000 +0100
++++ xorg-server-1.2.0/Makefile.am 2007-03-28 20:26:19.000000000 +0200
+@@ -30,6 +30,10 @@
+ XINPUT_DIR=Xi
+ endif
+
++if XKB
++XKB_DIR=xkb
++endif
++
+ if DBE
+ DBE_DIR=dbe
+ endif
+@@ -46,7 +50,7 @@
+ randr \
+ render \
+ $(XINPUT_DIR) \
+- xkb \
++ $(XKB_DIR) \
+ $(DBE_DIR) \
+ $(MFB_DIR) \
+ $(AFB_DIR) \
+Index: xorg-server-1.2.0/configure.ac
+===================================================================
+--- xorg-server-1.2.0.orig/configure.ac 2007-01-23 06:39:15.000000000 +0100
++++ xorg-server-1.2.0/configure.ac 2007-03-28 20:27:13.000000000 +0200
+@@ -428,6 +428,7 @@
+ AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
+ AC_ARG_ENABLE(xinput, AS_HELP_STRING([--disable-xinput], [Build XInput Extension (default: enabled)]), [XINPUT=$enableval], [XINPUT=yes])
+ AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=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])
+@@ -754,12 +755,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/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/tosa-fbdev.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/tosa-fbdev.patch
new file mode 100644
index 0000000000..a935bc57de
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/tosa-fbdev.patch
@@ -0,0 +1,13 @@
+--- xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.c.old 2007-12-24 04:54:13.000000000 -0600
++++ xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.c 2007-12-25 01:13:27.000000000 -0600
+@@ -357,10 +357,7 @@ fbdevMapFramebuffer (KdScreenInfo *scree
+ KdMouseMatrix m;
+ FbdevPriv *priv = screen->card->driver;
+
+- if (scrpriv->randr != RR_Rotate_0 || priv->Have18Bpp)
+ scrpriv->shadow = TRUE;
+- else
+- scrpriv->shadow = FALSE;
+
+ KdComputeMouseMatrix (&m, scrpriv->randr, screen->width, screen->height);
+
diff --git a/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch
new file mode 100644
index 0000000000..e0cca5428b
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch
@@ -0,0 +1,122 @@
+---
+ Xext/xcalibrate.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
+ hw/kdrive/src/kdrive.h | 3 +++
+ hw/kdrive/src/kinput.c | 12 ++++++++++++
+ 3 files changed, 61 insertions(+), 1 deletion(-)
+
+Index: xorg-server-1.3.0.0/Xext/xcalibrate.c
+===================================================================
+--- xorg-server-1.3.0.0.orig/Xext/xcalibrate.c 2007-06-29 17:30:03.000000000 +0100
++++ xorg-server-1.3.0.0/Xext/xcalibrate.c 2007-06-30 14:04:40.000000000 +0100
+@@ -166,7 +166,6 @@ ProcXCalibrateSetRawMode (ClientPtr clie
+ return (client->noClientException);
+ }
+
+-
+ static int
+ SProcXCalibrateSetRawMode (ClientPtr client)
+ {
+@@ -180,6 +179,47 @@ SProcXCalibrateSetRawMode (ClientPtr cli
+ return ProcXCalibrateSetRawMode(client);
+ }
+
++static int
++ProcXCalibrateScreenToCoord (ClientPtr client)
++{
++ REQUEST(xXCalibrateScreenToCoordReq);
++ xXCalibrateScreenToCoordReply rep;
++
++ REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
++
++ memset (&rep, 0, sizeof (rep));
++ rep.type = X_Reply;
++ rep.sequenceNumber = client->sequence;
++ rep.x = stuff->x;
++ rep.y = stuff->y;
++
++ KdScreenToMouseCoords(&rep.x, &rep.y);
++
++ if (client->swapped)
++ {
++ int n;
++
++ swaps (&rep.x, n);
++ swaps (&rep.y, n);
++ }
++ WriteToClient(client, sizeof (rep), (char *) &rep);
++ return (client->noClientException);
++}
++
++static int
++SProcXCalibrateScreenToCoord (ClientPtr client)
++{
++ REQUEST(xXCalibrateScreenToCoordReq);
++ int n;
++
++ REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
++
++ swaps(&stuff->x, n);
++ swaps(&stuff->y, n);
++
++ return ProcXCalibrateScreenToCoord(client);
++}
++
+ static void
+ XCalibrateResetProc (ExtensionEntry *extEntry)
+ {
+@@ -194,6 +234,9 @@ ProcXCalibrateDispatch (ClientPtr client
+ return ProcXCalibrateQueryVersion(client);
+ case X_XCalibrateRawMode:
+ return ProcXCalibrateSetRawMode(client);
++ case X_XCalibrateScreenToCoord:
++ return ProcXCalibrateScreenToCoord(client);
++
+ default: break;
+ }
+
+@@ -213,6 +256,8 @@ SProcXCalibrateDispatch (ClientPtr clien
+ return SProcXCalibrateQueryVersion(client);
+ case X_XCalibrateRawMode:
+ return SProcXCalibrateSetRawMode(client);
++ case X_XCalibrateScreenToCoord:
++ return SProcXCalibrateScreenToCoord(client);
+
+ default: break;
+ }
+Index: xorg-server-1.3.0.0/hw/kdrive/src/kdrive.h
+===================================================================
+--- xorg-server-1.3.0.0.orig/hw/kdrive/src/kdrive.h 2007-06-30 13:43:45.000000000 +0100
++++ xorg-server-1.3.0.0/hw/kdrive/src/kdrive.h 2007-06-30 13:45:03.000000000 +0100
+@@ -746,6 +746,9 @@ void
+ KdSetMouseMatrix (KdMouseMatrix *matrix);
+
+ void
++KdScreenToMouseCoords (int *x, int *y);
++
++void
+ KdComputeMouseMatrix (KdMouseMatrix *matrix, Rotation randr, int width, int height);
+
+ void
+Index: xorg-server-1.3.0.0/hw/kdrive/src/kinput.c
+===================================================================
+--- xorg-server-1.3.0.0.orig/hw/kdrive/src/kinput.c 2007-06-29 17:30:16.000000000 +0100
++++ xorg-server-1.3.0.0/hw/kdrive/src/kinput.c 2007-06-30 15:52:16.000000000 +0100
+@@ -381,6 +381,18 @@ KdSetMouseMatrix (KdMouseMatrix *matrix)
+ }
+
+ void
++KdScreenToMouseCoords (int *x, int *y)
++{
++ int (*m)[3] = kdMouseMatrix.matrix;
++ int div = m[0][1] * m[1][0] - m[1][1] * m[0][0];
++ int sx = *x;
++ int sy = *y;
++
++ *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div;
++ *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div;
++}
++
++void
+ KdComputeMouseMatrix (KdMouseMatrix *m, Rotation randr, int width, int height)
+ {
+ int x_dir = 1, y_dir = 1;