qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zack Marvel <zpmarvel@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
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 09:37:59 -0700	[thread overview]
Message-ID: <293978ea-bb78-066e-dbe8-f93b2165d28d@gmail.com> (raw)
In-Reply-To: <CAFEAcA8BB=ka9nPv9-okHhHwXOAbfbaXs9OFn4bNkbU+b-H+FQ@mail.gmail.com>

Peter,

Thanks for the quick review. You're right, I misunderstood the API and 
the bug is in ui/gtk.c.

Thanks,
Zack M

On 2/21/21 8:19 AM, Peter Maydell wrote:
> 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 16:39 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
2021-02-21 16:37   ` Zack Marvel [this message]

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=293978ea-bb78-066e-dbe8-f93b2165d28d@gmail.com \
    --to=zpmarvel@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).