Commit 3893c124e7b768d7e7e6cd9933df77e6dbf0816f

Authored by malc
1 parent 27463101

Change the way video graphics adapter is selected

Instead of having (current)three command line switches -std-vga,
-cirrusvga and -vmwarevga, provide one -vga switch which takes
an argument, so that:
qemu -std-vga   becomes qemu -vga std
qemu -cirrusvga becomes qemu -vga cirrus
qemu -vmwarevga becomes qemu -vga vmware

Update documentation accordingly.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5335 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 45 additions and 24 deletions
qemu-doc.texi
@@ -955,11 +955,24 @@ images. @@ -955,11 +955,24 @@ images.
955 @item -L path 955 @item -L path
956 Set the directory for the BIOS, VGA BIOS and keymaps. 956 Set the directory for the BIOS, VGA BIOS and keymaps.
957 957
958 -@item -std-vga  
959 -Simulate a standard VGA card with Bochs VBE extensions (default is  
960 -Cirrus Logic GD5446 PCI VGA). If your guest OS supports the VESA 2.0  
961 -VBE extensions (e.g. Windows XP) and if you want to use high  
962 -resolution modes (>= 1280x1024x16) then you should use this option. 958 +@item -vga @var{type}
  959 +Select type of VGA card to emulate. Valid values for @var{type} are
  960 +@table @code
  961 +@item cirrus
  962 +Cirrus Logic GD5446 Video card. All Windows versions starting from
  963 +Windows 95 should recognize and use this graphic card. For optimal
  964 +performances, use 16 bit color depth in the guest and the host OS.
  965 +(This one is the default)
  966 +@item std
  967 +Standard VGA card with Bochs VBE extensions. If your guest OS
  968 +supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
  969 +to use high resolution modes (>= 1280x1024x16) then you should use
  970 +this option.
  971 +@item vmware
  972 +VMWare SVGA-II compatible adapter. Use it if you have sufficiently
  973 +recent XFree86/XOrg server or Windows guest with a driver for this
  974 +card.
  975 +@end table
963 976
964 @item -no-acpi 977 @item -no-acpi
965 Disable ACPI (Advanced Configuration and Power Interface) support. Use 978 Disable ACPI (Advanced Configuration and Power Interface) support. Use
@@ -7691,6 +7691,8 @@ static void help(int exitcode) @@ -7691,6 +7691,8 @@ static void help(int exitcode)
7691 " use -soundhw ? to get the list of supported cards\n" 7691 " use -soundhw ? to get the list of supported cards\n"
7692 " use -soundhw all to enable all of them\n" 7692 " use -soundhw all to enable all of them\n"
7693 #endif 7693 #endif
  7694 + "-vga [std|cirrus|vmware]\n"
  7695 + " select video card type\n"
7694 "-localtime set the real time clock to local time [default=utc]\n" 7696 "-localtime set the real time clock to local time [default=utc]\n"
7695 "-full-screen start in full screen\n" 7697 "-full-screen start in full screen\n"
7696 #ifdef TARGET_I386 7698 #ifdef TARGET_I386
@@ -7769,8 +7771,6 @@ static void help(int exitcode) @@ -7769,8 +7771,6 @@ static void help(int exitcode)
7769 "-no-kqemu disable KQEMU kernel module usage\n" 7771 "-no-kqemu disable KQEMU kernel module usage\n"
7770 #endif 7772 #endif
7771 #ifdef TARGET_I386 7773 #ifdef TARGET_I386
7772 - "-std-vga simulate a standard VGA card with VESA Bochs Extensions\n"  
7773 - " (default is CL-GD5446 PCI VGA)\n"  
7774 "-no-acpi disable ACPI\n" 7774 "-no-acpi disable ACPI\n"
7775 #endif 7775 #endif
7776 #ifdef CONFIG_CURSES 7776 #ifdef CONFIG_CURSES
@@ -7861,10 +7861,8 @@ enum { @@ -7861,10 +7861,8 @@ enum {
7861 QEMU_OPTION_bios, 7861 QEMU_OPTION_bios,
7862 QEMU_OPTION_k, 7862 QEMU_OPTION_k,
7863 QEMU_OPTION_localtime, 7863 QEMU_OPTION_localtime,
7864 - QEMU_OPTION_cirrusvga,  
7865 - QEMU_OPTION_vmsvga,  
7866 QEMU_OPTION_g, 7864 QEMU_OPTION_g,
7867 - QEMU_OPTION_std_vga, 7865 + QEMU_OPTION_vga,
7868 QEMU_OPTION_echr, 7866 QEMU_OPTION_echr,
7869 QEMU_OPTION_monitor, 7867 QEMU_OPTION_monitor,
7870 QEMU_OPTION_serial, 7868 QEMU_OPTION_serial,
@@ -7966,7 +7964,7 @@ const QEMUOption qemu_options[] = { @@ -7966,7 +7964,7 @@ const QEMUOption qemu_options[] = {
7966 { "g", 1, QEMU_OPTION_g }, 7964 { "g", 1, QEMU_OPTION_g },
7967 #endif 7965 #endif
7968 { "localtime", 0, QEMU_OPTION_localtime }, 7966 { "localtime", 0, QEMU_OPTION_localtime },
7969 - { "std-vga", 0, QEMU_OPTION_std_vga }, 7967 + { "vga", HAS_ARG, QEMU_OPTION_vga },
7970 { "echr", HAS_ARG, QEMU_OPTION_echr }, 7968 { "echr", HAS_ARG, QEMU_OPTION_echr },
7971 { "monitor", HAS_ARG, QEMU_OPTION_monitor }, 7969 { "monitor", HAS_ARG, QEMU_OPTION_monitor },
7972 { "serial", HAS_ARG, QEMU_OPTION_serial }, 7970 { "serial", HAS_ARG, QEMU_OPTION_serial },
@@ -7990,8 +7988,6 @@ const QEMUOption qemu_options[] = { @@ -7990,8 +7988,6 @@ const QEMUOption qemu_options[] = {
7990 7988
7991 /* temporary options */ 7989 /* temporary options */
7992 { "usb", 0, QEMU_OPTION_usb }, 7990 { "usb", 0, QEMU_OPTION_usb },
7993 - { "cirrusvga", 0, QEMU_OPTION_cirrusvga },  
7994 - { "vmwarevga", 0, QEMU_OPTION_vmsvga },  
7995 { "no-acpi", 0, QEMU_OPTION_no_acpi }, 7991 { "no-acpi", 0, QEMU_OPTION_no_acpi },
7996 { "no-reboot", 0, QEMU_OPTION_no_reboot }, 7992 { "no-reboot", 0, QEMU_OPTION_no_reboot },
7997 { "no-shutdown", 0, QEMU_OPTION_no_shutdown }, 7993 { "no-shutdown", 0, QEMU_OPTION_no_shutdown },
@@ -8189,6 +8185,27 @@ static void select_soundhw (const char *optarg) @@ -8189,6 +8185,27 @@ static void select_soundhw (const char *optarg)
8189 } 8185 }
8190 #endif 8186 #endif
8191 8187
  8188 +static void select_vgahw (const char *p)
  8189 +{
  8190 + const char *opts;
  8191 +
  8192 + if (strstart(p, "std", &opts)) {
  8193 + cirrus_vga_enabled = 0;
  8194 + vmsvga_enabled = 0;
  8195 + } else if (strstart(p, "cirrus", &opts)) {
  8196 + cirrus_vga_enabled = 1;
  8197 + vmsvga_enabled = 0;
  8198 + } else if (strstart(p, "vmware", &opts)) {
  8199 + cirrus_vga_enabled = 0;
  8200 + vmsvga_enabled = 1;
  8201 + } else {
  8202 + invalid_vga:
  8203 + fprintf(stderr, "Unknown vga type: %s\n", p);
  8204 + exit(1);
  8205 + }
  8206 + if (*opts) goto invalid_vga;
  8207 +}
  8208 +
8192 #ifdef _WIN32 8209 #ifdef _WIN32
8193 static BOOL WINAPI qemu_ctrl_handler(DWORD type) 8210 static BOOL WINAPI qemu_ctrl_handler(DWORD type)
8194 { 8211 {
@@ -8652,17 +8669,8 @@ int main(int argc, char **argv) @@ -8652,17 +8669,8 @@ int main(int argc, char **argv)
8652 case QEMU_OPTION_localtime: 8669 case QEMU_OPTION_localtime:
8653 rtc_utc = 0; 8670 rtc_utc = 0;
8654 break; 8671 break;
8655 - case QEMU_OPTION_cirrusvga:  
8656 - cirrus_vga_enabled = 1;  
8657 - vmsvga_enabled = 0;  
8658 - break;  
8659 - case QEMU_OPTION_vmsvga:  
8660 - cirrus_vga_enabled = 0;  
8661 - vmsvga_enabled = 1;  
8662 - break;  
8663 - case QEMU_OPTION_std_vga:  
8664 - cirrus_vga_enabled = 0;  
8665 - vmsvga_enabled = 0; 8672 + case QEMU_OPTION_vga:
  8673 + select_vgahw (optarg);
8666 break; 8674 break;
8667 case QEMU_OPTION_g: 8675 case QEMU_OPTION_g:
8668 { 8676 {