From af87bf290f31d8ef0aaf8f20259fa34e51ed1e7a Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 15 Oct 2013 21:03:04 +0100 Subject: sun4m: Add Sun CG3 framebuffer initialisation function In order to allow the user to choose the framebuffer for sparc-softmmu, add -vga tcx and -vga cg3 options to the QEMU command line. If no option is specified, the default TCX framebuffer is used. Since proprietary FCode ROMs use a resolution of 1152x900, slightly relax the validation rules to allow both displays to be initiated at the higher resolution used by these ROMs upon request (OpenBIOS FCode ROMs default to the normal QEMU sun4m default resolution of 1024x768). Finally move any fprintf(stderr ...) statements in the areas affected by this patch over to the new error_report() function. Signed-off-by: Mark Cave-Ayland CC: Blue Swirl CC: Anthony Liguori CC: Peter Maydell CC: Bob Breuer CC: Artyom Tarasenko --- vl.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 1d27b34301..52ee67e4be 100644 --- a/vl.c +++ b/vl.c @@ -2031,6 +2031,16 @@ static bool qxl_vga_available(void) return object_class_by_name("qxl-vga"); } +static bool tcx_vga_available(void) +{ + return object_class_by_name("SUNW,tcx"); +} + +static bool cg3_vga_available(void) +{ + return object_class_by_name("cgthree"); +} + static void select_vgahw (const char *p) { const char *opts; @@ -2066,6 +2076,20 @@ static void select_vgahw (const char *p) fprintf(stderr, "Error: QXL VGA not available\n"); exit(0); } + } else if (strstart(p, "tcx", &opts)) { + if (tcx_vga_available()) { + vga_interface_type = VGA_TCX; + } else { + fprintf(stderr, "Error: TCX framebuffer not available\n"); + exit(0); + } + } else if (strstart(p, "cg3", &opts)) { + if (cg3_vga_available()) { + vga_interface_type = VGA_CG3; + } else { + fprintf(stderr, "Error: CG3 framebuffer not available\n"); + exit(0); + } } else if (!strstart(p, "none", &opts)) { invalid_vga: fprintf(stderr, "Unknown vga type: %s\n", p); -- cgit v1.2.3