diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-25 14:37:20 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-25 14:37:20 +0000 |
commit | 1b8493ad41fd107454d5344db3334358abed2490 (patch) | |
tree | 7c67085a304f23d4152ed414ff57473dc479abd9 /meta | |
parent | 429837b61339b9c8a6f5469bcfbb127ceb104a0f (diff) | |
download | poky-1b8493ad41fd107454d5344db3334358abed2490.tar.gz |
qemu: Update to 0.10.6 and add fix wacom emulation issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/conf/distro/include/poky-fixed-revisions.inc | 3 | ||||
-rw-r--r-- | meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch | 130 | ||||
-rw-r--r-- | meta/packages/qemu/qemu_git.bb | 7 |
3 files changed, 136 insertions, 4 deletions
diff --git a/meta/conf/distro/include/poky-fixed-revisions.inc b/meta/conf/distro/include/poky-fixed-revisions.inc index 96ffcf50ba..161eb66f43 100644 --- a/meta/conf/distro/include/poky-fixed-revisions.inc +++ b/meta/conf/distro/include/poky-fixed-revisions.inc | |||
@@ -86,7 +86,8 @@ SRCREV_pn-libowl-av = "398" | |||
86 | SRCREV_pn-owl-video = "394" | 86 | SRCREV_pn-owl-video = "394" |
87 | SRCREV_pn-psplash ?= "422" | 87 | SRCREV_pn-psplash ?= "422" |
88 | #QEMUSRCREV = "6477" | 88 | #QEMUSRCREV = "6477" |
89 | QEMUSRCREV = "9e3a7df77c6c456ff58ab9931cb86e3d5983404d" | 89 | QEMUSRCREV = "9eab386edbf8cf002a731f8204a156f243a47a57" |
90 | #QEMUSRCREV = "1bec86a0bcaac7fa07f3081b3e26b9c7e1ec072c" | ||
90 | SRCREV_pn-qemu-native ?= "${QEMUSRCREV}" | 91 | SRCREV_pn-qemu-native ?= "${QEMUSRCREV}" |
91 | SRCREV_pn-qemu-nativesdk ?= "${QEMUSRCREV}" | 92 | SRCREV_pn-qemu-nativesdk ?= "${QEMUSRCREV}" |
92 | SRCREV_pn-qemu ?= "${QEMUSRCREV}" | 93 | SRCREV_pn-qemu ?= "${QEMUSRCREV}" |
diff --git a/meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch b/meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch new file mode 100644 index 0000000000..e2ebf67922 --- /dev/null +++ b/meta/packages/qemu/qemu-git/2ca2078e287174522e3a6229618947d3d285b8c0.patch | |||
@@ -0,0 +1,130 @@ | |||
1 | From 2ca2078e287174522e3a6229618947d3d285b8c0 Mon Sep 17 00:00:00 2001 | ||
2 | From: François Revol <revol@free.fr> | ||
3 | Date: Tue, 25 Aug 2009 09:14:10 +0000 | ||
4 | Subject: Fixed wacom emulation | ||
5 | |||
6 | - for absolute mode, scale coordinates to the real device maximum values, | ||
7 | since some drivers (on Haiku and Linux at least) need them as such, | ||
8 | and the HID descriptor is boggus on some models anyway, | ||
9 | - keep the coordinates even when no button is pressed, on real tablet | ||
10 | the pen is sensed on the surface even without direct contact, | ||
11 | and 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 | |||
18 | Signed-off-by: François Revol <revol@free.fr> | ||
19 | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> | ||
20 | --- | ||
21 | Index: 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 | } | ||
diff --git a/meta/packages/qemu/qemu_git.bb b/meta/packages/qemu/qemu_git.bb index c4e48a9068..057543530f 100644 --- a/meta/packages/qemu/qemu_git.bb +++ b/meta/packages/qemu/qemu_git.bb | |||
@@ -1,7 +1,7 @@ | |||
1 | LICENSE = "GPL" | 1 | LICENSE = "GPL" |
2 | DEPENDS = "zlib" | 2 | DEPENDS = "zlib" |
3 | PV = "0.10.2+git${SRCREV}" | 3 | PV = "0.10.6+git${SRCREV}" |
4 | PR = "r6" | 4 | PR = "r0" |
5 | 5 | ||
6 | FILESPATH = "${FILE_DIRNAME}/qemu-${PV}/:${FILE_DIRNAME}/qemu-git/" | 6 | FILESPATH = "${FILE_DIRNAME}/qemu-${PV}/:${FILE_DIRNAME}/qemu-git/" |
7 | 7 | ||
@@ -13,7 +13,8 @@ SRC_URI = "\ | |||
13 | file://fix-dirent.patch;patch=1 \ | 13 | file://fix-dirent.patch;patch=1 \ |
14 | file://fix-nogl.patch;patch=1 \ | 14 | file://fix-nogl.patch;patch=1 \ |
15 | file://zlibsearch.patch;patch=1 \ | 15 | file://zlibsearch.patch;patch=1 \ |
16 | file://qemugl-allow-glxcontext-release.patch;patch=1 " | 16 | file://qemugl-allow-glxcontext-release.patch;patch=1 \ |
17 | file://2ca2078e287174522e3a6229618947d3d285b8c0.patch;patch=1" | ||
17 | 18 | ||
18 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
19 | 20 | ||