From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] Fix spurious VGA updates
Date: Mon, 28 Apr 2008 11:41:15 +0100 [thread overview]
Message-ID: <20080428104115.GF4537@implementation.uk.xensource.com> (raw)
In-Reply-To: <20080428103248.GE4537@implementation.uk.xensource.com>
Samuel Thibault, le Mon 28 Apr 2008 11:32:49 +0100, a écrit :
> VGA used to use
> bwidth = width * 4;
> to detect how much memory it should check for dirtyness for each line to
> be updated. This is however only valid in 32bit modes. The patch below
> fixes that by using the exact number of bytes.
Oops, sorry, width is used for bwidth, not disp_width, so that even in
double width mode, bits should be 4, please use patch below instead.
Index: hw/vga.c
===================================================================
--- hw/vga.c (révision 4276)
+++ hw/vga.c (copie de travail)
@@ -1418,7 +1418,7 @@
static void vga_draw_graphic(VGAState *s, int full_update)
{
int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask;
- int width, height, shift_control, line_offset, page0, page1, bwidth;
+ int width, height, shift_control, line_offset, page0, page1, bwidth, bits;
int disp_width, multi_scan, multi_run;
uint8_t *d;
uint32_t v, addr1, addr;
@@ -1454,6 +1454,7 @@
} else {
v = VGA_DRAW_LINE4;
}
+ bits = 4;
} else if (shift_control == 1) {
full_update |= update_palette16(s);
if (s->sr[0x01] & 8) {
@@ -1462,28 +1463,35 @@
} else {
v = VGA_DRAW_LINE2;
}
+ bits = 4;
} else {
switch(s->get_bpp(s)) {
default:
case 0:
full_update |= update_palette256(s);
v = VGA_DRAW_LINE8D2;
+ bits = 4;
break;
case 8:
full_update |= update_palette256(s);
v = VGA_DRAW_LINE8;
+ bits = 8;
break;
case 15:
v = VGA_DRAW_LINE15;
+ bits = 16;
break;
case 16:
v = VGA_DRAW_LINE16;
+ bits = 16;
break;
case 24:
v = VGA_DRAW_LINE24;
+ bits = 24;
break;
case 32:
v = VGA_DRAW_LINE32;
+ bits = 32;
break;
}
}
@@ -1507,7 +1515,7 @@
width, height, v, line_offset, s->cr[9], s->cr[0x17], s->line_compare, s->sr[0x01]);
#endif
addr1 = (s->start_addr * 4);
- bwidth = width * 4;
+ bwidth = (width * bits + 7) / 8;
y_start = -1;
page_min = 0x7fffffff;
page_max = -1;
prev parent reply other threads:[~2008-04-28 10:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-28 10:32 [Qemu-devel] [PATCH] Fix spurious VGA updates Samuel Thibault
2008-04-28 10:41 ` Samuel Thibault [this message]
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=20080428104115.GF4537@implementation.uk.xensource.com \
--to=samuel.thibault@eu.citrix.com \
--cc=qemu-devel@nongnu.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).