From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW51O-0002DE-6b for qemu-devel@nongnu.org; Mon, 22 Sep 2014 10:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW51J-0005nW-8a for qemu-devel@nongnu.org; Mon, 22 Sep 2014 10:55:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW51J-0005lg-1A for qemu-devel@nongnu.org; Mon, 22 Sep 2014 10:55:17 -0400 From: Gerd Hoffmann Date: Mon, 22 Sep 2014 16:44:53 +0200 Message-Id: <1411397096-31566-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1411397096-31566-1-git-send-email-kraxel@redhat.com> References: <1411397096-31566-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 5/8] vga: Simplify vga_draw_blank() a bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann From: Benjamin Herrenschmidt 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 --- 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 cb8992b..b0efae4 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