All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: Linus Torvalds <torvalds@osdl.org>, Matt <dirtbird@ntlworld.com>,
	herbert@gondor.apana.org.au,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [MOUSE] Alias for /dev/psaux
Date: Sun, 9 Nov 2003 11:04:12 +0100	[thread overview]
Message-ID: <20031109100412.GA12868@ucw.cz> (raw)
In-Reply-To: <20031105180321.GC27922@ucw.cz>

[-- Attachment #1: Type: text/plain, Size: 2539 bytes --]

On Wed, Nov 05, 2003 at 07:03:21PM +0100, Vojtech Pavlik wrote:
> > How about something like this:
> > 
> >  - if "mouse_noext" is set (which implies that we won't be doing any 
> >    probing), we also don't set rate/precision unless the user asked us.
> > 
> >    Thus "psmouse_noext" becomes the "ultra-safe" setting. We still want to 
> >    have some way to set things like wheel etc info by hand later on (ie as
> >    a response to the user _telling_ us what mouse it is), but that's a
> >    more long-range plan.
> > 
> >  - if we do probing, we first ask the mouse for its current details, and 
> >    we restore the thing by default afterwards. That at least should give 
> >    us 2.4.x behaviour unless the mouse is broken (and for broken mice 
> >    you'd just have to have "mouse_noext").
> > 
> >    Again, long-term we'd want to have the possibility of tweaking the 
> >    results later even with the autodetection.
> > 
> > Does that sound like a reasonable plan?
> 
> Yes, it does.

It didn't work out.

The problem is that the psmouse driver always issues the 0xf6 RESET
command as the second command in the command sequence. This is correct,
because we need to disable the mouse input, so that it doesn't collide
with further probing and setup.

The 0xf6 RESET command will initalize the mouse to the default (100
samples/second, 100 dpi, 1:1 mapping) settings.

So there is no point in saving those settings and restoring them later,
when we know what they are already.

Also, in 2.4, the 0xf6 RESET is one of the first commands XFree86 sends
to the mouse, so again, there is no state left from BIOS or powerup
defaults.

XFree86 also sets the mouse to 200dpi, because that's what some mice
need to operate properly (Windows does the same). Most mice ignore that
setting, anyway.

So the attached patch sets the mouse to 100 samples/second, 200 dpi, 1:1
mapping, which is a standard setting, as close to 2.4 XFree86 behavior as
possible, and a good performance setting, too.

It also in the case of 'psmouse_noext' doesn't probe and set anything
all, though it still issues the RESET command. This is as safe as one
can get.

The only real problem remaining is that the report rate and resolution
cannot be set from XFree86 config and only is available as a
kernel/module parameter. The fix is, howewer not 2.6.0 material.

The attached patch, although rather obvious, was tested on most of my
computers and laptops, and works fine.

Please apply it before 2.6.0 ...

Thanks.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

[-- Attachment #2: mousefix --]
[-- Type: text/plain, Size: 1629 bytes --]

ChangeSet@1.1396.2.2, 2003-11-09 08:45:56+01:00, vojtech@suse.cz
  input: Always reset PS/2 mouse resolution and update speed to default
         values after probing, if probing for extensions is enabled.


 psmouse-base.c |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)


diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c	Sun Nov  9 11:03:54 2003
+++ b/drivers/input/mouse/psmouse-base.c	Sun Nov  9 11:03:54 2003
@@ -36,12 +36,10 @@
 MODULE_PARM_DESC(psmouse_resetafter, "Reset Synaptics Touchpad after so many bad packets (0 = never).");
 MODULE_LICENSE("GPL");
 
-#define PSMOUSE_LOGITECH_SMARTSCROLL	1
-
 static int psmouse_noext;
-int psmouse_resolution;
-unsigned int psmouse_rate;
-int psmouse_smartscroll = PSMOUSE_LOGITECH_SMARTSCROLL;
+int psmouse_resolution = 200;
+unsigned int psmouse_rate = 100;
+int psmouse_smartscroll = 1;
 unsigned int psmouse_resetafter;
 
 static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2", "ImPS/2", "ImExPS/2", "SynPS/2"};
@@ -466,22 +464,15 @@
 {
 	unsigned char param[2];
 	
-
 /*
- * We set the mouse report rate.
+ * We set the mouse report rate, resolution and scaling.
  */
 
-	if (psmouse_rate)
+	if (!psmouse_noext) {
 		psmouse_set_rate(psmouse);
-
-/*
- * We also set the resolution and scaling.
- */
-
-	if (psmouse_resolution)
 		psmouse_set_resolution(psmouse);
-
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+		psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+	}
 
 /*
  * We set the mouse into streaming mode.

  reply	other threads:[~2003-11-09 10:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-05 15:17 Re:[MOUSE] Alias for /dev/psaux Matt
2003-11-05 16:27 ` Linus Torvalds
2003-11-05 17:02   ` [MOUSE] " Vojtech Pavlik
2003-11-05 17:36     ` Linus Torvalds
2003-11-05 18:00       ` Vojtech Pavlik
2003-11-05 18:39         ` Linus Torvalds
2003-11-06 10:41         ` Mikael Pettersson
2003-11-05 17:39   ` Vojtech Pavlik
2003-11-05 17:49     ` Linus Torvalds
2003-11-05 18:03       ` Vojtech Pavlik
2003-11-09 10:04         ` Vojtech Pavlik [this message]
2003-11-09 10:33           ` John Bradford
2003-11-09 10:38             ` Vojtech Pavlik
  -- strict thread matches above, loose matches on Subject: below --
2003-11-05 11:03 "Andrey Borzenkov" 
2003-11-05 10:48 Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031109100412.GA12868@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=dirtbird@ntlworld.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.