From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH for-2.4 2/2] framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer
Date: Thu, 23 Jul 2015 12:28:22 +0200 [thread overview]
Message-ID: <55B0C1C6.3090502@redhat.com> (raw)
In-Reply-To: <CAFEAcA_aV37eh6qLNpmEGkUkqCFr=OENGTCTdQ=HZ-4vM6F26g@mail.gmail.com>
On 23/07/2015 12:22, Peter Maydell wrote:
> I have a few minor nits below, but the patch works and looks
> good overall.
>
> At the moment the pattern in all the callsites is
> if (s->invalidate) {
> framebuffer_update_memory_section(...);
> }
> framebuffer_update_display(...);
>
> What's the rationale for not just having framebuffer_update_display()
> do this -- that we might in future want to be cleverer about how
> often we call framebuffer_update_memory_section() ?
Yes. I initially set out adding framebuffer_update_memory_section calls
after the register writes, but using s->invalidate is simpler albeit
marginally less efficient.
>> + memory_region_reset_dirty(mem, mem_section->offset_within_region, src_len,
>> DIRTY_MEMORY_VGA);
>
> Not new in this patch, but isn't there technically a race
> condition if the guest writes to the framebuffer memory
> after we've done the memory_region_get_dirty() for that
> row but before we clear all the dirty bits again here?
Yes, I think you're right.
>>
>> +void framebuffer_update_memory_section(
>> + MemoryRegionSection *mem_section,
>> + MemoryRegion *root,
>> + hwaddr base,
>> + unsigned rows,
>> + unsigned src_width);
>
> A doc-comment header would be nice.
Ok.
>>
>> + if (s->invalidated) {
>> + framebuffer_update_memory_section(&s->fbsection, s->sysmem,
>> + addr, src_width, s->yres);
>
> Aren't src_width and s->yres in the wrong order here?
> They should be in the same order as they are in the
> (ditto in the other hunks in the patch for this file).
Ouch, indeed.
Paolo
prev parent reply other threads:[~2015-07-23 10:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 12:46 [Qemu-devel] [PATCH for-2.4 0/2] framebuffer: automatically set DIRTY_MEMORY_VGA Paolo Bonzini
2015-07-22 12:46 ` [Qemu-devel] [PATCH for-2.4 1/2] memory: count number of active VGA logging clients Paolo Bonzini
2015-07-23 9:45 ` Peter Maydell
2015-07-22 12:46 ` [Qemu-devel] [PATCH for-2.4 2/2] framebuffer: set DIRTY_MEMORY_VGA on RAM that is used for the framebuffer Paolo Bonzini
2015-07-23 10:22 ` Peter Maydell
2015-07-23 10:28 ` Paolo Bonzini [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=55B0C1C6.3090502@redhat.com \
--to=pbonzini@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 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).