qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 08/14] vga: Simplify vga_draw_blank() a bit


From: Benjamin Herrenschmidt
Subject: [Qemu-devel] [RFC 08/14] vga: Simplify vga_draw_blank() a bit
Date: Tue, 24 Jun 2014 09:11:02 +1000

The test for surface_bits_per_pixel() isn't necessary anymore,
the 8bpp case never happens.

Signed-off-by: Benjamin Herrenschmidt <address@hidden>
---
 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 70405e6..3b2cca5 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1639,7 +1639,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)
@@ -1647,15 +1647,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.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]