summaryrefslogtreecommitdiffstats
path: root/meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch')
-rw-r--r--meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch130
1 files changed, 0 insertions, 130 deletions
diff --git a/meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch b/meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch
deleted file mode 100644
index e2ebf67922..0000000000
--- a/meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch
+++ /dev/null
@@ -1,130 +0,0 @@
1From 2ca2078e287174522e3a6229618947d3d285b8c0 Mon Sep 17 00:00:00 2001
2From: François Revol <revol@free.fr>
3Date: Tue, 25 Aug 2009 09:14:10 +0000
4Subject: Fixed wacom emulation
5
6- for absolute mode, scale coordinates to the real device maximum values,
7since some drivers (on Haiku and Linux at least) need them as such,
8and the HID descriptor is boggus on some models anyway,
9- keep the coordinates even when no button is pressed, on real tablet
10the pen is sensed on the surface even without direct contact,
11and drivers expect this,
12- map left button to pressure according to what the Haiku driver wants,
13- map the right button to the pen button,
14- map the middle button to the eraser,
15- use asynchronous reporting as the hid code does, stops the Haiku driver
16(and probably others) from spending 50% cpu polling for changes.
17
18Signed-off-by: François Revol <revol@free.fr>
19Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
20---
21Index: git/hw/usb-wacom.c
22===================================================================
23--- git.orig/hw/usb-wacom.c 2009-11-24 14:10:15.000000000 +0000
24+++ git/hw/usb-wacom.c 2009-11-24 16:39:26.000000000 +0000
25@@ -50,6 +50,8 @@
26 WACOM_MODE_HID = 1,
27 WACOM_MODE_WACOM = 2,
28 } mode;
29+ uint8_t idle;
30+ int changed;
31 } USBWacomState;
32
33 static const uint8_t qemu_wacom_dev_descriptor[] = {
34@@ -125,6 +127,7 @@
35 s->dy += dy1;
36 s->dz += dz1;
37 s->buttons_state = buttons_state;
38+ s->changed = 1;
39 }
40
41 static void usb_wacom_event(void *opaque,
42@@ -132,10 +135,12 @@
43 {
44 USBWacomState *s = opaque;
45
46- s->x = x;
47- s->y = y;
48+ /* scale to Penpartner resolution */
49+ s->x = (x * 5040 / 0x7FFF);
50+ s->y = (y * 3780 / 0x7FFF);
51 s->dz += dz;
52 s->buttons_state = buttons_state;
53+ s->changed = 1;
54 }
55
56 static inline int int_clamp(int val, int vmin, int vmax)
57@@ -199,26 +204,22 @@
58 if (s->buttons_state & MOUSE_EVENT_LBUTTON)
59 b |= 0x01;
60 if (s->buttons_state & MOUSE_EVENT_RBUTTON)
61- b |= 0x02;
62+ b |= 0x40;
63 if (s->buttons_state & MOUSE_EVENT_MBUTTON)
64- b |= 0x04;
65+ b |= 0x20; /* eraser */
66
67 if (len < 7)
68 return 0;
69
70 buf[0] = s->mode;
71- buf[5] = 0x00;
72- if (b) {
73- buf[1] = s->x & 0xff;
74- buf[2] = s->x >> 8;
75- buf[3] = s->y & 0xff;
76- buf[4] = s->y >> 8;
77+ buf[5] = 0x00 | (b & 0xf0);
78+ buf[1] = s->x & 0xff;
79+ buf[2] = s->x >> 8;
80+ buf[3] = s->y & 0xff;
81+ buf[4] = s->y >> 8;
82+ if (b & 0x3f) {
83 buf[6] = 0;
84 } else {
85- buf[1] = 0;
86- buf[2] = 0;
87- buf[3] = 0;
88- buf[4] = 0;
89 buf[6] = (unsigned char) -127;
90 }
91
92@@ -350,7 +351,12 @@
93 else if (s->mode == WACOM_MODE_WACOM)
94 ret = usb_wacom_poll(s, data, length);
95 break;
96+ case HID_GET_IDLE:
97+ ret = 1;
98+ data[0] = s->idle;
99+ break;
100 case HID_SET_IDLE:
101+ s->idle = (uint8_t) (value >> 8);
102 ret = 0;
103 break;
104 default:
105@@ -369,6 +375,9 @@
106 switch (p->pid) {
107 case USB_TOKEN_IN:
108 if (p->devep == 1) {
109+ if (!(s->changed || s->idle))
110+ return USB_RET_NAK;
111+ s->changed = 0;
112 if (s->mode == WACOM_MODE_HID)
113 ret = usb_mouse_poll(s, p->data, p->len);
114 else if (s->mode == WACOM_MODE_WACOM)
115@@ -399,7 +408,6 @@
116 s = qemu_mallocz(sizeof(USBWacomState));
117 s->dev.speed = USB_SPEED_FULL;
118 s->dev.handle_packet = usb_generic_handle_packet;
119-
120 s->dev.handle_reset = usb_wacom_handle_reset;
121 s->dev.handle_control = usb_wacom_handle_control;
122 s->dev.handle_data = usb_wacom_handle_data;
123@@ -407,6 +415,7 @@
124
125 pstrcpy(s->dev.devname, sizeof(s->dev.devname),
126 "QEMU PenPartner Tablet");
127+ s->changed = 1;
128
129 return (USBDevice *) s;
130 }