qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Mark Wu <wudxw@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: Alexander Graf <agraf@suse.de>,
	nikunj@linux.vnet.ibm.com, Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] Add a generic vga device type for that specified by '-device'
Date: Fri, 28 Feb 2014 14:03:21 +0100	[thread overview]
Message-ID: <53108919.10103@redhat.com> (raw)
In-Reply-To: <1393591540-32435-1-git-send-email-wudxw@linux.vnet.ibm.com>

Il 28/02/2014 13:45, Mark Wu ha scritto:
> Some machine (like ppc) initialization code determines if it has vga
> configured according to vga_interface_type. In the original code,
> vga_interface_type is evaluated to VGA_NONE even if a vga is added
> by '-device VGA'. It causes the machine not aware of the graphics
> device configured. This patch adds a new vga device type to indicate
> that it has a vga device, but the machine code doesn't need to care
> about its initialization.

Can you use memory_region_present and look (for example) for a device 
that owns I/O port 0x3d4?

Paolo

> Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
> ---
>  include/sysemu/sysemu.h | 2 +-
>  vl.c                    | 8 +++++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
> index 495dae8..a21205f 100644
> --- a/include/sysemu/sysemu.h
> +++ b/include/sysemu/sysemu.h
> @@ -103,7 +103,7 @@ typedef enum DisplayType
>  extern int autostart;
>
>  typedef enum {
> -    VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
> +    VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, VGA_DEVICE
>  } VGAInterfaceType;
>
>  extern int vga_interface_type;
> diff --git a/vl.c b/vl.c
> index 1d27b34..06a4253 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -226,6 +226,7 @@ static int default_floppy = 1;
>  static int default_cdrom = 1;
>  static int default_sdcard = 1;
>  static int default_vga = 1;
> +static int has_defaults = 1;
>
>  static struct {
>      const char *driver;
> @@ -2066,7 +2067,11 @@ static void select_vgahw (const char *p)
>              fprintf(stderr, "Error: QXL VGA not available\n");
>              exit(0);
>          }
> -    } else if (!strstart(p, "none", &opts)) {
> +    } else if (strstart(p, "none", &opts)) {
> +        if (!has_defaults && !default_vga) {
> +            vga_interface_type = VGA_DEVICE;
> +        }
> +    } else {
>      invalid_vga:
>          fprintf(stderr, "Unknown vga type: %s\n", p);
>          exit(1);
> @@ -3672,6 +3677,7 @@ int main(int argc, char **argv, char **envp)
>                  default_cdrom = 0;
>                  default_sdcard = 0;
>                  default_vga = 0;
> +                has_defaults = 0;
>                  break;
>              case QEMU_OPTION_xen_domid:
>                  if (!(xen_available())) {
>

  parent reply	other threads:[~2014-02-28 13:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 12:45 [Qemu-devel] [PATCH 1/2] Add a generic vga device type for that specified by '-device' Mark Wu
2014-02-28 12:45 ` [Qemu-devel] [PATCH 2/2] Fix return value of vga initlization on ppc Mark Wu
2014-02-28 13:03 ` Paolo Bonzini [this message]
2014-03-06 13:37   ` [Qemu-devel] [PATCH 1/2] Add a generic vga device type for that specified by '-device' Mark Wu
2014-03-06 14:33     ` Paolo Bonzini
2014-03-06 14:39       ` Andreas Färber
2014-03-06 16:09         ` Paolo Bonzini
2014-03-07  9:34           ` Mark Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53108919.10103@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=wudxw@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).