Bug 1688 - Enhancement/fix to the mouse acceleration code
Summary: Enhancement/fix to the mouse acceleration code
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 6.8.0
Hardware: x86 (IA32) Linux (All)
: medium enhancement
Assignee: Roland Mainz
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-21 15:56 UTC by Jan Brunner
Modified: 2004-12-11 23:16 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to the mouse acceleration code (1.20 KB, patch)
2004-10-21 15:57 UTC, Jan Brunner
no flags Details | Splinter Review
Patch without floats (suggested version) (2.03 KB, patch)
2004-11-14 16:33 UTC, Jan Brunner
no flags Details | Splinter Review
[FIXED_X11R68x] Patch including changelog comment (same as attachment #1147) (4.12 KB, patch)
2004-12-12 18:06 UTC, Roland Mainz
roland.mainz: 6.8-branch+
Details | Splinter Review

Description Jan Brunner 2004-10-21 15:56:03 UTC
With the current implementation, it's not possible to slow down the mouse
pointer or use arbitrary fractions without rounding errors. "xset m 1/4 1" for
example prevents the pointer from moving when the mouse is moved slowly.

I propose a small change using the same method of preserving rounding errors
that the exponential method is already using.
Comment 1 Jan Brunner 2004-10-21 15:57:43 UTC
Created attachment 1147 [details] [review]
Patch to the mouse acceleration code
Comment 2 Jan Brunner 2004-11-14 16:33:31 UTC
Created attachment 1308 [details] [review]
Patch without floats (suggested version)
Comment 3 Jan Brunner 2004-11-30 14:50:42 UTC
The other acceleration method isn't exponential but a power function. Just to
correct the mistake. :)
Comment 4 Roland Mainz 2004-11-30 15:06:23 UTC
Comment on attachment 1308 [details] [review]
Patch without floats (suggested version)

Jan_B:
Only release wranglers can grant approval for attachments (the '+' state of the
flag), normal users can only request approval ('?' state of the flag dropdown
widget) or clear the approval request (the first choice of the dropdown).

Setting approval flag to '?' (=requesting approval) ...
Comment 5 Kristian Høgsberg 2004-12-07 08:24:01 UTC
The patch looks fine to me, it makes good sense.  But actually, I think
attachment 1147 [details] [review] is better, since the pow() based acceleration code already uses
floats, so there's no reason to jump through hoops and introduce extra struct
fields to avoid using floats.

I've obsoleted the integer-only patch and nominated the float patch instead.
Comment 6 Jan Brunner 2004-12-07 08:52:35 UTC
> [..]there's no reason to jump through hoops and introduce extra struct
> fields to avoid using floats.
That's what I thought first but after some input from Jim Gettys and Keith
Packard, I found out that casting from float to integer is very slow in C, at
least with x86 cpus. Additionally, there are target platforms that don't have a FPU.

For desktop computers, the difference is not noticeable of course, even with
future 10'000 Hz mice but without an FPU, this could make a system crawl. :)

I don't know what others think but I now like the integer version better. I hate
to waste CPU time even if it's not much. Plus the integer version is
theoretically more accurate.

I guess the mouse acceleration code is going to be revised to a more
sophisticated algorithm in the future anyway so I don't care a lot about which
patch gets accepted now as I see it as a needed fix.
Comment 7 Kristian Høgsberg 2004-12-08 08:06:35 UTC
(In reply to comment #6)
> I guess the mouse acceleration code is going to be revised to a more
> sophisticated algorithm in the future anyway so I don't care a lot about which
> patch gets accepted now as I see it as a needed fix.

The current code is sort-of broken, and in a future rewrite (not for 6.8.2) it
would be nice to get rid of the float code altogether.  If you want to look into
that, that would be cool, but for 6.8.2 I think a smaller, less intrusive patch
is better.  Since the polynomial acceleration code already use floats and has
the remainder fields in the struct, I think that's the way to go for the stable
release.

I didn't mean to obsolete your integer patch as a long term solution, I was just
evaluating it in the context of 6.8.2.
Comment 8 Jim Gettys 2004-12-08 08:56:17 UTC
Jan,

Thanks for all your efforts.

I think Kristian is right; we'll go with your original patch for the maintenence
release, and contemplate a full rewrite for a future release, and in the new
input stuff that Kristian and I are beginning work on.
Comment 9 Jan Brunner 2004-12-08 09:29:45 UTC
> I think Kristian is right; we'll go with your original patch for the maintenence
> release, and contemplate a full rewrite for a future release, and in the new
> input stuff that Kristian and I are beginning work on.
OK.
Comment 10 Roland Mainz 2004-12-11 19:28:16 UTC
Comment on attachment 1147 [details] [review]
Patch to the mouse acceleration code

Approval for X11R6.8.x stable branch granted in the 2004-12-08
release-wranglers phone call.
Please don't commit, I'll do that myself...
Comment 11 Roland Mainz 2004-12-12 18:06:14 UTC
Created attachment 1530 [details] [review]
[FIXED_X11R68x] Patch including changelog comment (same as attachment #1147 [details] [review])
Comment 12 Roland Mainz 2004-12-12 18:07:00 UTC
Comment on attachment 1530 [details] [review]
[FIXED_X11R68x] Patch including changelog comment (same as attachment #1147 [details] [review])

Carry over the approval flag (the patches are identical except the added entry
for xc/Changelog)
Comment 13 Roland Mainz 2004-12-12 18:14:31 UTC
Comment on attachment 1530 [details] [review]
[FIXED_X11R68x] Patch including changelog comment (same as attachment #1147 [details] [review])

Patch checked-in into Xorg trunk:

/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.602; previous revision: 1.601
cvs commit: Using deprecated info format strings.  Convert your scripts to use
the new argument format and remove '1's from your info file format strings.
/cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v	<-- 
xf86Xinput.c
new revision: 1.2; previous revision: 1.1
cvs commit: Using deprecated info format strings.  Convert your scripts to use
the new argument format and remove '1's from your info file format strings.
Mailing the commit message to xorg-commit@lists.freedesktop.org...
Comment 14 Roland Mainz 2004-12-12 18:16:13 UTC
Comment on attachment 1530 [details] [review]
[FIXED_X11R68x] Patch including changelog comment (same as attachment #1147 [details] [review])

Patch checked-in into X11R6.8.x stable branch:

/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.365.2.24; previous revision: 1.365.2.23
cvs commit: Using deprecated info format strings.  Convert your scripts to use
the new argument format and remove '1's from your info file format strings.
/cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v	<-- 
xf86Xinput.c
new revision: 1.1.1.2.6.1; previous revision: 1.1.1.2
cvs commit: Using deprecated info format strings.  Convert your scripts to use
the new argument format and remove '1's from your info file format strings.
Mailing the commit message to xorg-commit@lists.freedesktop.org...
Comment 15 Roland Mainz 2004-12-12 18:16:50 UTC
Patch has been commited to Xorg trunk and X11R6.8.x stable branch...

... marking bug as FIXED (please reopen if there are any issues left).   


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.