From 02e8afd51d10eb0f498cb7283ff67617892cb4c0 Mon Sep 17 00:00:00 2001 From: dgibson Date: Wed, 29 Oct 2014 05:04:04 +0100 Subject: [PATCH 06/48] vga: Simplify vga_draw_blank() a bit Message-id: <1414559050-21089-6-git-send-email-dgibson@redhat.com> Patchwork-id: 61983 O-Subject: [RHEL 7.1 qemu-kvm-rhev 05/11] vga: Simplify vga_draw_blank() a bit Bugzilla: 1146809 RH-Acked-by: Laszlo Ersek RH-Acked-by: Paolo Bonzini RH-Acked-by: Gerd Hoffmann Signed-off-by: David Gibson commit 2c79f2a2ecba89abe6304ef39c79cb9b3e616bcd Author: Benjamin Herrenschmidt Date: Sun Jun 22 11:03:49 2014 +1000 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 Signed-off-by: Gerd Hoffmann Reviewed-by: David Gibson Signed-off-by: Miroslav Rezanina --- hw/display/vga.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index 25d35ad..139a3c9 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, -- 1.8.3.1