Skip to contentSkip to conversation

vga: make stdvga the global default

PATCH Superseded Gerd Hoffmann 4 participants 14 messages Jul 4, 2018 – Jul 6, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vga: make stdvga the global default

This reverts the stdvga vs. cirrus selection logic. Current state is that "cirrus" is the default and MachineClass->default_display is set to "std" by some machine types to override that.

The patch makes "std" the default. Setting default_display to "std" is dropped. Machine types which likely depend on cirrus (alpha, mips, old pc versions) will explicitly set default_display to "cirrus".

With this patch applied all ppc machine types will use "std" as default display, no matter whenever cirrus-vga is compiled in or not.

Fixes 29f9cef39e ppc: Include vga cirrus card into the compiling process
---
 hw/alpha/dp264.c     | 1 +
 hw/i386/pc_piix.c    | 3 +--
 hw/i386/pc_q35.c     | 1 -
 hw/mips/mips_malta.c | 1 +
 hw/mips/mips_r4k.c   | 1 +
 hw/ppc/spapr.c       | 1 -
 vl.c                 | 4 ++--
 7 files changed, 6 insertions(+), 6 deletions(-)
hw/alpha/dp264.c +1 -0
index 80b987f7fb..668e6d099f 100644
@@ -182,6 +182,7 @@ static void clipper_machine_init(MachineClass *mc)
     mc->max_cpus = 4;
     mc->is_default = 1;
     mc->default_cpu_type = ALPHA_CPU_TYPE_NAME("ev67");
+    mc->default_display = "cirrus";
 }
 
 DEFINE_MACHINE("clipper", clipper_machine_init)
hw/i386/pc_piix.c +1 -2
index dc09466b3e..30ad22e2e3 100644
@@ -424,7 +424,6 @@ static void pc_i440fx_machine_options(MachineClass *m)
     m->family = "pc_piix";
     m->desc = "Standard PC (i440FX + PIIX, 1996)";
     m->default_machine_opts = "firmware=bios-256k.bin";
-    m->default_display = "std";
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
 }
 
@@ -566,7 +565,7 @@ static void pc_i440fx_2_1_machine_options(MachineClass *m)
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     pc_i440fx_2_2_machine_options(m);
     m->hw_version = "2.1.0";
-    m->default_display = NULL;
+    m->default_display = "cirrus";
     SET_MACHINE_COMPAT(m, PC_COMPAT_2_1);
     pcmc->smbios_uuid_encoded = false;
     pcmc->enforce_aligned_dimm = false;
hw/i386/pc_q35.c +0 -1
index 532241e3f8..8f2c8c8b8b 100644
@@ -303,7 +303,6 @@ static void pc_q35_machine_options(MachineClass *m)
     m->desc = "Standard PC (Q35 + ICH9, 2009)";
     m->units_per_default_bus = 1;
     m->default_machine_opts = "firmware=bios-256k.bin";
-    m->default_display = "std";
     m->no_floppy = 1;
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE);
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
hw/mips/mips_malta.c +1 -0
index 3467451482..998971c53a 100644
@@ -1242,6 +1242,7 @@ static void mips_malta_machine_init(MachineClass *mc)
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 16;
     mc->is_default = 1;
+    mc->default_display = "cirrus";
 #ifdef TARGET_MIPS64
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("20Kc");
 #else
hw/mips/mips_r4k.c +1 -0
index d5725d0555..c4c7ee8aa5 100644
@@ -295,6 +295,7 @@ static void mips_machine_init(MachineClass *mc)
     mc->desc = "mips r4k platform";
     mc->init = mips_r4k_init;
     mc->block_default_type = IF_IDE;
+    mc->default_display = "cirrus";
 #ifdef TARGET_MIPS64
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("R4000");
 #else
hw/ppc/spapr.c +0 -1
index 3f5e1d3ec2..0ab90f3aa8 100644
@@ -3962,7 +3962,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
     mc->no_parallel = 1;
     mc->default_boot_order = "";
     mc->default_ram_size = 512 * MiB;
-    mc->default_display = "std";
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
vl.c +2 -2
index 16b913f9d5..e60bf2d6cd 100644
@@ -4475,10 +4475,10 @@ int main(int argc, char **argv, char **envp)
     if (default_vga) {
         if (machine_class->default_display) {
             vga_model = machine_class->default_display;
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";
         }
     }
     if (vga_model) {
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw

Am 2018-07-04 13:28, schrieb Gerd Hoffmann:

Quoted 117 lines

This reverts the stdvga vs. cirrus selection logic. Current state is that "cirrus" is the default and MachineClass->default_display is set to "std" by some machine types to override that.

The patch makes "std" the default. Setting default_display to "std" is dropped. Machine types which likely depend on cirrus (alpha, mips, old pc versions) will explicitly set default_display to "cirrus".

With this patch applied all ppc machine types will use "std" as default display, no matter whenever cirrus-vga is compiled in or not.

Fixes 29f9cef39e ppc: Include vga cirrus card into the compiling process
---
 hw/alpha/dp264.c     | 1 +
 hw/i386/pc_piix.c    | 3 +--
 hw/i386/pc_q35.c     | 1 -
 hw/mips/mips_malta.c | 1 +
 hw/mips/mips_r4k.c   | 1 +
 hw/ppc/spapr.c       | 1 -
 vl.c                 | 4 ++--
 7 files changed, 6 insertions(+), 6 deletions(-)
hw/alpha/dp264.c +1 -0
index 80b987f7fb..668e6d099f 100644
@@ -182,6 +182,7 @@ static void clipper_machine_init(MachineClass *mc)
     mc->max_cpus = 4;
     mc->is_default = 1;
     mc->default_cpu_type = ALPHA_CPU_TYPE_NAME("ev67");
+    mc->default_display = "cirrus";
 }
 
 DEFINE_MACHINE("clipper", clipper_machine_init)
hw/i386/pc_piix.c +1 -2
index dc09466b3e..30ad22e2e3 100644
@@ -424,7 +424,6 @@ static void pc_i440fx_machine_options(MachineClass 
 *m)
     m->family = "pc_piix";
     m->desc = "Standard PC (i440FX + PIIX, 1996)";
     m->default_machine_opts = "firmware=bios-256k.bin";
-    m->default_display = "std";
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
 }
@@ -566,7 +565,7 @@ static void 
 pc_i440fx_2_1_machine_options(MachineClass *m)
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     pc_i440fx_2_2_machine_options(m);
     m->hw_version = "2.1.0";
-    m->default_display = NULL;
+    m->default_display = "cirrus";
     SET_MACHINE_COMPAT(m, PC_COMPAT_2_1);
     pcmc->smbios_uuid_encoded = false;
     pcmc->enforce_aligned_dimm = false;
hw/i386/pc_q35.c +0 -1
index 532241e3f8..8f2c8c8b8b 100644
@@ -303,7 +303,6 @@ static void pc_q35_machine_options(MachineClass *m)
     m->desc = "Standard PC (Q35 + ICH9, 2009)";
     m->units_per_default_bus = 1;
     m->default_machine_opts = "firmware=bios-256k.bin";
-    m->default_display = "std";
     m->no_floppy = 1;
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE);
     machine_class_allow_dynamic_sysbus_dev(m, 

TYPE_INTEL_IOMMU_DEVICE);

hw/mips/mips_malta.c +1 -0
index 3467451482..998971c53a 100644
@@ -1242,6 +1242,7 @@ static void mips_malta_machine_init(MachineClass 
 *mc)
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 16;
     mc->is_default = 1;
+    mc->default_display = "cirrus";
 #ifdef TARGET_MIPS64
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("20Kc");

#else

hw/mips/mips_r4k.c +1 -0
index d5725d0555..c4c7ee8aa5 100644
@@ -295,6 +295,7 @@ static void mips_machine_init(MachineClass *mc)
     mc->desc = "mips r4k platform";
     mc->init = mips_r4k_init;
     mc->block_default_type = IF_IDE;
+    mc->default_display = "cirrus";
 #ifdef TARGET_MIPS64
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("R4000");
 #else
hw/ppc/spapr.c +0 -1
index 3f5e1d3ec2..0ab90f3aa8 100644
@@ -3962,7 +3962,6 @@ static void spapr_machine_class_init(ObjectClass
 *oc, void *data)
     mc->no_parallel = 1;
     mc->default_boot_order = "";
     mc->default_ram_size = 512 * MiB;
-    mc->default_display = "std";
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc, 
TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
vl.c +0 -0
index 16b913f9d5..e60bf2d6cd 100644
@@ -4475,10 +4475,10 @@ int main(int argc, char **argv, char **envp)
     if (default_vga) {
         if (machine_class->default_display) {

vl.c int main(int argc, char **argv, char **envp) · line 4484

Quoted 10 lines
vl.c +2 -2
             vga_model = machine_class->default_display;
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";
         }
     }
     if (vga_model) {

If that counts:

If applied, perhaps setting the default to "std" except for few machines is worth to be mentioned in an upcoming ChangeLog, in case there are other machines that may require cirrus graphics.

Bye
Sebastian

#2 lore raw
In reply to Gerd Hoffmann
Quoted 8 lines · Gerd Hoffmann

This reverts the stdvga vs. cirrus selection logic. Current state is that "cirrus" is the default and MachineClass->default_display is set to "std" by some machine types to override that.

The patch makes "std" the default. Setting default_display to "std" is dropped. Machine types which likely depend on cirrus (alpha, mips, old pc versions) will explicitly set default_display to "cirrus".

Quoted 5 lines

With this patch applied all ppc machine types will use "std" as default display, no matter whenever cirrus-vga is compiled in or not.

Fixes 29f9cef39e ppc: Include vga cirrus card into the compiling process

So, the current state is that default_display==NULL is unpredictable and fragile. The last hunk in this patch changes the default when default_dispay==NULL, but it's still fragile.

I don't think we must audit all machine-types with default_display=NULL today. But:

[...]

hw/alpha/dp264.c static void clipper_machine_init(MachineClass *mc) · line 185

Quoted 9 lines
hw/alpha/dp264.c +1 -0
index 80b987f7fb..668e6d099f 100644
@@ -182,6 +182,7 @@ static void clipper_machine_init(MachineClass *mc)
     mc->max_cpus = 4;
     mc->is_default = 1;
     mc->default_cpu_type = ALPHA_CPU_TYPE_NAME("ev67");
+    mc->default_display = "cirrus";

OK.

hw/i386/pc_piix.c static void pc_i440fx_machine_options(MachineClass *m) · line 427

Quoted 13 lines
hw/alpha/dp264.c +0 -0
 }
 
 DEFINE_MACHINE("clipper", clipper_machine_init)
hw/i386/pc_piix.c +0 -1
index dc09466b3e..30ad22e2e3 100644
@@ -424,7 +424,6 @@ static void pc_i440fx_machine_options(MachineClass *m)
     m->family = "pc_piix";
     m->desc = "Standard PC (i440FX + PIIX, 1996)";
     m->default_machine_opts = "firmware=bios-256k.bin";
-    m->default_display = "std";
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);

I wouldn't like to do this. Long term, it would be a good idea to have zero machines with default_display==NULL, so let's keep default_machine="std" on PC?

hw/i386/pc_piix.c static void pc_i440fx_2_1_machine_options(MachineClass *m) · line 568

Quoted 8 lines
hw/i386/pc_piix.c +1 -1
 }
 
@@ -566,7 +565,7 @@ static void pc_i440fx_2_1_machine_options(MachineClass *m)
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     pc_i440fx_2_2_machine_options(m);
     m->hw_version = "2.1.0";
-    m->default_display = NULL;
+    m->default_display = "cirrus";

OK.

hw/i386/pc_q35.c static void pc_q35_machine_options(MachineClass *m) · line 306

Quoted 12 lines
hw/i386/pc_piix.c +0 -0
     SET_MACHINE_COMPAT(m, PC_COMPAT_2_1);
     pcmc->smbios_uuid_encoded = false;
     pcmc->enforce_aligned_dimm = false;
hw/i386/pc_q35.c +0 -1
index 532241e3f8..8f2c8c8b8b 100644
@@ -303,7 +303,6 @@ static void pc_q35_machine_options(MachineClass *m)
     m->desc = "Standard PC (Q35 + ICH9, 2009)";
     m->units_per_default_bus = 1;
     m->default_machine_opts = "firmware=bios-256k.bin";
-    m->default_display = "std";

Same comment as pc_i440fx_machine_options() above.

hw/mips/mips_malta.c static void mips_malta_machine_init(MachineClass *mc) · line 1245

Quoted 12 lines
hw/i386/pc_q35.c +0 -0
     m->no_floppy = 1;
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE);
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
hw/mips/mips_malta.c +1 -0
index 3467451482..998971c53a 100644
@@ -1242,6 +1242,7 @@ static void mips_malta_machine_init(MachineClass *mc)
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 16;
     mc->is_default = 1;
+    mc->default_display = "cirrus";

OK.

hw/mips/mips_r4k.c static void mips_machine_init(MachineClass *mc) · line 298

Quoted 12 lines
hw/mips/mips_malta.c +0 -0
 #ifdef TARGET_MIPS64
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("20Kc");
 #else
hw/mips/mips_r4k.c +1 -0
index d5725d0555..c4c7ee8aa5 100644
@@ -295,6 +295,7 @@ static void mips_machine_init(MachineClass *mc)
     mc->desc = "mips r4k platform";
     mc->init = mips_r4k_init;
     mc->block_default_type = IF_IDE;
+    mc->default_display = "cirrus";

OK.

hw/ppc/spapr.c static void spapr_machine_class_init(ObjectClass *oc, void *data) · line 3965

Quoted 12 lines
hw/mips/mips_r4k.c +0 -0
 #ifdef TARGET_MIPS64
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("R4000");
 #else
hw/ppc/spapr.c +0 -1
index 3f5e1d3ec2..0ab90f3aa8 100644
@@ -3962,7 +3962,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
     mc->no_parallel = 1;
     mc->default_boot_order = "";
     mc->default_ram_size = 512 * MiB;
-    mc->default_display = "std";

Same comment as pc_i440fx_machine_options() above.

Quoted 8 lines
hw/ppc/spapr.c +0 -0
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
vl.c +0 -0
index 16b913f9d5..e60bf2d6cd 100644

vl.c int main(int argc, char **argv, char **envp) · line 4481

Quoted 9 lines
vl.c +2 -2
@@ -4475,10 +4475,10 @@ int main(int argc, char **argv, char **envp)
     if (default_vga) {
         if (machine_class->default_display) {
             vga_model = machine_class->default_display;
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";

If we don't make the machines above have default_display=NULL, we won't need this hunk, right? In either case, I suggest doing this change on a separate patch.

Signature · 1 line
Eduardo
#3 lore raw

Am 2018-07-04 20:53, schrieb Eduardo Habkost:

Quoted 14 lines
Quoted 14 lines
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc, 
TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
vl.c +0 -2
index 16b913f9d5..e60bf2d6cd 100644
@@ -4475,10 +4475,10 @@ int main(int argc, char **argv, char **envp)
     if (default_vga) {
         if (machine_class->default_display) {
             vga_model = machine_class->default_display;
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
Quoted 8 lines

vl.c int main(int argc, char **argv, char **envp) · line 4481

Quoted 4 lines
vl.c +2 -0
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";

If we don't make the machines above have default_display=NULL, we won't need this hunk, right? In either case, I suggest doing this change on a separate patch.

An alternative would be to define the default always to VGA_STD if the machine does not override it. This is from the observation that the majority would chose std. Obviously, having default values always has pro and cons. I would not consider it harmful here.

Is there any configuration that includes VGA_CIRRUS but not VGA_STD?

Bye
Sebastian

#4 lore raw
Quoted 24 lines · Sebastian Bauer

Am 2018-07-04 20:53, schrieb Eduardo Habkost:

Quoted 14 lines
Quoted 14 lines
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc,
TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
vl.c +0 -2
index 16b913f9d5..e60bf2d6cd 100644
@@ -4475,10 +4475,10 @@ int main(int argc, char **argv, char **envp)
     if (default_vga) {
         if (machine_class->default_display) {
             vga_model = machine_class->default_display;
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
Quoted 8 lines

vl.c int main(int argc, char **argv, char **envp) · line 4481

Quoted 4 lines
vl.c +2 -0
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";

If we don't make the machines above have default_display=NULL, we won't need this hunk, right? In either case, I suggest doing this change on a separate patch.

Quoted 4 lines

An alternative would be to define the default always to VGA_STD if the machine does not override it. This is from the observation that the majority would chose std. Obviously, having default values always has pro and cons. I would not consider it harmful here.

That would be my preference: not having any machine with default_display==NULL. I just don't want to make this a requirement for fixing the current bug.

Quoted 2 lines

Is there any configuration that includes VGA_CIRRUS but not VGA_STD?

Not sure, I'll check.

Signature · 1 line
Eduardo
#5 lore raw
Quoted 30 lines · Eduardo Habkost
Quoted 24 lines · Sebastian Bauer

Am 2018-07-04 20:53, schrieb Eduardo Habkost:

Quoted 14 lines
Quoted 14 lines
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc,
TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
vl.c +0 -2
index 16b913f9d5..e60bf2d6cd 100644
@@ -4475,10 +4475,10 @@ int main(int argc, char **argv, char **envp)
     if (default_vga) {
         if (machine_class->default_display) {
             vga_model = machine_class->default_display;
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
Quoted 8 lines

vl.c int main(int argc, char **argv, char **envp) · line 4481

Quoted 4 lines
vl.c +2 -0
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";

If we don't make the machines above have default_display=NULL, we won't need this hunk, right? In either case, I suggest doing this change on a separate patch.

Quoted 4 lines

An alternative would be to define the default always to VGA_STD if the machine does not override it. This is from the observation that the majority would chose std. Obviously, having default values always has pro and cons. I would not consider it harmful here.

Quoted 8 lines

That would be my preference: not having any machine with default_display==NULL. I just don't want to make this a requirement for fixing the current bug.

Quoted 2 lines

Is there any configuration that includes VGA_CIRRUS but not VGA_STD?

Not sure, I'll check.

I couldn't find any:

    [VGA_STD] = {
        .opt_name = "std",
        .name = "standard VGA",
        .class_names = { "VGA", "isa-vga" },
    },
    [VGA_CIRRUS] = {
        .opt_name = "cirrus",
        .name = "Cirrus VGA",
        .class_names = { "cirrus-vga", "isa-cirrus-vga" },
    },

"VGA" enabled by CONFIG_VGA_PCI:
hw/display/vga-pci.c: .name = "VGA",
hw/display/Makefile.objs:common-obj-$(CONFIG_VGA_PCI) += vga-pci.o

"isa-vga" enabled by CONFIG_VGA_ISA:
hw/display/vga-isa.c:#define TYPE_ISA_VGA "isa-vga"
hw/display/vga-isa.c: .name = TYPE_ISA_VGA,
hw/display/Makefile.objs:common-obj-$(CONFIG_VGA_ISA) += vga-isa.o

"cirrus-vga" enabled by CONFIG_VGA_CIRRUS:
hw/display/cirrus_vga.c:#define TYPE_PCI_CIRRUS_VGA "cirrus-vga"
hw/display/cirrus_vga.c: .name = TYPE_PCI_CIRRUS_VGA,
hw/display/Makefile.objs:common-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o

"isa-cirrus-vga" enabled by CONFIG_VGA_CIRRUS:
hw/display/cirrus_vga.c:#define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga"
hw/display/cirrus_vga.c: .name = TYPE_ISA_CIRRUS_VGA,
hw/display/Makefile.objs:common-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o

Build configs:

$ git grep -E 'CONFIG_VGA_(ISA|PCI|CIRRUS)|pci.mak'

default-configs/pci.mak:CONFIG_VGA_PCI=y

* 'include pci.mak' below means VGA_STD is available

default-configs/alpha-softmmu.mak:include pci.mak default-configs/alpha-softmmu.mak:CONFIG_VGA_CIRRUS=y

* VGA_CIRRUS & VGA_STD.

default-configs/arm-softmmu.mak:include pci.mak

* VGA_STD only.

default-configs/hppa-softmmu.mak:include pci.mak

* VGA_STD only.

default-configs/i386-softmmu.mak:include pci.mak default-configs/i386-softmmu.mak:CONFIG_VGA_ISA=y default-configs/i386-softmmu.mak:CONFIG_VGA_CIRRUS=y

* VGA_CIRRUS & VGA_STD.

default-configs/mips-softmmu-common.mak:include pci.mak default-configs/mips-softmmu-common.mak:CONFIG_VGA_ISA=y default-configs/mips-softmmu-common.mak:CONFIG_VGA_ISA_MM=y default-configs/mips-softmmu-common.mak:CONFIG_VGA_CIRRUS=y

* VGA_CIRRUS & VGA_STD.

default-configs/ppc-softmmu.mak:include pci.mak default-configs/ppc-softmmu.mak:CONFIG_VGA_CIRRUS=y

* VGA_CIRRUS & VGA_STD.

default-configs/ppcemb-softmmu.mak:include pci.mak

* VGA_STD only.

default-configs/sh4-softmmu.mak:include pci.mak

* VGA_STD only.

default-configs/sh4eb-softmmu.mak:include pci.mak

* VGA_STD only.

default-configs/sparc64-softmmu.mak:include pci.mak

* VGA_STD only.

default-configs/x86_64-softmmu.mak:include pci.mak default-configs/x86_64-softmmu.mak:CONFIG_VGA_ISA=y default-configs/x86_64-softmmu.mak:CONFIG_VGA_CIRRUS=y

* VGA_CIRRUS & VGA_STD.

roms/config.vga-bochs-display:CONFIG_VGA_PCI=y
roms/config.vga-cirrus:CONFIG_VGA_CIRRUS=y
roms/config.vga-cirrus:CONFIG_VGA_PCI=y
roms/config.vga-isavga:CONFIG_VGA_PCI=n
roms/config.vga-qxl:CONFIG_VGA_PCI=y
roms/config.vga-ramfb:CONFIG_VGA_PCI=n
roms/config.vga-stdvga:CONFIG_VGA_PCI=y
roms/config.vga-virtio:CONFIG_VGA_PCI=y
roms/config.vga-vmware:CONFIG_VGA_PCI=y

* I have no idea what this is, I guess this is not related to the QEMU build system at all. :)

Signature · 1 line
Eduardo
#6 lore raw

Am 2018-07-04 23:04, schrieb Eduardo Habkost:

Quoted 36 lines · Eduardo Habkost
Quoted 35 lines · Sebastian Bauer
Quoted 24 lines

Am 2018-07-04 20:53, schrieb Eduardo Habkost:

Quoted 14 lines
Quoted 14 lines
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc,
TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
vl.c +0 -2
index 16b913f9d5..e60bf2d6cd 100644
@@ -4475,10 +4475,10 @@ int main(int argc, char **argv, char **envp)
     if (default_vga) {
         if (machine_class->default_display) {
             vga_model = machine_class->default_display;
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
Quoted 8 lines

vl.c int main(int argc, char **argv, char **envp) · line 4481

Quoted 4 lines
vl.c +2 -0
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";

If we don't make the machines above have default_display=NULL, we won't need this hunk, right? In either case, I suggest doing this change on a separate patch.

Quoted 4 lines

An alternative would be to define the default always to VGA_STD if the machine does not override it. This is from the observation that the majority would chose std. Obviously, having default values always has pro and cons. I would not consider it harmful here.

That would be my preference: not having any machine with default_display==NULL. I just don't want to make this a requirement for fixing the current bug.

Quoted 1 line
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Is there any configuration that includes VGA_CIRRUS but not VGA_STD?

Not sure, I'll check.

I couldn't find any:

Thanks for checking! In that case, the VGA_CIRRUS branch in the above hunk will never be executed (for any current config) after the proposed patch. So that branch could be eliminated.

I also checked the code, default values are used also for other fields in that struct (e.g., default_cpus). If default values are considered fragile, they must be changed as well in the middle term. However, given a solid documentation (which is currently missing for these fields) I still think that default values are acceptable.

Note that there seems also be the possibility to set != NULL default values in the machine_class_init() function.

Bye
Sebastian

#13 lore raw
In reply to Eduardo Habkost
Quoted 6 lines
Quoted 2 lines
-    m->default_display = "std";
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);

I wouldn't like to do this. Long term, it would be a good idea to have zero machines with default_display==NULL, so let's keep default_machine="std" on PC?

Fine with me, I'll send a v2.

Quoted 10 lines

vl.c int main(int argc, char **argv, char **envp) · line 4481

Quoted 6 lines
vl.c +2 -2
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";

If we don't make the machines above have default_display=NULL, we won't need this hunk, right? In either case, I suggest doing this change on a separate patch.

ok.

cheers,
Gerd

#12 lore raw
In reply to Eduardo Habkost
Quoted 10 lines

roms/config.vga-bochs-display:CONFIG_VGA_PCI=y
roms/config.vga-cirrus:CONFIG_VGA_CIRRUS=y
roms/config.vga-cirrus:CONFIG_VGA_PCI=y
roms/config.vga-isavga:CONFIG_VGA_PCI=n
roms/config.vga-qxl:CONFIG_VGA_PCI=y
roms/config.vga-ramfb:CONFIG_VGA_PCI=n
roms/config.vga-stdvga:CONFIG_VGA_PCI=y
roms/config.vga-virtio:CONFIG_VGA_PCI=y
roms/config.vga-vmware:CONFIG_VGA_PCI=y

Quoted 2 lines

* I have no idea what this is, I guess this is not related to the QEMU build system at all. :)

seabios config, for vgabios builds (make -C roms vgabios).

cheers,
Gerd

#7 lore raw
In reply to Sebastian Bauer
Quoted 39 lines · Sebastian Bauer

Am 2018-07-04 23:04, schrieb Eduardo Habkost:

Quoted 38 lines · Eduardo Habkost
Quoted 37 lines · Sebastian Bauer
Quoted 24 lines

Am 2018-07-04 20:53, schrieb Eduardo Habkost:

Quoted 14 lines
Quoted 14 lines
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc,
TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
vl.c +0 -2
index 16b913f9d5..e60bf2d6cd 100644
@@ -4475,10 +4475,10 @@ int main(int argc, char **argv, char **envp)
     if (default_vga) {
         if (machine_class->default_display) {
             vga_model = machine_class->default_display;
-        } else if (vga_interface_available(VGA_CIRRUS)) {
-            vga_model = "cirrus";
Quoted 8 lines

vl.c int main(int argc, char **argv, char **envp) · line 4481

Quoted 4 lines
vl.c +2 -0
         } else if (vga_interface_available(VGA_STD)) {
             vga_model = "std";
+        } else if (vga_interface_available(VGA_CIRRUS)) {
+            vga_model = "cirrus";

If we don't make the machines above have default_display=NULL, we won't need this hunk, right? In either case, I suggest doing this change on a separate patch.

Quoted 4 lines

An alternative would be to define the default always to VGA_STD if the machine does not override it. This is from the observation that the majority would chose std. Obviously, having default values always has pro and cons. I would not consider it harmful here.

That would be my preference: not having any machine with default_display==NULL. I just don't want to make this a requirement for fixing the current bug.

Quoted 2 lines

Is there any configuration that includes VGA_CIRRUS but not VGA_STD?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Not sure, I'll check.

I couldn't find any:

Thanks for checking! In that case, the VGA_CIRRUS branch in the above hunk will never be executed (for any current config) after the proposed patch. So that branch could be eliminated.

I'd prefer to eliminate both vga_interface_available() checks.

Quoted 9 lines

I also checked the code, default values are used also for other fields in that struct (e.g., default_cpus). If default values are considered fragile, they must be changed as well in the middle term. However, given a solid documentation (which is currently missing for these fields) I still think that default values are acceptable.

Note that there seems also be the possibility to set != NULL default values in the machine_class_init() function.

I don't mind if the default value is defined at machine_class_init() or main(). What bothers me is a default value that depends on vga_interface_available(), because it can be easily broken by a build config change (as demonstrated by the bug fixed by this patch).

Signature · 1 line
Eduardo
#8 lore raw
Quoted 6 lines · Eduardo Habkost
Quoted 6 lines

I also checked the code, default values are used also for other fields in that struct (e.g., default_cpus). If default values are considered fragile, they must be changed as well in the middle term. However, given a solid documentation (which is currently missing for these fields) I still think that default values are acceptable.

Quoted 8 lines
Quoted 2 lines

Note that there seems also be the possibility to set != NULL default values in the machine_class_init() function.

I don't mind if the default value is defined at machine_class_init() or main(). What bothers me is a default value that depends on vga_interface_available(), because it can be easily broken by a build config change (as demonstrated by the bug fixed by this patch).

I've already sent David a for-3.0 patch to set stdvga for the PPC Mac machines, but should I also do the same for PReP too?

Is it also worth explicitly adding this for sun4u? And what about non-ISA/PCI cards such as sun4m's TCX/CG3?

ATB,

Mark.

#9 lore raw
Quoted 17 lines · Mark Cave-Ayland
Quoted 6 lines · Eduardo Habkost
Quoted 6 lines

I also checked the code, default values are used also for other fields in that struct (e.g., default_cpus). If default values are considered fragile, they must be changed as well in the middle term. However, given a solid documentation (which is currently missing for these fields) I still think that default values are acceptable.

Quoted 8 lines
Quoted 2 lines

Note that there seems also be the possibility to set != NULL default values in the machine_class_init() function.

I don't mind if the default value is defined at machine_class_init() or main(). What bothers me is a default value that depends on vga_interface_available(), because it can be easily broken by a build config change (as demonstrated by the bug fixed by this patch).

Quoted 6 lines

I've already sent David a for-3.0 patch to set stdvga for the PPC Mac machines, but should I also do the same for PReP too?

Is it also worth explicitly adding this for sun4u? And what about non-ISA/PCI cards such as sun4m's TCX/CG3?

I think it's worth it. Having fewer machines with default_display==NULL sounds like a good idea to me.

Having zero machines with default_display==NULL (so we can finally delete the vga_interface_available() checks on main()) would be even better.

This is not urgent, though (unless there we plan to change CONFIG_VGA_* on default-configs again in 3.0).

Signature · 1 line
Eduardo
#10 lore raw
In reply to Mark Cave-Ayland
Quoted 11 lines · Mark Cave-Ayland
Quoted 9 lines · Eduardo Habkost
Quoted 8 lines

I also checked the code, default values are used also for other fields in that struct (e.g., default_cpus). If default values are considered fragile, they must be changed as well in the middle term. However, given a solid documentation (which is currently missing for these fields) I still think that default values are acceptable.

Note that there seems also be the possibility to set != NULL default values in the machine_class_init() function.

Quoted 8 lines
Quoted 5 lines

I don't mind if the default value is defined at machine_class_init() or main(). What bothers me is a default value that depends on vga_interface_available(), because it can be easily broken by a build config change (as demonstrated by the bug fixed by this patch).

I've already sent David a for-3.0 patch to set stdvga for the PPC Mac machines, but should I also do the same for PReP too?

Makes sense, yes.

Quoted 2 lines

Is it also worth explicitly adding this for sun4u? And what about non-ISA/PCI cards such as sun4m's TCX/CG3?

Hmm, sparc has its own mechanism to use tcx as default (IIRC you get tcx unless -vga cg3 is specified). Should be possible to switch this over to use the MachineClass field instead.

cheers,
Gerd

#11 lore raw
Quoted 18 lines · Gerd Hoffmann
Quoted 17 lines · Mark Cave-Ayland
Quoted 14 lines · Eduardo Habkost
Quoted 8 lines

I also checked the code, default values are used also for other fields in that struct (e.g., default_cpus). If default values are considered fragile, they must be changed as well in the middle term. However, given a solid documentation (which is currently missing for these fields) I still think that default values are acceptable.

Note that there seems also be the possibility to set != NULL default values in the machine_class_init() function.

I don't mind if the default value is defined at machine_class_init() or main(). What bothers me is a default value that depends on vga_interface_available(), because it can be easily broken by a build config change (as demonstrated by the bug fixed by this patch).

Quoted 4 lines
Quoted 2 lines

I've already sent David a for-3.0 patch to set stdvga for the PPC Mac machines, but should I also do the same for PReP too?

Makes sense, yes.

Okay, done. This should ensure that the PPC Mac/PReP machines will always work regardless of what the outcome of your other patchset is.

Quoted 6 lines
Quoted 2 lines

Is it also worth explicitly adding this for sun4u? And what about non-ISA/PCI cards such as sun4m's TCX/CG3?

Hmm, sparc has its own mechanism to use tcx as default (IIRC you get tcx unless -vga cg3 is specified). Should be possible to switch this over to use the MachineClass field instead.

Thanks for the pointers - I'll have a look at this again when the 3.1 development cycle opens.

ATB,

Mark.