usb-hid: bind an absolute pointer, and plumb EV_ABS through
Groundwork for usb-tablet, which is the fix for the guest cursor and the
host's never being in the same place: a PS/2 mouse reports how far it
moved, two pointers accumulating deltas independently drift apart, and no
amount of care in the compositor can make them agree. An absolute device
reports where it is, so they coincide by construction.
- the HID driver no longer matches the boot subclass only. usb-tablet
declares subclass 0 and was refused at the door; hid_probe decides
what an interface actually is, and still declines what it cannot make
sense of.
- a non-boot HID interface is taken to be an absolute pointer and is
not asked for boot protocol, which it does not have -- that request
failing is what stopped it binding.
- tablet_report decodes the fixed 6-byte layout (buttons, 16-bit X,
16-bit Y, wheel) and scales the logical range to pixels there,
because it is the only place that knows the range.
- input_mouse_abs reports EV_ABS/ABS_X/ABS_Y so a reader can tell an
absolute position from a delta, and mouse_set_abs places the pointer
rather than nudging it.
- Schcom treats EV_ABS as authoritative and EV_REL as a nudge.
The device binds and identifies correctly: "usb-hid: tablet (absolute) on
slot 1, endpoint 0x81 every 4 ms".
It is NOT finished, and QEMU_INPUT is empty by default because of it. No
reports have yet been observed arriving on the tablet's interrupt
endpoint, so making it the default pointer would trade a cursor that
drifts for one that does not move at all. Opt in with
make qemu QEMU_INPUT='-device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0'
Next step is to find out why nothing arrives: whether the first transfer
is queued but never completes, whether a completion needs re-arming for
this endpoint, or whether QEMU is not routing motion to the tablet at all
(`info mice`).
bootcheck 108 [ok], schcom-test passes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
bf9ac843f7
commit
8b7b8df74f
9 changed files with 174 additions and 11 deletions
|
|
@ -49,6 +49,11 @@
|
|||
#define USB_HID_SUBCLASS_BOOT 0x01
|
||||
#define USB_HID_PROTO_KEYBOARD 0x01
|
||||
#define USB_HID_PROTO_MOUSE 0x02
|
||||
// Not a USB value: bInterfaceProtocol has no code for "absolute pointer".
|
||||
// A HID device that claims neither boot protocol is treated as a tablet, which
|
||||
// is what a VM offers so its cursor and the guest's can agree. Kept out of the
|
||||
// 0x00-0x02 range the specification defines so it cannot collide.
|
||||
#define USB_HID_PROTO_TABLET 0x80
|
||||
|
||||
// Bus speeds.
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in a new issue