aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-05-05 16:30:59 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2017-05-05 16:31:28 +0100
commitdd76c10f9fa25f1117d28bca09c6bce0c53d2a3f (patch)
tree98e62f9091ebb41b4878874a820f5c31a2075c3b /hw
parent317134bb54bbaf13548c35d92cb00c650a18e32f (diff)
parent2222e0a633070f7f3eafcc9d0e95e7f1a4e6fe36 (diff)
Merge remote-tracking branch 'kraxel/tags/pull-input-20170504-1' into staging
input: limit kbd queue depth input: don't queue delay if paused input: Add trace event for empty keyboard queue # gpg: Signature made Thu 04 May 2017 06:48:37 AM BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * kraxel/tags/pull-input-20170504-1: input: Add trace event for empty keyboard queue input: don't queue delay if paused input: limit kbd queue depth Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/input/hid.c4
-rw-r--r--hw/input/trace-events1
2 files changed, 5 insertions, 0 deletions
diff --git a/hw/input/hid.c b/hw/input/hid.c
index fa9cc4c616..93887ecc43 100644
--- a/hw/input/hid.c
+++ b/hw/input/hid.c
@@ -256,6 +256,10 @@ static void hid_keyboard_process_keycode(HIDState *hs)
slot = hs->head & QUEUE_MASK; QUEUE_INCR(hs->head); hs->n--;
keycode = hs->kbd.keycodes[slot];
+ if (!hs->n) {
+ trace_hid_kbd_queue_empty();
+ }
+
key = keycode & 0x7f;
index = key | ((hs->kbd.modifiers & (1 << 8)) >> 1);
hid_code = hid_usage_keys[index];
diff --git a/hw/input/trace-events b/hw/input/trace-events
index f3bfbede5c..5a87818b49 100644
--- a/hw/input/trace-events
+++ b/hw/input/trace-events
@@ -24,6 +24,7 @@ milkymist_softusb_pulse_irq(void) "Pulse IRQ"
# hw/input/hid.c
hid_kbd_queue_full(void) "queue full"
+hid_kbd_queue_empty(void) "queue empty"
# hw/input/virtio
virtio_input_queue_full(void) "queue full"