All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: aliguori@us.ibm.com, Jason Wang <jasowang@redhat.com>,
	qemu-devel@nongnu.org, lcapitulino@redhat.com, kraxel@redhat.com,
	lersek@redhat.com
Subject: Re: [Qemu-devel] [PATCH] ps2: add support of auto-repeat
Date: Thu, 16 May 2013 15:17:50 +0800	[thread overview]
Message-ID: <20130516071750.GC3785@t430s.nay.redhat.com> (raw)
In-Reply-To: <CAFEAcA9veHwz9gcJK5k3SpZjCbLY+1Jb2tBLZk1tE_WkDy+XTw@mail.gmail.com>

On Thu, May 16, 2013 at 07:50:35AM +0100, Peter Maydell wrote:
> On 16 May 2013 05:30, Amos Kong <akong@redhat.com> wrote:
> > Guest driver sets repeat rate and delay time by KBD_CMD_SET_RATE,
> > but ps2 backend doesn't process it and no auto-repeat implementation.
> > This patch adds support of auto-repeat feature.
> 
> > diff --git a/hw/input/ps2.c b/hw/input/ps2.c
> > index 3412079..1cfe055 100644
> > --- a/hw/input/ps2.c
> > +++ b/hw/input/ps2.c
> > @@ -94,6 +94,9 @@ typedef struct {
> >      int translate;
> >      int scancode_set; /* 1=XT, 2=AT, 3=PS/2 */
> >      int ledstate;
> > +    int repeat_period; /* typematic period, ms */
> > +    int repeat_delay; /* typematic delay, ms */
> > +    int repeat_key; /* keycode to repeat */
> >  } PS2KbdState;
> >
> >  typedef struct {
> > @@ -146,6 +149,22 @@ void ps2_queue(void *opaque, int b)
> >      s->update_irq(s->update_arg, 1);
> >  }
> >
> > +static QEMUTimer *repeat_timer;
> > +static bool auto_repeat;
> 
> These shouldn't be static -- what would happen
> on a system with two ps2 keyboard models in it?

I will move them to PS2KbdState.


For the migrate issue mentioned by jason, the keyboard state
(repeat_period/repeat_delay/etc) are configured by guest, it
should be saved to vmstate and migrated to dest vm.

If we want the unfinished repeat continue, repeat-timer also
should be migrated, but another key_timer in ui/input.c for
send-key could not be migrated, it means the release event
will be lost.

Do we need to migrate the keyboard state?
 
> You need to reset your qemu_timer in the ps2 reset
> handler, as well; otherwise it could go off unexpectedly
> after a reset. (Though perhaps not if we're simulating
> a human with their finger held down on the key...)

Ok
 
> thanks
> -- PMM

-- 
			Amos.

  reply	other threads:[~2013-05-16  7:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16  4:30 [Qemu-devel] [PATCH] ps2: add support of auto-repeat Amos Kong
2013-05-16  5:30 ` li guang
2013-05-16  6:58   ` Amos Kong
2013-05-16  7:13     ` li guang
2013-05-16  7:28       ` Amos Kong
2013-05-16 15:04     ` Paolo Bonzini
2013-05-16  6:40 ` Jason Wang
2013-05-16  6:50 ` Peter Maydell
2013-05-16  7:17   ` Amos Kong [this message]
2013-05-16  7:23 ` Lei Li
2013-05-16  7:35   ` Amos Kong
2013-05-16  9:11     ` Lei Li
2013-05-16 20:37       ` Amos Kong
2013-05-16 15:09         ` Paolo Bonzini
2013-05-16 15:17           ` Peter Maydell
2013-05-16 15:20             ` Paolo Bonzini
2013-05-21  8:33               ` Amos Kong
2013-05-21  8:38                 ` Paolo Bonzini
2013-05-21  9:04                   ` Amos Kong
2013-05-21  9:51                     ` Amos Kong
2013-05-21  9:54                       ` Paolo Bonzini
2013-05-16 15:03 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130516071750.GC3785@t430s.nay.redhat.com \
    --to=akong@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=lersek@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.