qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: balrog@zabor.org, i.mitsyanko@samsung.com, paul@codesourcery.com,
	Juan Quintela <quintela@trasno.org>
Subject: [Qemu-devel] [PATCH 4/7] sm501: port to test_and_clear instead of test/reset
Date: Fri, 11 Oct 2013 16:20:47 +0200	[thread overview]
Message-ID: <1381501250-19351-5-git-send-email-quintela@redhat.com> (raw)
In-Reply-To: <1381501250-19351-1-git-send-email-quintela@redhat.com>

From: Juan Quintela <quintela@trasno.org>

Now page_min/max are not needed anymore.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/display/sm501.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index c75d6ac..2b2bfac 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1270,8 +1270,6 @@ static void sm501_draw_crt(SM501State * s)
     draw_hwc_line_func * draw_hwc_line = NULL;
     int full_update = 0;
     int y_start = -1;
-    ram_addr_t page_min = ~0l;
-    ram_addr_t page_max = 0l;
     ram_addr_t offset = 0;

     /* choose draw_line function */
@@ -1328,8 +1326,9 @@ 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 - page0, DIRTY_MEMORY_VGA);
+        update = memory_region_test_and_clear_dirty(&s->local_mem_region, page0,
+                                                    page1 - page0,
+                                                    DIRTY_MEMORY_VGA);

 	/* draw line and change status */
 	if (update) {
@@ -1346,10 +1345,6 @@ static void sm501_draw_crt(SM501State * s)

 	    if (y_start < 0)
 		y_start = y;
-	    if (page0 < page_min)
-		page_min = page0;
-	    if (page1 > page_max)
-		page_max = page1;
 	} else {
 	    if (y_start >= 0) {
 		/* flush to display */
@@ -1365,13 +1360,6 @@ static void sm501_draw_crt(SM501State * s)
     /* complete flush to display */
     if (y_start >= 0)
         dpy_gfx_update(s->con, 0, y_start, width, y - y_start);
-
-    /* clear dirty flags */
-    if (page_min != ~0l) {
-	memory_region_reset_dirty(&s->local_mem_region,
-                                  page_min, page_max + TARGET_PAGE_SIZE,
-                                  DIRTY_MEMORY_VGA);
-    }
 }

 static void sm501_update_display(void *opaque)
-- 
1.8.3.1

  parent reply	other threads:[~2013-10-11 14:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 14:20 [Qemu-devel] [PATCH 0/7] Make vga devices use test_and_set Juan Quintela
2013-10-11 14:20 ` [Qemu-devel] [PATCH 1/7] vmware_vga: port to test_and_clear instead of test/reset Juan Quintela
2013-10-11 14:40   ` Eric Blake
2013-10-11 15:10     ` Juan Quintela
2013-10-11 14:20 ` [Qemu-devel] [PATCH 2/7] vga: " Juan Quintela
2013-10-11 14:20 ` [Qemu-devel] [PATCH 3/7] tcx: " Juan Quintela
2013-10-11 14:20 ` Juan Quintela [this message]
2013-10-11 14:20 ` [Qemu-devel] [PATCH 5/7] g364fb: " Juan Quintela
2013-10-11 14:20 ` [Qemu-devel] [PATCH 6/7] framebufer: " Juan Quintela
2013-10-11 14:20 ` [Qemu-devel] [PATCH 7/7] exynox4210: " Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381501250-19351-5-git-send-email-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=balrog@zabor.org \
    --cc=i.mitsyanko@samsung.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@trasno.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).