Skip to content

Commit

Permalink
qxl: fix qxl_set_dirty call in qxl_dirty_one_surface
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Message-id: [email protected]
  • Loading branch information
kraxel committed Jul 20, 2016
1 parent 5d32173 commit e0127d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions hw/display/qxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion hw/display/trace-events
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ qxl_spice_reset_image_cache(int qid) "%d"
qxl_spice_reset_memslots(int qid) "%d"
qxl_spice_update_area(int qid, uint32_t surface_id, uint32_t left, uint32_t right, uint32_t top, uint32_t bottom) "%d sid=%d [%d,%d,%d,%d]"
qxl_spice_update_area_rest(int qid, uint32_t num_dirty_rects, uint32_t clear_dirty_region) "%d #d=%d clear=%d"
qxl_surfaces_dirty(int qid, int offset, int size) "%d offset=%d size=%d"
qxl_surfaces_dirty(int qid, uint64_t offset, uint64_t size) "%d offset=0x%"PRIx64" size=0x%"PRIx64
qxl_send_events(int qid, uint32_t events) "%d %d"
qxl_send_events_vm_stopped(int qid, uint32_t events) "%d %d"
qxl_set_guest_bug(int qid) "%d"
Expand Down

0 comments on commit e0127d2

Please sign in to comment.