Re: Extra pointer motion with current git xf86-input-synaptics

2008-09-29 Thread Simon Thum
Peter Hutterer wrote:
 On Sun, Sep 28, 2008 at 07:26:06PM +0200, Simon Thum wrote:
 rescaleValuatorAxis(int coord, AxisInfoPtr from, AxisInfoPtr to,
 int defmax)
 {
 [...]
 return (int)(((float)(coord - fmin) + 0.5f) * (tmax - tmin + 1) /
  (fmax - fmin + 1)) + tmin;
 
 
 The patch below should fix another issue, the scaling from device - core -
 device. With the patch below, x/y is now used as it is reported by the device
 (unless a screen cross happens).
Great, that's fixing what my patch merely conceals. However, I'm in 
favor of applying both. With translation in place, rounding to nearest 
is simply avoiding errors.

Cheers,

Simon


 diff --git a/dix/getevents.c b/dix/getevents.c
 index 166ab4e..f2086e8 100644
 --- a/dix/getevents.c
 +++ b/dix/getevents.c
 @@ -919,17 +919,22 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, 
 int type, int buttons,
  master-last.valuators[1] = pDev-last.valuators[1];
  }
  
 +/* Crossed screen? Scale back to device coordiantes */
  if(cx != pDev-last.valuators[0])
 +{
 +scr = miPointerGetScreen(pDev);
 +x = rescaleValuatorAxis(pDev-last.valuators[0], NULL,
 +pDev-valuator-axes + 0, scr-width);
  cx = pDev-last.valuators[0];
 +}
  if(cy != pDev-last.valuators[1])
 +{
 +scr = miPointerGetScreen(pDev);
  cy = pDev-last.valuators[1];
 +y = rescaleValuatorAxis(pDev-last.valuators[1], NULL,
 +pDev-valuator-axes + 1, scr-height);
 +}
  
 -/* scale x/y back to device coordinates */
 -scr = miPointerGetScreen(pDev);
 -x = rescaleValuatorAxis(pDev-last.valuators[0], NULL,
 -pDev-valuator-axes + 0, scr-width);
 -y = rescaleValuatorAxis(pDev-last.valuators[1], NULL,
 -pDev-valuator-axes + 1, scr-height);
  
  updateMotionHistory(pDev, ms, first_valuator, num_valuators,
  pDev-last.valuators[first_valuator]);
 @@ -938,7 +943,6 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, 
 int type, int buttons,
  pDev-last.valuators[first_valuator]);
  
  /* Update the valuators with the true value sent to the client*/
 -/* FIXME: we lose subpixel precision here. */
  if(v0) *v0 = x;
  if(v1) *v1 = y;
  

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Extra pointer motion with current git xf86-input-synaptics

2008-09-28 Thread Magnus Kessler
On Sunday 28 September 2008, Peter Hutterer wrote:
 On Sat, Sep 27, 2008 at 06:10:32PM +0100, Magnus Kessler wrote:
  Since updating to the current git version of xorg-server, inputproto
  and xf86-input-synaptics I observe extra pointer movements for every
  event generated by the touchpad.
 
  Even when not touching the pad and using the buttons instead the
  pointer moves 1 pixel to the top-left which each event (x and y
  coordinate decrease by 1 every time). Equally, each event generated
  from touching the pad seems to have this extra movement towards the
  top-left of the screen.

 what hardware do you have?
 Any special options in xorg.conf/the fdi file?

 Cheers,
   Peter

This is with an external mini-keyboard with built-in touchpad. Dmesg reports 
it as

Synaptics Touchpad, model: 1, fw: 4.1, id: 0x14aa1, caps: 0x0/0x0

and in Xorg.0.log the xf86-input-synaptics driver reports

(**) Option Device /dev/input/event1
(II) SynPS/2 Synaptics TouchPad: x-axis range 1472 - 5472
(II) SynPS/2 Synaptics TouchPad: y-axis range 1408 - 4448
(II) SynPS/2 Synaptics TouchPad: pressure range 0 - 255
(II) SynPS/2 Synaptics TouchPad: finger width range 0 - 0
(II) SynPS/2 Synaptics TouchPad: buttons: left right middle double triple
(**) Option SHMConfig 1
(**) Option VertEdgeScroll 1
(**) Option HorizEdgeScroll 1
(**) Option LockedDrags 0
(**) Option TapButton1 1
(**) Option PalmDetect yes

The fdi file I'm using is

?xml version=1.0 encoding=ISO-8859-1?
deviceinfo version=0.2
  device
match key=info.capabilities contains=input.touchpad
  match key=info.product contains=Synaptics TouchPad
merge key=input.x11_driver type=stringsynaptics/merge
merge key=input.x11_options.Emulate3Buttons 
type=stringyes/merge
merge key=input.x11_options.LockedDrags type=string0/merge
merge key=input.x11_options.PalmDetect type=stringyes/merge
merge key=input.x11_options.CoastingSpeed 
type=string20/merge
merge key=input.x11_options.TapButton1 type=string1/merge
merge key=input.x11_options.VertEdgeScroll 
type=string1/merge
merge key=input.x11_options.HorizEdgeScroll 
type=string1/merge
merge key=input.x11_options.SHMConfig type=string1/merge
  /match
/match
  /device
/deviceinfo


I have just reverted the part of commit  
c405a69f83dab77cfe6c76f718a3ca5614a85918 that passes the actual x/y ranges 
to xf86InitValuatorAxisStruct. Now the extra movement is gone, but I get a 
somewhat quicker cursor movement than I was used to before. This would be 
due to the other recent changes that set new default values for the 
acceleration parameters, of course.

I'm trying to see where in the valuators are actually used inside the X 
server. With a smaller range than [0, -1] some rounding error (?) seems to 
create that extra pixel offset for each event processed. This is on a 
64-bit platform, in case this is important.

Any hints on where to look next are welcome.

Cheers,

Magnus


signature.asc
Description: This is a digitally signed message part.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: Extra pointer motion with current git xf86-input-synaptics

2008-09-28 Thread Peter Hutterer
On Sun, Sep 28, 2008 at 08:23:51AM +0100, Magnus Kessler wrote:
 I have just reverted the part of commit  
 c405a69f83dab77cfe6c76f718a3ca5614a85918 that passes the actual x/y ranges 
 to xf86InitValuatorAxisStruct. Now the extra movement is gone, but I get a 
 somewhat quicker cursor movement than I was used to before. This would be 
 due to the other recent changes that set new default values for the 
 acceleration parameters, of course.

 I'm trying to see where in the valuators are actually used inside the X 
 server. With a smaller range than [0, -1] some rounding error (?) seems to 
 create that extra pixel offset for each event processed. This is on a 
 64-bit platform, in case this is important.

Check out GetPointerEvents in xserver/dix/getevents.c. 

We take valuator coordinates, scale them to screen coords based on the axis
information and then scale them back to device coords*.

The screen coords are used to move the cursor and the scaling is done based on
the axis ranges. Hence the different acceleration when you change the axis
range to 0,-1 (in which case the screen coords are used as axis ranges).

On top of it all, pointer acceleration kicks in as well. So the problem you're
experiencing (i don't see it on similar hardware) can be:
1. in-driver scaling issues
2. server scaling issues
3. pointer accel issues

1. is easy to figure out by putting xf86Msg(X_ERROR, ...) before
xf86PostMotionEvent and xf86PostButtonEvent in the driver and checking the 
valuators. If they change, the driver is to blame.

2 and 3 are a bit harder to find out, but narrowing it down to 1 or [2,3]
would be good already.

Cheers,
  Peter

* the last step is buggy, we lose information here :(
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Extra pointer motion with current git xf86-input-synaptics

2008-09-27 Thread Magnus Kessler
Since updating to the current git version of xorg-server, inputproto and 
xf86-input-synaptics I observe extra pointer movements for every event 
generated by the touchpad.

Even when not touching the pad and using the buttons instead the pointer 
moves 1 pixel to the top-left which each event (x and y coordinate decrease 
by 1 every time). Equally, each event generated from touching the pad seems 
to have this extra movement towards the top-left of the screen.

Is anyone else experiencing this problem?

Best Regards,

Magnus Kessler


signature.asc
Description: This is a digitally signed message part.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: Extra pointer motion with current git xf86-input-synaptics

2008-09-27 Thread Peter Hutterer
On Sat, Sep 27, 2008 at 06:10:32PM +0100, Magnus Kessler wrote:
 Since updating to the current git version of xorg-server, inputproto and 
 xf86-input-synaptics I observe extra pointer movements for every event 
 generated by the touchpad.
 
 Even when not touching the pad and using the buttons instead the pointer 
 moves 1 pixel to the top-left which each event (x and y coordinate decrease 
 by 1 every time). Equally, each event generated from touching the pad seems 
 to have this extra movement towards the top-left of the screen.

what hardware do you have?
Any special options in xorg.conf/the fdi file?

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg