xorg-xserver: move older xserver's to meta-extras

Move xservers which are only used by retired machines to meta-extras

Signed-off-by: Joshua Lock <josh@linux.intel.com>
This commit is contained in:
Joshua Lock
2010-06-29 14:31:43 +01:00
parent b6fcd71cb5
commit 6ca31b0522
30 changed files with 0 additions and 0 deletions

View File

@@ -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;

View File

@@ -0,0 +1,15 @@
# Reverse include order in render/picturestr.h to be able to compile against renderproto >= 0.9.3
Index: xorg-server-1.2.0/render/picturestr.h
===================================================================
--- xorg-server-1.2.0.orig/render/picturestr.h 2008-02-09 22:54:46.000000000 +0100
+++ xorg-server-1.2.0/render/picturestr.h 2008-02-09 22:54:50.000000000 +0100
@@ -26,8 +26,8 @@
#ifndef _PICTURESTR_H_
#define _PICTURESTR_H_
-#include "glyphstr.h"
#include "scrnintstr.h"
+#include "glyphstr.h"
#include "resource.h"
typedef struct _DirectFormat {

View File

@@ -0,0 +1,26 @@
---
hw/kdrive/src/kmode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: xorg-server-1.3.0.0/hw/kdrive/src/kmode.c
===================================================================
--- xorg-server-1.3.0.0.orig/hw/kdrive/src/kmode.c 2007-05-16 10:30:29.000000000 +0100
+++ xorg-server-1.3.0.0/hw/kdrive/src/kmode.c 2007-05-16 10:31:08.000000000 +0100
@@ -106,6 +106,8 @@ const KdMonitorTiming kdMonitorTimings[
16, 120, 176, KdSyncNegative, /* 37.861 */
1, 20, 24, KdSyncNegative, /* 72.809 */
},
+ /* DEFAULT */
+#define MONITOR_TIMING_DEFAULT 13
{ 640, 480, 60, 25175, /* VESA */
16, 48, 160, KdSyncNegative, /* 31.469 */
10, 33, 45, KdSyncNegative, /* 59.940 */
@@ -127,8 +129,6 @@ const KdMonitorTiming kdMonitorTimings[
16, 160, 256, KdSyncPositive, /* 46.875 */
1, 21, 25, KdSyncPositive, /* 75.000 */
},
- /* DEFAULT */
-#define MONITOR_TIMING_DEFAULT 9
{ 800, 600, 72, 50000, /* VESA */
56, 64, 240, KdSyncPositive, /* 48.077 */
37, 23, 66, KdSyncPositive, /* 72.188 */

View File

@@ -0,0 +1,23 @@
--- /tmp/kmode.c 2007-10-07 11:49:52.000000000 +0200
+++ xorg-server-1.3.0.0/hw/kdrive/src/kmode.c 2007-10-07 11:51:57.962045000 +0200
@@ -119,7 +119,19 @@
0, 0, 0, KdSyncNegative, /* 59.940 */
},
-
+
+/* gumstix console-vx */
+ { 480, 272, 60, 0, /* VESA */
+ 0, 0, 0, KdSyncNegative, /* 31.469 */
+ 0, 0, 0, KdSyncNegative, /* 59.940 */
+ },
+
+ { 272, 480, 60, 0, /* VESA */
+ 0, 0, 0, KdSyncNegative, /* 31.469 */
+ 0, 0, 0, KdSyncNegative, /* 59.940 */
+ },
+
+
/* 800x600 modes */
{ 800, 600, 85, 56250, /* VESA */
32, 152, 248, KdSyncPositive, /* 53.674 */

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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 */

View File

@@ -0,0 +1,54 @@
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

View File

@@ -0,0 +1,15 @@
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;

View File

@@ -0,0 +1,28 @@
Index: xorg-server-1.4/hw/kdrive/w100/ati_stub.c
===================================================================
--- xorg-server-1.4.orig/hw/kdrive/w100/ati_stub.c 2007-09-08 21:40:26.000000000 +0200
+++ xorg-server-1.4/hw/kdrive/w100/ati_stub.c 2007-09-08 22:04:27.000000000 +0200
@@ -74,10 +74,20 @@
void
InitInput(int argc, char **argv)
{
- KdInitInput(&LinuxMouseFuncs, &LinuxKeyboardFuncs);
-#ifdef TOUCHSCREEN
- KdAddMouseDriver(&TsFuncs);
+ KdKeyboardInfo *ki;
+
+ KdAddKeyboardDriver (&LinuxKeyboardDriver);
+ KdAddPointerDriver (&LinuxMouseDriver);
+ KdAddKeyboardDriver (&LinuxEvdevKeyboardDriver);
+ KdAddPointerDriver (&LinuxEvdevMouseDriver);
+#ifdef TSLIB
+ KdAddPointerDriver (&TsDriver);
#endif
+
+ ki = KdParseKeyboard ("keyboard");
+ KdAddKeyboard(ki);
+
+ KdInitInput ();
}
void

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,64 @@
DESCRIPTION = "X server for glamo chip in GTA02"
SECTION = "x11/base"
LICENSE = "MIT"
DEPENDS = "compositeproto damageproto fixesproto recordproto resourceproto \
scrnsaverproto xineramaproto videoproto xextproto xproto \
libxau libxext libxdmcp libxfont libxrandr tslib virtual/libx11 \
xtrans libxkbfile libxcalibrate"
DEPENDS += "libxkbfile libxcalibrate"
RDEPENDS_${PN} = "xserver-kdrive"
PROVIDES = "virtual/xserver"
PE = "1"
PR = "r8"
PV = "1.3.0.0+git${SRCREV}"
SRC_URI = "git://git.openmoko.org/git/xglamo.git;protocol=git \
file://kmode.patch;patch=1 \
file://disable-apm.patch;patch=1 \
file://no-serial-probing.patch;patch=1 \
file://fbdev-not-fix.patch;patch=1 \
file://optional-xkb.patch;patch=1 \
file://enable-tslib.patch;patch=1 \
file://kmode-palm.patch;patch=1 \
file://enable-epson.patch;patch=1 \
file://enable-builtin-fonts.patch;patch=1 \
file://kdrive-evdev.patch;patch=1 \
file://kdrive-use-evdev.patch;patch=1 \
file://disable-xf86-dga-xorgcfg.patch;patch=1 \
file://fix_default_mode.patch;patch=1 \
file://enable-xcalibrate.patch;patch=1 \
file://hide-cursor-and-ppm-root.patch;patch=1 \
file://xcalibrate_coords.patch;patch=1 \
file://w100.patch;patch=1 \
file://w100-autofoo.patch;patch=1 \
file://w100-fix-offscreen-bmp.patch;patch=1 \
file://kdrive-1.3-18bpp.patch;patch=1 \
file://gumstix-kmode.patch;patch=1 \
file://fix-picturestr-include-order.patch;patch=1 \
"
FILESPATH = "${FILE_DIRNAME}/xserver-kdrive-glamo:${FILE_DIRNAME}/xserver-kdrive-1.3.0.0:${FILE_DIRNAME}/xserver-kdrive:${FILE_DIRNAME}/files"
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 \
--enable-tslib --enable-xcalibrate \
ac_cv_file__usr_share_sgml_X11_defs_ent=no"
do_configure_prepend() {
sed -i -e 's/tslib-0.0/tslib-1.0/' ${S}/configure.ac
}
FILES_${PN} = "${bindir}/Xglamo"
FILES_${PN}-dbg = "${bindir}/.debug/Xglamo"
ARM_INSTRUCTION_SET = "arm"

View File

@@ -0,0 +1,20 @@
---
hw/kdrive/linux/tslib.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Index: xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/linux/tslib.c 2007-05-17 10:28:12.000000000 +0100
+++ xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c 2007-05-17 10:28:42.000000000 +0100
@@ -111,10 +111,7 @@ TsRead (int fd, void *closure)
event.pressure);
discard = 0;
if (event.pressure) {
- if (event.pressure > pi->dixdev->absolute->button_threshold)
- flags = KD_BUTTON_8;
- else
- flags = KD_BUTTON_1;
+ flags = KD_BUTTON_1;
/*
* Here we test for the touch screen driver actually being on the

View File

@@ -0,0 +1,124 @@
---
configure |38107 -----------------------------------------------------------
configure.ac | 2 -
hw/kdrive/linux/tslib.c | 68 ++++++++++++++++++++++++++----------------------
2 files changed, 39 insertions(+), 31 deletions(-)
Index: xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/linux/tslib.c 2007-01-30 00:44:13.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c 2007-01-30 21:55:52.000000000 +0000
@@ -47,6 +47,10 @@
#define TSLIB_QUEUE_SIZE 3
+/* For XCalibrate extension */
+void (*tslib_raw_event_hook)(int x, int y, int pressure, void *closure);
+void *tslib_raw_event_closure;
+
struct TslibPrivate {
int fd;
int lastx, lasty;
@@ -76,6 +80,19 @@ TsRead (int fd, void *closure)
unsigned long flags = 0;
int discard = 0;
+ if (tslib_raw_event_hook)
+ {
+ /* XCalibrate Ext */
+ if (ts_read_raw(private->tsDev, &event, 1) == 1)
+ {
+ tslib_raw_event_hook (event.x,
+ event.y,
+ event.pressure,
+ tslib_raw_event_closure);
+ }
+ return;
+ }
+
if (!private->tsDev) {
DebugF("[tslib] EXTREME BADNESS: TsRead called while tsDev is null!\n");
return;
@@ -322,14 +339,14 @@ TsRead (int fd, void *closure)
}
}
-/* must always be NULL-terminated. */
-char *valid_ts_names[] = {
- "ADS784x Touchscreen",
- "omap-ts",
- "TSC2301 touchscreen",
- NULL
+static char *TsNames[] = {
+ NULL, /* set via TSLIB_TSDEVICE */
+ "/dev/ts",
+ "/dev/touchscreen/0",
};
+#define NUM_TS_NAMES (sizeof (TsNames) / sizeof (TsNames[0]))
+
#define TS_NAME_SIZE 32
static Status
@@ -383,11 +400,10 @@ TslibDisable (KdPointerInfo *pi)
private->tsDev = NULL;
}
-
static Status
TslibInit (KdPointerInfo *pi)
{
- int fd = 0, i = 0;
+ int fd = 0, i = 0, j = 0;
char devpath[PATH_MAX], devname[TS_NAME_SIZE];
DIR *inputdir = NULL;
struct dirent *inputent = NULL;
@@ -397,33 +413,25 @@ TslibInit (KdPointerInfo *pi)
return !Success;
if (!pi->path || strcmp(pi->path, "auto") == 0) {
- if (!(inputdir = opendir("/dev/input"))) {
- ErrorF("[tslib/TslibInit]: couldn't open /dev/input!\n");
- return BadMatch;
- }
- while ((inputent = readdir(inputdir))) {
- if (strncmp(inputent->d_name, "event", 5) != 0)
- continue;
+ if ((TsNames[0] = getenv("TSLIB_TSDEVICE")) == NULL)
+ j++;
+
+ for (i = j; i < NUM_TS_NAMES; i++)
+ {
+ struct tsdev *tsDev;
- snprintf(devpath, PATH_MAX, "/dev/input/%s", inputent->d_name);
- fd = open(devpath, O_RDWR);
+ if(!(tsDev = ts_open(TsNames[i], 0)))
+ continue;
- if (!ioctl(fd, EVIOCGNAME(sizeof(devname)), devname)) {
- close(fd);
+ if (ts_config(tsDev))
continue;
- }
- close(fd);
- for (i = 0; valid_ts_names[i]; i++) {
- if (strcmp(devname, valid_ts_names[i]) == 0) {
- pi->path = KdSaveString(devpath);
- break;
- }
- }
- }
-
- closedir(inputdir);
+ ts_close(tsDev);
+
+ pi->path = KdSaveString(TsNames[i]);
+ break;
+ }
}
if (!pi->path || strcmp(pi->path, "auto") == 0) {

View File

@@ -0,0 +1,15 @@
Index: xorg-server-1.1.99.3/configure.ac
===================================================================
--- xorg-server-1.1.99.3.orig/configure.ac 2010-06-09 12:52:26.000000000 +0100
+++ xorg-server-1.1.99.3/configure.ac 2010-06-09 12:52:51.000000000 +0100
@@ -1731,7 +1731,9 @@
DIX_CFLAGS="-DHAVE_DIX_CONFIG_H"
AC_SUBST([DIX_CFLAGS])
-AC_SUBST([libdir exec_prefix prefix])
+AC_SUBST([libdir])
+AC_SUBST([exec_prefix])
+AC_SUBST([prefix])
# Man page sections - used in config utils & generating man pages
XORG_MANPAGE_SECTIONS

View File

@@ -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
*/

View File

@@ -0,0 +1,37 @@
--- 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],

View File

@@ -0,0 +1,82 @@
Index: xorg-server-1.1.99.3/Makefile.am
===================================================================
--- xorg-server-1.1.99.3.orig/Makefile.am 2008-02-20 22:22:56.000000000 +0000
+++ xorg-server-1.1.99.3/Makefile.am 2008-02-20 22:23:22.000000000 +0000
@@ -34,6 +34,11 @@
XSP_DIR=xsp
endif
+if XKB
+XKB_DIR=xkb
+endif
+
+
SUBDIRS = \
doc \
include \
@@ -46,7 +51,7 @@
randr \
render \
Xi \
- xkb \
+ $(XKB_DIR) \
$(DBE_DIR) \
$(MFB_DIR) \
$(AFB_DIR) \
Index: xorg-server-1.1.99.3/configure.ac
===================================================================
--- xorg-server-1.1.99.3.orig/configure.ac 2008-02-20 22:04:15.000000000 +0000
+++ xorg-server-1.1.99.3/configure.ac 2008-02-20 22:28:35.000000000 +0000
@@ -434,6 +434,7 @@
AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [Build D-BUS support (default: auto)]), [DBUS=$enableval], [DBUS=auto])
AC_ARG_ENABLE(xsp, AS_HELP_STRING([--disable-xsp], [Build XSP support (default: auto)]), [XSP=$enableval], [XSP=auto])
AC_ARG_ENABLE(tslib, AS_HELP_STRING([--disable-tslib], [Build embedded touchscreen support (default: auto)]), [TSLIB=$enableval], [TSLIB=auto])
+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])
@@ -751,12 +752,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'.]))
Index: xorg-server-1.1.99.3/hw/kdrive/src/Makefile.am
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/src/Makefile.am 2008-02-20 22:28:04.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/src/Makefile.am 2008-02-20 22:28:31.000000000 +0000
@@ -39,4 +39,4 @@
libkdrivestubs_a_SOURCES = \
$(top_srcdir)/fb/fbcmap.c
-libkdrivexkb_a_SOURCES = kxkb.c
+libkdrivexkb_a_SOURCES =
Index: xorg-server-1.1.99.3/hw/kdrive/src/kinput.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kinput.c 2008-02-20 22:25:58.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/src/kinput.c 2008-02-20 22:27:29.000000000 +0000
@@ -777,7 +777,7 @@
KdInitModMap(ki);
KdInitAutoRepeats(ki);
-#ifndef XKB
+#ifdef XKB
if (!noXkbExtension) {
memset(&names, 0, sizeof(XkbComponentNamesRec));
if (XkbInitialMap)

View File

@@ -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>

View File

@@ -0,0 +1,23 @@
--- 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])

View File

@@ -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;

View File

@@ -0,0 +1,446 @@
---
Xi/chgdctl.c | 55 +++++++++++++++++++------
Xi/getdctl.c | 87 +++++++++++++++++++++++++++++++----------
Xi/getdctl.h | 11 +++--
Xi/stubs.c | 2
configure.ac | 2
dix/devices.c | 31 +++++++++-----
hw/kdrive/linux/tslib.c | 8 +--
hw/kdrive/src/kinput.c | 6 +-
hw/xfree86/common/xf86Xinput.c | 3 -
include/input.h | 2
include/inputstr.h | 18 +++++++-
11 files changed, 162 insertions(+), 63 deletions(-)
Index: xorg-server-1.1.99.3/Xi/chgdctl.c
===================================================================
--- xorg-server-1.1.99.3.orig/Xi/chgdctl.c 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/Xi/chgdctl.c 2007-01-29 22:59:27.000000000 +0000
@@ -104,8 +104,10 @@ ProcXChangeDeviceControl(ClientPtr clien
xChangeDeviceControlReply rep;
AxisInfoPtr a;
CARD32 *resolution;
- xDeviceTSCtl *ts;
+ xDeviceAbsCalibCtl *calib;
+ xDeviceAbsAreaCtl *area;
xDeviceCoreCtl *c;
+ xDeviceEnableCtl *e;
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
@@ -170,25 +172,28 @@ ProcXChangeDeviceControl(ClientPtr clien
return Success;
}
break;
- case DEVICE_TOUCHSCREEN:
- ts = (xDeviceTSCtl *)&stuff[1];
-
- if (ts->button_threshold < 0 || ts->button_threshold > 255) {
+ case DEVICE_ABS_CALIB:
+ calib = (xDeviceAbsCalibCtl *)&stuff[1];
+
+ if (calib->button_threshold < 0 || calib->button_threshold > 255) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadValue);
return Success;
}
- status = ChangeDeviceControl(client, dev, (xDeviceCtl *) ts);
+ status = ChangeDeviceControl(client, dev, (xDeviceCtl *) calib);
if (status == Success) {
- dev->touchscreen->min_x = ts->min_x;
- dev->touchscreen->max_x = ts->max_x;
- dev->touchscreen->min_y = ts->min_y;
- dev->touchscreen->max_y = ts->max_y;
- dev->touchscreen->button_threshold = ts->button_threshold;
- } else if (status == DeviceBusy) {
- rep.status = DeviceBusy;
+ dev->absolute->min_x = calib->min_x;
+ dev->absolute->max_x = calib->max_x;
+ dev->absolute->min_y = calib->min_y;
+ dev->absolute->max_y = calib->max_y;
+ dev->absolute->flip_x = calib->flip_x;
+ dev->absolute->flip_y = calib->flip_y;
+ dev->absolute->rotation = calib->rotation;
+ dev->absolute->button_threshold = calib->button_threshold;
+ } else if (status == DeviceBusy || status == BadValue) {
+ rep.status = status;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
&rep);
return Success;
@@ -199,6 +204,30 @@ ProcXChangeDeviceControl(ClientPtr clien
}
break;
+ case DEVICE_ABS_AREA:
+ area = (xDeviceAbsAreaCtl *)&stuff[1];
+
+ status = ChangeDeviceControl(client, dev, (xDeviceCtl *) area);
+
+ if (status == Success) {
+ dev->absolute->offset_x = area->offset_x;
+ dev->absolute->offset_y = area->offset_y;
+ dev->absolute->width = area->width;
+ dev->absolute->height = area->height;
+ dev->absolute->screen = area->screen;
+ dev->absolute->following = area->following;
+ } else if (status == DeviceBusy || status == BadValue) {
+ rep.status = status;
+ WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
+ &rep);
+ return Success;
+ } else {
+ SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
+ BadMatch);
+ return Success;
+ }
+
+ break;
case DEVICE_CORE:
c = (xDeviceCoreCtl *)&stuff[1];
Index: xorg-server-1.1.99.3/Xi/getdctl.c
===================================================================
--- xorg-server-1.1.99.3.orig/Xi/getdctl.c 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/Xi/getdctl.c 2007-01-29 22:59:27.000000000 +0000
@@ -124,14 +124,23 @@ ProcXGetDeviceControl(ClientPtr client)
total_length = sizeof(xDeviceResolutionState) +
(3 * sizeof(int) * dev->valuator->numAxes);
break;
- case DEVICE_TOUCHSCREEN:
- if (!dev->touchscreen) {
+ case DEVICE_ABS_CALIB:
+ if (!dev->absolute) {
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
BadMatch);
return Success;
}
- total_length = sizeof(xDeviceTSCtl);
+ total_length = sizeof(xDeviceAbsCalibCtl);
+ break;
+ case DEVICE_ABS_AREA:
+ if (!dev->absolute) {
+ SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
+ BadMatch);
+ return Success;
+ }
+
+ total_length = sizeof(xDeviceAbsAreaCtl);
break;
case DEVICE_CORE:
total_length = sizeof(xDeviceCoreCtl);
@@ -152,8 +161,11 @@ ProcXGetDeviceControl(ClientPtr client)
case DEVICE_RESOLUTION:
CopySwapDeviceResolution(client, dev->valuator, buf, total_length);
break;
- case DEVICE_TOUCHSCREEN:
- CopySwapDeviceTouchscreen(client, dev->touchscreen, buf);
+ case DEVICE_ABS_CALIB:
+ CopySwapDeviceAbsCalib(client, dev->absolute, buf);
+ break;
+ case DEVICE_ABS_AREA:
+ CopySwapDeviceAbsArea(client, dev->absolute, buf);
break;
case DEVICE_CORE:
CopySwapDeviceCore(client, dev, buf);
@@ -206,28 +218,61 @@ CopySwapDeviceResolution(ClientPtr clien
}
}
-void CopySwapDeviceTouchscreen (ClientPtr client, TouchscreenClassPtr dts,
+void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
register char n;
- xDeviceTSState *ts = (xDeviceTSState *) buf;
+ xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf;
- ts->control = DEVICE_TOUCHSCREEN;
- ts->length = sizeof(ts);
- ts->min_x = dts->min_x;
- ts->max_x = dts->max_x;
- ts->min_y = dts->min_y;
- ts->max_y = dts->max_y;
- ts->button_threshold = dts->button_threshold;
+ calib->control = DEVICE_ABS_CALIB;
+ calib->length = sizeof(calib);
+ calib->min_x = dts->min_x;
+ calib->max_x = dts->max_x;
+ calib->min_y = dts->min_y;
+ calib->max_y = dts->max_y;
+ calib->flip_x = dts->flip_x;
+ calib->flip_y = dts->flip_y;
+ calib->rotation = dts->rotation;
+ calib->button_threshold = dts->button_threshold;
if (client->swapped) {
- swaps(&ts->control, n);
- swaps(&ts->length, n);
- swapl(&ts->min_x, n);
- swapl(&ts->max_x, n);
- swapl(&ts->min_y, n);
- swapl(&ts->max_y, n);
- swapl(&ts->button_threshold, n);
+ swaps(&calib->control, n);
+ swaps(&calib->length, n);
+ swapl(&calib->min_x, n);
+ swapl(&calib->max_x, n);
+ swapl(&calib->min_y, n);
+ swapl(&calib->max_y, n);
+ swapl(&calib->flip_x, n);
+ swapl(&calib->flip_y, n);
+ swapl(&calib->rotation, n);
+ swapl(&calib->button_threshold, n);
+ }
+}
+
+void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
+ char *buf)
+{
+ register char n;
+ xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf;
+
+ area->control = DEVICE_ABS_AREA;
+ area->length = sizeof(area);
+ area->offset_x = dts->offset_x;
+ area->offset_y = dts->offset_y;
+ area->width = dts->width;
+ area->height = dts->height;
+ area->screen = dts->screen;
+ area->following = dts->following;
+
+ if (client->swapped) {
+ swaps(&area->control, n);
+ swaps(&area->length, n);
+ swapl(&area->offset_x, n);
+ swapl(&area->offset_y, n);
+ swapl(&area->width, n);
+ swapl(&area->height, n);
+ swapl(&area->screen, n);
+ swapl(&area->following, n);
}
}
Index: xorg-server-1.1.99.3/Xi/getdctl.h
===================================================================
--- xorg-server-1.1.99.3.orig/Xi/getdctl.h 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/Xi/getdctl.h 2007-01-29 22:59:27.000000000 +0000
@@ -42,10 +42,13 @@ void CopySwapDeviceResolution(ClientPtr
int /* length */
);
-void CopySwapDeviceTouchscreen(ClientPtr /* client */ ,
- TouchscreenClassPtr /* ts */ ,
- char * /* buf */
- );
+void CopySwapDeviceAbsCalib (ClientPtr client,
+ AbsoluteClassPtr dts,
+ char *buf);
+
+void CopySwapDeviceAbsArea (ClientPtr client,
+ AbsoluteClassPtr dts,
+ char *buf);
void CopySwapDeviceCore(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
Index: xorg-server-1.1.99.3/Xi/stubs.c
===================================================================
--- xorg-server-1.1.99.3.orig/Xi/stubs.c 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/Xi/stubs.c 2007-01-29 22:59:27.000000000 +0000
@@ -287,7 +287,7 @@ ChangeDeviceControl(register ClientPtr c
switch (control->control) {
case DEVICE_RESOLUTION:
return (BadMatch);
- case DEVICE_TOUCHSCREEN:
+ case DEVICE_ABS_CALIB:
return (BadMatch);
case DEVICE_CORE:
return (BadMatch);
Index: xorg-server-1.1.99.3/dix/devices.c
===================================================================
--- xorg-server-1.1.99.3.orig/dix/devices.c 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/dix/devices.c 2007-01-29 22:59:27.000000000 +0000
@@ -117,7 +117,7 @@ AddInputDevice(DeviceProc deviceProc, Bo
dev->button = (ButtonClassPtr)NULL;
dev->focus = (FocusClassPtr)NULL;
dev->proximity = (ProximityClassPtr)NULL;
- dev->touchscreen = (TouchscreenClassPtr)NULL;
+ dev->absolute = (AbsoluteClassPtr)NULL;
dev->kbdfeed = (KbdFeedbackPtr)NULL;
dev->ptrfeed = (PtrFeedbackPtr)NULL;
dev->intfeed = (IntegerFeedbackPtr)NULL;
@@ -821,22 +821,31 @@ InitValuatorClassDeviceStruct(DeviceIntP
}
_X_EXPORT Bool
-InitTouchscreenClassDeviceStruct(DeviceIntPtr dev)
+InitAbsoluteClassDeviceStruct(DeviceIntPtr dev)
{
- register TouchscreenClassPtr tsc;
+ register AbsoluteClassPtr abs;
- tsc = (TouchscreenClassPtr)xalloc(sizeof(TouchscreenClassRec));
- if (!tsc)
+ abs = (AbsoluteClassPtr)xalloc(sizeof(AbsoluteClassRec));
+ if (!abs)
return FALSE;
/* we don't do anything sensible with these, but should */
- tsc->min_x = -1;
- tsc->min_y = -1;
- tsc->max_x = -1;
- tsc->max_y = -1;
+ abs->min_x = -1;
+ abs->min_y = -1;
+ abs->max_x = -1;
+ abs->max_y = -1;
+ abs->flip_x = 0;
+ abs->flip_y = 0;
+ abs->rotation = 0;
+ abs->button_threshold = 0;
- tsc->button_threshold = 0;
- dev->touchscreen = tsc;
+ abs->offset_x = 0;
+ abs->offset_y = 0;
+ abs->width = -1;
+ abs->height = -1;
+ abs->following = 0;
+
+ dev->absolute = abs;
return TRUE;
}
Index: xorg-server-1.1.99.3/hw/xfree86/common/xf86Xinput.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/xfree86/common/xf86Xinput.c 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/hw/xfree86/common/xf86Xinput.c 2007-01-29 22:59:27.000000000 +0000
@@ -538,7 +538,8 @@ ChangeDeviceControl (ClientPtr client, D
switch (control->control) {
case DEVICE_CORE:
case DEVICE_RESOLUTION:
- case DEVICE_TOUCHSCREEN:
+ case DEVICE_ABS_CALIB:
+ case DEVICE_ABS_AREA:
return Success;
default:
return BadMatch;
Index: xorg-server-1.1.99.3/include/input.h
===================================================================
--- xorg-server-1.1.99.3.orig/include/input.h 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/include/input.h 2007-01-29 22:59:27.000000000 +0000
@@ -238,7 +238,7 @@ extern Bool InitValuatorClassDeviceStruc
int /*numMotionEvents*/,
int /*mode*/);
-extern Bool InitTouchscreenClassDeviceStruct(
+extern Bool InitAbsoluteClassDeviceStruct(
DeviceIntPtr /*device*/);
extern Bool InitFocusClassDeviceStruct(
Index: xorg-server-1.1.99.3/include/inputstr.h
===================================================================
--- xorg-server-1.1.99.3.orig/include/inputstr.h 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/include/inputstr.h 2007-01-29 22:59:27.000000000 +0000
@@ -185,13 +185,25 @@ typedef struct _ProximityClassRec {
char pad;
} ProximityClassRec, *ProximityClassPtr;
-typedef struct _TouchscreenClassRec {
+typedef struct _AbsoluteClassRec {
+ /* Calibration. */
int min_x;
int max_x;
int min_y;
int max_y;
+ int flip_x;
+ int flip_y;
+ int rotation;
int button_threshold;
-} TouchscreenClassRec, *TouchscreenClassPtr;
+
+ /* Area. */
+ int offset_x;
+ int offset_y;
+ int width;
+ int height;
+ int screen;
+ XID following;
+} AbsoluteClassRec, *AbsoluteClassPtr;
typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
@@ -293,7 +305,7 @@ typedef struct _DeviceIntRec {
ButtonClassPtr button;
FocusClassPtr focus;
ProximityClassPtr proximity;
- TouchscreenClassPtr touchscreen;
+ AbsoluteClassPtr absolute;
KbdFeedbackPtr kbdfeed;
PtrFeedbackPtr ptrfeed;
IntegerFeedbackPtr intfeed;
Index: xorg-server-1.1.99.3/configure.ac
===================================================================
--- xorg-server-1.1.99.3.orig/configure.ac 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/configure.ac 2007-01-29 22:59:27.000000000 +0000
@@ -1586,7 +1586,7 @@ if test "$KDRIVE" = yes; then
#KDRIVE_PURE_LIBS="$DIX_LIB $OS_LIB $FB_LIB $XEXT_LIB $MIEXT_DAMAGE_LIB \
# $MIEXT_SHADOW_LIB $XPSTUBS_LIB"
KDRIVE_XKB_DDX_LIB='$(top_builddir)/hw/kdrive/src/libkdrivexkb.a'
- KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $KDRIVE_XKB_DDX_LIB $XKB_LIB $KDRIVE_XKB_DDX_LIB$COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB $CONFIG_LIB"
+ KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $KDRIVE_XKB_DDX_LIB $XKB_LIB $KDRIVE_XKB_DDX_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB $CONFIG_LIB"
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'
Index: xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/linux/tslib.c 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c 2007-01-29 22:59:27.000000000 +0000
@@ -94,7 +94,7 @@ TsRead (int fd, void *closure)
event.pressure);
discard = 0;
if (event.pressure) {
- if (event.pressure > pi->dixdev->touchscreen->button_threshold)
+ if (event.pressure > pi->dixdev->absolute->button_threshold)
flags = KD_BUTTON_8;
else
flags = KD_BUTTON_1;
@@ -356,9 +356,9 @@ TslibEnable (KdPointerInfo *pi)
close(private->fd);
return BadAlloc;
}
- if (pi->dixdev && pi->dixdev->touchscreen &&
- pi->dixdev->touchscreen->button_threshold == 0)
- pi->dixdev->touchscreen->button_threshold = 115;
+ if (pi->dixdev && pi->dixdev->absolute &&
+ pi->dixdev->absolute->button_threshold == 0)
+ pi->dixdev->absolute->button_threshold = 115;
DebugF("[tslib/TslibEnable] successfully enabled %s\n", pi->path);
KdRegisterFd(private->fd, TsRead, pi);
Index: xorg-server-1.1.99.3/hw/kdrive/src/kinput.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kinput.c 2007-01-29 22:58:18.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/src/kinput.c 2007-01-29 22:59:27.000000000 +0000
@@ -444,7 +444,7 @@ KdPointerProc(DeviceIntPtr pDevice, int
#ifdef XINPUT
if (pi->inputClass == KD_TOUCHSCREEN) {
- InitTouchscreenClassDeviceStruct(pDevice);
+ InitAbsoluteClassDeviceStruct(pDevice);
xiclass = AtomFromName(XI_TOUCHSCREEN);
}
else {
@@ -2323,8 +2323,8 @@ ChangeDeviceControl(register ClientPtr c
/* FIXME do something more intelligent here */
return BadMatch;
- case DEVICE_TOUCHSCREEN:
- if (!pDev->touchscreen)
+ case DEVICE_ABS_CALIB:
+ if (!pDev->absolute)
return BadDevice;
else
return Success;

View File

@@ -0,0 +1,503 @@
# Kdrive evdev support patch, posted by Ander Conselvan de Oliveira at
# http://lists.freedesktop.org/archives/xorg/2005-December/011635.html
---
# hw/kdrive/linux/evdev.c | 385 ++++++++++++++++++++++++++++++++++++++++++++++--
# hw/kdrive/src/kdrive.c | 9 +
# hw/kdrive/src/kdrive.h | 4
# 3 files changed, 386 insertions(+), 12 deletions(-)
#
Index: xorg-server-1.1.99.3/hw/kdrive/linux/evdev.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/linux/evdev.c 2006-11-03 14:49:05.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/linux/evdev.c 2007-01-25 22:05:48.000000000 +0000
@@ -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
@@ -107,9 +109,10 @@ EvdevRead (int evdevPort, void *closure)
{
KdPointerInfo *pi = closure;
Kevdev *ke = pi->driverPrivate;
- 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)
@@ -117,22 +120,64 @@ EvdevRead (int evdevPort, void *closure)
n /= sizeof (struct input_event);
for (i = 0; i < n; i++)
{
+ flags = KD_MOUSE_DELTA | kdPointerInfo->buttonState;
switch (events[i].type) {
case EV_SYN:
break;
case EV_KEY:
- EvdevMotion (pi);
- 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;
}
}
@@ -162,6 +207,12 @@ EvdevInit (KdPointerInfo *pi)
for (i = 0; i < NUM_DEFAULT_EVDEV; i++) {
fd = open (kdefaultEvdev[i], 2);
if (fd >= 0) {
+ if (ioctl (fd, EVIOCGRAB, 1) < 0)
+ {
+ close (fd);
+ continue;
+ }
+
pi->path = KdSaveString (kdefaultEvdev[i]);
break;
}
@@ -300,7 +351,319 @@ KdPointerDriver LinuxEvdevMouseDriver =
NULL,
};
-#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,
@@ -309,4 +672,4 @@ KdKeyboardFuncs LinuxEvdevKeyboardFuncs
EvdevKbdFini,
0,
};
-#endif
+
Index: xorg-server-1.1.99.3/hw/kdrive/src/kdrive.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kdrive.c 2006-11-03 14:49:05.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/src/kdrive.c 2007-01-25 21:56:32.000000000 +0000
@@ -80,6 +80,7 @@ Bool kdDontZap;
Bool kdEnabled;
int kdSubpixelOrder;
int kdVirtualTerminal = -1;
+char *kdKeyboard = 0;
Bool kdSwitchPending;
char *kdSwitchCmd;
DDXPointRec kdOrigin;
@@ -707,6 +708,14 @@ KdProcessArgument (int argc, char **argv
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)
Index: xorg-server-1.1.99.3/hw/kdrive/src/kdrive.h
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kdrive.h 2006-11-03 14:49:05.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/src/kdrive.h 2007-01-25 21:58:26.000000000 +0000
@@ -512,6 +512,7 @@ extern Bool kdEmulateMiddleButton;
extern Bool kdDisableZaphod;
extern Bool kdDontZap;
extern int kdVirtualTerminal;
+extern char *kdKeyboard;
extern char *kdSwitchCmd;
extern KdOsFuncs *kdOsFuncs;
@@ -875,12 +876,13 @@ void
ProcessInputEvents (void);
extern KdPointerDriver LinuxMouseDriver;
-extern KdPointerDriver LinuxEvdevDriver;
+extern KdPointerDriver LinuxEvdevMouseFuncs;
extern KdPointerDriver Ps2MouseDriver;
extern KdPointerDriver BusMouseDriver;
extern KdPointerDriver MsMouseDriver;
extern KdPointerDriver TsDriver;
extern KdKeyboardDriver LinuxKeyboardDriver;
+extern KdKeyboardFuncs LinuxEvdevKeyboardFuncs;
extern KdOsFuncs LinuxFuncs;
extern KdPointerDriver VxWorksMouseDriver;

View File

@@ -0,0 +1,53 @@
--- 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,10 @@
UseMsg ();
return 2;
}
+ if (!strcmp (argv[i], "-use-evdev"))
+ {
+ use_evdev = 1;
+ }
if (!strcmp (argv[i], "-keyboard"))
{
if ((i+1) < argc)

View File

@@ -0,0 +1,43 @@
---
hw/kdrive/src/kmode.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
Index: xorg-server-1.1.99.3/hw/kdrive/src/kmode.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kmode.c 2007-01-25 23:53:59.000000000 +0000
+++ xorg-server-1.1.99.3/hw/kdrive/src/kmode.c 2007-01-27 17:17:09.000000000 +0000
@@ -41,6 +41,11 @@ const KdMonitorTiming kdMonitorTimings[
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,22 @@ const KdMonitorTiming kdMonitorTimings[
16, 48, 160, KdSyncNegative, /* 31.469 */
10, 33, 45, KdSyncNegative, /* 59.940 */
},
+
+
+ { 480, 640, 60, 0,
+ 0, 0, 0, KdSyncNegative,
+ 0, 0, 0, KdSyncNegative,
+ },
+
+ { 800, 480, 51, 0,
+ 0, 0, 0, KdSyncNegative,
+ 0, 0, 0, KdSyncNegative,
+ },
+
+ { 480, 800, 51, 0,
+ 0, 0, 0, KdSyncNegative,
+ 0, 0, 0, KdSyncNegative,
+ },
/* 800x600 modes */
{ 800, 600, 85, 56250, /* VESA */

View File

@@ -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]))

View File

@@ -0,0 +1,73 @@
---
Xext/Makefile.am | 5
Xext/xcalibrate.c | 262 +++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 8 +
include/kdrive-config.h.in | 3
mi/miinitext.c | 6 +
5 files changed, 283 insertions(+), 1 deletion(-)
Index: xorg-server-1.1.99.3/mi/miinitext.c
===================================================================
--- xorg-server-1.1.99.3.orig/mi/miinitext.c 2006-11-03 14:49:06.000000000 +0000
+++ xorg-server-1.1.99.3/mi/miinitext.c 2007-01-27 17:59:40.000000000 +0000
@@ -368,6 +368,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
@@ -662,6 +665,9 @@ InitExtensions(argc, argv)
#ifdef XSP
if (!noXspExtension) XSPExtensionInit();
#endif
+#ifdef XCALIBRATE
+ XCalibrateExtensionInit ();
+#endif
}
void
Index: xorg-server-1.1.99.3/configure.ac
===================================================================
--- xorg-server-1.1.99.3.orig/configure.ac 2006-11-03 14:49:05.000000000 +0000
+++ xorg-server-1.1.99.3/configure.ac 2007-01-29 22:58:18.000000000 +0000
@@ -1584,7 +1590,7 @@ if test "$KDRIVE" = yes; then
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="$XSERVERLIBS_LIBS $DIX_LIB $XSP_LIB $KDRIVE_LIB $TSLIB_LIBS $KDRIVE_OS_LIB $KDRIVE_PURE_LIBS $KDRIVE_STUB_LIB"
+ KDRIVE_LIBS="$XSERVERLIBS_LIBS $DIX_LIB $XSP_LIB $KDRIVE_LIB $TSLIB_LIBS $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"])
Index: xorg-server-1.1.99.3/include/kdrive-config.h.in
===================================================================
--- xorg-server-1.1.99.3.orig/include/kdrive-config.h.in 2006-11-03 14:49:06.000000000 +0000
+++ xorg-server-1.1.99.3/include/kdrive-config.h.in 2007-01-27 17:59:40.000000000 +0000
@@ -28,4 +28,7 @@
/* Have the backtrace() functiln. */
#undef HAVE_BACKTRACE
+/* Enable XCalibrate extension */
+#undef XCALIBRATE
+
#endif /* _KDRIVE_CONFIG_H_ */
Index: xorg-server-1.1.99.3/Xext/Makefile.am
===================================================================
--- xorg-server-1.1.99.3.orig/Xext/Makefile.am 2006-11-03 14:49:05.000000000 +0000
+++ xorg-server-1.1.99.3/Xext/Makefile.am 2007-01-29 22:58:33.000000000 +0000
@@ -81,6 +81,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.

View File

@@ -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.1.99.3/Xext/xcalibrate.c
===================================================================
--- xorg-server-1.1.99.3.orig/Xext/xcalibrate.c 2007-06-30 16:27:13.000000000 +0100
+++ xorg-server-1.1.99.3/Xext/xcalibrate.c 2007-06-30 16:27:15.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.1.99.3/hw/kdrive/src/kdrive.h
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kdrive.h 2007-06-30 16:27:13.000000000 +0100
+++ xorg-server-1.1.99.3/hw/kdrive/src/kdrive.h 2007-06-30 16:30:40.000000000 +0100
@@ -851,6 +851,9 @@ void
KdSetPointerMatrix (KdPointerMatrix *pointer);
void
+KdScreenToMouseCoords (int *x, int *y);
+
+void
KdComputePointerMatrix (KdPointerMatrix *pointer, Rotation randr, int width, int height);
void
Index: xorg-server-1.1.99.3/hw/kdrive/src/kinput.c
===================================================================
--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kinput.c 2007-06-30 16:27:14.000000000 +0100
+++ xorg-server-1.1.99.3/hw/kdrive/src/kinput.c 2007-06-30 16:30:16.000000000 +0100
@@ -570,6 +570,18 @@ KdSetPointerMatrix (KdPointerMatrix *mat
}
void
+KdScreenToMouseCoords (int *x, int *y)
+{
+ int (*m)[3] = kdPointerMatrix.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
KdComputePointerMatrix (KdPointerMatrix *m, Rotation randr, int width,
int height)
{

View File

@@ -0,0 +1,82 @@
---
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 */

View File

@@ -0,0 +1,52 @@
LICENSE = "MIT"
DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto libxfont resourceproto compositeproto calibrateproto recordproto videoproto scrnsaverproto xpext xsp libxkbfile dbus"
PROVIDES = "virtual/xserver"
PACKAGES =+ "xserver-kdrive-xomap"
SECTION = "x11/base"
DESCRIPTION = "X server from freedesktop.org"
DESCRIPTION_xserver-kdrive-xomap = "X server for the OMAP in the Nokia 800"
PE = "1"
COMPATIBLE_MACHINE = "nokia(800|770)"
FILES_${PN} = "${libdir}/xserver /etc/dbus-1/* ${bindir}/Xomap"
SRC_URI = "http://repository.maemo.org/pool/maemo3.1/free/source/xorg-server_1.1.99.3-0osso31.tar.gz \
file://kmode.patch;patch=1 \
file://disable-apm.patch;patch=1 \
file://no-serial-probing.patch;patch=1 \
file://fbdev-not-fix.patch;patch=1 \
file://enable-builtin-fonts.patch;patch=1 \
file://xcalibrate.patch;patch=1 \
file://fixups.patch;patch=1 \
file://button_only.patch;patch=1 \
file://calibrateext.patch;patch=1 \
file://disable-xkb.patch;patch=1 \
file://configfix.patch;patch=1 \
file://xcalibrate_coords.patch;patch=1"
# file://kdrive-evdev.patch;patch=1 \
# file://kdrive-use-evdev.patch;patch=1 \
# file://disable-xf86-dga-xorgcfg.patch;patch=1 \
# file://enable-tslib.patch;patch=1 \
# file://xfbdev-fb-opt.patch;patch=1"
S = "${WORKDIR}/xorg-server-1.1.99.3"
inherit autotools pkgconfig
EXTRA_OECONF = "--enable-composite --enable-kdrive --enable-builtin-fonts \
--disable-dga --disable-dri --disable-xinerama \
--disable-xf86misc --disable-xf86vidmode \
--disable-xorg --disable-xorgcfg \
--disable-dmx --enable-xcalibrate \
--disable-xkb --disable-xnest --disable-xvfb \
--disable-xevie --disable-xprint --disable-xtrap \
--with-default-font-path=built-ins \
ac_cv_file__usr_share_X11_sgml_defs_ent=no \
--enable-xomap"
do_configure_prepend() {
sed -i -e 's/tslib-0.0/tslib-1.0/' ${S}/configure.ac
}