Skip to contentSkip to conversation

vga: demote cirrus

PATCH In review Gerd Hoffmann 4 participants 15 messages Oct 28, 2014 – Nov 25, 2014

lore
Share & tools
lore
#0 lore raw

cover vga: demote cirrus

Hi,

Time to flip the default to stdvga. Done for 2.2+ machine types only, for obvious compatibility reasons.

https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/

Gerd Hoffmann (2):
vga: add default display to machine class
vga: flip qemu 2.2 pc machine types from cirrus to stdvga

 hw/i386/pc.c        | 1 +
 hw/i386/pc_piix.c   | 7 +++++--
 hw/i386/pc_q35.c    | 7 +++++--
 include/hw/boards.h | 2 ++
 vl.c                | 5 ++++-
 5 files changed, 17 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/2 vga: add default display to machine class

This allows machine classes to specify which display device they want as default. If unspecified the current behavior (try cirrus, failing that try stdvga, failing that use no display) will be used.

---
 hw/i386/pc.c        | 1 +
 include/hw/boards.h | 2 ++
 vl.c                | 5 ++++-
 3 files changed, 7 insertions(+), 1 deletion(-)
hw/i386/pc.c +1 -0
index 61aba9f..ef37528 100644
@@ -1536,6 +1536,7 @@ static void pc_generic_machine_class_init(ObjectClass *oc, void *data)
     mc->is_default = qm->is_default;
     mc->default_machine_opts = qm->default_machine_opts;
     mc->default_boot_order = qm->default_boot_order;
+    mc->default_display = qm->default_display;
     mc->compat_props = qm->compat_props;
     mc->hw_version = qm->hw_version;
 }
include/hw/boards.h +2 -0
index e07c03f..2a09a10 100644
@@ -39,6 +39,7 @@ struct QEMUMachine {
     int is_default;
     const char *default_machine_opts;
     const char *default_boot_order;
+    const char *default_display;
     GlobalProperty *compat_props;
     const char *hw_version;
 };
@@ -98,6 +99,7 @@ struct MachineClass {
     int is_default;
     const char *default_machine_opts;
     const char *default_boot_order;
+    const char *default_display;
     GlobalProperty *compat_props;
     const char *hw_version;
 
vl.c +4 -1
index 50b97b4..fb5ab79 100644
@@ -1437,6 +1437,7 @@ static void machine_class_init(ObjectClass *oc, void *data)
     mc->is_default = qm->is_default;
     mc->default_machine_opts = qm->default_machine_opts;
     mc->default_boot_order = qm->default_boot_order;
+    mc->default_display = qm->default_display;
     mc->compat_props = qm->compat_props;
     mc->hw_version = qm->hw_version;
 }
@@ -4193,7 +4194,9 @@ int main(int argc, char **argv, char **envp)
 
     /* If no default VGA is requested, the default is "none".  */
     if (default_vga) {
-        if (cirrus_vga_available()) {
+        if (machine_class->default_display) {
+            vga_model = machine_class->default_display;
+        } else if (cirrus_vga_available()) {
             vga_model = "cirrus";
         } else if (vga_available()) {
             vga_model = "std";
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/2 vga: flip qemu 2.2 pc machine types from cirrus to stdvga

In reply to Gerd Hoffmann

This patch switches the default display from cirrus to vga for the new (qemu 2.2+) machine types. Old machines types stay as-is for compatibility reasons.

---
 hw/i386/pc_piix.c | 7 +++++--
 hw/i386/pc_q35.c  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
hw/i386/pc_piix.c +5 -2
index 91a20cb..8637246 100644
@@ -456,7 +456,8 @@ static void pc_xen_hvm_init(MachineState *machine)
 
 #define PC_I440FX_2_2_MACHINE_OPTIONS                           \
     PC_I440FX_MACHINE_OPTIONS,                                  \
-    .default_machine_opts = "firmware=bios-256k.bin"
+    .default_machine_opts = "firmware=bios-256k.bin",           \
+    .default_display = "std"
 
 static QEMUMachine pc_i440fx_machine_v2_2 = {
     PC_I440FX_2_2_MACHINE_OPTIONS,
@@ -466,7 +467,9 @@ static QEMUMachine pc_i440fx_machine_v2_2 = {
     .is_default = 1,
 };
 
-#define PC_I440FX_2_1_MACHINE_OPTIONS PC_I440FX_2_2_MACHINE_OPTIONS
+#define PC_I440FX_2_1_MACHINE_OPTIONS                           \
+    PC_I440FX_MACHINE_OPTIONS,                                  \
+    .default_machine_opts = "firmware=bios-256k.bin"
 
 static QEMUMachine pc_i440fx_machine_v2_1 = {
     PC_I440FX_2_1_MACHINE_OPTIONS,
hw/i386/pc_q35.c +5 -2
index e225c6d..9fdb3fa 100644
@@ -353,7 +353,8 @@ static void pc_q35_init_1_4(MachineState *machine)
 
 #define PC_Q35_2_2_MACHINE_OPTIONS                      \
     PC_Q35_MACHINE_OPTIONS,                             \
-    .default_machine_opts = "firmware=bios-256k.bin"
+    .default_machine_opts = "firmware=bios-256k.bin",   \
+    .default_display = "std"
 
 static QEMUMachine pc_q35_machine_v2_2 = {
     PC_Q35_2_2_MACHINE_OPTIONS,
@@ -362,7 +363,9 @@ static QEMUMachine pc_q35_machine_v2_2 = {
     .init = pc_q35_init,
 };
 
-#define PC_Q35_2_1_MACHINE_OPTIONS PC_Q35_2_2_MACHINE_OPTIONS
+#define PC_Q35_2_1_MACHINE_OPTIONS                      \
+    PC_Q35_MACHINE_OPTIONS,                             \
+    .default_machine_opts = "firmware=bios-256k.bin"
 
 static QEMUMachine pc_q35_machine_v2_1 = {
     PC_Q35_2_1_MACHINE_OPTIONS,
Signature · 1 line
1.8.3.1
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] vga: flip qemu 2.2 pc machine types from cirrus to stdvga

Quoted 25 lines · * Gerd Hoffmann ([email protected]) wrote:

This patch switches the default display from cirrus to vga for the new (qemu 2.2+) machine types. Old machines types stay as-is for compatibility reasons.

---
 hw/i386/pc_piix.c | 7 +++++--
 hw/i386/pc_q35.c  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
hw/i386/pc_piix.c +2 -1
index 91a20cb..8637246 100644
@@ -456,7 +456,8 @@ static void pc_xen_hvm_init(MachineState *machine)
 
 #define PC_I440FX_2_2_MACHINE_OPTIONS                           \
     PC_I440FX_MACHINE_OPTIONS,                                  \
-    .default_machine_opts = "firmware=bios-256k.bin"
+    .default_machine_opts = "firmware=bios-256k.bin",           \
+    .default_display = "std"
 
 static QEMUMachine pc_i440fx_machine_v2_2 = {
     PC_I440FX_2_2_MACHINE_OPTIONS,

hw/i386/pc_piix.c static QEMUMachine pc_i440fx_machine_v2_2 = { · line 472

Quoted 7 lines
hw/i386/pc_piix.c +3 -1
@@ -466,7 +467,9 @@ static QEMUMachine pc_i440fx_machine_v2_2 = {
     .is_default = 1,
 };
 
-#define PC_I440FX_2_1_MACHINE_OPTIONS PC_I440FX_2_2_MACHINE_OPTIONS
+#define PC_I440FX_2_1_MACHINE_OPTIONS                           \
+    PC_I440FX_MACHINE_OPTIONS,                                  \
+    .default_machine_opts = "firmware=bios-256k.bin"

I think the normal way to do this is the opposite of this; i.e.
make the display defaults be the new behaviour, then add the .default_display = "cirrus" to the v2_1 machine type, and everything below it will automatically inherit it, and everything newer will just use the new default.

Dave

Quoted 32 lines
hw/i386/pc_piix.c +0 -0
 static QEMUMachine pc_i440fx_machine_v2_1 = {
     PC_I440FX_2_1_MACHINE_OPTIONS,
hw/i386/pc_q35.c +5 -2
index e225c6d..9fdb3fa 100644
@@ -353,7 +353,8 @@ static void pc_q35_init_1_4(MachineState *machine)
 
 #define PC_Q35_2_2_MACHINE_OPTIONS                      \
     PC_Q35_MACHINE_OPTIONS,                             \
-    .default_machine_opts = "firmware=bios-256k.bin"
+    .default_machine_opts = "firmware=bios-256k.bin",   \
+    .default_display = "std"
 
 static QEMUMachine pc_q35_machine_v2_2 = {
     PC_Q35_2_2_MACHINE_OPTIONS,
@@ -362,7 +363,9 @@ static QEMUMachine pc_q35_machine_v2_2 = {
     .init = pc_q35_init,
 };
 
-#define PC_Q35_2_1_MACHINE_OPTIONS PC_Q35_2_2_MACHINE_OPTIONS
+#define PC_Q35_2_1_MACHINE_OPTIONS                      \
+    PC_Q35_MACHINE_OPTIONS,                             \
+    .default_machine_opts = "firmware=bios-256k.bin"
 
 static QEMUMachine pc_q35_machine_v2_1 = {
     PC_Q35_2_1_MACHINE_OPTIONS,
Signature · 1 line
1.8.3.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] vga: flip qemu 2.2 pc machine types from cirrus to stdvga

Quoted 29 lines · Dr. David Alan Gilbert
Quoted 28 lines · * Gerd Hoffmann ([email protected]) wrote:

This patch switches the default display from cirrus to vga for the new (qemu 2.2+) machine types. Old machines types stay as-is for compatibility reasons.

---
 hw/i386/pc_piix.c | 7 +++++--
 hw/i386/pc_q35.c  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
hw/i386/pc_piix.c +2 -1
index 91a20cb..8637246 100644
@@ -456,7 +456,8 @@ static void pc_xen_hvm_init(MachineState *machine)
 
 #define PC_I440FX_2_2_MACHINE_OPTIONS                           \
     PC_I440FX_MACHINE_OPTIONS,                                  \
-    .default_machine_opts = "firmware=bios-256k.bin"
+    .default_machine_opts = "firmware=bios-256k.bin",           \
+    .default_display = "std"
 
 static QEMUMachine pc_i440fx_machine_v2_2 = {
     PC_I440FX_2_2_MACHINE_OPTIONS,
@@ -466,7 +467,9 @@ static QEMUMachine pc_i440fx_machine_v2_2 = {
     .is_default = 1,
 };
 
Quoted 9 lines

hw/i386/pc_piix.c static QEMUMachine pc_i440fx_machine_v2_2 = { · line 472

Quoted 4 lines
hw/i386/pc_piix.c +3 -1
-#define PC_I440FX_2_1_MACHINE_OPTIONS PC_I440FX_2_2_MACHINE_OPTIONS
+#define PC_I440FX_2_1_MACHINE_OPTIONS                           \
+    PC_I440FX_MACHINE_OPTIONS,                                  \
+    .default_machine_opts = "firmware=bios-256k.bin"

I think the normal way to do this is the opposite of this; i.e.
make the display defaults be the new behaviour, then add the .default_display = "cirrus" to the v2_1 machine type, and everything below it will automatically inherit it, and everything newer will just use the new default.

That is indeed the case for (device) compat properties,
but not for QEMUMachine entries. default_display logic follows the way default_machine_opts works.

cheers,
Gerd

#11 lore raw
In reply to Gerd Hoffmann
Quoted 6 lines · Gerd Hoffmann

Hi,

Time to flip the default to stdvga. Done for 2.2+ machine types only, for obvious compatibility reasons.

https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/

Would you classify this a bugfix? If not, this missed soft freeze deadline, so should be deferred to 2.3?

Quoted 14 lines

Gerd Hoffmann (2):
vga: add default display to machine class
vga: flip qemu 2.2 pc machine types from cirrus to stdvga

 hw/i386/pc.c        | 1 +
 hw/i386/pc_piix.c   | 7 +++++--
 hw/i386/pc_q35.c    | 7 +++++--
 include/hw/boards.h | 2 ++
 vl.c                | 5 ++++-
 5 files changed, 17 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.3.1
#12 lore raw
Quoted 10 lines · Michael S. Tsirkin
Quoted 6 lines · Gerd Hoffmann

Hi,

Time to flip the default to stdvga. Done for 2.2+ machine types only, for obvious compatibility reasons.

https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/

Would you classify this a bugfix? If not, this missed soft freeze deadline, so should be deferred to 2.3?

Given that cirrus simply can't meet todays graphics needs I think this can be classified as bugfix. And as we don't add something new but just flip the default to something more sane I don't expect any stability issues from adding this post freeze.

cheers,
Gerd

#13 lore raw
Quoted 9 lines · Gerd Hoffmann
Quoted 8 lines · Michael S. Tsirkin
Quoted 6 lines · Gerd Hoffmann

Hi,

Time to flip the default to stdvga. Done for 2.2+ machine types only, for obvious compatibility reasons.

https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/

Quoted 7 lines
Quoted 2 lines

Would you classify this a bugfix? If not, this missed soft freeze deadline, so should be deferred to 2.3?

Given that cirrus simply can't meet todays graphics needs I think this can be classified as bugfix. And as we don't add something new but just flip the default to something more sane I don't expect any stability issues from adding this post freeze.

No need for semantic games as far as I'm concerned. We should be serious about soft freeze, but not dogmatic.

#14 lore raw
In reply to Gerd Hoffmann
Quoted 10 lines · Gerd Hoffmann

Hi,

Time to flip the default to stdvga. Done for 2.2+ machine types only, for obvious compatibility reasons.

https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/

Gerd Hoffmann (2):
vga: add default display to machine class
vga: flip qemu 2.2 pc machine types from cirrus to stdvga

OK I trust your judgement that it's a good idea even though it's late. Applied, thanks!

Quoted 10 lines
 hw/i386/pc.c        | 1 +
 hw/i386/pc_piix.c   | 7 +++++--
 hw/i386/pc_q35.c    | 7 +++++--
 include/hw/boards.h | 2 ++
 vl.c                | 5 ++++-
 5 files changed, 17 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.3.1
#5 lore raw

Re: [Qemu-devel] [PATCH 2/2] vga: flip qemu 2.2 pc machine types from cirrus to stdvga

In reply to Gerd Hoffmann
Quoted 5 lines · Gerd Hoffmann

This patch switches the default display from cirrus to vga for the new (qemu 2.2+) machine types. Old machines types stay as-is for compatibility reasons.

Gerd, I noticed that this caused a regression:
suspend no longer works with windows, the option to suspend is greyed out.

This is not new - it was disabled with -vga std previously - but poses a bigger problem now it's the default? Thoughts? Something we can fix for 2.2?

Quoted 57 lines
---
 hw/i386/pc_piix.c | 7 +++++--
 hw/i386/pc_q35.c  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
hw/i386/pc_piix.c +5 -2
index 91a20cb..8637246 100644
@@ -456,7 +456,8 @@ static void pc_xen_hvm_init(MachineState *machine)
 
 #define PC_I440FX_2_2_MACHINE_OPTIONS                           \
     PC_I440FX_MACHINE_OPTIONS,                                  \
-    .default_machine_opts = "firmware=bios-256k.bin"
+    .default_machine_opts = "firmware=bios-256k.bin",           \
+    .default_display = "std"
 
 static QEMUMachine pc_i440fx_machine_v2_2 = {
     PC_I440FX_2_2_MACHINE_OPTIONS,
@@ -466,7 +467,9 @@ static QEMUMachine pc_i440fx_machine_v2_2 = {
     .is_default = 1,
 };
 
-#define PC_I440FX_2_1_MACHINE_OPTIONS PC_I440FX_2_2_MACHINE_OPTIONS
+#define PC_I440FX_2_1_MACHINE_OPTIONS                           \
+    PC_I440FX_MACHINE_OPTIONS,                                  \
+    .default_machine_opts = "firmware=bios-256k.bin"
 
 static QEMUMachine pc_i440fx_machine_v2_1 = {
     PC_I440FX_2_1_MACHINE_OPTIONS,
hw/i386/pc_q35.c +5 -2
index e225c6d..9fdb3fa 100644
@@ -353,7 +353,8 @@ static void pc_q35_init_1_4(MachineState *machine)
 
 #define PC_Q35_2_2_MACHINE_OPTIONS                      \
     PC_Q35_MACHINE_OPTIONS,                             \
-    .default_machine_opts = "firmware=bios-256k.bin"
+    .default_machine_opts = "firmware=bios-256k.bin",   \
+    .default_display = "std"
 
 static QEMUMachine pc_q35_machine_v2_2 = {
     PC_Q35_2_2_MACHINE_OPTIONS,
@@ -362,7 +363,9 @@ static QEMUMachine pc_q35_machine_v2_2 = {
     .init = pc_q35_init,
 };
 
-#define PC_Q35_2_1_MACHINE_OPTIONS PC_Q35_2_2_MACHINE_OPTIONS
+#define PC_Q35_2_1_MACHINE_OPTIONS                      \
+    PC_Q35_MACHINE_OPTIONS,                             \
+    .default_machine_opts = "firmware=bios-256k.bin"
 
 static QEMUMachine pc_q35_machine_v2_1 = {
     PC_Q35_2_1_MACHINE_OPTIONS,
Signature · 1 line
1.8.3.1
#6 lore raw

Re: [Qemu-devel] [PATCH 2/2] vga: flip qemu 2.2 pc machine types from cirrus to stdvga

Quoted 8 lines · Michael S. Tsirkin
Quoted 5 lines · Gerd Hoffmann

This patch switches the default display from cirrus to vga for the new (qemu 2.2+) machine types. Old machines types stay as-is for compatibility reasons.

Quoted 7 lines

Gerd, I noticed that this caused a regression:
suspend no longer works with windows, the option to suspend is greyed out.

This is not new - it was disabled with -vga std previously - but poses a bigger problem now it's the default? Thoughts? Something we can fix for 2.2?

Which windows version is this?

I'm wondering why windows handles stdvga different from cirrus. Recent windows versions don't ship cirrus drivers any more, so windows uses the vgabios to drive the card in both cases ...

cheers,
Gerd

#7 lore raw

Re: [Qemu-devel] [PATCH 2/2] vga: flip qemu 2.2 pc machine types from cirrus to stdvga

Quoted 17 lines · Gerd Hoffmann
Quoted 8 lines · Michael S. Tsirkin
Quoted 5 lines · Gerd Hoffmann

This patch switches the default display from cirrus to vga for the new (qemu 2.2+) machine types. Old machines types stay as-is for compatibility reasons.

Quoted 7 lines

Gerd, I noticed that this caused a regression:
suspend no longer works with windows, the option to suspend is greyed out.

This is not new - it was disabled with -vga std previously - but poses a bigger problem now it's the default? Thoughts? Something we can fix for 2.2?

Quoted 9 lines

Which windows version is this?

I'm wondering why windows handles stdvga different from cirrus. Recent windows versions don't ship cirrus drivers any more, so windows uses the vgabios to drive the card in both cases ...

cheers,
Gerd

I tested with XP. I can try others if you like.

#8 lore raw

Re: [Qemu-devel] [PATCH 2/2] vga: flip qemu 2.2 pc machine types from cirrus to stdvga

Hi,

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

This is not new - it was disabled with -vga std previously - but poses a bigger problem now it's the default? Thoughts? Something we can fix for 2.2?

Which windows version is this?

I'm wondering why windows handles stdvga different from cirrus. Recent windows versions don't ship cirrus drivers any more, so windows uses the vgabios to drive the card in both cases ...

Quoted 5 lines
Quoted 3 lines

cheers,
Gerd

I tested with XP. I can try others if you like.

Yep. WinXP was the last release shipping with cirrus drivers, so, yes, it'll be a change there. On anything more recent I'd expect you don't see a difference in behavior between cirrus and stdvga.

WinXP is out of support though, and I see little reason to care too much here. Especially as this is only about picking a default, not about dropping cirrus support. If you need it it is still there, and machine types for 2.1 & older continue to default to cirrus.

cheers,
Gerd

#9 lore raw

Re: [Qemu-devel] [PATCH 2/2] vga: flip qemu 2.2 pc machine types from cirrus to stdvga

Quoted 22 lines · Gerd Hoffmann

Hi,

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

This is not new - it was disabled with -vga std previously - but poses a bigger problem now it's the default? Thoughts? Something we can fix for 2.2?

Which windows version is this?

I'm wondering why windows handles stdvga different from cirrus. Recent windows versions don't ship cirrus drivers any more, so windows uses the vgabios to drive the card in both cases ...

Quoted 5 lines
Quoted 3 lines

cheers,
Gerd

I tested with XP. I can try others if you like.

Yep. WinXP was the last release shipping with cirrus drivers, so, yes, it'll be a change there. On anything more recent I'd expect you don't see a difference in behavior between cirrus and stdvga.

Quoted 7 lines

WinXP is out of support though, and I see little reason to care too much here. Especially as this is only about picking a default, not about dropping cirrus support. If you need it it is still there, and machine types for 2.1 & older continue to default to cirrus.

cheers,
Gerd

I checked windows 7, and I see a problem with it, as well:
with -vga cirrus, hybernate is enabled, with new default, it is disabled :(

Signature · 1 line
MST
#10 lore raw

Re: [Qemu-devel] [PATCH 2/2] vga: flip qemu 2.2 pc machine types from cirrus to stdvga

Hi,

Quoted 3 lines

I checked windows 7, and I see a problem with it, as well:
with -vga cirrus, hybernate is enabled, with new default, it is disabled :(

No difference here. sleep is grayed, hibernate is available, for both cirrus+stdvga.

Noticed that hibernate was grayed on the first vm boot with cirrus plugged in though, so maybe you have to reboot once after windows went through the new-hardware-found cycle.

cheers,
Gerd