From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apZ6O-0005g0-Pd for qemu-devel@nongnu.org; Mon, 11 Apr 2016 06:29:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apZ6J-000675-OQ for qemu-devel@nongnu.org; Mon, 11 Apr 2016 06:29:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apZ6J-00066M-JF for qemu-devel@nongnu.org; Mon, 11 Apr 2016 06:29:47 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46EEB47E for ; Mon, 11 Apr 2016 10:29:47 +0000 (UTC) From: Gerd Hoffmann Date: Mon, 11 Apr 2016 12:29:43 +0200 Message-Id: <1460370583-29038-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1460370583-29038-1-git-send-email-kraxel@redhat.com> References: <1460370583-29038-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 5/5] virtio-input: fix emulated tablet axis ranges List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ladi Prosek , Gerd Hoffmann , "Michael S. Tsirkin" From: Ladi Prosek 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 Message-id: 1460128893-10244-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann --- hw/input/virtio-input-hid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index fe6d37f..3ee0c18 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 */ }, }; -- 1.8.3.1