Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1469
-gerrit
commit 4731ef54c859eb3b78841097010ec9878b4cb41b Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Mon Aug 20 23:53:23 2012 +0300
SerialICE: Move dumb screen init
This is not really part of SerialICE session in anyway.
Change-Id: Ie0fc0058208e720abd309b0145184f9054feb5a9 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- qemu-0.15.x/Makefile.target | 3 ++ qemu-0.15.x/console.h | 1 + qemu-0.15.x/dumb_screen.c | 87 +++++++++++++++++++++++++++++++++++++++++++++ qemu-0.15.x/serialice.c | 57 +---------------------------- 4 files changed, 92 insertions(+), 56 deletions(-)
diff --git a/qemu-0.15.x/Makefile.target b/qemu-0.15.x/Makefile.target index 445949d..e1efe50 100644 --- a/qemu-0.15.x/Makefile.target +++ b/qemu-0.15.x/Makefile.target @@ -239,6 +239,9 @@ obj-i386-y += pc_piix.o obj-i386-$(CONFIG_KVM) += kvmclock.o obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
+# Dummy VNC output +obj-i386-y += dumb_screen.o + # shared objects obj-ppc-y = ppc.o obj-ppc-y += vga.o diff --git a/qemu-0.15.x/console.h b/qemu-0.15.x/console.h index 67d1373..3e34577 100644 --- a/qemu-0.15.x/console.h +++ b/qemu-0.15.x/console.h @@ -352,6 +352,7 @@ void vga_hw_invalidate(void); void vga_hw_screen_dump(const char *filename); void vga_hw_text_update(console_ch_t *chardata);
+void dumb_screen(void); int is_graphic_console(void); int is_fixedsize_console(void); int text_console_init(QemuOpts *opts, CharDriverState **_chr); diff --git a/qemu-0.15.x/dumb_screen.c b/qemu-0.15.x/dumb_screen.c new file mode 100644 index 0000000..5b3e7c7 --- /dev/null +++ b/qemu-0.15.x/dumb_screen.c @@ -0,0 +1,87 @@ +/* + * QEMU PC System Emulator + * + * Copyright (c) 2009 coresystems GmbH + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/* Indented with: + * gnuindent -npro -kr -i4 -nut -bap -sob -l80 -ss -ncs serialice.* + */ + +/* Local includes */ +#include "console.h" + +#define SERIALICE_BANNER 1 +#if SERIALICE_BANNER +#include "serialice_banner.h" +#endif + +static DisplayState *ds; +static int screen_invalid = 1; + +static void serialice_refresh(void *opaque) +{ + uint8_t *dest; + int bpp, linesize; + + if (!screen_invalid) { + return; + } + + dest = ds_get_data(ds); + bpp = (ds_get_bits_per_pixel(ds) + 7) >> 3; + linesize = ds_get_linesize(ds); + + memset(dest, 0x00, linesize * ds_get_height(ds)); +#if SERIALICE_BANNER + int x, y; + if (bpp == 4) { + for (y = 0; y < 240; y++) { + for (x = 0; x < 320; x++) { + int doff = (y * linesize) + (x * bpp); + int soff = (y * (320 * 3)) + (x * 3); + dest[doff + 0] = serialice_banner[soff + 2]; // blue + dest[doff + 1] = serialice_banner[soff + 1]; // green + dest[doff + 2] = serialice_banner[soff + 0]; // red + } + } + } else { + printf("Banner enabled and BPP = %d (line size = %d)\n", bpp, linesize); + } +#endif + + dpy_update(ds, 0, 0, ds_get_width(ds), ds_get_height(ds)); + screen_invalid = 0; +} + +static void serialice_invalidate(void *opaque) +{ + screen_invalid = 1; +} + +void dumb_screen(void) +{ + ds = graphic_console_init(serialice_refresh, serialice_invalidate, + NULL, NULL, ds); + qemu_console_resize(ds, 320, 240); +} + + diff --git a/qemu-0.15.x/serialice.c b/qemu-0.15.x/serialice.c index 5fe5cfb..69568f0 100644 --- a/qemu-0.15.x/serialice.c +++ b/qemu-0.15.x/serialice.c @@ -42,11 +42,6 @@ #include "serialice.h" #include "sysemu.h"
-#define SERIALICE_BANNER 1 -#if SERIALICE_BANNER -#include "serialice_banner.h" -#endif - #define DEFAULT_RAM_SIZE 128 #define BIOS_FILENAME "bios.bin"
@@ -54,56 +49,6 @@ const SerialICE_target *target;
int serialice_active = 0;
-static DisplayState *ds; -static int screen_invalid = 1; - -static void serialice_refresh(void *opaque) -{ - uint8_t *dest; - int bpp, linesize; - - if (!screen_invalid) { - return; - } - - dest = ds_get_data(ds); - bpp = (ds_get_bits_per_pixel(ds) + 7) >> 3; - linesize = ds_get_linesize(ds); - - memset(dest, 0x00, linesize * ds_get_height(ds)); -#if SERIALICE_BANNER - int x, y; - if (bpp == 4) { - for (y = 0; y < 240; y++) { - for (x = 0; x < 320; x++) { - int doff = (y * linesize) + (x * bpp); - int soff = (y * (320 * 3)) + (x * 3); - dest[doff + 0] = serialice_banner[soff + 2]; // blue - dest[doff + 1] = serialice_banner[soff + 1]; // green - dest[doff + 2] = serialice_banner[soff + 0]; // red - } - } - } else { - printf("Banner enabled and BPP = %d (line size = %d)\n", bpp, linesize); - } -#endif - - dpy_update(ds, 0, 0, ds_get_width(ds), ds_get_height(ds)); - screen_invalid = 0; -} - -static void serialice_invalidate(void *opaque) -{ - screen_invalid = 1; -} - -static void serialice_screen(void) -{ - ds = graphic_console_init(serialice_refresh, serialice_invalidate, - NULL, NULL, ds); - qemu_console_resize(ds, 320, 240); -} - // ************************************************************************** // high level communication with the SerialICE shell
@@ -269,7 +214,7 @@ void serialice_io_write(uint16_t port, unsigned int size, uint32 data)
static void serialice_init(void) { - serialice_screen(); + dumb_screen();
printf("SerialICE: Open connection to target hardware...\n"); target = serialice_serial_init();