From 0881669f89048a4e7137d71e6e6f310ec86850d6 Mon Sep 17 00:00:00 2001 From: Jean Guyader Date: Tue, 27 Oct 2009 16:00:37 +0000 Subject: [PATCH] Merge vga-passthrough patches. --- master/dont-remap-passthrough-mmio | 13 -------- master/series | 3 -- master/use-vga-cmdline | 49 --------------------------- master/vga-passthrough | 53 ++++++++++++++++++++++++++++-- 4 files changed, 50 insertions(+), 68 deletions(-) delete mode 100644 master/dont-remap-passthrough-mmio delete mode 100644 master/use-vga-cmdline diff --git a/master/dont-remap-passthrough-mmio b/master/dont-remap-passthrough-mmio deleted file mode 100644 index ece055b..0000000 --- a/master/dont-remap-passthrough-mmio +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/hw/pass-through.c b/hw/pass-through.c -index 10904c9..100be0f 100644 ---- a/hw/pass-through.c -+++ b/hw/pass-through.c -@@ -1010,7 +1010,7 @@ static void pt_iomem_map(PCIDevice *d, int i, uint32_t e_phys, uint32_t e_size, - e_phys, (unsigned long)assigned_device->bases[i].access.maddr, - type, e_size, i, first_map); - -- if ( e_size == 0 ) -+ if ( e_size == 0 || !first_map) - return; - - if ( !first_map && old_ebase != -1 ) diff --git a/master/series b/master/series index 95c7fd7..73ebb45 100644 --- a/master/series +++ b/master/series @@ -20,10 +20,7 @@ thermal-management vga-passthrough dom0-driver intel -use-vga-cmdline - -dont-remap-passthrough-mmio fix-drop-mouse-keyboard fix-imobile-mouse new-input-code diff --git a/master/use-vga-cmdline b/master/use-vga-cmdline deleted file mode 100644 index 4006998..0000000 --- a/master/use-vga-cmdline +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/vl.c b/vl.c -index ae32f82..05d12ae 100644 ---- a/vl.c -+++ b/vl.c -@@ -4598,24 +4598,20 @@ static void select_soundhw (const char *optarg) - static void select_vgahw (const char *p) - { - const char *opts; -+ std_vga_enabled = 0; -+ cirrus_vga_enabled = 0; -+ vmsvga_enabled = 0; - -- if (strstart(p, "std", &opts)) { -+ if (strstart(p, "std", &opts)) - std_vga_enabled = 1; -- cirrus_vga_enabled = 0; -- vmsvga_enabled = 0; -- } else if (strstart(p, "cirrus", &opts)) { -+ else if (strstart(p, "cirrus", &opts)) - cirrus_vga_enabled = 1; -- std_vga_enabled = 0; -- vmsvga_enabled = 0; -- } else if (strstart(p, "vmware", &opts)) { -- cirrus_vga_enabled = 0; -- std_vga_enabled = 0; -+ else if (strstart(p, "vmware", &opts)) - vmsvga_enabled = 1; -- } else if (strstart(p, "none", &opts)) { -- cirrus_vga_enabled = 0; -- std_vga_enabled = 0; -- vmsvga_enabled = 0; -- } else { -+ else if (strstart(p, "passthrough", &opts)) -+ vga_passthrough = 1; -+ else if (!strstart(p, "none", &opts)) -+ { - invalid_vga: - fprintf(stderr, "Unknown vga type: %s\n", p); - exit(1); -@@ -5272,6 +5268,9 @@ int main(int argc, char **argv, char **envp) - break; - case QEMU_OPTION_vga_passthrough: - vga_passthrough = 1; -+ std_vga_enabled = 0; -+ cirrus_vga_enabled = 0; -+ vmsvga_enabled = 0; - break; - case QEMU_OPTION_dom0_input: - dom0_input = optarg; diff --git a/master/vga-passthrough b/master/vga-passthrough index 91fe357..730235b 100644 --- a/master/vga-passthrough +++ b/master/vga-passthrough @@ -1,5 +1,5 @@ diff --git a/hw/pass-through.c b/hw/pass-through.c -index 51a39db..10904c9 100644 +index 51a39db..100be0f 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -90,6 +90,8 @@ @@ -11,6 +11,15 @@ index 51a39db..10904c9 100644 struct php_dev { struct pt_dev *pt_dev; uint8_t valid; +@@ -1008,7 +1010,7 @@ static void pt_iomem_map(PCIDevice *d, int i, uint32_t e_phys, uint32_t e_size, + e_phys, (unsigned long)assigned_device->bases[i].access.maddr, + type, e_size, i, first_map); + +- if ( e_size == 0 ) ++ if ( e_size == 0 || !first_map) + return; + + if ( !first_map && old_ebase != -1 ) @@ -1573,10 +1575,11 @@ static int pt_dev_is_virtfn(struct pci_dev *dev) static int pt_register_regions(struct pt_dev *assigned_device) @@ -198,7 +207,7 @@ index d7c516e..ec8b0c4 100644 printf("pci_config_read: %s: addr=%02x val=%08x len=%d\n", pci_dev->name, config_addr, val, len); diff --git a/vl.c b/vl.c -index cdbe2a3..6d79072 100644 +index cdbe2a3..a4b8bd8 100644 --- a/vl.c +++ b/vl.c @@ -233,6 +233,7 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES]; @@ -225,12 +234,50 @@ index cdbe2a3..6d79072 100644 #if defined(CONFIG_XEN) && !defined(CONFIG_DM) { "xen-domid", HAS_ARG, QEMU_OPTION_xen_domid }, { "xen-create", 0, QEMU_OPTION_xen_create }, -@@ -5293,6 +5296,9 @@ int main(int argc, char **argv, char **envp) +@@ -4620,24 +4623,20 @@ static void select_soundhw (const char *optarg) + static void select_vgahw (const char *p) + { + const char *opts; ++ std_vga_enabled = 0; ++ cirrus_vga_enabled = 0; ++ vmsvga_enabled = 0; + +- if (strstart(p, "std", &opts)) { ++ if (strstart(p, "std", &opts)) + std_vga_enabled = 1; +- cirrus_vga_enabled = 0; +- vmsvga_enabled = 0; +- } else if (strstart(p, "cirrus", &opts)) { ++ else if (strstart(p, "cirrus", &opts)) + cirrus_vga_enabled = 1; +- std_vga_enabled = 0; +- vmsvga_enabled = 0; +- } else if (strstart(p, "vmware", &opts)) { +- cirrus_vga_enabled = 0; +- std_vga_enabled = 0; ++ else if (strstart(p, "vmware", &opts)) + vmsvga_enabled = 1; +- } else if (strstart(p, "none", &opts)) { +- cirrus_vga_enabled = 0; +- std_vga_enabled = 0; +- vmsvga_enabled = 0; +- } else { ++ else if (strstart(p, "passthrough", &opts)) ++ vga_passthrough = 1; ++ else if (!strstart(p, "none", &opts)) ++ { + invalid_vga: + fprintf(stderr, "Unknown vga type: %s\n", p); + exit(1); +@@ -5293,6 +5292,12 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_disable_opengl: opengl_enabled = 0; break; + case QEMU_OPTION_vga_passthrough: + vga_passthrough = 1; ++ std_vga_enabled = 0; ++ cirrus_vga_enabled = 0; ++ vmsvga_enabled = 0; + break; case QEMU_OPTION_direct_pci: direct_pci = optarg; -- 2.39.5