diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-09-07 13:27:20 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-09-07 13:27:20 +0100 |
commit | 62f9256052df85194faa33137bbe0afb1c95b6e6 (patch) | |
tree | bc1f0f0fdca85c96707621f5b4ce22525fafdb0a /hw/display/cirrus_vga.c | |
parent | 7c37270b3fbe3d034ba80e488761461676e21eb4 (diff) | |
parent | 5fcf787582dd911df3a971718010bfca5a20e61d (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20200904-pull-request' into staging
vga: fixes for cirrus and virtio-gpu.
# gpg: Signature made Fri 04 Sep 2020 12:26:36 BST
# gpg: using RSA key 4CB6D8EED3E87138
# 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/vga-20200904-pull-request:
cirrus: handle wraparound in cirrus_invalidate_region
virtio-gpu: fix unmap the already mapped items
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/display/cirrus_vga.c')
-rw-r--r-- | hw/display/cirrus_vga.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 02d9ed0bd4..41e71af08a 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -640,10 +640,16 @@ static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin, } for (y = 0; y < lines; y++) { - off_cur = off_begin; + off_cur = off_begin & s->cirrus_addr_mask; off_cur_end = ((off_cur + bytesperline - 1) & s->cirrus_addr_mask) + 1; - assert(off_cur_end >= off_cur); - memory_region_set_dirty(&s->vga.vram, off_cur, off_cur_end - off_cur); + if (off_cur_end >= off_cur) { + memory_region_set_dirty(&s->vga.vram, off_cur, off_cur_end - off_cur); + } else { + /* wraparound */ + memory_region_set_dirty(&s->vga.vram, off_cur, + s->cirrus_addr_mask + 1 - off_cur); + memory_region_set_dirty(&s->vga.vram, 0, off_cur_end); + } off_begin += off_pitch; } } |