vga: fixes for cirrus and virtio-gpu.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABCgAGBQJfUiRsAAoJEEy22O7T6HE4Tv4QAIhkJ8uyt4Z6OZYZclAs86Ny 3z96+WCsuzCmI+qP8JAnLnegSxdqJgKWpBOQ6I/BdST6hsLJ5+56q+SYkOt27ry9 CJF7l+xZgYuutl8dF4GXR6M8sDjWlKJtMwjFTZvo9/RQ9jm3DHsfFz0zi87oOyhr 3XJM36aR/OMXSouxaPGhrw8tmi+AU0ditOa95NKK8qu872v4fHn2s/L0GKi61Qh9 YoE3N141gFFmkPuWjalSFERc6ozQEf0DzOLK3efTSMHmjBRnzI8SmKUoXBd77+tj enLvRQW0vrGMFziV2sxCs4jJXvvY1QbW+7IOvry6hnRr7sIU+GsRcrBxWlKgCHrR 1Gn2qY+9ALJTBbiGSWXiCfhoAqjZnv4MYWS4bZTuih3SlWgk8An+vIanM5YkVZg0 1JMmEuSwfSFhet12fmR8SOStIGwXHACYTkVr6ITGvThaoAEaBG76wd80kv920ruW F892hq7Al6rm7rZ/hH5FZwXHOqEn8bomOZtl6DN2q5w5waZfzk6FnAVS86b79/18 LvR1pf8xYAhUcckkJWKvk2kDghOjVsNun0o6FY7L3+8MBDHRGcSgJaZ2feAkH2S9 ywUrYSItn0lvmVTvl9WWApRp8uR42f8R2Luf9kSWCzetBn1XAfGHjOiT20WO7jBB tx1oz5kE7sO5FwKXZJE0 =inDV -----END PGP SIGNATURE----- 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>
This commit is contained in:
commit
62f9256052
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -646,9 +646,9 @@ int virtio_gpu_create_mapping_iov(VirtIOGPU *g,
|
||||
uint64_t a = le64_to_cpu(ents[i].addr);
|
||||
uint32_t l = le32_to_cpu(ents[i].length);
|
||||
hwaddr len = l;
|
||||
(*iov)[i].iov_len = l;
|
||||
(*iov)[i].iov_base = dma_memory_map(VIRTIO_DEVICE(g)->dma_as,
|
||||
a, &len, DMA_DIRECTION_TO_DEVICE);
|
||||
(*iov)[i].iov_len = len;
|
||||
if (addr) {
|
||||
(*addr)[i] = a;
|
||||
}
|
||||
@ -656,6 +656,9 @@ int virtio_gpu_create_mapping_iov(VirtIOGPU *g,
|
||||
qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to map MMIO memory for"
|
||||
" resource %d element %d\n",
|
||||
__func__, ab->resource_id, i);
|
||||
if ((*iov)[i].iov_base) {
|
||||
i++; /* cleanup the 'i'th map */
|
||||
}
|
||||
virtio_gpu_cleanup_mapping_iov(g, *iov, i);
|
||||
g_free(ents);
|
||||
*iov = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user