diff options
author | Junqian Gordon Xu <xjqian@gmail.com> | 2008-02-01 07:02:51 +0000 |
---|---|---|
committer | Junqian Gordon Xu <xjqian@gmail.com> | 2008-02-01 07:02:51 +0000 |
commit | 8676aae43b79aa4b52255dd60c11e5dd171bf7aa (patch) | |
tree | 19014920c08156d11b2cdfebb294658e94a8fa02 | |
parent | 6e642c106cf936da3ef370717eb85c06cc7e535c (diff) |
xserver-kdrive-1.3/1.4: keycode MEDIUMRAW patch, oebug 2637, courtesy of Stanislav Brabec utx@penguin.cz
* see details in bugtracker and mailinglist
4 files changed, 131 insertions, 2 deletions
diff --git a/packages/xorg-xserver/xserver-kdrive-1.3.0.0/linux-keyboard-mediumraw.patch b/packages/xorg-xserver/xserver-kdrive-1.3.0.0/linux-keyboard-mediumraw.patch new file mode 100644 index 0000000000..997028ad8d --- /dev/null +++ b/packages/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/packages/xorg-xserver/xserver-kdrive-1.4/linux-keyboard-mediumraw.patch b/packages/xorg-xserver/xserver-kdrive-1.4/linux-keyboard-mediumraw.patch new file mode 100644 index 0000000000..36d2f8eae8 --- /dev/null +++ b/packages/xorg-xserver/xserver-kdrive-1.4/linux-keyboard-mediumraw.patch @@ -0,0 +1,44 @@ +Index: git/hw/kdrive/linux/keyboard.c +=================================================================== +--- git.orig/hw/kdrive/linux/keyboard.c 2007-11-14 21:30:45.000000000 +0000 ++++ git/hw/kdrive/linux/keyboard.c 2007-11-15 12:00:11.000000000 +0000 +@@ -42,6 +42,8 @@ + #include <sys/ioctl.h> + + extern int LinuxConsoleFd; ++static unsigned char mediumraw_data, mediumraw_up; ++static enum { DEFAULT, EXTBYTE1, EXTBYTE2 } mediumraw_state = DEFAULT; + + static const KeySym linux_to_x[256] = { + NoSymbol, NoSymbol, NoSymbol, NoSymbol, +@@ -701,7 +703,29 @@ + else + #endif + scancode = b[0] & 0x7f; +- KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80); ++ /* This is extended medium raw mode interpreter ++ see linux/drivers/keyboard.c (kbd->kbdmode == VC_MEDIUMRAW) */ ++ switch (mediumraw_state) ++ { ++ case DEFAULT: ++ if (scancode == 0) ++ { ++ mediumraw_state = EXTBYTE1; ++ mediumraw_up = b[0] & 0x80; ++ } ++ else ++ KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80); ++ break; ++ case EXTBYTE1: ++ mediumraw_data = scancode; ++ mediumraw_state = EXTBYTE2; ++ break; ++ case EXTBYTE2: ++ /* Note: Only codes < 256 will pass correctly through KdEnqueueKeyboardEvent() */ ++ KdEnqueueKeyboardEvent (closure, (int)mediumraw_data << 7 | scancode, mediumraw_up); ++ mediumraw_state = DEFAULT; ++ break; ++ } + b++; + } + } diff --git a/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb b/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb index 71d0eccba8..755a51ca63 100644 --- a/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb +++ b/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb @@ -3,7 +3,7 @@ require xserver-kdrive-common.inc DEPENDS += "libxkbfile libxcalibrate" PE = "1" -PR = "r23" +PR = "r24" SRC_URI = "${XORG_MIRROR}/individual/xserver/xorg-server-${PV}.tar.bz2 \ ${KDRIVE_COMMON_PATCHES} \ @@ -20,6 +20,7 @@ SRC_URI = "${XORG_MIRROR}/individual/xserver/xorg-server-${PV}.tar.bz2 \ file://w100-autofoo.patch;patch=1 \ file://w100-fix-offscreen-bmp.patch;patch=1 \ file://kdrive-1.3-18bpp.patch;patch=1 \ + file://linux-keyboard-mediumraw.patch;patch=1 \ file://gumstix-kmode.patch;patch=1 \ file://smedia-glamo.patch;patch=1 \ file://build-glamo.patch;patch=1 \ diff --git a/packages/xorg-xserver/xserver-kdrive_1.4.bb b/packages/xorg-xserver/xserver-kdrive_1.4.bb index f2d9810ec4..f4d5be38e1 100644 --- a/packages/xorg-xserver/xserver-kdrive_1.4.bb +++ b/packages/xorg-xserver/xserver-kdrive_1.4.bb @@ -3,7 +3,7 @@ require xserver-kdrive-common.inc DEPENDS += "hal libxkbfile libxcalibrate pixman" PE = "1" -PR = "r1" +PR = "r2" SRC_URI = "${XORG_MIRROR}/individual/xserver/xorg-server-${PV}.tar.bz2 \ ${KDRIVE_COMMON_PATCHES} \ @@ -16,6 +16,7 @@ SRC_URI = "${XORG_MIRROR}/individual/xserver/xorg-server-${PV}.tar.bz2 \ file://w100-autofoo.patch;patch=1 \ file://w100-fix-offscreen-bmp.patch;patch=1 \ file://w100-new-input-world-order.patch;patch=1 \ + file://linux-keyboard-mediumraw.patch;patch=1 \ file://xcalibrate-new-input-world-order.patch;patch=1 \ file://tslib-default-device.patch;patch=1 \ file://fbdev-evdev.patch;patch=1 \ |