diff -ur xserver-xorg-input-synaptics_1.1.2.orig/src/synapticsstr.h xserver-xorg-input-synaptics_1.1.2/src/synapticsstr.h --- xserver-xorg-input-synaptics_1.1.2.orig/src/synapticsstr.h 2011-01-14 19:36:17.000000000 +0100 +++ xserver-xorg-input-synaptics_1.1.2/src/synapticsstr.h 2011-01-14 19:36:03.000000000 +0100 @@ -104,6 +104,7 @@ /* Parameter data */ int left_edge, right_edge, top_edge, bottom_edge; /* edge coordinates absolute */ int finger_low, finger_high, finger_press; /* finger detection values in Z-values */ + int orientation; int tap_time; int tap_move; /* max. tapping time and movement in packets and coord. */ int single_tap_timeout; /* timeout to recognize a single tap */ diff -ur xserver-xorg-input-synaptics_1.1.2.orig/include/synaptics-properties.h xserver-xorg-input-synaptics_1.1.2/include/synaptics-properties.h --- xserver-xorg-input-synaptics_1.1.2.orig/include/synaptics-properties.h 2009-10-20 22:09:01.679710327 +0200 +++ xserver-xorg-input-synaptics_1.1.2/include/synaptics-properties.h 2009-10-22 18:48:47.123708014 +0200 @@ -161,4 +161,7 @@ /* 8 bit (BOOL) */ #define SYNAPTICS_PROP_GRAB "Synaptics Grab Event Device" +/* 32 bit */ +#define SYNAPTICS_ORIENTATION "Synaptics Orientation" + #endif /* _SYNAPTICS_PROPERTIES_H_ */ diff -ur xserver-xorg-input-synaptics_1.1.2.orig/src/eventcomm.c xserver-xorg-input-synaptics_1.1.2/src/eventcomm.c --- xserver-xorg-input-synaptics_1.1.2.orig/src/eventcomm.c 2009-10-20 22:09:01.683709019 +0200 +++ xserver-xorg-input-synaptics_1.1.2/src/eventcomm.c 2009-10-22 21:22:58.224803290 +0200 @@ -629,10 +629,28 @@ case EV_ABS: switch (ev->code) { case ABS_X: - hw->x = ev->value; + if (para->orientation==0) + hw->x = ev->value; + else if (para->orientation==2) + hw->x = priv->maxx + priv->minx - ev->value; + else if (para->orientation==3) + hw->y = (priv->maxx - ev->value) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny; + else if (para->orientation==1) + hw->y = (ev->value - priv->minx) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny; + else + hw->x = ev->value; break; case ABS_Y: - hw->y = ev->value; + if (para->orientation==0) + hw->y = ev->value; + else if (para->orientation==2) + hw->y = priv->maxy + priv->miny - ev->value; + else if (para->orientation==3) + hw->x = (ev->value - priv->miny) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx; + else if (para->orientation==1) + hw->x = (priv->maxy - ev->value) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx; + else + hw->y = ev->value; break; case ABS_PRESSURE: hw->z = ev->value; diff -ur xserver-xorg-input-synaptics_1.1.2.orig/src/properties.c xserver-xorg-input-synaptics_1.1.2/src/properties.c --- xserver-xorg-input-synaptics_1.1.2.orig/src/properties.c 2009-10-20 22:09:01.683709019 +0200 +++ xserver-xorg-input-synaptics_1.1.2/src/properties.c 2009-10-22 18:48:47.131703654 +0200 @@ -46,6 +46,7 @@ Atom prop_edges = 0; Atom prop_finger = 0; +Atom prop_orientation = 0; Atom prop_tap_time = 0; Atom prop_tap_move = 0; Atom prop_tap_durations = 0; @@ -255,6 +256,8 @@ fvalues[0] = para->press_motion_min_factor; fvalues[1] = para->press_motion_max_factor; + prop_orientation = InitAtom(pInfo->dev, SYNAPTICS_ORIENTATION, 32, 1, ¶->orientation); + prop_pressuremotion_factor = InitFloatAtom(pInfo->dev, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 2, fvalues); prop_resolution_detect = InitAtom(pInfo->dev, SYNAPTICS_PROP_RESOLUTION_DETECT, 8, 1, ¶->resolution_detect); prop_grab = InitAtom(pInfo->dev, SYNAPTICS_PROP_GRAB, 8, 1, ¶->grab_event_device); @@ -305,7 +308,12 @@ para = &tmp; } - if (property == prop_edges) + if (property == prop_orientation) + { + if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER) + return BadMatch; + para->orientation = *(INT32*)prop->data; + } else if (property == prop_edges) { INT32 *edges; if (prop->size != 4 || prop->format != 32 || prop->type != XA_INTEGER) diff -ur xserver-xorg-input-synaptics_1.1.2.orig/src/synaptics.c xserver-xorg-input-synaptics_1.1.2/src/synaptics.c --- xserver-xorg-input-synaptics_1.1.2.orig/src/synaptics.c 2009-10-20 22:09:01.683709019 +0200 +++ xserver-xorg-input-synaptics_1.1.2/src/synaptics.c 2009-10-22 18:57:34.363700791 +0200 @@ -508,6 +508,7 @@ horizTwoFingerScroll = FALSE; /* set the parameters */ + pars->orientation = xf86SetIntOption(opts, "Orientation", 0); pars->left_edge = xf86SetIntOption(opts, "LeftEdge", l); pars->right_edge = xf86SetIntOption(opts, "RightEdge", r); pars->top_edge = xf86SetIntOption(opts, "TopEdge", t); @@ -2643,8 +2643,14 @@ int xCenter = (priv->synpara.left_edge + priv->synpara.right_edge) / 2; int yCenter = (priv->synpara.top_edge + priv->synpara.bottom_edge) / 2; - hw->x = (hw->x - xCenter) * priv->horiz_coeff + xCenter; - hw->y = (hw->y - yCenter) * priv->vert_coeff + yCenter; + if ((priv->synpara.orientation==1) || (priv->synpara.orientation==3)) { + hw->x = (hw->x - xCenter) * priv->vert_coeff + xCenter; + hw->y = (hw->y - yCenter) * priv->horiz_coeff + yCenter; + } else { + hw->x = (hw->x - xCenter) * priv->horiz_coeff + xCenter; + hw->y = (hw->y - yCenter) * priv->vert_coeff + yCenter; + } + } void diff -ur xserver-xorg-input-synaptics_1.1.2.orig/tools/synclient.c xserver-xorg-input-synaptics_1.1.2/tools/synclient.c --- xserver-xorg-input-synaptics_1.1.2.orig/tools/synclient.c 2011-01-14 19:22:01.000000000 +0100 +++ xserver-xorg-input-synaptics_1.1.2/tools/synclient.c 2011-01-14 19:19:13.000000000 +0100 @@ -78,6 +78,7 @@ {"RightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 1}, {"TopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 2}, {"BottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 3}, + {"Orientation", PT_INT, 0, 3, SYNAPTICS_ORIENTATION, 32, 0}, {"FingerLow", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 0}, {"FingerHigh", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 1}, {"FingerPress", PT_INT, 0, 256, SYNAPTICS_PROP_FINGER, 32, 2},