summaryrefslogtreecommitdiffstats
path: root/hw/input/virtio-input-hid.c
diff options
context:
space:
mode:
authorLadi Prosek2016-04-08 17:21:33 +0200
committerGerd Hoffmann2016-04-13 15:52:28 +0200
commit0263b3a72fbd2ac9ba59ecc2449a9bc53ccf6fb3 (patch)
tree735ddcd826a5a287013d956a1f1e407c2741cb4b /hw/input/virtio-input-hid.c
parentvirtio-input: add live migration support (diff)
downloadqemu-0263b3a72fbd2ac9ba59ecc2449a9bc53ccf6fb3.tar.gz
qemu-0263b3a72fbd2ac9ba59ecc2449a9bc53ccf6fb3.tar.xz
qemu-0263b3a72fbd2ac9ba59ecc2449a9bc53ccf6fb3.zip
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. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1460128893-10244-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/input/virtio-input-hid.c')
-rw-r--r--hw/input/virtio-input-hid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c
index fe6d37fd73..3ee0c1814a 100644
--- a/hw/input/virtio-input-hid.c
+++ b/hw/input/virtio-input-hid.c
@@ -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 */ },
};