diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-07-13 14:33:06 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-07-20 12:08:14 +0200 |
commit | e0127d2eec9cd5676ea9f3c47c2a7579a02c0466 (patch) | |
tree | 773acae8e5b4e6a0ab0961ab61aec76438813cb6 /hw/display/qxl.c | |
parent | 5d3217340adcb6c4f0e4af5d2b865331eb2ff63d (diff) | |
download | qemu-e0127d2eec9cd5676ea9f3c47c2a7579a02c0466.zip qemu-e0127d2eec9cd5676ea9f3c47c2a7579a02c0466.tar.gz qemu-e0127d2eec9cd5676ea9f3c47c2a7579a02c0466.tar.bz2 |
qxl: fix qxl_set_dirty call in qxl_dirty_one_surface
qxl_set_dirty() expects start and end as range specification.
qxl_dirty_one_surface passes 'size' instead of 'offset + size' as end
parameter. Fix that. Also use uint64_t everywhere while being at it.
Bug was added by "e25139b qxl: set only off-screen surfaces dirty instead
of the whole vram" and carried forward unnoticed by "5cdc402 qxl: fix
surface migration".
Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: 1468413187-22071-1-git-send-email-kraxel@redhat.com
Diffstat (limited to 'hw/display/qxl.c')
-rw-r--r-- | hw/display/qxl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 46cc866..0e2682d 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1816,16 +1816,17 @@ static void qxl_hw_update(void *opaque) static void qxl_dirty_one_surface(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, uint32_t height, int32_t stride) { - uint64_t offset; - uint32_t slot, size; + uint64_t offset, size; + uint32_t slot; bool rc; rc = qxl_get_check_slot_offset(qxl, pqxl, &slot, &offset); assert(rc == true); - size = height * abs(stride); - trace_qxl_surfaces_dirty(qxl->id, (int)offset, size); + size = (uint64_t)height * abs(stride); + trace_qxl_surfaces_dirty(qxl->id, offset, size); qxl_set_dirty(qxl->guest_slots[slot].mr, - qxl->guest_slots[slot].offset + offset, size); + qxl->guest_slots[slot].offset + offset, + qxl->guest_slots[slot].offset + offset + size); } static void qxl_dirty_surfaces(PCIQXLDevice *qxl) |