qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] ps2: Clear the queue on PS/2 mouse reset and obey device disable
@ 2018-05-07 12:00 geoff
  2018-05-07 12:21 ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: geoff @ 2018-05-07 12:00 UTC (permalink / raw)
  To: qemu-devel

This allows guest's to correctly reinitialize and identify the mouse
should the guest decide to re-scan or reset during mouse input events.

Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
---
  hw/input/ps2.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 06f5d2ac4a..6edf046820 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -673,6 +673,9 @@ static void ps2_mouse_sync(DeviceState *dev)
  {
      PS2MouseState *s = (PS2MouseState *)dev;

+    if (!(s->mouse_status & MOUSE_STATUS_ENABLED))
+        return;
+
      if (s->mouse_buttons) {
          qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER);
      }
@@ -776,6 +779,7 @@ void ps2_write_mouse(void *opaque, int val)
              s->mouse_resolution = 2;
              s->mouse_status = 0;
              s->mouse_type = 0;
+            ps2_reset_queue(&s->common);
              ps2_queue(&s->common, AUX_ACK);
              ps2_queue(&s->common, 0xaa);
              ps2_queue(&s->common, s->mouse_type);
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-07 12:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-07 12:00 [Qemu-devel] [PATCH 1/2] ps2: Clear the queue on PS/2 mouse reset and obey device disable geoff
2018-05-07 12:21 ` Gerd Hoffmann
2018-05-07 12:26   ` geoff
2018-05-07 12:41     ` Gerd Hoffmann
2018-05-07 12:42       ` geoff

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).