diff mbox

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

Message ID 1414487352-6027-3-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann Oct. 28, 2014, 9:09 a.m. UTC
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.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/pc_piix.c | 7 +++++--
 hw/i386/pc_q35.c  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

Comments

Dr. David Alan Gilbert Oct. 28, 2014, 10:37 a.m. UTC | #1
* Gerd Hoffmann (kraxel@redhat.com) 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.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/i386/pc_piix.c | 7 +++++--
>  hw/i386/pc_q35.c  | 7 +++++--
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 91a20cb..8637246 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -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"

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

>  
>  static QEMUMachine pc_i440fx_machine_v2_1 = {
>      PC_I440FX_2_1_MACHINE_OPTIONS,
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index e225c6d..9fdb3fa 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -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,
> -- 
> 1.8.3.1
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Gerd Hoffmann Oct. 28, 2014, 10:48 a.m. UTC | #2
On Di, 2014-10-28 at 10:37 +0000, Dr. David Alan Gilbert wrote:
> * Gerd Hoffmann (kraxel@redhat.com) 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.
> > 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  hw/i386/pc_piix.c | 7 +++++--
> >  hw/i386/pc_q35.c  | 7 +++++--
> >  2 files changed, 10 insertions(+), 4 deletions(-)
> > 
> > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> > index 91a20cb..8637246 100644
> > --- a/hw/i386/pc_piix.c
> > +++ b/hw/i386/pc_piix.c
> > @@ -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"
> 
> 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
Michael S. Tsirkin Nov. 23, 2014, 12:11 p.m. UTC | #3
On Tue, Oct 28, 2014 at 10:09:12AM +0100, Gerd Hoffmann 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.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


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?


> ---
>  hw/i386/pc_piix.c | 7 +++++--
>  hw/i386/pc_q35.c  | 7 +++++--
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 91a20cb..8637246 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -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,
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index e225c6d..9fdb3fa 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -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,
> -- 
> 1.8.3.1
Gerd Hoffmann Nov. 24, 2014, 8:55 a.m. UTC | #4
On So, 2014-11-23 at 14:11 +0200, Michael S. Tsirkin wrote:
> On Tue, Oct 28, 2014 at 10:09:12AM +0100, Gerd Hoffmann 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.
> > 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> 
> 
> 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
Michael S. Tsirkin Nov. 24, 2014, 11:50 a.m. UTC | #5
On Mon, Nov 24, 2014 at 09:55:11AM +0100, Gerd Hoffmann wrote:
> On So, 2014-11-23 at 14:11 +0200, Michael S. Tsirkin wrote:
> > On Tue, Oct 28, 2014 at 10:09:12AM +0100, Gerd Hoffmann 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.
> > > 
> > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > 
> > 
> > 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
> 

I tested with XP. I can try others if you like.
Gerd Hoffmann Nov. 24, 2014, 12:18 p.m. UTC | #6
Hi,

> > > 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
> > 
> 
> 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
Michael S. Tsirkin Nov. 25, 2014, 10:35 a.m. UTC | #7
On Mon, Nov 24, 2014 at 01:18:59PM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > > > 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
> > > 
> > 
> > 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

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 :(
Gerd Hoffmann Nov. 25, 2014, 3:05 p.m. UTC | #8
Hi,

> 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
diff mbox

Patch

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 91a20cb..8637246 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -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,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index e225c6d..9fdb3fa 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -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,