xserver-xorg-input-evtouch: Changes to 'debian-unstable'
debian/patches/07_random_fixes_for_06.patch | 496 +++++++++++++++++++++++++++-
1 file changed, 489 insertions(+), 7 deletions(-)
New commits:
commit 14a087f813f1e2a0eb8a95edcff598f4cd411aeb
Author: Mattia Dongili <malattia@linux.it>
Date: Sun Feb 3 11:54:13 2008 +0900
Re-enable swapping coords when the screen is randr rotated
Signed-off-by: Mattia Dongili <malattia@linux.it>
diff --git a/debian/patches/07_random_fixes_for_06.patch b/debian/patches/07_random_fixes_for_06.patch
index d5a1269..e25b999 100644
--- a/debian/patches/07_random_fixes_for_06.patch
+++ b/debian/patches/07_random_fixes_for_06.patch
@@ -1,8 +1,307 @@
+# Description:
+# o Random whitespace fixes
+# o uninitialized variables warning fix
+#
Index: xserver-xorg-input-evtouch/evtouch.c
===================================================================
---- xserver-xorg-input-evtouch.orig/evtouch.c 2008-02-02 21:35:07.970972486 +0900
-+++ xserver-xorg-input-evtouch/evtouch.c 2008-02-02 21:36:37.970971869 +0900
-@@ -884,7 +884,7 @@ ConvertProc ( LocalDevicePtr local,
+--- xserver-xorg-input-evtouch.orig/evtouch.c 2008-02-03 11:51:32.082972688 +0900
++++ xserver-xorg-input-evtouch/evtouch.c 2008-02-03 11:51:32.106981862 +0900
+@@ -1,6 +1,6 @@
+ /*
+ *
+- * Copyright 2004 by Kenan Esau <kenan.esau@conan.de>, Baltmannsweiler,
++ * Copyright 2004 by Kenan Esau <kenan.esau@conan.de>, Baltmannsweiler,
+ * Germany.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+@@ -182,17 +182,17 @@ static const char *default_options[] =
+ static int
+ ControlProc(LocalDevicePtr device, xDeviceCtl *ctrl);
+
+-static void
++static void
+ PostMotionEvent(LocalDevicePtr local);
+
+-static void
++static void
+ PostProximityEvent(LocalDevicePtr local,int is_in);
+
+-static void
++static void
+ PostButtonEvent(LocalDevicePtr local, int button,
+ int is_down, int x,int y);
+
+-static void
++static void
+ InputSetScreen(LocalDevicePtr local);
+
+
+@@ -216,7 +216,7 @@ emulate3Timer(OsTimerPtr timer, CARD32 n
+
+ PostMotionEvent(local);
+
+- /*
++ /*
+ * Emit a button press -- release is handled in EVTouchLBRBEvent
+ */
+ if ( ( priv->touch_flags & LB_STAT ) &&
+@@ -241,11 +241,11 @@ emulate3Timer(OsTimerPtr timer, CARD32 n
+
+ priv->emulate3_timer_expired = TRUE;
+ xf86UnblockSIGIO(sigstate);
+-
++
+ return 0;
+ }
+
+-static void DoBtnAction(EVTouchPrivatePtr priv)
++static void DoBtnAction(EVTouchPrivatePtr priv)
+ {
+ int btn = 0;
+ LocalDevicePtr local = priv->local;
+@@ -253,7 +253,7 @@ static void DoBtnAction(EVTouchPrivatePt
+ DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__, priv->btn_count);
+
+ for (btn = 0; btn < priv->btn_count; btn++) {
+- DBGOUT(9, "EVTouch: %s do_it = %d \n",
++ DBGOUT(9, "EVTouch: %s do_it = %d \n",
+ __FUNCTION__, priv->btn_actions[btn].do_it);
+ if (priv->btn_actions[btn].do_it != 0) {
+ if (priv->emulate3_timer != NULL)
+@@ -263,10 +263,10 @@ static void DoBtnAction(EVTouchPrivatePt
+ priv->emulate3_timer_expired = FALSE;
+ }
+
+- DBGOUT(2, "EVTouch: %s btn = %d action = %d\n",
+- __FUNCTION__, btn,
++ DBGOUT(2, "EVTouch: %s btn = %d action = %d\n",
++ __FUNCTION__, btn,
+ priv->btn_actions[btn].action);
+- PostButtonEvent (local, btn, priv->btn_actions[btn].action,priv->cur_x,priv->cur_y);
++ PostButtonEvent (local, btn, priv->btn_actions[btn].action,priv->cur_x,priv->cur_y);
+
+ priv->btn_actions[btn].do_it = 0;
+ priv->btn_actions[btn].action = 0;
+@@ -318,7 +318,7 @@ void EVTouchProcessAbs(EVTouchPrivatePtr
+ PostButtonEvent (local, 5,1,priv->cur_x,priv->cur_y);
+ PostButtonEvent (local, 5,0,priv->cur_x,priv->cur_y);
+ }
+- }
++ }
+ }
+ }
+
+@@ -337,7 +337,7 @@ void EVTouchProcessRel(EVTouchPrivatePtr
+ if (priv->cur_x < priv->min_x)
+ priv->cur_x = priv->min_x;
+ return;
+- }
++ }
+ if ( ev->code == REL_Y ) {
+ priv->cur_y += ev->value;
+ if (priv->cur_y > priv->max_y)
+@@ -346,7 +346,7 @@ void EVTouchProcessRel(EVTouchPrivatePtr
+ priv->cur_y = priv->min_y;
+ return;
+ }
+-
++
+ libtouchSetPos(priv->libtouch, priv->cur_x, priv->cur_y);
+ }
+
+@@ -363,12 +363,12 @@ void EVTouchLBRBEvent(EVTouchPrivatePtr
+
+ if (priv->emulate3) {
+ if ( (ev->value==1) && (priv->emulate3_timer==NULL) )
+- priv->emulate3_timer = TimerSet(priv->emulate3_timer,
++ priv->emulate3_timer = TimerSet(priv->emulate3_timer,
+ 0,
+ priv->emulate3_timeout,
+ emulate3Timer,
+ local);
+-
++
+ if ( (ev->value == 1) && (ev->code == BTN_LEFT) ) {
+ priv->touch_flags |= LB_STAT;
+ }
+@@ -376,8 +376,8 @@ void EVTouchLBRBEvent(EVTouchPrivatePtr
+ priv->touch_flags |= RB_STAT;
+ }
+
+- if ( (ev->value == 0) &&
+- (priv->touch_flags & RB_STAT) &&
++ if ( (ev->value == 0) &&
++ (priv->touch_flags & RB_STAT) &&
+ (priv->touch_flags & LB_STAT) ) {
+ DBGOUT(2, "EVTouch: Middle Release\n");
+ priv->touch_flags &= ~LB_STAT;
+@@ -393,7 +393,7 @@ void EVTouchLBRBEvent(EVTouchPrivatePtr
+ DBGOUT(2, "EVTouch: Right Release\n");
+ priv->touch_flags &= ~RB_STAT;
+ SetBtnAction(priv, 3, BTN_RELEASE);
+- }
++ }
+ } else {
+ if (ev->code == BTN_LEFT) {
+ SetBtnAction(priv, 1, ev->value);
+@@ -418,11 +418,11 @@ void EVTouchProcessKey(EVTouchPrivatePtr
+
+ DBGOUT(2, "EVTouch: %s\n", __FUNCTION__);
+ ev = &priv->ev;
+- if ( (ev->code == BTN_LEFT) ||
++ if ( (ev->code == BTN_LEFT) ||
+ (ev->code == BTN_RIGHT) ||
+ (ev->code == BTN_MIDDLE) ) {
+
+- /* give lb and rb-events some special treatment
++ /* give lb and rb-events some special treatment
+ (emulate3 or not, ...) */
+ EVTouchLBRBEvent(priv);
+ return;
+@@ -468,7 +468,7 @@ DeviceOn (DeviceIntPtr dev)
+ {
+ LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
+ EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
+-
++
+ local->fd = xf86OpenSerial(local->options);
+
+ DBGOUT(2, "EVTouch: %s\n", __FUNCTION__ );
+@@ -484,7 +484,7 @@ DeviceOn (DeviceIntPtr dev)
+ // breaks compilation
+ // DBG (9, XisbTrace (priv->buffer, 1));
+
+- if (!priv->buffer)
++ if (!priv->buffer)
+ {
+ xf86CloseSerial(local->fd);
+ local->fd = -1;
+@@ -526,7 +526,7 @@ DeviceOff (DeviceIntPtr dev)
+ DBGOUT(2, "EVTouch: %s\n", __FUNCTION__ );
+
+ if (local->fd != -1)
+- {
++ {
+ ioctl(local->fd, EVIOCGRAB, (void *)0);
+ xf86RemoveEnabledDevice (local);
+ if (priv->buffer)
+@@ -564,7 +564,7 @@ DeviceInit (DeviceIntPtr dev)
+
+ priv->btn_count = EV_MAX_BUTTONS;
+
+- /*
++ /*
+ * these have to be here instead of in the SetupProc, because when the
+ * SetupProc is run at server startup, screenInfo is not setup yet
+ */
+@@ -574,9 +574,9 @@ DeviceInit (DeviceIntPtr dev)
+ priv->screen_height = pScrn->virtualY;
+ priv->pViewPort_X0 = &(pScrn->frameX0); /* initialize the pointers to the viewport coords */
+ if ( (priv->screen_width != priv->phys_width) ||
+- (priv->screen_height != priv->phys_height) )
++ (priv->screen_height != priv->phys_height) )
+ priv->virtual = 1;
+- else
++ else
+ priv->virtual = 0;
+
+ priv->pViewPort_Y0 = &(pScrn->frameY0);
+@@ -591,24 +591,24 @@ DeviceInit (DeviceIntPtr dev)
+ DBGOUT(2, "EVTouch: MaxValue H,V: %d %d\n", pScrn->maxHValue, pScrn->maxVValue);
+
+ priv->screen_width = screenInfo.screens[priv->screen_num]->width;
+- priv->screen_height = screenInfo.screens[priv->screen_num]->height;
++ priv->screen_height = screenInfo.screens[priv->screen_num]->height;
+
+- /*
++ /*
+ * Device reports button press for 5 buttons.
+ */
+ if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS, map) == FALSE)
+ {
+ ErrorF("Unable to allocate EVTouch touchscreen ButtonClassDeviceStruct\n");
+ return BadAlloc;
+- }
++ }
+
+- DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__,
++ DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__,
+ priv->btn_count);
+ priv->btn_actions = xcalloc(priv->btn_count, sizeof(BtnAction));
+- xf86memset(priv->btn_actions, 0,
++ xf86memset(priv->btn_actions, 0,
+ priv->btn_count * sizeof(BtnAction));
+-
+- DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__,
++
++ DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__,
+ priv->btn_count);
+
+ if (InitFocusClassDeviceStruct(dev) == FALSE) {
+@@ -616,7 +616,7 @@ DeviceInit (DeviceIntPtr dev)
+ return !Success;
+ }
+
+- /*
++ /*
+ * Device reports motions on 2 axes in absolute coordinates.
+ * Axes min and max values are reported in raw coordinates.
+ */
+@@ -654,7 +654,7 @@ DeviceInit (DeviceIntPtr dev)
+ priv->cur_y=(priv->max_y - priv->min_y)/2;
+ libtouchSetPos(priv->libtouch, priv->cur_x, priv->cur_y);
+
+-
++
+ if (InitProximityClassDeviceStruct (dev) == FALSE)
+ {
+ ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n");
+@@ -667,7 +667,7 @@ DeviceInit (DeviceIntPtr dev)
+ return !Success;
+ }
+
+- /*
++ /*
+ * Allocate the motion events buffer.
+ */
+ xf86MotionHistoryAllocate (local);
+@@ -748,7 +748,7 @@ EVTouchGetPacket (EVTouchPrivatePtr priv
+ if (sizeof(priv->ev) == count) {
+ count = 0;
+ EVTouchDumpPacketToLog(priv);
+-
++
+ return Success;
+ }
+ }
+@@ -764,7 +764,7 @@ static void ReadInput (LocalDevicePtr lo
+
+ EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
+
+- /*
++ /*
+ * set blocking to -1 on the first call because we know there is data to
+ * read. Xisb automatically clears it after one successful read so that
+ * succeeding reads are preceeded buy a select with a 0 timeout to prevent
+@@ -815,7 +815,7 @@ static void ReadInput (LocalDevicePtr lo
+ break;
+ }
+
+- DBGOUT( 2, "EVTouch: setting (x/y)=(%d/%d)\n",
++ DBGOUT( 2, "EVTouch: setting (x/y)=(%d/%d)\n",
+ priv->cur_x, priv->cur_y);
+
+ }
+@@ -855,7 +855,7 @@ static int
+ SwitchMode (ClientPtr client, DeviceIntPtr dev, int mode)
+ {
+ DBGOUT(2, "EVTouch: %s\n", __FUNCTION__);
+-
++
+ return (!Success);
+ }
+
+@@ -884,19 +884,20 @@ ConvertProc ( LocalDevicePtr local,
float dx = 0, dy = 0;
int max_x, max_y;
@@ -11,15 +310,108 @@ Index: xserver-xorg-input-evtouch/evtouch.c
int screen_width = 0;
int screen_height = 0;
#ifdef EVDBG
-@@ -895,7 +895,7 @@ ConvertProc ( LocalDevicePtr local,
+ int i = 0;
+ #endif
+
+- EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
++ EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
ScrnInfoPtr pScrn = xf86Screens[priv->screen_num];
// X Segfaults
-// Rotation rotation = RRGetRotation(pScrn->pScreen);
+ Rotation rotation = RRGetRotation(pScrn->pScreen);
++ DBGOUT(2, "EVTouch: RRRotation=%d\n", rotation);
DBGOUT(2, "EVTouch: FIRST: v0=%d v1=%d\n", v0, v1);
+ /*correction of raw coordinates*/
+@@ -910,21 +911,20 @@ ConvertProc ( LocalDevicePtr local,
+ DBGOUT(2, "EVTouch: Scaling coordinates\n");
+ xc = v0 - priv->min_x;
+ yc = v1 - priv->min_y;
+-
++
+ max_x = priv->max_x - priv->min_x;
+ max_y = priv->max_y - priv->min_y;
+
+
+-// if (priv->rotate == EV_ROTATE_NONE) {
++ if (priv->rotate == EV_ROTATE_NONE) {
+ screen_width = pScrn->currentMode->HDisplay;
+ screen_height = pScrn->currentMode->VDisplay;
+-/* Swapping is done below in Coords! Leave those to be able to calc correct mapping
++/* Swapping is done below in Coords! Leave those to be able to calc correct mapping */
+ } else {
+ screen_width = pScrn->currentMode->VDisplay;
+ screen_height = pScrn->currentMode->HDisplay;
+ }
+
+-*/
+ if (xc < (max_x / 2)) {
+ /*
+ left
+@@ -942,7 +942,7 @@ ConvertProc ( LocalDevicePtr local,
+ (float)(cx[0] * cy[0] * priv->diff[0][0]) +
+ (float)(cx[1] * cy[1] * priv->diff[4][0]) +
+ (float)(cx[0] * cy[1] * priv->diff[3][0]));
+-
++
+ dy = ((float) (cx[1] * cy[0] * priv->diff[1][1]) +
+ (float)(cx[0] * cy[0] * priv->diff[0][1]) +
+ (float)(cx[1] * cy[1] * priv->diff[4][1]) +
+@@ -961,7 +961,7 @@ ConvertProc ( LocalDevicePtr local,
+ (float)(cx[0] * cy[0] * priv->diff[3][0]) +
+ (float)(cx[1] * cy[1] * priv->diff[7][0]) +
+ (float)(cx[0] * cy[1] * priv->diff[6][0]));
+-
++
+ dy = ((float) (cx[1] * cy[0] * priv->diff[4][1]) +
+ (float)(cx[0] * cy[0] * priv->diff[3][1]) +
+ (float)(cx[1] * cy[1] * priv->diff[7][1]) +
+@@ -985,7 +985,7 @@ ConvertProc ( LocalDevicePtr local,
+ (float)(cx[0] * cy[0] * priv->diff[1][0]) +
+ (float)(cx[1] * cy[1] * priv->diff[5][0]) +
+ (float)(cx[0] * cy[1] * priv->diff[4][0]));
+-
++
+ dy = ((float) (cx[1] * cy[0] * priv->diff[2][1]) +
+ (float)(cx[0] * cy[0] * priv->diff[1][1]) +
+ (float)(cx[1] * cy[1] * priv->diff[5][1]) +
+@@ -1004,7 +1004,7 @@ ConvertProc ( LocalDevicePtr local,
+ (float)(cx[0] * cy[0] * priv->diff[4][0]) +
+ (float)(cx[1] * cy[1] * priv->diff[8][0]) +
+ (float)(cx[0] * cy[1] * priv->diff[7][0]));
+-
++
+ dy = ((float) (cx[1] * cy[0] * priv->diff[5][1]) +
+ (float)(cx[0] * cy[0] * priv->diff[4][1]) +
+ (float)(cx[1] * cy[1] * priv->diff[8][1]) +
+@@ -1014,12 +1014,12 @@ ConvertProc ( LocalDevicePtr local,
+
+
+ #ifdef EVDBG
+- for (i=0; i<3; i++)
++ for (i=0; i<3; i++)
+ xf86ErrorFVerb(2, "cx[%d]=%f cy[%d]=%f\n", i, cx[i]
+ ,i, cy[i]);
+-
+- DBGOUT(2, "EVTouch: ViewPort_X0=%d ViewPort_Y0=%d\n",
+- *(priv->pViewPort_X0),
++
++ DBGOUT(2, "EVTouch: ViewPort_X0=%d ViewPort_Y0=%d\n",
++ *(priv->pViewPort_X0),
+ *(priv->pViewPort_Y0));
+ DBGOUT(2, "EVTouch: dx=%f dy=%f\n", dx, dy);
+ #endif
+@@ -1030,7 +1030,7 @@ ConvertProc ( LocalDevicePtr local,
+ if (priv->swap_y == TRUE)
+ yc = screen_height - yc;
+
+- /* ususally we DON'T swap x -- but if swap_x is 1
++ /* ususally we DON'T swap x -- but if swap_x is 1
+ => go on and swap */
+ if (priv->swap_x == TRUE)
+ xc = screen_width - xc;
@@ -1056,7 +1056,7 @@ ConvertProc ( LocalDevicePtr local,
break;
}
@@ -29,13 +421,103 @@ Index: xserver-xorg-input-evtouch/evtouch.c
switch (rotation) {
case RR_Rotate_0:
v0 = xc;
-@@ -1079,9 +1079,6 @@ ConvertProc ( LocalDevicePtr local,
- default:
+@@ -1080,14 +1080,12 @@ ConvertProc ( LocalDevicePtr local,
break;
}
--
+
-
-*/
}
DBGOUT(2, "EVTouch: FINAL: v0=%d v1=%d\n", v0, v1);
+
+- *x = xc;
+- *y = yc;
++ *x = v0;
++ *y = v1;
+ return (TRUE);
+ }
+
+@@ -1160,7 +1158,7 @@ EVTouchPreInit(InputDriverPtr drv, IDevP
+ priv->button_number = xf86SetIntOption(local->options, "ButtonNumber", 2 );
+
+ priv->emulate3 = xf86SetBoolOption(local->options, "Emulate3Buttons", TRUE);
+- priv->emulate3_timeout = xf86SetIntOption(local->options,
++ priv->emulate3_timeout = xf86SetIntOption(local->options,
+ "Emulate3Timeout", 50);
+
+ debug_level = xf86SetIntOption(local->options, "DebugLevel", 0);
+@@ -1180,33 +1178,33 @@ EVTouchPreInit(InputDriverPtr drv, IDevP
+ s = xf86FindOptionValue(local->options, "Rotate");
+ if (s) {
+ if (xf86NameCmp(s, "CW") == 0) {
+- priv->rotate = EV_ROTATE_CW;
++ priv->rotate = EV_ROTATE_CW;
+ } else if (xf86NameCmp(s, "CCW") == 0 ) {
+ priv->rotate = EV_ROTATE_CCW;
+ } else if (xf86NameCmp(s, "UD") == 0 ) {
+ priv->rotate = EV_ROTATE_UD;
+ }
+
+-
++
+ }
+
+ if (priv->rotate == EV_ROTATE_NONE) {
+ priv->max_rel_x = priv->max_x;
+ priv->max_rel_y = priv->max_y;
+ priv->min_rel_x = priv->min_x;
+- priv->min_rel_y = priv->min_y;
++ priv->min_rel_y = priv->min_y;
+ } else {
+ priv->max_rel_x = priv->max_y;
+ priv->max_rel_y = priv->max_x;
+ priv->min_rel_x = priv->min_y;
+- priv->min_rel_y = priv->min_x;
++ priv->min_rel_y = priv->min_x;
+ }
+
+ priv->swap_y = xf86SetBoolOption(local->options, "SwapY", FALSE);
+ priv->swap_x = xf86SetBoolOption(local->options, "SwapX", FALSE);
+
+- /*
+- get calibration parameters from XF86Config
++ /*
++ get calibration parameters from XF86Config
+ */
+ for (i = 0; i < 9; i++){
+ sprintf(tmp_str, "x%d", i);
+@@ -1215,10 +1213,10 @@ EVTouchPreInit(InputDriverPtr drv, IDevP
+ sprintf(tmp_str, "y%d", i);
+ priv->diff[i][1] = xf86SetIntOption( local->options,
+ tmp_str, 0 );
+- DBGOUT(2, "(diff[%d][0]/diff[%d][1])=(%d/%d)\n", i, i,
++ DBGOUT(2, "(diff[%d][0]/diff[%d][1])=(%d/%d)\n", i, i,
+ priv->diff[i][0], priv->diff[i][1]);
+ }
+-
++
+ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+ xf86AlwaysCore(local, TRUE);
+ #endif
+@@ -1228,9 +1226,9 @@ EVTouchPreInit(InputDriverPtr drv, IDevP
+ /* prepare to process touch packets */
+ EVTouchNewPacket (priv);
+
+- /*
++ /*
+ if started in calibration-mode:
+- - open named pipe
++ - open named pipe
+ */
+ if (priv->calibrate) {
+ priv->fifo = open("/tmp/ev_calibrate", O_RDWR, 0);
+@@ -1252,7 +1250,7 @@ EVTouchPreInit(InputDriverPtr drv, IDevP
+ static void
+ EVTouchPtrCtrl(DeviceIntPtr device, PtrCtrl *ctrl)
+ {
+- /* I have no clue what this does, except that registering it stops the
++ /* I have no clue what this does, except that registering it stops the
+ X server segfaulting in ProcGetPointerMapping()
+ Ho Hum.
+ */
Reply to: