[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/11] ps2: fix mouse stream corruption
From: |
Volker Rümelin |
Subject: |
[PATCH v3 01/11] ps2: fix mouse stream corruption |
Date: |
Sat, 15 May 2021 13:32:44 +0200 |
Commit 7abe7eb294 "ps2: Fix mouse stream corruption due to lost data"
added code to avoid mouse stream corruptions but the calculation of
the needed free queue size was wrong. Fix this.
To reproduce, open a text file with the vim 7.3 32 bit for DOS exe-
cutable in a FreeDOS client started with -display sdl and move the
mouse around for a few seconds. You will quickly see erratic mouse
movements and unexpected mouse clicks. CuteMouse (ctmouse.exe) in
FreeDOS doesn't try to re-sync the mouse stream.
Fixes: 7abe7eb294 ("ps2: Fix mouse stream corruption due to lost data")
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
hw/input/ps2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 72cdb80ae1..d9f79e8260 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -645,7 +645,8 @@ void ps2_keyboard_set_translation(void *opaque, int mode)
static int ps2_mouse_send_packet(PS2MouseState *s)
{
- const int needed = 3 + (s->mouse_type - 2);
+ /* IMPS/2 and IMEX send 4 bytes, PS2 sends 3 bytes */
+ const int needed = s->mouse_type ? 4 : 3;
unsigned int b;
int dx1, dy1, dz1;
--
2.26.2
- [PATCH v3 00/11] PS/2 controller related fixes, Volker Rümelin, 2021/05/15
- [PATCH v3 01/11] ps2: fix mouse stream corruption,
Volker Rümelin <=
- [PATCH v3 04/11] pckbd: split out interrupt line changing code, Volker Rümelin, 2021/05/15
- [PATCH v3 03/11] ps2: don't deassert irq twice if queue is empty, Volker Rümelin, 2021/05/15
- [PATCH v3 05/11] pckbd: don't update OBF flags if KBD_STAT_OBF is set, Volker Rümelin, 2021/05/15
- [PATCH v3 08/11] pckbd: add controller response queue, Volker Rümelin, 2021/05/15
- [PATCH v3 02/11] ps2: don't raise an interrupt if queue is full, Volker Rümelin, 2021/05/15
- [PATCH v3 06/11] pckbd: PS/2 keyboard throttle, Volker Rümelin, 2021/05/15
- [PATCH v3 09/11] pckbd: add function kbd_pending(), Volker Rümelin, 2021/05/15
- [PATCH v3 07/11] pckbd: add state variable for interrupt source, Volker Rümelin, 2021/05/15