mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/kraxel/tags/input-20210526-pull-request' into staging
input: a bunch of ps2 fixes. # gpg: Signature made Wed 26 May 2021 15:06:12 BST # gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/input-20210526-pull-request: hw/input/ps2: Use ps2_raise_irq() instead of open coding it pckbd: clear outport_present in outer pre_load() pckbd: remove duplicated keyboard and mouse defines pckbd: correctly disable PS/2 communication pckbd: add function kbd_pending() pckbd: add controller response queue pckbd: add state variable for interrupt source pckbd: PS/2 keyboard throttle pckbd: don't update OBF flags if KBD_STAT_OBF is set pckbd: split out interrupt line changing code ps2: don't deassert irq twice if queue is empty ps2: don't raise an interrupt if queue is full ps2: fix mouse stream corruption hw/input: expand trace info reported for ps2 device Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
|
||||
GlobalProperty hw_compat_6_0[] = {
|
||||
{ "gpex-pcihost", "allow-unmapped-accesses", "false" },
|
||||
{ "i8042", "extended-state", "false"},
|
||||
};
|
||||
const size_t hw_compat_6_0_len = G_N_ELEMENTS(hw_compat_6_0);
|
||||
|
||||
|
||||
+275
-76
File diff suppressed because it is too large
Load Diff
+15
-7
@@ -212,8 +212,12 @@ void ps2_raise_irq(PS2State *s)
|
||||
|
||||
void ps2_queue(PS2State *s, int b)
|
||||
{
|
||||
if (PS2_QUEUE_SIZE - s->queue.count < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
ps2_queue_noirq(s, b);
|
||||
s->update_irq(s->update_arg, 1);
|
||||
ps2_raise_irq(s);
|
||||
}
|
||||
|
||||
void ps2_queue_2(PS2State *s, int b1, int b2)
|
||||
@@ -224,7 +228,7 @@ void ps2_queue_2(PS2State *s, int b1, int b2)
|
||||
|
||||
ps2_queue_noirq(s, b1);
|
||||
ps2_queue_noirq(s, b2);
|
||||
s->update_irq(s->update_arg, 1);
|
||||
ps2_raise_irq(s);
|
||||
}
|
||||
|
||||
void ps2_queue_3(PS2State *s, int b1, int b2, int b3)
|
||||
@@ -236,7 +240,7 @@ void ps2_queue_3(PS2State *s, int b1, int b2, int b3)
|
||||
ps2_queue_noirq(s, b1);
|
||||
ps2_queue_noirq(s, b2);
|
||||
ps2_queue_noirq(s, b3);
|
||||
s->update_irq(s->update_arg, 1);
|
||||
ps2_raise_irq(s);
|
||||
}
|
||||
|
||||
void ps2_queue_4(PS2State *s, int b1, int b2, int b3, int b4)
|
||||
@@ -249,7 +253,7 @@ void ps2_queue_4(PS2State *s, int b1, int b2, int b3, int b4)
|
||||
ps2_queue_noirq(s, b2);
|
||||
ps2_queue_noirq(s, b3);
|
||||
ps2_queue_noirq(s, b4);
|
||||
s->update_irq(s->update_arg, 1);
|
||||
ps2_raise_irq(s);
|
||||
}
|
||||
|
||||
/* keycode is the untranslated scancode in the current scancode set. */
|
||||
@@ -293,7 +297,8 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src,
|
||||
qcode = qemu_input_key_value_to_qcode(key->key);
|
||||
|
||||
mod = ps2_modifier_bit(qcode);
|
||||
trace_ps2_keyboard_event(s, qcode, key->down, mod, s->modifiers);
|
||||
trace_ps2_keyboard_event(s, qcode, key->down, mod,
|
||||
s->modifiers, s->scancode_set, s->translate);
|
||||
if (key->down) {
|
||||
s->modifiers |= mod;
|
||||
} else {
|
||||
@@ -515,7 +520,9 @@ uint32_t ps2_read_data(PS2State *s)
|
||||
/* reading deasserts IRQ */
|
||||
s->update_irq(s->update_arg, 0);
|
||||
/* reassert IRQs if data left */
|
||||
s->update_irq(s->update_arg, q->count != 0);
|
||||
if (q->count) {
|
||||
s->update_irq(s->update_arg, 1);
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
@@ -645,7 +652,8 @@ void ps2_keyboard_set_translation(void *opaque, int mode)
|
||||
|
||||
static int ps2_mouse_send_packet(PS2MouseState *s)
|
||||
{
|
||||
const int needed = 3 + (s->mouse_type - 2);
|
||||
/* IMPS/2 and IMEX send 4 bytes, PS2 sends 3 bytes */
|
||||
const int needed = s->mouse_type ? 4 : 3;
|
||||
unsigned int b;
|
||||
int dx1, dy1, dz1;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ pckbd_kbd_write_data(uint64_t val) "0x%02"PRIx64
|
||||
|
||||
# ps2.c
|
||||
ps2_put_keycode(void *opaque, int keycode) "%p keycode 0x%02x"
|
||||
ps2_keyboard_event(void *opaque, int qcode, int down, unsigned int modifier, unsigned int modifiers) "%p qcode %d down %d modifier 0x%x modifiers 0x%x"
|
||||
ps2_keyboard_event(void *opaque, int qcode, int down, unsigned int modifier, unsigned int modifiers, int set, int xlate) "%p qcode %d down %d modifier 0x%x modifiers 0x%x set %d xlate %d"
|
||||
ps2_read_data(void *opaque) "%p"
|
||||
ps2_set_ledstate(void *s, int ledstate) "%p ledstate %d"
|
||||
ps2_reset_keyboard(void *s) "%p"
|
||||
|
||||
Reference in New Issue
Block a user