summaryrefslogtreecommitdiffstats
path: root/hw/display/vga.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt2014-06-22 03:03:49 +0200
committerGerd Hoffmann2014-09-30 13:34:09 +0200
commit2c79f2a2ecba89abe6304ef39c79cb9b3e616bcd (patch)
tree1d4f8738b58f4acafb51a5463d7d374b71c18b35 /hw/display/vga.c
parentvga: Remove rgb_to_pixel indirection (diff)
downloadqemu-2c79f2a2ecba89abe6304ef39c79cb9b3e616bcd.tar.gz
qemu-2c79f2a2ecba89abe6304ef39c79cb9b3e616bcd.tar.xz
qemu-2c79f2a2ecba89abe6304ef39c79cb9b3e616bcd.zip
vga: Simplify vga_draw_blank() a bit
The test for surface_bits_per_pixel() isn't necessary anymore, the 8bpp case never happens. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/display/vga.c')
-rw-r--r--hw/display/vga.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 9d06691b1c..c3df0c59c3 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1682,7 +1682,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
static void vga_draw_blank(VGACommonState *s, int full_update)
{
DisplaySurface *surface = qemu_console_surface(s->con);
- int i, w, val;
+ int i, w;
uint8_t *d;
if (!full_update)
@@ -1690,15 +1690,10 @@ static void vga_draw_blank(VGACommonState *s, int full_update)
if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
return;
- if (surface_bits_per_pixel(surface) == 8) {
- val = rgb_to_pixel32(0, 0, 0);
- } else {
- val = 0;
- }
w = s->last_scr_width * surface_bytes_per_pixel(surface);
d = surface_data(surface);
for(i = 0; i < s->last_scr_height; i++) {
- memset(d, val, w);
+ memset(d, 0, w);
d += surface_stride(surface);
}
dpy_gfx_update(s->con, 0, 0,