~ubuntu-branches/ubuntu/vivid/qemu/vivid

« back to all changes in this revision

Viewing changes to debian/patches/ubuntu/linaro/0027-tsc2005-rearrange-pin_update-timer_tick.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-25 22:31:43 UTC
  • mfrom: (1.8.5)
  • Revision ID: package-import@ubuntu.com-20140225223143-odhqxfc60wxrjl15
Tags: 2.0.0~rc1+dfsg-0ubuntu1
* Merge 2.0.0-rc1
* debian/rules: consolidate ppc filter entries.
* Move qemu-system-arch64 into qemu-system-arm
* debian/patches/define-trusty-machine-type.patch: define a trusty machine
  type, currently the same as pc-i440fx-2.0, to put is in a better position
  to enable live migrations from trusty onward.  (LP: #1294823)
* debian/control: build-dep on libfdt >= 1.4.0  (LP: #1295072)
* Merge latest upstream git to commit dc9528f
* Debian/rules:
  - remove -enable-uname-release=2.6.32
  - don't make the aarch64 target Ubuntu-specific.
* Remove patches which are now upstream:
  - fix-smb-security-share.patch
  - slirp-smb-redirect-port-445-too.patch 
  - linux-user-Implement-sendmmsg-syscall.patch (better version is upstream)
  - signal-added-a-wrapper-for-sigprocmask-function.patch
  - ubuntu/signal-sigsegv-protection-on-do_sigprocmask.patch
  - ubuntu/Don-t-block-SIGSEGV-at-more-places.patch
  - ubuntu/ppc-force-cpu-threads-count-to-be-power-of-2.patch
* add link for /usr/share/qemu/bios-256k.bin
* Remove all linaro patches.
* Remove all arm64/ patches.  Many but not all are upstream.
* Remove CVE-2013-4377.patch which is upstream.
* debian/control-in: don't make qemu-system-aarch64 ubuntu-specific

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 2c7c6abd1c972d177e73853eaf750ed3216c18f5 Mon Sep 17 00:00:00 2001
2
 
From: =?UTF-8?q?Juha=20Riihim=C3=A4ki?= <juha.riihimaki@nokia.com>
3
 
Date: Mon, 18 Feb 2013 16:58:28 +0000
4
 
Subject: [PATCH 27/70] tsc2005: rearrange pin_update/timer_tick
5
 
 
6
 
Rearrange the division of work between pin_update and
7
 
timer_tick functions.
8
 
 
9
 
TODO: this has the look of a bug fix but I have not identified what.
10
 
---
11
 
 hw/input/tsc2005.c | 74 +++++++++++++++++++++++++++++++-----------------------
12
 
 1 file changed, 43 insertions(+), 31 deletions(-)
13
 
 
14
 
diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c
15
 
index 50f8163..7554fb6 100644
16
 
--- a/hw/input/tsc2005.c
17
 
+++ b/hw/input/tsc2005.c
18
 
@@ -2,7 +2,7 @@
19
 
  * TI TSC2005 emulator.
20
 
  *
21
 
  * Copyright (c) 2006 Andrzej Zaborowski  <balrog@zabor.org>
22
 
- * Copyright (C) 2008 Nokia Corporation
23
 
+ * Copyright (c) 2009-2010 Nokia Corporation
24
 
  *
25
 
  * This program is free software; you can redistribute it and/or
26
 
  * modify it under the terms of the GNU General Public License as
27
 
@@ -274,29 +274,16 @@ static void tsc2005_write(TSC2005State *s, int reg, uint16_t data)
28
 
 static void tsc2005_pin_update(TSC2005State *s)
29
 
 {
30
 
     int64_t expires;
31
 
-    int pin_state;
32
 
-
33
 
-    switch (s->pin_func) {
34
 
-    case 0:
35
 
-        pin_state = !s->pressure && !!s->dav;
36
 
-        break;
37
 
-    case 1:
38
 
-    case 3:
39
 
-    default:
40
 
-        pin_state = !s->dav;
41
 
-        break;
42
 
-    case 2:
43
 
-        pin_state = !s->pressure;
44
 
-    }
45
 
-
46
 
-    if (pin_state != s->irq) {
47
 
-        s->irq = pin_state;
48
 
-        qemu_set_irq(s->pint, s->irq);
49
 
-    }
50
 
-
51
 
+    TRACE("nextf=%d, press=%d, ena=%d, busy=%d, dav=0x%04x, irq=%d",
52
 
+          s->nextfunction, s->pressure, s->enabled, s->busy, s->dav, s->irq);
53
 
     switch (s->nextfunction) {
54
 
     case TSC_MODE_XYZ_SCAN:
55
 
     case TSC_MODE_XY_SCAN:
56
 
+            if (!s->pin_func && !s->dav) {
57
 
+                TRACE("all values read, lowering irq");
58
 
+                s->irq = 0;
59
 
+                qemu_set_irq(s->pint, s->irq);
60
 
+            }
61
 
         if (!s->host_mode && s->dav)
62
 
             s->enabled = 0;
63
 
         if (!s->pressure)
64
 
@@ -329,15 +316,15 @@ static void tsc2005_pin_update(TSC2005State *s)
65
 
         return;
66
 
     }
67
 
 
68
 
-    if (!s->enabled || s->busy)
69
 
-        return;
70
 
-
71
 
-    s->busy = 1;
72
 
-    s->precision = s->nextprecision;
73
 
-    s->function = s->nextfunction;
74
 
-    s->pdst = !s->pnd0;        /* Synchronised on internal clock */
75
 
-    expires = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (get_ticks_per_sec() >> 7);
76
 
-    timer_mod(s->timer, expires);
77
 
+    if (s->enabled && !s->busy) {
78
 
+        s->busy = 1;
79
 
+        s->precision = s->nextprecision;
80
 
+        s->function = s->nextfunction;
81
 
+        s->pdst = !s->pnd0;    /* Synchronised on internal clock */
82
 
+        expires = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)
83
 
+            + (get_ticks_per_sec() >> 7);
84
 
+        timer_mod(s->timer, expires);
85
 
+    }
86
 
 }
87
 
 
88
 
 static void tsc2005_reset(TSC2005State *s)
89
 
@@ -444,6 +431,7 @@ uint32_t tsc2005_txrx(void *opaque, uint32_t value, int len)
90
 
 
91
 
 static void tsc2005_timer_tick(void *opaque)
92
 
 {
93
 
+    int pin_state;
94
 
     TSC2005State *s = opaque;
95
 
 
96
 
     /* Timer ticked -- a set of conversions has been finished.  */
97
 
@@ -453,10 +441,34 @@ static void tsc2005_timer_tick(void *opaque)
98
 
         return;
99
 
     }
100
 
 
101
 
+    switch (s->pin_func) {
102
 
+    case 0:
103
 
+        pin_state = s->pressure || !s->dav;
104
 
+        break;
105
 
+    case 1:
106
 
+    case 3:
107
 
+    default:
108
 
+        pin_state = !s->dav;
109
 
+        break;
110
 
+    case 2:
111
 
+        pin_state = s->pressure;
112
 
+    }
113
 
     s->busy = 0;
114
 
-    s->dav |= mode_regs[s->function];
115
 
+    if (!s->dav) {
116
 
+        TRACE("report new conversions ready");
117
 
+        s->dav |= mode_regs[s->function];
118
 
+    }
119
 
+    TRACE("pin_func=%d, pin_state=%d, pressure=%d, irq=%d, dav=0x%04x",
120
 
+          s->pin_func, pin_state, s->pressure, s->irq, s->dav);
121
 
     s->function = -1;
122
 
     tsc2005_pin_update(s);
123
 
+
124
 
+    if (pin_state != s->irq) {
125
 
+        TRACE("changing IRQ state to %d", pin_state);
126
 
+        s->irq = pin_state;
127
 
+        qemu_set_irq(s->pint, s->irq);
128
 
+    }
129
 
+    TRACE("done");
130
 
 }
131
 
 
132
 
 static void tsc2005_touchscreen_event(void *opaque,
133
 
1.8.5.2
134