All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Zack Marvel <zpmarvel@gmail.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH] hw/char/pl011: fix receiving multiple chars
Date: Sun, 21 Feb 2021 15:19:33 +0000	[thread overview]
Message-ID: <CAFEAcA8BB=ka9nPv9-okHhHwXOAbfbaXs9OFn4bNkbU+b-H+FQ@mail.gmail.com> (raw)
In-Reply-To: <20210221150430.6223-1-zpmarvel@gmail.com>

On Sun, 21 Feb 2021 at 15:04, Zack Marvel <zpmarvel@gmail.com> wrote:
>
> When using the GTK UI with libvte, multicharacter keystrokes are not
> sent correctly (such as arrow keys). This is not an issue for e.g. the
> SDL UI because qemu_chr_be_write is called with len=1 for each character
> (SDL sends more than once keystroke).
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1407808
>
> Signed-off-by: Zack Marvel <zpmarvel@gmail.com>

> @@ -300,7 +300,9 @@ static void pl011_put_fifo(void *opaque, uint32_t value)
>
>  static void pl011_receive(void *opaque, const uint8_t *buf, int size)
>  {
> -    pl011_put_fifo(opaque, *buf);
> +    for (int i = 0; i < size; i++) {
> +        pl011_put_fifo(opaque, buf[i]);
> +    }
>  }

I think this is a bug in whatever is on the other end
of the chardev connection. The pl011 can_receive routine
only ever returns 0 or 1, so it is an error for the
code calling its receive function to ever pass a
size that is greater than 1.

thanks
-- PMM


  reply	other threads:[~2021-02-21 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 15:04 [PATCH] hw/char/pl011: fix receiving multiple chars Zack Marvel
2021-02-21 15:19 ` Peter Maydell [this message]
2021-02-21 16:37   ` Zack Marvel

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='CAFEAcA8BB=ka9nPv9-okHhHwXOAbfbaXs9OFn4bNkbU+b-H+FQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zpmarvel@gmail.com \
    /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.