All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] ioemu: simplyfing vga_draw_text code
Date: Mon, 09 Jun 2008 14:56:22 +0100	[thread overview]
Message-ID: <484D3686.1090400@eu.citrix.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Hi all,
the last patch I submitted to clean up the DisplayState interface 
introduces a new static variable called old_depth in vga.c.
It would be better to add a last_depth field instead in the VGAState 
structure for uniformity with the rest of the code.
Thanks to Samuel for the suggestion.
Regards,

Stefano Stabellini

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

[-- Attachment #2: vga.patch --]
[-- Type: text/x-diff, Size: 2754 bytes --]

diff -r f6520678755a tools/ioemu/hw/vga.c
--- a/tools/ioemu/hw/vga.c	Mon Jun 09 10:44:09 2008 +0100
+++ b/tools/ioemu/hw/vga.c	Mon Jun 09 13:52:16 2008 +0100
@@ -1065,8 +1065,6 @@ typedef unsigned int rgb_to_pixel_dup_fu
 
 static rgb_to_pixel_dup_func *rgb_to_pixel_dup_table[NB_DEPTHS];
 
-static int old_depth = 0;
-
 /* 
  * Text mode update 
  * Missing:
@@ -1115,13 +1113,10 @@ static void vga_draw_text(VGAState *s, i
 
     s->last_scr_width = width * cw;
     s->last_scr_height = height * cheight;
-    if (s->ds->dpy_resize_shared && old_depth) {
-        dpy_resize_shared(s->ds, s->last_scr_width, s->last_scr_height, 0, s->last_scr_width * (s->ds->depth / 8), NULL);
-        old_depth = 0;
-        full_update = 1;
-    } else if (width != s->last_width || height != s->last_height ||
-        cw != s->last_cw || cheight != s->last_ch) {
+    if (width != s->last_width || height != s->last_height ||
+        cw != s->last_cw || cheight != s->last_ch || s->last_depth) {
         dpy_resize(s->ds, s->last_scr_width, s->last_scr_height);
+        s->last_depth = 0;
         full_update = 1;
     }
     s->last_width = width;
@@ -1532,14 +1527,14 @@ static void vga_draw_graphic(VGAState *s
         if (s->line_offset != s->last_line_offset || 
             disp_width != s->last_width ||
             height != s->last_height ||
-            old_depth != depth) {
+            s->last_depth != depth) {
             dpy_resize_shared(s->ds, disp_width, height, depth, s->line_offset, s->vram_ptr + (s->start_addr * 4));
             s->last_scr_width = disp_width;
             s->last_scr_height = height;
             s->last_width = disp_width;
             s->last_height = height;
             s->last_line_offset = s->line_offset;
-            old_depth = depth;
+            s->last_depth = depth;
             full_update = 1;
         } else if (s->ds->shared_buf && (full_update || s->ds->data != s->vram_ptr + (s->start_addr * 4)))
             s->ds->dpy_setdata(s->ds, s->vram_ptr + (s->start_addr * 4));
diff -r f6520678755a tools/ioemu/hw/vga_int.h
--- a/tools/ioemu/hw/vga_int.h	Mon Jun 09 10:44:09 2008 +0100
+++ b/tools/ioemu/hw/vga_int.h	Mon Jun 09 11:33:03 2008 +0100
@@ -135,6 +135,7 @@
     uint8_t last_cw, last_ch;                                           \
     uint32_t last_width, last_height; /* in chars or pixels */          \
     uint32_t last_scr_width, last_scr_height; /* in pixels */           \
+    uint32_t last_depth; /* in bits */                                  \
     uint8_t cursor_start, cursor_end;                                   \
     uint32_t cursor_offset;                                             \
     unsigned int (*rgb_to_pixel)(unsigned int r,                        \

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2008-06-09 13:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=484D3686.1090400@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 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.