From f21d42887804fd14d9534ae388e6967041f9aacf Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Wed, 11 Nov 2009 14:48:26 -0300 Subject: [PATCH 061/118] xserver-kdrive-xomap-1.3.99.0: adding recipe Signed-off-by: Ricardo Salveti de Araujo Signed-off-by: Francisco Alecrim Signed-off-by: Willer Moreira --- .../xserver-kdrive-xomap/add_input.patch | 23 + .../add_linuxmouse_support.patch | 12 + .../fix-configure-autoconf-2.62.patch | 15 + .../fix_renderedge_compilation.patch | 11 + .../xserver-kdrive-xomap/fix_shutdown.patch | 14 + .../kdrive-evdev-from-4.0.90.patch | 1059 ++++++++++++++++++++ .../kdrive-omap-use-evdev.patch | 117 +++ .../xserver-kdrive-xomap/optional-xkb.patch | 91 ++- .../xorg-xserver/xserver-kdrive-xomap_1.3.99.0.bb | 68 ++ 9 files changed, 1395 insertions(+), 15 deletions(-) create mode 100644 recipes/xorg-xserver/xserver-kdrive-xomap/add_input.patch create mode 100644 recipes/xorg-xserver/xserver-kdrive-xomap/add_linuxmouse_support.patch create mode 100644 recipes/xorg-xserver/xserver-kdrive-xomap/fix-configure-autoconf-2.62.patch create mode 100644 recipes/xorg-xserver/xserver-kdrive-xomap/fix_renderedge_compilation.patch create mode 100644 recipes/xorg-xserver/xserver-kdrive-xomap/fix_shutdown.patch create mode 100644 recipes/xorg-xserver/xserver-kdrive-xomap/kdrive-evdev-from-4.0.90.patch create mode 100644 recipes/xorg-xserver/xserver-kdrive-xomap/kdrive-omap-use-evdev.patch create mode 100644 recipes/xorg-xserver/xserver-kdrive-xomap_1.3.99.0.bb diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/add_input.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/add_input.patch new file mode 100644 index 0000000..4f521a7 --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/add_input.patch @@ -0,0 +1,23 @@ +Index: xorg-server-1.3.99.0~git20070321/hw/kdrive/omap/omapinit.c +=================================================================== +--- xorg-server-1.3.99.0~git20070321.orig/hw/kdrive/omap/omapinit.c 2008-06-05 16:39:41.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321/hw/kdrive/omap/omapinit.c 2008-06-05 16:41:17.000000000 -0300 +@@ -52,11 +52,18 @@ + void + InitInput (int argc, char **argv) + { ++ KdKeyboardInfo *ki; ++ + ENTER(); + + KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); + KdAddPointerDriver(&TsDriver); + ++ KdAddKeyboardDriver (&LinuxKeyboardDriver); ++ KdAddPointerDriver (&LinuxMouseDriver); ++ ++ ki = KdParseKeyboard ("keyboard"); ++ + KdInitInput(); + + LEAVE(); diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/add_linuxmouse_support.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/add_linuxmouse_support.patch new file mode 100644 index 0000000..486df84 --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/add_linuxmouse_support.patch @@ -0,0 +1,12 @@ +Index: xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/omap/omapinit.c +=================================================================== +--- xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/omap/omapinit.c 2008-02-11 05:25:23.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/omap/omapinit.c 2008-04-09 18:08:19.000000000 -0300 +@@ -55,6 +55,7 @@ + ENTER(); + + KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); ++ KdAddPointerDriver(&LinuxMouseDriver); + KdAddPointerDriver(&TsDriver); + + KdInitInput(); diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/fix-configure-autoconf-2.62.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/fix-configure-autoconf-2.62.patch new file mode 100644 index 0000000..04150a6 --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/fix-configure-autoconf-2.62.patch @@ -0,0 +1,15 @@ +diff --git a/configure.ac b/configure.ac +index 1e7222e..0c8ae71 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1727,7 +1727,9 @@ AC_SUBST([BUILD_DATE]) + 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 diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/fix_renderedge_compilation.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/fix_renderedge_compilation.patch new file mode 100644 index 0000000..d342dcc --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/fix_renderedge_compilation.patch @@ -0,0 +1,11 @@ +diff -uNr xorg-server-1.1.99.3.orig/render/renderedge.c xorg-server-1.1.99.3/render/renderedge.c +--- xorg-server-1.1.99.3.orig/render/renderedge.c 2007-01-10 08:21:02.000000000 -0300 ++++ xorg-server-1.1.99.3/render/renderedge.c 2007-09-24 19:06:01.000000000 -0300 +@@ -26,6 +26,7 @@ + #include + #endif + ++#include + #include "renderedge.h" + + /* diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/fix_shutdown.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/fix_shutdown.patch new file mode 100644 index 0000000..5940dad --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/fix_shutdown.patch @@ -0,0 +1,14 @@ +Index: xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/omap/omap.h +=================================================================== +--- xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/omap/omap.h 2008-03-31 16:25:29.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/omap/omap.h 2008-03-31 16:25:38.000000000 -0300 +@@ -124,8 +124,8 @@ + }; + + struct _omapCardInfo { +- OmapPlaneInfo *planes; + FbdevPriv fbdev; ++ OmapPlaneInfo *planes; + }; + + struct _omapScreenInfo { diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/kdrive-evdev-from-4.0.90.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/kdrive-evdev-from-4.0.90.patch new file mode 100644 index 0000000..a302cc5 --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/kdrive-evdev-from-4.0.90.patch @@ -0,0 +1,1059 @@ +diff -Naur xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/linux/evdev.c xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/linux/evdev.c +--- xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/linux/evdev.c 2008-02-11 05:25:23.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/linux/evdev.c 2008-10-19 22:01:05.000000000 -0300 +@@ -1,305 +1,40 @@ + /* +- * Copyright © 2007 Nokia Corporation ++ * Copyright © 2004 Keith Packard + * +- * Permission to use, copy, modify, distribute and sell this software and its ++ * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting +- * documentation, and that the names of the authors and/or copyright holders +- * not be used in advertising or publicity pertaining to distribution of the +- * software without specific, written prior permission. The authors and +- * copyright holders make no representations about the suitability of this +- * software for any purpose. It is provided "as is" without any express +- * or implied warranty. ++ * documentation, and that the name of Keith Packard not be used in ++ * advertising or publicity pertaining to distribution of the software without ++ * specific, written prior permission. Keith Packard makes no ++ * representations about the suitability of this software for any purpose. It ++ * is provided "as is" without express or implied warranty. + * +- * THE AUTHORS AND COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO +- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +- * FITNESS, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +- * +- * Author: Daniel Stone ++ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ++ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR ++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, ++ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER ++ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ++ * PERFORMANCE OF THIS SOFTWARE. + */ + + #ifdef HAVE_CONFIG_H + #include + #endif +- ++#define NEED_EVENTS + #include + #include +- +-#define NEED_EVENTS + #include + #include + #include +-#include +- + #include "inputstr.h" + #include "scrnintstr.h" + #include "kdrive.h" + +-static KeySym evdev_kbd_map[] = { +- /* 0x00 */ NoSymbol, NoSymbol, +- /* 0x01 */ XK_Escape, NoSymbol, +- /* 0x02 */ XK_1, XK_exclam, +- /* 0x03 */ XK_2, XK_at, +- /* 0x04 */ XK_3, XK_numbersign, +- /* 0x05 */ XK_4, XK_dollar, +- /* 0x06 */ XK_5, XK_percent, +- /* 0x07 */ XK_6, XK_asciicircum, +- /* 0x08 */ XK_7, XK_ampersand, +- /* 0x09 */ XK_8, XK_asterisk, +- /* 0x0a */ XK_9, XK_parenleft, +- /* 0x0b */ XK_0, XK_parenright, +- /* 0x0c */ XK_minus, XK_underscore, +- /* 0x0d */ XK_equal, XK_plus, +- /* 0x0e */ XK_BackSpace, NoSymbol, +- /* 0x0f */ XK_Tab, XK_ISO_Left_Tab, +- /* 0x10 */ XK_Q, NoSymbol, +- /* 0x11 */ XK_W, NoSymbol, +- /* 0x12 */ XK_E, NoSymbol, +- /* 0x13 */ XK_R, NoSymbol, +- /* 0x14 */ XK_T, NoSymbol, +- /* 0x15 */ XK_Y, NoSymbol, +- /* 0x16 */ XK_U, NoSymbol, +- /* 0x17 */ XK_I, NoSymbol, +- /* 0x18 */ XK_O, NoSymbol, +- /* 0x19 */ XK_P, NoSymbol, +- /* 0x1a */ XK_bracketleft, XK_braceleft, +- /* 0x1b */ XK_bracketright,XK_braceright, +- /* 0x1c */ XK_Return, NoSymbol, +- /* 0x1d */ XK_Control_L, NoSymbol, +- /* 0x1e */ XK_A, NoSymbol, +- /* 0x1f */ XK_S, NoSymbol, +- /* 0x20 */ XK_D, NoSymbol, +- /* 0x21 */ XK_F, NoSymbol, +- /* 0x22 */ XK_G, NoSymbol, +- /* 0x23 */ XK_H, NoSymbol, +- /* 0x24 */ XK_J, NoSymbol, +- /* 0x25 */ XK_K, NoSymbol, +- /* 0x26 */ XK_L, NoSymbol, +- /* 0x27 */ XK_semicolon, XK_colon, +- /* 0x28 */ XK_quoteright, XK_quotedbl, +- /* 0x29 */ XK_quoteleft, XK_asciitilde, +- /* 0x2a */ XK_Shift_L, NoSymbol, +- /* 0x2b */ XK_backslash, XK_bar, +- /* 0x2c */ XK_Z, NoSymbol, +- /* 0x2d */ XK_X, NoSymbol, +- /* 0x2e */ XK_C, NoSymbol, +- /* 0x2f */ XK_V, NoSymbol, +- /* 0x30 */ XK_B, NoSymbol, +- /* 0x31 */ XK_N, NoSymbol, +- /* 0x32 */ XK_M, NoSymbol, +- /* 0x33 */ XK_comma, XK_less, +- /* 0x34 */ XK_period, XK_greater, +- /* 0x35 */ XK_slash, XK_question, +- /* 0x36 */ XK_Shift_R, NoSymbol, +- /* 0x37 */ XK_KP_Multiply, NoSymbol, +- /* 0x38 */ XK_Alt_L, XK_Meta_L, +- /* 0x39 */ XK_space, NoSymbol, +- /* 0x3a */ XK_Caps_Lock, NoSymbol, +- /* 0x3b */ XK_F1, NoSymbol, +- /* 0x3c */ XK_F2, NoSymbol, +- /* 0x3d */ XK_F3, NoSymbol, +- /* 0x3e */ XK_F4, NoSymbol, +- /* 0x3f */ XK_F5, NoSymbol, +- /* 0x40 */ XK_F6, NoSymbol, +- /* 0x41 */ XK_F7, NoSymbol, +- /* 0x42 */ XK_F8, NoSymbol, +- /* 0x43 */ XK_F9, NoSymbol, +- /* 0x44 */ XK_F10, NoSymbol, +- /* 0x45 */ XK_Num_Lock, NoSymbol, +- /* 0x46 */ XK_Scroll_Lock, NoSymbol, +- /* These KP keys should have the KP_7 keysyms in the numlock +- * modifer... ? */ +- /* 0x47 */ XK_KP_Home, XK_KP_7, +- /* 0x48 */ XK_KP_Up, XK_KP_8, +- /* 0x49 */ XK_KP_Prior, XK_KP_9, +- /* 0x4a */ XK_KP_Subtract, NoSymbol, +- /* 0x4b */ XK_KP_Left, XK_KP_4, +- /* 0x4c */ XK_KP_Begin, XK_KP_5, +- /* 0x4d */ XK_KP_Right, XK_KP_6, +- /* 0x4e */ XK_KP_Add, NoSymbol, +- /* 0x4f */ XK_KP_End, XK_KP_1, +- /* 0x50 */ XK_KP_Down, XK_KP_2, +- /* 0x51 */ XK_KP_Next, XK_KP_3, +- /* 0x52 */ XK_KP_Insert, XK_KP_0, +- /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, +- /* 0x54 */ NoSymbol, NoSymbol, +- /* 0x55 */ XK_F13, NoSymbol, +- /* 0x56 */ XK_less, XK_greater, +- /* 0x57 */ XK_F11, NoSymbol, +- /* 0x58 */ XK_F12, NoSymbol, +- /* 0x59 */ XK_F14, NoSymbol, +- /* 0x5a */ XK_F15, NoSymbol, +- /* 0x5b */ XK_F16, NoSymbol, +- /* 0x5c */ XK_F17, NoSymbol, +- /* 0x5d */ XK_F18, NoSymbol, +- /* 0x5e */ XK_F19, NoSymbol, +- /* 0x5f */ XK_F20, NoSymbol, +- /* 0x60 */ XK_KP_Enter, NoSymbol, +- /* 0x61 */ XK_Control_R, NoSymbol, +- /* 0x62 */ XK_KP_Divide, NoSymbol, +- /* 0x63 */ XK_Print, XK_Sys_Req, +- /* 0x64 */ XK_Alt_R, XK_Meta_R, +- /* 0x65 */ NoSymbol, NoSymbol, /* KEY_LINEFEED */ +- /* 0x66 */ XK_Home, NoSymbol, +- /* 0x67 */ XK_Up, NoSymbol, +- /* 0x68 */ XK_Prior, NoSymbol, +- /* 0x69 */ XK_Left, NoSymbol, +- /* 0x6a */ XK_Right, NoSymbol, +- /* 0x6b */ XK_End, NoSymbol, +- /* 0x6c */ XK_Down, NoSymbol, +- /* 0x6d */ XK_Next, NoSymbol, +- /* 0x6e */ XK_Insert, NoSymbol, +- /* 0x6f */ XK_Delete, NoSymbol, +- /* 0x6f */ NoSymbol, NoSymbol, /* KEY_MACRO */ +- /* 0x70 */ NoSymbol, NoSymbol, +- /* 0x71 */ NoSymbol, NoSymbol, +- /* 0x72 */ NoSymbol, NoSymbol, +- /* 0x73 */ NoSymbol, NoSymbol, +- /* 0x74 */ NoSymbol, NoSymbol, +- /* 0x75 */ XK_KP_Equal, NoSymbol, +- /* 0x76 */ NoSymbol, NoSymbol, +- /* 0x77 */ NoSymbol, NoSymbol, +- /* 0x78 */ XK_F21, NoSymbol, +- /* 0x79 */ XK_F22, NoSymbol, +- /* 0x7a */ XK_F23, NoSymbol, +- /* 0x7b */ XK_F24, NoSymbol, +- /* 0x7c */ XK_KP_Separator, NoSymbol, +- /* 0x7d */ XK_Meta_L, NoSymbol, +- /* 0x7e */ XK_Meta_R, NoSymbol, +- /* 0x7f */ XK_Multi_key, NoSymbol, +- /* 0x80 */ NoSymbol, NoSymbol, +- /* 0x81 */ NoSymbol, NoSymbol, +- /* 0x82 */ NoSymbol, NoSymbol, +- /* 0x83 */ NoSymbol, NoSymbol, +- /* 0x84 */ NoSymbol, NoSymbol, +- /* 0x85 */ NoSymbol, NoSymbol, +- /* 0x86 */ NoSymbol, NoSymbol, +- /* 0x87 */ NoSymbol, NoSymbol, +- /* 0x88 */ NoSymbol, NoSymbol, +- /* 0x89 */ NoSymbol, NoSymbol, +- /* 0x8a */ NoSymbol, NoSymbol, +- /* 0x8b */ NoSymbol, NoSymbol, +- /* 0x8c */ NoSymbol, NoSymbol, +- /* 0x8d */ NoSymbol, NoSymbol, +- /* 0x8e */ NoSymbol, NoSymbol, +- /* 0x8f */ NoSymbol, NoSymbol, +- /* 0x90 */ NoSymbol, NoSymbol, +- /* 0x91 */ NoSymbol, NoSymbol, +- /* 0x92 */ NoSymbol, NoSymbol, +- /* 0x93 */ NoSymbol, NoSymbol, +- /* 0x94 */ NoSymbol, NoSymbol, +- /* 0x95 */ NoSymbol, NoSymbol, +- /* 0x96 */ NoSymbol, NoSymbol, +- /* 0x97 */ NoSymbol, NoSymbol, +- /* 0x98 */ NoSymbol, NoSymbol, +- /* 0x99 */ NoSymbol, NoSymbol, +- /* 0x9a */ NoSymbol, NoSymbol, +- /* 0x9b */ NoSymbol, NoSymbol, +- /* 0x9c */ NoSymbol, NoSymbol, +- /* 0x9d */ NoSymbol, NoSymbol, +- /* 0x9e */ NoSymbol, NoSymbol, +- /* 0x9f */ NoSymbol, NoSymbol, +- /* 0xa0 */ NoSymbol, NoSymbol, +- /* 0xa1 */ NoSymbol, NoSymbol, +- /* 0xa2 */ NoSymbol, NoSymbol, +- /* 0xa3 */ NoSymbol, NoSymbol, +- /* 0xa4 */ NoSymbol, NoSymbol, +- /* 0xa5 */ NoSymbol, NoSymbol, +- /* 0xa6 */ NoSymbol, NoSymbol, +- /* 0xa7 */ NoSymbol, NoSymbol, +- /* 0xa8 */ NoSymbol, NoSymbol, +- /* 0xa9 */ NoSymbol, NoSymbol, +- /* 0xaa */ NoSymbol, NoSymbol, +- /* 0xab */ NoSymbol, NoSymbol, +- /* 0xac */ NoSymbol, NoSymbol, +- /* 0xad */ NoSymbol, NoSymbol, +- /* 0xae */ NoSymbol, NoSymbol, +- /* 0xaf */ NoSymbol, NoSymbol, +- /* 0xb0 */ NoSymbol, NoSymbol, +- /* 0xb1 */ NoSymbol, NoSymbol, +- /* 0xb2 */ NoSymbol, NoSymbol, +- /* 0xb3 */ NoSymbol, NoSymbol, +- /* 0xb4 */ NoSymbol, NoSymbol, +- /* 0xb5 */ NoSymbol, NoSymbol, +- /* 0xb6 */ NoSymbol, NoSymbol, +- /* 0xb7 */ NoSymbol, NoSymbol, +- /* 0xb8 */ NoSymbol, NoSymbol, +- /* 0xb9 */ NoSymbol, NoSymbol, +- /* 0xba */ NoSymbol, NoSymbol, +- /* 0xbb */ NoSymbol, NoSymbol, +- /* 0xbc */ NoSymbol, NoSymbol, +- /* 0xbd */ NoSymbol, NoSymbol, +- /* 0xbe */ NoSymbol, NoSymbol, +- /* 0xbf */ NoSymbol, NoSymbol, +- /* 0xc0 */ NoSymbol, NoSymbol, +- /* 0xc1 */ NoSymbol, NoSymbol, +- /* 0xc2 */ NoSymbol, NoSymbol, +- /* 0xc3 */ NoSymbol, NoSymbol, +- /* 0xc4 */ NoSymbol, NoSymbol, +- /* 0xc5 */ NoSymbol, NoSymbol, +- /* 0xc6 */ NoSymbol, NoSymbol, +- /* 0xc7 */ NoSymbol, NoSymbol, +- /* 0xc8 */ NoSymbol, NoSymbol, +- /* 0xc9 */ NoSymbol, NoSymbol, +- /* 0xca */ NoSymbol, NoSymbol, +- /* 0xcb */ NoSymbol, NoSymbol, +- /* 0xcc */ NoSymbol, NoSymbol, +- /* 0xcd */ NoSymbol, NoSymbol, +- /* 0xce */ NoSymbol, NoSymbol, +- /* 0xcf */ NoSymbol, NoSymbol, +- /* 0xd0 */ NoSymbol, NoSymbol, +- /* 0xd1 */ NoSymbol, NoSymbol, +- /* 0xd2 */ NoSymbol, NoSymbol, +- /* 0xd3 */ NoSymbol, NoSymbol, +- /* 0xd4 */ NoSymbol, NoSymbol, +- /* 0xd5 */ NoSymbol, NoSymbol, +- /* 0xd6 */ NoSymbol, NoSymbol, +- /* 0xd7 */ NoSymbol, NoSymbol, +- /* 0xd8 */ NoSymbol, NoSymbol, +- /* 0xd9 */ NoSymbol, NoSymbol, +- /* 0xda */ NoSymbol, NoSymbol, +- /* 0xdb */ NoSymbol, NoSymbol, +- /* 0xdc */ NoSymbol, NoSymbol, +- /* 0xdd */ NoSymbol, NoSymbol, +- /* 0xde */ NoSymbol, NoSymbol, +- /* 0xdf */ NoSymbol, NoSymbol, +- /* 0xe0 */ NoSymbol, NoSymbol, +- /* 0xe1 */ NoSymbol, NoSymbol, +- /* 0xe2 */ NoSymbol, NoSymbol, +- /* 0xe3 */ NoSymbol, NoSymbol, +- /* 0xe4 */ NoSymbol, NoSymbol, +- /* 0xe5 */ NoSymbol, NoSymbol, +- /* 0xe6 */ NoSymbol, NoSymbol, +- /* 0xe7 */ NoSymbol, NoSymbol, +- /* 0xe8 */ NoSymbol, NoSymbol, +- /* 0xe9 */ NoSymbol, NoSymbol, +- /* 0xea */ NoSymbol, NoSymbol, +- /* 0xeb */ NoSymbol, NoSymbol, +- /* 0xec */ NoSymbol, NoSymbol, +- /* 0xed */ NoSymbol, NoSymbol, +- /* 0xee */ NoSymbol, NoSymbol, +- /* 0xef */ NoSymbol, NoSymbol, +- /* 0xf0 */ NoSymbol, NoSymbol, +- /* 0xf1 */ NoSymbol, NoSymbol, +- /* 0xf2 */ NoSymbol, NoSymbol, +- /* 0xf3 */ NoSymbol, NoSymbol, +- /* 0xf4 */ NoSymbol, NoSymbol, +- /* 0xf5 */ NoSymbol, NoSymbol, +- /* 0xf6 */ NoSymbol, NoSymbol, +- /* 0xf7 */ NoSymbol, NoSymbol, +-}; +- +-enum evdev_type { +- Keyboard, +- Pointer, +-}; +- + #define NUM_EVENTS 128 ++#define ABS_UNSET -65535 + + #define BITS_PER_LONG (sizeof(long) * 8) + #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) +@@ -307,340 +42,498 @@ + #define OFF(x) ((x)%BITS_PER_LONG) + #define LONG(x) ((x)/BITS_PER_LONG) + #define BIT(x) (1 << OFF(x)) +-#define SETBIT(x,y) ((x)[LONG(y)] |= BIT(y)) +-#define CLRBIT(x,y) ((x)[LONG(y)] &= ~BIT(y)) +-#define ASSIGNBIT(x,y,z) ((x)[LONG(y)] = ((x)[LONG(y)] & ~BIT(y)) | (z << OFF(y))) +- +-struct evdev_device_info { +- int max_rel; +- int max_abs; +- +- unsigned long key_bits[NBITS(KEY_MAX)]; +- unsigned long rel_bits[NBITS(REL_MAX)]; +- unsigned long abs_bits[NBITS(EV_MAX)]; +- +- enum evdev_type type; +- void *device; +- char *path; +- int fd; +-}; + +-#if 0 ++typedef struct _kevdev { ++ /* current device state */ ++ int rel[REL_MAX + 1]; ++ int abs[ABS_MAX + 1]; ++ int prevabs[ABS_MAX + 1]; ++ long key[NBITS(KEY_MAX + 1)]; ++ ++ /* supported device info */ ++ long relbits[NBITS(REL_MAX + 1)]; ++ long absbits[NBITS(ABS_MAX + 1)]; ++ long keybits[NBITS(KEY_MAX + 1)]; ++ struct input_absinfo absinfo[ABS_MAX + 1]; ++ int max_rel; ++ int max_abs; ++ ++ int fd; ++} Kevdev; ++ ++static void ++EvdevPtrBtn (KdPointerInfo *pi, struct input_event *ev) ++{ ++ int flags = KD_MOUSE_DELTA | pi->buttonState; ++ ++ if (ev->code >= BTN_MOUSE && ev->code < BTN_JOYSTICK) { ++ switch (ev->code) { ++ case BTN_LEFT: ++ if (ev->value == 1) ++ flags |= KD_BUTTON_1; ++ else ++ flags &= ~KD_BUTTON_1; ++ break; ++ case BTN_MIDDLE: ++ if (ev->value == 1) ++ flags |= KD_BUTTON_2; ++ else ++ flags &= ~KD_BUTTON_2; ++ break; ++ case BTN_RIGHT: ++ if (ev->value == 1) ++ flags |= KD_BUTTON_3; ++ else ++ flags &= ~KD_BUTTON_3; ++ break; ++ default: ++ /* Unknow button */ ++ break; ++ } ++ ++ KdEnqueuePointerEvent (pi, flags, 0, 0, 0); ++ } ++} + static void +-evdev_pointer_check_motion(KdPointerInfo *pi) ++EvdevPtrMotion (KdPointerInfo *pi, struct input_event *ev) + { +- Kevdev *ke = pi->driverPrivate; ++ Kevdev *ke = pi->driverPrivate; + int i; ++ int flags = KD_MOUSE_DELTA | pi->buttonState; + +- for (i = 0; i <= ke->max_rel; i++) { +- if (ke->rel[i]) { ++ for (i = 0; i <= ke->max_rel; i++) ++ if (ke->rel[i]) ++ { + int a; +- ErrorF("rel"); +- for (a = 0; a <= ke->max_rel; a++) { +- if (ISBITSET(ke->relbits, a)) +- ErrorF(" %d=%d", a, ke->rel[a]); +- ke->rel[a] = 0; ++ for (a = 0; a <= ke->max_rel; a++) ++ { ++ if (ISBITSET (ke->relbits, a)) ++ { ++ if (a == 0) ++ KdEnqueuePointerEvent(pi, flags, ke->rel[a], 0, 0); ++ else if (a == 1) ++ KdEnqueuePointerEvent(pi, flags, 0, ke->rel[a], 0); ++ } ++ ke->rel[a] = 0; + } +- ErrorF("\n"); + break; + } +- } +- +- for (i = 0; i < ke->max_abs; i++) { +- if (ke->abs[i] != ke->prevabs[i]) { ++ for (i = 0; i < ke->max_abs; i++) ++ if (ke->abs[i] != ke->prevabs[i]) ++ { + int a; +- ErrorF("abs"); +- for (a = 0; a <= ke->max_abs; a++) { +- if (ISBITSET(ke->absbits, a)) +- ErrorF(" %d=%d", a, ke->abs[a]); ++ ErrorF ("abs"); ++ for (a = 0; a <= ke->max_abs; a++) ++ { ++ if (ISBITSET (ke->absbits, a)) ++ ErrorF (" %d=%d", a, ke->abs[a]); + ke->prevabs[a] = ke->abs[a]; + } +- ErrorF("\n"); ++ ErrorF ("\n"); + break; + } ++ ++ if (ev->code == REL_WHEEL) { ++ for (i = 0; i < abs (ev->value); i++) ++ { ++ if (ev->value > 0) ++ flags |= KD_BUTTON_4; ++ else ++ flags |= KD_BUTTON_5; ++ ++ KdEnqueuePointerEvent (pi, flags, 0, 0, 0); ++ ++ if (ev->value > 0) ++ flags &= ~KD_BUTTON_4; ++ else ++ flags &= ~KD_BUTTON_5; ++ ++ KdEnqueuePointerEvent (pi, flags, 0, 0, 0); ++ } + } ++ + } +-#endif + +-static int +-evdev_device_read(int evdevPort, void *closure) ++static void ++EvdevPtrRead (int evdevPort, void *closure) + { +- struct evdev_device_info *info = closure; +- struct input_event events[NUM_EVENTS]; +- int i, n; ++ KdPointerInfo *pi = closure; ++ Kevdev *ke = pi->driverPrivate; ++ int i; ++ struct input_event events[NUM_EVENTS]; ++ int n; + +- n = read(evdevPort, &events, NUM_EVENTS * sizeof(struct input_event)); ++ n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event)); + if (n <= 0) { +- if (n == 0 || errno == -EAGAIN || errno == -EINTR) +- return 0; +- else +- return errno; ++ if (errno == ENODEV) ++ DeleteInputDeviceRequest(pi->common.dixdev); ++ return; + } +- n /= sizeof(struct input_event); +- +- for (i = 0; i < n; i++) { + ++ n /= sizeof (struct input_event); ++ for (i = 0; i < n; i++) ++ { + switch (events[i].type) { + case EV_SYN: + break; + case EV_KEY: +- if (info->type == Keyboard) +- KdEnqueueKeyboardEvent(info->device, events[i].code, +- !events[i].value); ++ EvdevPtrBtn (pi, &events[i]); + break; +-#if 0 + case EV_REL: + ke->rel[events[i].code] += events[i].value; ++ EvdevPtrMotion (pi, &events[i]); + break; + case EV_ABS: + ke->abs[events[i].code] = events[i].value; ++ EvdevPtrMotion (pi, &events[i]); + break; +-#endif + } + } +- +- return 0; + } + +-static char * +-get_name_for_type(struct evdev_device_info *info) +-{ +- switch (info->type) { +- case Keyboard: +- return "keyboard"; +- case Pointer: +- return "pointer"; +- } +-} ++char *kdefaultEvdev[] = { ++ "/dev/input/event0", ++ "/dev/input/event1", ++ "/dev/input/event2", ++ "/dev/input/event3", ++}; ++ ++#define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0])) + + static Status +-evdev_device_init(struct evdev_device_info *info) ++EvdevPtrInit (KdPointerInfo *pi) + { +- int fd; +- char devname[256]; ++ int i; ++ int fd; + +- fd = open(info->path, O_RDWR); +- if (fd < 0) { +- ErrorF("[evdev] failed to open device %s\n", info->path); +- return BadMatch; ++ if (!pi->common.path) { ++ for (i = 0; i < NUM_DEFAULT_EVDEV; i++) { ++ fd = open (kdefaultEvdev[i], 2); ++ if (fd >= 0) { ++ pi->common.path = KdSaveString (kdefaultEvdev[i]); ++ break; ++ } ++ } ++ } ++ else { ++ fd = open (pi->common.path, O_RDWR); ++ if (fd < 0) { ++ ErrorF("Failed to open evdev device %s\n", pi->common.path); ++ return BadMatch; ++ } + } +- +-#if 0 +- if (ioctl(fd, EVIOCGNAME(sizeof(devname)), devname) < 0) +- info->name = xstrdup(devname); +- else +- info->name = xstrdup("Generic %s", get_name_for_type(info)); +-#endif + + close(fd); + ++ pi->common.name = KdSaveString("Evdev mouse"); ++ + return Success; + } + + static Status +-evdev_device_enable(struct evdev_device_info *info) +-{ ++EvdevPtrEnable (KdPointerInfo *pi) ++{ + int fd; +- unsigned long ev_bits[NBITS(EV_MAX)]; + +- fd = open(info->path, O_RDWR); +- if (fd < 0) { +- ErrorF("[evdev] couldn't open %s\n", info->path); ++ if (!pi || !pi->common.path) ++ return BadImplementation; ++ ++ fd = open(pi->common.path, 2); ++ if (fd < 0) + return BadMatch; +- } + +- if (ioctl(fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits) < 0) { +- ErrorF("[evdev] couldn't get device capabilities\n"); +- goto unwind; ++ unsigned long ev[NBITS(EV_MAX)]; ++ Kevdev *ke; ++ ++ if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0) ++ { ++ perror ("EVIOCGBIT 0"); ++ close (fd); ++ return BadMatch; + } +- +- switch (info->type) { +- case Keyboard: +- if (ISBITSET(ev_bits, EV_KEY)) { +- if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(info->key_bits)), +- info->key_bits) < 0) { +- ErrorF("[evdev] keyboard, isn't\n"); +- goto unwind; +- } ++ ke = xalloc (sizeof (Kevdev)); ++ if (!ke) ++ { ++ close (fd); ++ return BadAlloc; ++ } ++ memset (ke, '\0', sizeof (Kevdev)); ++ if (ISBITSET (ev, EV_KEY)) ++ { ++ if (ioctl (fd, EVIOCGBIT (EV_KEY, sizeof (ke->keybits)), ++ ke->keybits) < 0) ++ { ++ perror ("EVIOCGBIT EV_KEY"); ++ xfree (ke); ++ close (fd); ++ return BadMatch; + } +- +- break; +- +- case Pointer: +- if (ISBITSET(ev_bits, EV_REL)) { +- if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(info->rel_bits)), +- info->rel_bits) >= 0) { +- for (info->max_rel = REL_MAX; info->max_rel >= 0; info->max_rel--) +- if (ISBITSET(info->rel_bits, info->max_rel)) +- break; +- } ++ } ++ if (ISBITSET (ev, EV_REL)) ++ { ++ if (ioctl (fd, EVIOCGBIT (EV_REL, sizeof (ke->relbits)), ++ ke->relbits) < 0) ++ { ++ perror ("EVIOCGBIT EV_REL"); ++ xfree (ke); ++ close (fd); ++ return BadMatch; + } +- +-#if 0 /* Absolute support. */ +- if (ISBITSET(ev, EV_ABS)) { +- if (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(ke->absbits)), +- ke->absbits) >= 0) { +- for (ke->max_abs = ABS_MAX; ke->max_abs >= 0; ke->max_abs--) +- if (ISBITSET(ke->absbits, ke->max_abs)) ++ for (ke->max_rel = REL_MAX; ke->max_rel >= 0; ke->max_rel--) ++ if (ISBITSET(ke->relbits, ke->max_rel)) ++ break; ++ } ++ if (ISBITSET (ev, EV_ABS)) ++ { ++ int i; ++ ++ if (ioctl (fd, EVIOCGBIT (EV_ABS, sizeof (ke->absbits)), ++ ke->absbits) < 0) ++ { ++ perror ("EVIOCGBIT EV_ABS"); ++ xfree (ke); ++ close (fd); ++ return BadMatch; ++ } ++ for (ke->max_abs = ABS_MAX; ke->max_abs >= 0; ke->max_abs--) ++ if (ISBITSET(ke->absbits, ke->max_abs)) ++ break; ++ for (i = 0; i <= ke->max_abs; i++) ++ { ++ if (ISBITSET (ke->absbits, i)) ++ if (ioctl (fd, EVIOCGABS(i), &ke->absinfo[i]) < 0) ++ { ++ perror ("EVIOCGABS"); + break; +- +- for (i = 0; i <= ke->max_abs; i++) { +- if (ISBITSET(ke->absbits, i)) { +- if (ioctl(fd, EVIOCGABS(i), &ke->absinfo[i]) < 0) { +- perror("EVIOCGABS"); +- break; +- } + } +- +- ke->prevabs[i] = ABS_UNSET; +- } +- +- if (i <= ke->max_abs) { +- xfree(ke); +- close(fd); +- return BadValue; +- } ++ ke->prevabs[i] = ABS_UNSET; ++ } ++ if (i <= ke->max_abs) ++ { ++ xfree (ke); ++ close (fd); ++ return BadValue; + } +-#endif +- +- break; + } +-/* +- if (ioctl(fd, EVIOCGRAB, 2) < 0) { +- ErrorF("[evdev] couldn't grab device\n"); +- goto unwind; ++ if (!KdRegisterFd (fd, EvdevPtrRead, pi)) { ++ xfree (ke); ++ close (fd); ++ return BadAlloc; + } +-*/ +- if (!KdRegisterFd(fd, evdev_device_read, info)) +- goto unwind; +- +- info->fd = fd; ++ pi->driverPrivate = ke; ++ ke->fd = fd; + + return Success; +- +-unwind: +- close(fd); +- return BadMatch; + } + + static void +-evdev_device_disable(struct evdev_device_info *info) ++EvdevPtrDisable (KdPointerInfo *pi) + { +- ioctl(info->fd, EVIOCGRAB, 0); +- KdUnregisterFd(info, info->fd, TRUE); ++ Kevdev *ke; ++ ++ ke = pi->driverPrivate; ++ ++ if (!pi || !pi->driverPrivate) ++ return; ++ ++ KdUnregisterFd (pi, ke->fd, TRUE); ++ xfree (ke); ++ pi->driverPrivate = 0; + } + + static void +-evdev_device_fini(struct evdev_device_info *info) ++EvdevPtrFini (KdPointerInfo *pi) + { + } + +-static Status +-evdev_pointer_init(KdPointerInfo *pi) ++ ++/* ++ * Evdev keyboard functions ++ */ ++ ++static void ++readMapping (KdKeyboardInfo *ki) + { +- struct evdev_device_info *info; ++ int minScanCode, maxScanCode; + +- info = xcalloc(sizeof(*info), 1); +- if (!info) +- return BadAlloc; +- info->type = Pointer; +- info->path = pi->common.path; +- info->device = pi; +- pi->driverPrivate = info; ++ if (!ki) ++ return; + +- return evdev_device_init(info); +-} ++ minScanCode = 0; ++ maxScanCode = 193; + +-static Status +-evdev_pointer_enable(KdPointerInfo *pi) +-{ +- struct evdev_device_info *info = pi->driverPrivate; ++ ki->keySyms.mapWidth = 2; + +- return evdev_device_enable(info); ++ ki->minScanCode = minScanCode; ++ ki->maxScanCode = maxScanCode; + } + + static void +-evdev_pointer_disable(KdPointerInfo *pi) ++EvdevKbdRead (int evdevPort, void *closure) + { +- struct evdev_device_info *info = pi->driverPrivate; ++ KdKeyboardInfo *ki = closure; ++ struct input_event events[NUM_EVENTS]; ++ int i, n; + +- evdev_device_disable(info); ++ n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event)); ++ if (n <= 0) { ++ if (errno == ENODEV) ++ DeleteInputDeviceRequest(ki->common.dixdev); ++ return; ++ } ++ ++ n /= sizeof (struct input_event); ++ for (i = 0; i < n; i++) ++ { ++ if (events[i].type == EV_KEY) ++ KdEnqueueKeyboardEvent (ki, events[i].code, !events[i].value); ++/* FIXME: must implement other types of events ++ else ++ ErrorF("Event type (%d) not delivered\n", events[i].type); ++*/ ++ } + } + +-static void +-evdev_pointer_fini(KdPointerInfo *pi) ++static Status ++EvdevKbdInit (KdKeyboardInfo *ki) + { +- struct evdev_device_info *info = pi->driverPrivate; ++ int fd; ++ ++ /* enforce /dev/input/event1 */ ++ ki->common.path = KdSaveString(kdefaultEvdev[1]); ++ ++ if (!ki->common.path) { ++ ErrorF("Couldn't find evdev device path\n"); ++ return BadValue; ++ } ++ else { ++ fd = open (ki->common.path, O_RDWR); ++ if (fd < 0) { ++ ErrorF("Failed to open evdev device %s\n", ki->common.path); ++ return BadMatch; ++ } ++ } + +- evdev_device_fini(info); +- xfree(info); +- pi->driverPrivate = NULL; ++ close (fd); ++ ++ ki->common.name = KdSaveString("Evdev keyboard"); ++ ++ readMapping(ki); ++ ++ return Success; + } + + static Status +-evdev_keyboard_init(KdKeyboardInfo *ki) ++EvdevKbdEnable (KdKeyboardInfo *ki) + { +- struct evdev_device_info *info; ++ unsigned long ev[NBITS(EV_MAX)]; ++ Kevdev *ke; ++ int fd; + +- info = xcalloc(sizeof(*info), 1); +- if (!info) ++ if (!ki || !ki->common.path) ++ return BadImplementation; ++ ++ fd = open(ki->common.path, O_RDWR); ++ if (fd < 0) ++ return BadMatch; ++ ++ if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0) { ++ perror ("EVIOCGBIT 0"); ++ close (fd); ++ return BadMatch; ++ } ++ ++ ke = xalloc (sizeof (Kevdev)); ++ if (!ke) { ++ close (fd); + return BadAlloc; +- info->type = Keyboard; +- info->path = ki->common.path; +- info->device = ki; +- ki->driverPrivate = info; +- +- ki->minScanCode = 0; +- ki->maxScanCode = 255; +- ki->keySyms.minKeyCode = 8; +- ki->keySyms.maxKeyCode = 255; +- ki->keySyms.mapWidth = 2; +- memcpy(ki->keySyms.map, evdev_kbd_map, sizeof(evdev_kbd_map)); ++ } ++ memset (ke, '\0', sizeof (Kevdev)); + +- return evdev_device_init(info); ++ if (!KdRegisterFd (fd, EvdevKbdRead, ki)) { ++ xfree (ke); ++ close (fd); ++ return BadAlloc; ++ } ++ ki->driverPrivate = ke; ++ ke->fd = fd; ++ ++ return Success; + } + +-static Status +-evdev_keyboard_enable(KdKeyboardInfo *ki) ++static void ++EvdevKbdLeds (KdKeyboardInfo *ki, int leds) + { +- struct evdev_device_info *info = ki->driverPrivate; ++/* struct input_event event; ++ Kevdev *ke; ++ ++ ki->driverPrivate = ke; + +- return evdev_device_enable(info); ++ memset(&event, 0, sizeof(event)); ++ ++ event.type = EV_LED; ++ event.code = LED_CAPSL; ++ event.value = leds & (1 << 0) ? 1 : 0; ++ write(ke->fd, (char *) &event, sizeof(event)); ++ ++ event.type = EV_LED; ++ event.code = LED_NUML; ++ event.value = leds & (1 << 1) ? 1 : 0; ++ write(ke->fd, (char *) &event, sizeof(event)); ++ ++ event.type = EV_LED; ++ event.code = LED_SCROLLL; ++ event.value = leds & (1 << 2) ? 1 : 0; ++ write(ke->fd, (char *) &event, sizeof(event)); ++ ++ event.type = EV_LED; ++ event.code = LED_COMPOSE; ++ event.value = leds & (1 << 3) ? 1 : 0; ++ write(ke->fd, (char *) &event, sizeof(event)); ++*/ + } + + static void +-evdev_keyboard_disable(KdKeyboardInfo *ki) ++EvdevKbdBell (KdKeyboardInfo *ki, int volume, int frequency, int duration) + { +- struct evdev_device_info *info = ki->driverPrivate; +- +- evdev_device_disable(info); + } + + static void +-evdev_keyboard_fini(KdKeyboardInfo *ki) ++EvdevKbdDisable (KdKeyboardInfo *ki) + { +- struct evdev_device_info *info = ki->driverPrivate; ++ Kevdev *ke; ++ ++ ke = ki->driverPrivate; ++ ++ if (!ki || !ki->driverPrivate) ++ return; ++ ++ KdUnregisterFd (ki, ke->fd, TRUE); ++ xfree (ke); ++ ki->driverPrivate = 0; ++} + +- evdev_device_fini(info); +- xfree(info); +- ki->driverPrivate = NULL; ++static void ++EvdevKbdFini (KdKeyboardInfo *ki) ++{ + } + + KdPointerDriver LinuxEvdevMouseDriver = { +- .name = "evdev", +- .Init = evdev_pointer_init, +- .Enable = evdev_pointer_enable, +- .Disable = evdev_pointer_disable, +- .Fini = evdev_pointer_fini, ++ "evdev", ++ EvdevPtrInit, ++ EvdevPtrEnable, ++ EvdevPtrDisable, ++ EvdevPtrFini, ++ NULL, + }; + + KdKeyboardDriver LinuxEvdevKeyboardDriver = { +- .name = "evdev", +- .Init = evdev_keyboard_init, +- .Enable = evdev_keyboard_enable, +-#if 0 +- .Leds = evdev_keyboard_leds, +-#endif +- .Disable = evdev_keyboard_disable, +- .Fini = evdev_keyboard_fini, ++ "evdev", ++ EvdevKbdInit, ++ EvdevKbdEnable, ++ EvdevKbdLeds, ++ EvdevKbdBell, ++ EvdevKbdDisable, ++ EvdevKbdFini, ++ NULL, + }; +diff -Naur xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/src/kdrive.h xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/src/kdrive.h +--- xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/src/kdrive.h 2008-02-11 05:25:23.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/src/kdrive.h 2008-10-19 22:01:34.000000000 -0300 +@@ -886,7 +886,7 @@ + int duration); + + extern KdPointerDriver LinuxMouseDriver; +-extern KdPointerDriver LinuxEvdevPointerDriver; ++extern KdPointerDriver LinuxEvdevMouseDriver; + extern KdPointerDriver Ps2MouseDriver; + extern KdPointerDriver BusMouseDriver; + extern KdPointerDriver MsMouseDriver; diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/kdrive-omap-use-evdev.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/kdrive-omap-use-evdev.patch new file mode 100644 index 0000000..4163cfe --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/kdrive-omap-use-evdev.patch @@ -0,0 +1,117 @@ +Index: xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/fbdev/fbinit.c +=================================================================== +--- xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/fbdev/fbinit.c 2008-09-23 21:02:30.000000000 +0200 ++++ xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/fbdev/fbinit.c 2008-09-23 21:07:17.000000000 +0200 +@@ -28,6 +28,8 @@ + #endif + #include + ++extern int use_evdev; ++ + void + InitCard (char *name) + { +@@ -47,8 +49,17 @@ + { + KdKeyboardInfo *ki; + +- KdAddKeyboardDriver (&LinuxKeyboardDriver); +- KdAddPointerDriver (&LinuxMouseDriver); ++ if (use_evdev) ++ { ++ KdAddKeyboardDriver (&LinuxEvdevKeyboardDriver); ++ KdAddPointerDriver (&LinuxEvdevMouseDriver); ++ } ++ else ++ { ++ KdAddKeyboardDriver (&LinuxKeyboardDriver); ++ KdAddPointerDriver (&LinuxMouseDriver); ++ } ++ + #ifdef TSLIB + KdAddPointerDriver (&TsDriver); + #endif +Index: xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/src/kdrive.c +=================================================================== +--- xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/src/kdrive.c 2008-09-23 21:02:30.000000000 +0200 ++++ xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/src/kdrive.c 2008-09-23 22:52:30.000000000 +0200 +@@ -49,6 +49,8 @@ + + #include + ++int use_evdev = 0; ++ + typedef struct _kdDepths { + CARD8 depth; + CARD8 bpp; +@@ -609,6 +611,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"); +@@ -671,6 +674,11 @@ + kdEmulateMiddleButton = TRUE; + return 1; + } ++ if (!strcmp (argv[i], "-use-evdev")) ++ { ++ use_evdev = 1; ++ return 1; ++ } + if (!strcmp (argv[i], "-rawcoord")) + { + kdRawPointerCoordinates = 1; +Index: xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/omap/omapinit.c +=================================================================== +--- xorg-server-1.3.99.0~git20070321.patched.orig/hw/kdrive/omap/omapinit.c 2008-09-23 21:08:23.000000000 +0200 ++++ xorg-server-1.3.99.0~git20070321.patched/hw/kdrive/omap/omapinit.c 2008-09-24 01:36:34.000000000 +0200 +@@ -23,13 +23,15 @@ + * Author: Daniel Stone + */ + +-#ifdef HAVE_KDRIVE_CONFIG_H ++#ifdef HAVE_CONFIG_H + #include + #endif + + #include "omap.h" + #include "kdrive.h" + ++extern int use_evdev; ++ + void + InitCard (char *name) + { +@@ -54,12 +56,24 @@ + { + ENTER(); + +- KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver); +- KdAddPointerDriver(&LinuxMouseDriver); +- KdAddPointerDriver(&TsDriver); ++ if (use_evdev) ++ { ++ KdAddKeyboardDriver (&LinuxEvdevKeyboardDriver); ++ KdAddPointerDriver (&LinuxEvdevMouseDriver); ++ KdParseKeyboard("evdev"); ++ } ++ else ++ { ++ KdAddKeyboardDriver (&LinuxKeyboardDriver); ++ KdAddPointerDriver (&LinuxMouseDriver); ++ } ++ ++#ifdef TSLIB ++ KdAddPointerDriver (&TsDriver); ++#endif ++ ++ KdInitInput (); + +- KdInitInput(); +- + LEAVE(); + } + diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap/optional-xkb.patch b/recipes/xorg-xserver/xserver-kdrive-xomap/optional-xkb.patch index d9ef51c..21f90d4 100644 --- a/recipes/xorg-xserver/xserver-kdrive-xomap/optional-xkb.patch +++ b/recipes/xorg-xserver/xserver-kdrive-xomap/optional-xkb.patch @@ -1,7 +1,9 @@ ---- git/Makefile.am.orig 2006-06-09 16:01:51.000000000 +0200 -+++ git/Makefile.am 2006-06-09 16:02:59.000000000 +0200 -@@ -35,6 +35,10 @@ - XINPUT_DIR=Xi +Index: xorg-server-1.3.99.0~git20070321/Makefile.am +=================================================================== +--- xorg-server-1.3.99.0~git20070321.orig/Makefile.am 2008-06-05 12:10:24.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321/Makefile.am 2008-06-05 12:10:25.000000000 -0300 +@@ -26,6 +26,10 @@ + GLX_DIR=GL endif +if XKB @@ -11,26 +13,28 @@ if DBE DBE_DIR=dbe endif -@@ -51,7 +55,7 @@ +@@ -46,7 +50,7 @@ randr \ render \ - $(XINPUT_DIR) \ + Xi \ - xkb \ + $(XKB_DIR) \ $(DBE_DIR) \ $(MFB_DIR) \ $(AFB_DIR) \ ---- git/configure.ac.orig 2006-05-22 22:40:00.000000000 +0200 -+++ git/configure.ac 2006-06-10 15:10:14.000000000 +0200 -@@ -418,6 +418,7 @@ +Index: xorg-server-1.3.99.0~git20070321/configure.ac +=================================================================== +--- xorg-server-1.3.99.0~git20070321.orig/configure.ac 2008-06-05 12:10:24.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321/configure.ac 2008-06-05 12:16:45.000000000 -0300 +@@ -527,6 +527,7 @@ + AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes]) AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes]) - AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMS=$enableval], [DPMSExtension=yes]) - AC_ARG_ENABLE(xinput, AS_HELP_STRING([--disable-xinput], [Build XInput Extension (default: enabled)]), [XINPUT=$enableval], [XINPUT=yes]) + AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes]) +AC_ARG_ENABLE(xkb, AS_HELP_STRING([--disable-xkb], [Build XKB (default: enabled)]), [XKB=$enableval], [XKB=yes]) - - dnl DDXes. - AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) -@@ -739,12 +740,15 @@ + AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--disable-config-dbus], [Build D-BUS support (default: auto)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=auto]) + AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto]) + AC_ARG_ENABLE(xsp, AS_HELP_STRING([--disable-xsp], [Build XSP support (default: auto)]), [XSP=$enableval], [XSP=auto]) +@@ -901,12 +902,15 @@ AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) @@ -52,3 +56,60 @@ AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1, [Do not have `strcasecmp'.])) +@@ -1875,7 +1879,7 @@ + AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt")) + XEPHYR_LIBS="$XEPHYR_LIBS $XSERVER_LIBS" + if test "x$TSLIB" = xyes; then +- PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) ++ PKG_CHECK_MODULES([TSLIB], [tslib-1.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) + if test "x$HAVE_TSLIB" = xno; then + AC_CHECK_LIB([ts], [ts_open], HAVE_TSLIB="yes") + fi +@@ -1896,7 +1900,9 @@ + # dix os fb mi extension glx (NOTYET) damage shadow xpstubs + #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' ++ if test "x$XKB" = xyes; then ++ KDRIVE_XKB_DDX_LIB='$(top_builddir)/hw/kdrive/src/libkdrivexkb.a' ++ fi + 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' + case $host_os in +Index: xorg-server-1.3.99.0~git20070321/hw/kdrive/src/kinput.c +=================================================================== +--- xorg-server-1.3.99.0~git20070321.orig/hw/kdrive/src/kinput.c 2008-06-05 12:10:24.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321/hw/kdrive/src/kinput.c 2008-06-05 12:16:31.000000000 -0300 +@@ -809,7 +809,7 @@ + KdInitModMap(ki); + KdInitAutoRepeats(ki); + +-#ifndef XKB ++#ifdef XKB + if (!noXkbExtension) { + memset(&names, 0, sizeof(XkbComponentNamesRec)); + if (XkbInitialMap) +Index: xorg-server-1.3.99.0~git20070321/hw/kdrive/src/Makefile.am +=================================================================== +--- xorg-server-1.3.99.0~git20070321.orig/hw/kdrive/src/Makefile.am 2008-06-05 12:10:24.000000000 -0300 ++++ xorg-server-1.3.99.0~git20070321/hw/kdrive/src/Makefile.am 2008-06-05 12:10:25.000000000 -0300 +@@ -4,7 +4,11 @@ + + AM_CFLAGS = -DHAVE_DIX_CONFIG_H + ++if XKB + noinst_LIBRARIES = libkdrive.a libkdrivestubs.a libkdrivexkb.a ++else ++noinst_LIBRARIES = libkdrive.a libkdrivestubs.a ++endif + + if KDRIVE_HW + KDRIVE_HW_SOURCES = \ +@@ -39,4 +43,6 @@ + libkdrivestubs_a_SOURCES = \ + $(top_srcdir)/fb/fbcmap.c + ++if XKB + libkdrivexkb_a_SOURCES = kxkb.c ++endif +\ No newline at end of file diff --git a/recipes/xorg-xserver/xserver-kdrive-xomap_1.3.99.0.bb b/recipes/xorg-xserver/xserver-kdrive-xomap_1.3.99.0.bb new file mode 100644 index 0000000..233b3a2 --- /dev/null +++ b/recipes/xorg-xserver/xserver-kdrive-xomap_1.3.99.0.bb @@ -0,0 +1,68 @@ +LICENSE = "MIT" +DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto \ + libxfont resourceproto compositeproto libxcalibrate recordproto videoproto scrnsaverproto x11proto-xsp \ + xsp libxkbfile dbus xineramaproto xextproto-70-includes" + +PROVIDES = "virtual/xserver" +SECTION = "x11/base" +DESCRIPTION = "X server from freedesktop.org" + +PR = "r3" +PE = "1" + +COMPATIBLE_MACHINE = "nokia(770|800|810)" + +FILES_${PN} = "${libdir}/xserver /etc/dbus-1/* ${bindir}/Xomap" + +SRC_URI = "http://repository.maemo.org/pool/maemo4.0/free/x/xorg-server/xorg-server_1.3.99.0~git20070321-0osso20074202.tar.gz \ + file://fix_renderedge_compilation.patch;patch=1 \ + file://optional-xkb.patch;patch=1 \ + file://add_input.patch;patch=1 \ + file://fix-configure-autoconf-2.62.patch;patch=1" +# file://xcalibrate.patch;patch=1 \ +# file://calibrateext.patch;patch=1 \ +# 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://fixups.patch;patch=1 \ +# file://button_only.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" + +SRC_URI_nokia770 = "http://dev.openbossa.org/mamona/sources/xorg-server_1.3.99.0~git20070321-0osso20074202-HE.tar.gz \ + file://fix_renderedge_compilation.patch;patch=1 \ + file://add_linuxmouse_support.patch;patch=1 \ + file://fix_shutdown.patch;patch=1 \ + file://kdrive-evdev-from-4.0.90.patch;patch=1 \ + file://kdrive-omap-use-evdev.patch;patch=1 \ + file://fix-configure-autoconf-2.62.patch;patch=1" + +S = "${WORKDIR}/xorg-server-1.3.99.0~git20070321" +S_nokia770 = "${WORKDIR}/xorg-server-1.3.99.0~git20070321.patched" + +inherit autotools pkgconfig + +EXTRA_OECONF = "--enable-composite --enable-kdrive --enable-builtin-fonts \ + --disable-dga --disable-dri \ + --disable-xf86misc --disable-xf86vidmode \ + --disable-xorg --disable-xorgcfg \ + --disable-dmx --enable-xcalibrate --disable-xephyr \ + --disable-xkb --disable-xnest --disable-xvfb --disable-xfbdev \ + --disable-xevie --disable-xprint --disable-xtrap \ + --with-default-font-path=built-ins \ + ac_cv_file__usr_share_X11_sgml_defs_ent=no \ + --enable-xomap --enable-null-root-cursor --disable-xsdl" + +CPPFLAGS_append_mamona = " -D_GNU_SOURCE" + +CFLAGS_prepend = "-I${STAGING_INCDIR}/xextproto-70 " + +do_configure_prepend() { + sed -i -e 's/tslib-0.0/tslib-1.0/' ${S}/configure.ac +} -- 1.6.3.3