Skip to contentSkip to conversation

virtio-input: fix emulated tablet axis ranges

PATCH New Ladi Prosek 1 participant 1 message Apr 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-input: fix emulated tablet axis ranges

The reported maximum was wrong. The X and Y coordinates are 0-based so if size is 8000 maximum must be 7FFF.

---
 hw/input/virtio-input-hid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/input/virtio-input-hid.c +2 -2
index fe6d37f..3ee0c18 100644
@@ -484,12 +484,12 @@ static struct virtio_input_config virtio_tablet_config[] = {
         .select    = VIRTIO_INPUT_CFG_ABS_INFO,
         .subsel    = ABS_X,
         .size      = sizeof(virtio_input_absinfo),
-        .u.abs.max = const_le32(INPUT_EVENT_ABS_SIZE),
+        .u.abs.max = const_le32(INPUT_EVENT_ABS_SIZE - 1),
     },{
         .select    = VIRTIO_INPUT_CFG_ABS_INFO,
         .subsel    = ABS_Y,
         .size      = sizeof(virtio_input_absinfo),
-        .u.abs.max = const_le32(INPUT_EVENT_ABS_SIZE),
+        .u.abs.max = const_le32(INPUT_EVENT_ABS_SIZE - 1),
     },
     { /* end of list */ },
 };
Signature · 1 line
2.5.5