* [Qemu-devel] [PATCH] Fix memory dirty getting API change fallout
@ 2012-02-04 17:39 Blue Swirl
2012-02-04 17:44 ` Jan Kiszka
0 siblings, 1 reply; 2+ messages in thread
From: Blue Swirl @ 2012-02-04 17:39 UTC (permalink / raw)
To: Jan Kiszka, Avi Kivity, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]
Fix confusion in length calculation in commit
cd7a45c95ecf2404810f3c6becb7cb83c5010ad8.
Reported-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/framebuffer.c | 2 +-
hw/sm501.c | 4 ++--
hw/vga.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/framebuffer.c b/hw/framebuffer.c
index ea122fb..f4747cd 100644
--- a/hw/framebuffer.c
+++ b/hw/framebuffer.c
@@ -87,7 +87,7 @@ void framebuffer_update_display(
dest += i * dest_row_pitch;
for (; i < rows; i++) {
- dirty = memory_region_get_dirty(mem, addr, addr + src_width,
+ dirty = memory_region_get_dirty(mem, addr, src_width,
DIRTY_MEMORY_VGA);
if (dirty || invalidate) {
fn(opaque, dest, src, cols, dest_col_pitch);
diff --git a/hw/sm501.c b/hw/sm501.c
index 94c0abf..786e076 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1327,8 +1327,8 @@ static void sm501_draw_crt(SM501State * s)
ram_addr_t page1 = offset + width * src_bpp - 1;
/* check dirty flags for each line */
- update = memory_region_get_dirty(&s->local_mem_region, page0, page1,
- DIRTY_MEMORY_VGA);
+ update = memory_region_get_dirty(&s->local_mem_region, page0,
+ page1 - page0, DIRTY_MEMORY_VGA);
/* draw line and change status */
if (update) {
diff --git a/hw/vga.c b/hw/vga.c
index d87c4f9..d27700d 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1779,7 +1779,7 @@ static void vga_draw_graphic(VGACommonState *s,
int full_update)
}
page0 = addr;
page1 = addr + bwidth - 1;
- update = memory_region_get_dirty(&s->vram, page0, page1,
+ update = memory_region_get_dirty(&s->vram, page0, page1 - page0,
DIRTY_MEMORY_VGA);
/* explicit invalidation for the hardware cursor */
update |= (s->invalidated_y_table[y >> 5] >> (y & 0x1f)) & 1;
--
1.7.9.rc0
[-- Attachment #2: 0001-Fix-memory-dirty-getting-API-change-fallout.patch --]
[-- Type: text/x-patch, Size: 2314 bytes --]
From c5d0ac2705abaf6649cab7d085678fda014ba71f Mon Sep 17 00:00:00 2001
Message-Id: <c5d0ac2705abaf6649cab7d085678fda014ba71f.1328377141.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sat, 4 Feb 2012 17:09:14 +0000
Subject: [PATCH] Fix memory dirty getting API change fallout
Fix confusion in length calculation in commit
cd7a45c95ecf2404810f3c6becb7cb83c5010ad8.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/framebuffer.c | 2 +-
hw/sm501.c | 4 ++--
hw/vga.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/framebuffer.c b/hw/framebuffer.c
index ea122fb..f4747cd 100644
--- a/hw/framebuffer.c
+++ b/hw/framebuffer.c
@@ -87,7 +87,7 @@ void framebuffer_update_display(
dest += i * dest_row_pitch;
for (; i < rows; i++) {
- dirty = memory_region_get_dirty(mem, addr, addr + src_width,
+ dirty = memory_region_get_dirty(mem, addr, src_width,
DIRTY_MEMORY_VGA);
if (dirty || invalidate) {
fn(opaque, dest, src, cols, dest_col_pitch);
diff --git a/hw/sm501.c b/hw/sm501.c
index 94c0abf..786e076 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1327,8 +1327,8 @@ static void sm501_draw_crt(SM501State * s)
ram_addr_t page1 = offset + width * src_bpp - 1;
/* check dirty flags for each line */
- update = memory_region_get_dirty(&s->local_mem_region, page0, page1,
- DIRTY_MEMORY_VGA);
+ update = memory_region_get_dirty(&s->local_mem_region, page0,
+ page1 - page0, DIRTY_MEMORY_VGA);
/* draw line and change status */
if (update) {
diff --git a/hw/vga.c b/hw/vga.c
index d87c4f9..d27700d 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1779,7 +1779,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
}
page0 = addr;
page1 = addr + bwidth - 1;
- update = memory_region_get_dirty(&s->vram, page0, page1,
+ update = memory_region_get_dirty(&s->vram, page0, page1 - page0,
DIRTY_MEMORY_VGA);
/* explicit invalidation for the hardware cursor */
update |= (s->invalidated_y_table[y >> 5] >> (y & 0x1f)) & 1;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix memory dirty getting API change fallout
2012-02-04 17:39 [Qemu-devel] [PATCH] Fix memory dirty getting API change fallout Blue Swirl
@ 2012-02-04 17:44 ` Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2012-02-04 17:44 UTC (permalink / raw)
To: Blue Swirl; +Cc: Avi Kivity, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2316 bytes --]
On 2012-02-04 18:39, Blue Swirl wrote:
> Fix confusion in length calculation in commit
> cd7a45c95ecf2404810f3c6becb7cb83c5010ad8.
>
> Reported-by: Jan Kiszka <jan.kiszka@web.de>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
> hw/framebuffer.c | 2 +-
> hw/sm501.c | 4 ++--
> hw/vga.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/framebuffer.c b/hw/framebuffer.c
> index ea122fb..f4747cd 100644
> --- a/hw/framebuffer.c
> +++ b/hw/framebuffer.c
> @@ -87,7 +87,7 @@ void framebuffer_update_display(
> dest += i * dest_row_pitch;
>
> for (; i < rows; i++) {
> - dirty = memory_region_get_dirty(mem, addr, addr + src_width,
> + dirty = memory_region_get_dirty(mem, addr, src_width,
> DIRTY_MEMORY_VGA);
> if (dirty || invalidate) {
> fn(opaque, dest, src, cols, dest_col_pitch);
> diff --git a/hw/sm501.c b/hw/sm501.c
> index 94c0abf..786e076 100644
> --- a/hw/sm501.c
> +++ b/hw/sm501.c
> @@ -1327,8 +1327,8 @@ static void sm501_draw_crt(SM501State * s)
> ram_addr_t page1 = offset + width * src_bpp - 1;
>
> /* check dirty flags for each line */
> - update = memory_region_get_dirty(&s->local_mem_region, page0, page1,
> - DIRTY_MEMORY_VGA);
> + update = memory_region_get_dirty(&s->local_mem_region, page0,
> + page1 - page0, DIRTY_MEMORY_VGA);
>
> /* draw line and change status */
> if (update) {
> diff --git a/hw/vga.c b/hw/vga.c
> index d87c4f9..d27700d 100644
> --- a/hw/vga.c
> +++ b/hw/vga.c
> @@ -1779,7 +1779,7 @@ static void vga_draw_graphic(VGACommonState *s,
> int full_update)
> }
> page0 = addr;
> page1 = addr + bwidth - 1;
> - update = memory_region_get_dirty(&s->vram, page0, page1,
> + update = memory_region_get_dirty(&s->vram, page0, page1 - page0,
> DIRTY_MEMORY_VGA);
> /* explicit invalidation for the hardware cursor */
> update |= (s->invalidated_y_table[y >> 5] >> (y & 0x1f)) & 1;
Nope, doesn't help yet. It's particularly bad with the SDL GUI.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-04 17:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-04 17:39 [Qemu-devel] [PATCH] Fix memory dirty getting API change fallout Blue Swirl
2012-02-04 17:44 ` Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.