From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukfxp-0000xJ-Hu for qemu-devel@nongnu.org; Thu, 06 Jun 2013 15:35:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ukfxk-0006TQ-Lj for qemu-devel@nongnu.org; Thu, 06 Jun 2013 15:35:13 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:46649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukfxk-0006R4-I8 for qemu-devel@nongnu.org; Thu, 06 Jun 2013 15:35:08 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Jun 2013 15:35:05 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id BCB886E8039 for ; Thu, 6 Jun 2013 15:34:58 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r56JZ2T6345816 for ; Thu, 6 Jun 2013 15:35:02 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r56JZ2t6013755 for ; Thu, 6 Jun 2013 15:35:02 -0400 From: Anthony Liguori In-Reply-To: <1370532997-19092-1-git-send-email-kraxel@redhat.com> References: <1370532997-19092-1-git-send-email-kraxel@redhat.com> Date: Thu, 06 Jun 2013 14:34:54 -0500 Message-ID: <87k3m7ghi9.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] console: nicer initial screen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Gerd Hoffmann writes: > Now that we have a function to create a fancy DisplaySurface with a > message for the user, to handle non-existing graphics hardware, we > can make it more generic and use it for other things too. > > This patch adds a text line to the in initial DisplaySurface, notifying > the user that the display isn't initialized yet by the guest. > > You can see this in action when starting qemu with '-S'. Also when > booting ovmf in qemu (which needs a few moments to initialize itself > before it initializes the vga). > > Signed-off-by: Gerd Hoffmann Dunno if I said this in the previous posting, but what about just blitting an image? This text isn't internationalized. Regards, Anthony Liguori > --- > ui/console.c | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/ui/console.c b/ui/console.c > index b30853f..05f0b4a 100644 > --- a/ui/console.c > +++ b/ui/console.c > @@ -1300,19 +1300,18 @@ DisplaySurface *qemu_create_displaysurface_from(int width, int height, int bpp, > return surface; > } > > -static DisplaySurface *qemu_create_dummy_surface(void) > +static DisplaySurface *qemu_create_message_surface(int w, int h, > + const char *msg) > { > - static const char msg[] = > - "This VM has no graphic display device."; > - DisplaySurface *surface = qemu_create_displaysurface(640, 480); > + DisplaySurface *surface = qemu_create_displaysurface(w, h); > pixman_color_t bg = color_table_rgb[0][COLOR_BLACK]; > pixman_color_t fg = color_table_rgb[0][COLOR_WHITE]; > pixman_image_t *glyph; > int len, x, y, i; > > len = strlen(msg); > - x = (640/FONT_WIDTH - len) / 2; > - y = (480/FONT_HEIGHT - 1) / 2; > + x = (w / FONT_WIDTH - len) / 2; > + y = (h / FONT_HEIGHT - 1) / 2; > for (i = 0; i < len; i++) { > glyph = qemu_pixman_glyph_from_vgafont(FONT_HEIGHT, vgafont16, msg[i]); > qemu_pixman_glyph_render(glyph, surface->image, &fg, &bg, > @@ -1334,6 +1333,8 @@ void qemu_free_displaysurface(DisplaySurface *surface) > > void register_displaychangelistener(DisplayChangeListener *dcl) > { > + static const char nodev[] = > + "This VM has no graphic display device."; > static DisplaySurface *dummy; > QemuConsole *con; > > @@ -1352,7 +1353,7 @@ void register_displaychangelistener(DisplayChangeListener *dcl) > dcl->ops->dpy_gfx_switch(dcl, con->surface); > } else { > if (!dummy) { > - dummy = qemu_create_dummy_surface(); > + dummy = qemu_create_message_surface(640, 480, nodev); > } > dcl->ops->dpy_gfx_switch(dcl, dummy); > } > @@ -1600,6 +1601,8 @@ QemuConsole *graphic_console_init(DeviceState *dev, > const GraphicHwOps *hw_ops, > void *opaque) > { > + static const char noinit[] = > + "Guest has not initialized the display (yet)."; > Error *local_err = NULL; > int width = 640; > int height = 480; > @@ -1616,7 +1619,7 @@ QemuConsole *graphic_console_init(DeviceState *dev, > "device", &local_err); > } > > - s->surface = qemu_create_displaysurface(width, height); > + s->surface = qemu_create_message_surface(width, height, noinit); > return s; > } > > -- > 1.7.9.7