]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
vga: Simplify vga_draw_blank() a bit
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sun, 22 Jun 2014 01:03:49 +0000 (11:03 +1000)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 30 Sep 2014 11:34:09 +0000 (13:34 +0200)
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>
hw/display/vga.c

index 9d06691b1c3a25f5e0d917f1d5e4bec6cb89eaa7..c3df0c59c31a24f1006fbb8b5572027d2e54b097 100644 (file)
@@ -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,