* Re: [Qemu-devel] Improper mouse reset handling
@ 2005-08-05 9:15 Juergen Keil
0 siblings, 0 replies; 3+ messages in thread
From: Juergen Keil @ 2005-08-05 9:15 UTC (permalink / raw)
To: qemu-devel
> While tracking down a problem with getting X to work with the VNC
> version of Qemu I discovered a problem in the way the Qemu mouse
> emulation was handling mouse reset commands. Turns out, the emulation
> code is a little over aggressive in dealing with reset commands for the
> mouse. Since there are commands that enable and disable the mouse the
> emulator, quite properly, provides this control. Unfortunately, the
> emulator also interprets either a `reset' or `set to default' command to
> also disable the mouse. This is wrong, neither of these commands are
> supposed to affect the enabled status of the mouse
Huh?
Can you provide a pointer to a specification that `reset' or `set to
default' must not change the state of "Data Reporting
enabled/disabled"?
According to <URL:http://www.computer-engineering.org/ps2mouse/>,
Section "Reset Mode", a `reset' command is supposed to set the "Data
Reporting" to its default value, and the default value is "Data
Reporting disabled"! That is, qemu's `reset' and `set to default'
implementation appears to be perfectly ok, as it is now.
> so that, when X sends
> a `reset', no futher mouse data is sent, making it look like X is hung.
Why does X (the mouse driver?) send mouse resets? Any why doesn't it
enable data reporting afterwards? Isn't this a mouse driver problem in
your X server?
Btw. in my Solaris x86 PS/2 wheel mouse driver I've always sent an
"enable" command after sending "reset" commands to the mouse, like
this:
/*
* reset the mouse (restores to the standard ps/2 mouse protocol),
* probe for (and enable) the wheel mouse protocol, and enable the
* mouse.
*/
if ((error = psm_reset(softstate)) ||
(error = psm_protocol(softstate)) ||
(error = psm_config(softstate)) ||
(error = psm_enable(softstate, 1)))
{
qprocsoff(rq);
return error;
}
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [Qemu-devel] Improper mouse reset handling
@ 2005-08-05 15:21 Dugger, Donald D
0 siblings, 0 replies; 3+ messages in thread
From: Dugger, Donald D @ 2005-08-05 15:21 UTC (permalink / raw)
To: Juergen Keil, qemu-devel
Interesting. You're right, the protocol explicitly says that both
`reset' and `set to default' are supposed to disable the mouse. I have
to admit, I was basing my patch on the fact that, in tracing the
commands I received from the X server, I saw a `reset' that was not
followed by an `enable'. I'll have to go back and find out where the
missing `enable' command got dropped or an unexpected `reset' got added.
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
Donald.D.Dugger@intel.com
Ph: 303/440-1368
>-----Original Message-----
>From: qemu-devel-bounces+donald.d.dugger=intel.com@nongnu.org
>[mailto:qemu-devel-bounces+donald.d.dugger=intel.com@nongnu.org
>] On Behalf Of Juergen Keil
>Sent: Friday, August 05, 2005 3:16 AM
>To: qemu-devel@nongnu.org
>Subject: Re: [Qemu-devel] Improper mouse reset handling
>
>
>> While tracking down a problem with getting X to work with the VNC
>> version of Qemu I discovered a problem in the way the Qemu mouse
>> emulation was handling mouse reset commands. Turns out, the
>emulation
>> code is a little over aggressive in dealing with reset
>commands for the
>> mouse. Since there are commands that enable and disable the
>mouse the
>> emulator, quite properly, provides this control. Unfortunately, the
>> emulator also interprets either a `reset' or `set to
>default' command to
>> also disable the mouse. This is wrong, neither of these commands are
>> supposed to affect the enabled status of the mouse
>
>Huh?
>
>Can you provide a pointer to a specification that `reset' or `set to
>default' must not change the state of "Data Reporting
>enabled/disabled"?
>
>
>
>According to <URL:http://www.computer-engineering.org/ps2mouse/>,
>Section "Reset Mode", a `reset' command is supposed to set the "Data
>Reporting" to its default value, and the default value is "Data
>Reporting disabled"! That is, qemu's `reset' and `set to default'
>implementation appears to be perfectly ok, as it is now.
>
>
>
>> so that, when X sends
>> a `reset', no futher mouse data is sent, making it look like
>X is hung.
>
>Why does X (the mouse driver?) send mouse resets? Any why doesn't it
>enable data reporting afterwards? Isn't this a mouse driver
>problem in
>your X server?
>
>
>
>
>Btw. in my Solaris x86 PS/2 wheel mouse driver I've always sent an
>"enable" command after sending "reset" commands to the mouse, like
>this:
>
>
>
> /*
> * reset the mouse (restores to the standard ps/2 mouse protocol),
> * probe for (and enable) the wheel mouse protocol, and enable the
> * mouse.
> */
> if ((error = psm_reset(softstate)) ||
> (error = psm_protocol(softstate)) ||
> (error = psm_config(softstate)) ||
> (error = psm_enable(softstate, 1)))
> {
> qprocsoff(rq);
> return error;
> }
>
>
>
>
>_______________________________________________
>Qemu-devel mailing list
>Qemu-devel@nongnu.org
>http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
^ permalink raw reply [flat|nested] 3+ messages in thread* [Qemu-devel] Improper mouse reset handling
@ 2005-08-04 23:21 Dugger, Donald D
0 siblings, 0 replies; 3+ messages in thread
From: Dugger, Donald D @ 2005-08-04 23:21 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 943 bytes --]
While tracking down a problem with getting X to work with the VNC
version of Qemu I discovered a problem in the way the Qemu mouse
emulation was handling mouse reset commands. Turns out, the emulation
code is a little over aggressive in dealing with reset commands for the
mouse. Since there are commands that enable and disable the mouse the
emulator, quite properly, provides this control. Unfortunately, the
emulator also interprets either a `reset' or `set to default' command to
also disable the mouse. This is wrong, neither of these commands are
supposed to affect the enabled status of the mouse so that, when X sends
a `reset', no futher mouse data is sent, making it look like X is hung.
The attached patch fixes this problem by having the `reset' or `set to
default' commands ignore the enable bit.
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
Donald.D.Dugger@intel.com
Ph: 303/440-1368
[-- Attachment #2: patch-qemu-0804.l --]
[-- Type: application/octet-stream, Size: 769 bytes --]
diff -Naur qemu-0.7.0/hw/pckbd.c qemu-0.7.0-build/hw/pckbd.c
--- qemu-0.7.0/hw/pckbd.c 2005-04-27 14:52:05.000000000 -0600
+++ qemu-0.7.0-build/hw/pckbd.c 2005-08-04 17:09:58.000000000 -0600
@@ -532,13 +532,13 @@
case AUX_SET_DEFAULT:
s->mouse_sample_rate = 100;
s->mouse_resolution = 2;
- s->mouse_status = 0;
+ s->mouse_status &= MOUSE_STATUS_ENABLED;
kbd_queue(s, AUX_ACK, 1);
break;
case AUX_RESET:
s->mouse_sample_rate = 100;
s->mouse_resolution = 2;
- s->mouse_status = 0;
+ s->mouse_status &= MOUSE_STATUS_ENABLED;
s->mouse_type = 0;
kbd_queue(s, AUX_ACK, 1);
kbd_queue(s, 0xaa, 1);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-08-05 15:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-05 9:15 [Qemu-devel] Improper mouse reset handling Juergen Keil
-- strict thread matches above, loose matches on Subject: below --
2005-08-05 15:21 Dugger, Donald D
2005-08-04 23:21 Dugger, Donald D
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).