qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] adb-mouse: convert to use QemuInputHandler


From: Mark Cave-Ayland
Subject: Re: [PATCH v2] adb-mouse: convert to use QemuInputHandler
Date: Tue, 10 Sep 2024 21:36:09 +0100
User-agent: Mozilla Thunderbird

On 10/09/2024 15:48, Philippe Mathieu-Daudé wrote:

Hi Mark,

On 7/9/24 19:37, Mark Cave-Ayland wrote:
Update the ADB mouse implementation to use QemuInputHandler instead of the
legacy qemu_add_mouse_event_handler() function.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
  hw/input/adb-mouse.c | 56 ++++++++++++++++++++++++++++++++++++--------
  1 file changed, 46 insertions(+), 10 deletions(-)

v2:
- Rebase onto master

- Replace (DeviceState *)s with dev in adb_mouse_realize() as suggested by
   Phil

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

+static const QemuInputHandler adb_mouse_handler = {
+    .name  = "QEMU ADB Mouse",
+    .mask  = INPUT_EVENT_MASK_BTN | INPUT_EVENT_MASK_REL,
+    .event = adb_mouse_handle_event,
+};

Do you mind if you amend your comment from v1 for clarity?
I could squash the following and take in my next PR:

diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c
index c0e0282fee..15e6e91804 100644
--- a/hw/input/adb-mouse.c
+++ b/hw/input/adb-mouse.c
@@ -97,6 +97,11 @@ static const QemuInputHandler adb_mouse_handler = {
      .name  = "QEMU ADB Mouse",
      .mask  = INPUT_EVENT_MASK_BTN | INPUT_EVENT_MASK_REL,
      .event = adb_mouse_handle_event,
+    /*
+     * We do not need the .sync handler because unlike e.g. PS/2 where async
+     * mouse events are sent over the serial port, an ADB mouse is constantly
+     * polled by the host via the adb_mouse_poll() callback.
+     */
  };

Regards,

Phil.

Sure! If you think it is useful to an external set of eyes, then feel free to 
add it in.


ATB,

Mark.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]