qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-2.7 0/1] qxl: fix qxl_set_dirty call in qxl_dirty_one_surface
@ 2016-07-20 11:29 Gerd Hoffmann
  2016-07-20 11:29 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
  2016-07-20 19:20 ` [Qemu-devel] [PULL for-2.7 0/1] " Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2016-07-20 11:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

vga patch queue with a single qxl bugfix.

please pull,
  Gerd

The following changes since commit 5d3217340adcb6c4f0e4af5d2b865331eb2ff63d:

  disas: Fix ATTRIBUTE_UNUSED define clash with ALSA headers (2016-07-19 16:40:39 +0100)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/pull-vga-20160720-1

for you to fetch changes up to e0127d2eec9cd5676ea9f3c47c2a7579a02c0466:

  qxl: fix qxl_set_dirty call in qxl_dirty_one_surface (2016-07-20 12:08:14 +0200)

----------------------------------------------------------------
qxl: fix qxl_set_dirty call in qxl_dirty_one_surface

----------------------------------------------------------------
Gerd Hoffmann (1):
      qxl: fix qxl_set_dirty call in qxl_dirty_one_surface

 hw/display/qxl.c        | 11 ++++++-----
 hw/display/trace-events |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] qxl: fix qxl_set_dirty call in qxl_dirty_one_surface
  2016-07-20 11:29 [Qemu-devel] [PULL for-2.7 0/1] qxl: fix qxl_set_dirty call in qxl_dirty_one_surface Gerd Hoffmann
@ 2016-07-20 11:29 ` Gerd Hoffmann
  2016-07-20 19:20 ` [Qemu-devel] [PULL for-2.7 0/1] " Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2016-07-20 11:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

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
---
 hw/display/qxl.c        | 11 ++++++-----
 hw/display/trace-events |  2 +-
 2 files changed, 7 insertions(+), 6 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)
diff --git a/hw/display/trace-events b/hw/display/trace-events
index 9dd82ce..78f0465 100644
--- a/hw/display/trace-events
+++ b/hw/display/trace-events
@@ -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"
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL for-2.7 0/1] qxl: fix qxl_set_dirty call in qxl_dirty_one_surface
  2016-07-20 11:29 [Qemu-devel] [PULL for-2.7 0/1] qxl: fix qxl_set_dirty call in qxl_dirty_one_surface Gerd Hoffmann
  2016-07-20 11:29 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
@ 2016-07-20 19:20 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-07-20 19:20 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 20 July 2016 at 12:29, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
> vga patch queue with a single qxl bugfix.
>
> please pull,
>   Gerd
>
> The following changes since commit 5d3217340adcb6c4f0e4af5d2b865331eb2ff63d:
>
>   disas: Fix ATTRIBUTE_UNUSED define clash with ALSA headers (2016-07-19 16:40:39 +0100)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/pull-vga-20160720-1
>
> for you to fetch changes up to e0127d2eec9cd5676ea9f3c47c2a7579a02c0466:
>
>   qxl: fix qxl_set_dirty call in qxl_dirty_one_surface (2016-07-20 12:08:14 +0200)
>
> ----------------------------------------------------------------
> qxl: fix qxl_set_dirty call in qxl_dirty_one_surface
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-20 19:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-20 11:29 [Qemu-devel] [PULL for-2.7 0/1] qxl: fix qxl_set_dirty call in qxl_dirty_one_surface Gerd Hoffmann
2016-07-20 11:29 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
2016-07-20 19:20 ` [Qemu-devel] [PULL for-2.7 0/1] " Peter Maydell

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).