qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Hervé Poussineau" <hpoussin@reactos.org>
Cc: qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
	qemu-ppc@nongnu.org, Thomas Huth <thuth@redhat.com>,
	Giancarlo Teodori <gteodori@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/6] pci: add pci_vga_type(), giving the device name of the chosen VGA device
Date: Tue, 3 Jan 2017 10:01:25 +1100	[thread overview]
Message-ID: <20170102230125.GE12761@umbus.fritz.box> (raw)
In-Reply-To: <1483049536-21548-2-git-send-email-hpoussin@reactos.org>

[-- Attachment #1: Type: text/plain, Size: 2724 bytes --]

On Thu, Dec 29, 2016 at 11:12:11PM +0100, Hervé Poussineau wrote:
> This is in fact a split of pci_vga_init() function in two parts.
> 
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

I think it needs Michael or someone to merge it though.

> ---
>  hw/pci/pci.c         | 22 ++++++++++++++++------
>  include/hw/pci/pci.h |  1 +
>  2 files changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 24fae16..0d5a862 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -1816,19 +1816,19 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>      return pci_dev;
>  }
>  
> -PCIDevice *pci_vga_init(PCIBus *bus)
> +const char *pci_vga_type(void)
>  {
>      switch (vga_interface_type) {
>      case VGA_CIRRUS:
> -        return pci_create_simple(bus, -1, "cirrus-vga");
> +        return "cirrus-vga";
>      case VGA_QXL:
> -        return pci_create_simple(bus, -1, "qxl-vga");
> +        return "qxl-vga";
>      case VGA_STD:
> -        return pci_create_simple(bus, -1, "VGA");
> +        return "VGA";
>      case VGA_VMWARE:
> -        return pci_create_simple(bus, -1, "vmware-svga");
> +        return "vmware-svga";
>      case VGA_VIRTIO:
> -        return pci_create_simple(bus, -1, "virtio-vga");
> +        return "virtio-vga";
>      case VGA_NONE:
>      default: /* Other non-PCI types. Checking for unsupported types is already
>                  done in vl.c. */
> @@ -1836,6 +1836,16 @@ PCIDevice *pci_vga_init(PCIBus *bus)
>      }
>  }
>  
> +PCIDevice *pci_vga_init(PCIBus *bus)
> +{
> +    const char *vga_type = pci_vga_type();
> +    if (vga_type) {
> +        return pci_create_simple(bus, -1, vga_type);
> +    } else {
> +        return NULL;
> +    }
> +}
> +
>  /* Whether a given bus number is in range of the secondary
>   * bus of the given bridge device. */
>  static bool pci_secondary_bus_in_range(PCIDevice *dev, int bus_num)
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index 772692f..aa8d014 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -420,6 +420,7 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
>                                 const char *default_model,
>                                 const char *default_devaddr);
>  
> +const char *pci_vga_type(void);
>  PCIDevice *pci_vga_init(PCIBus *bus);
>  
>  int pci_bus_num(PCIBus *s);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2017-01-02 23:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-29 22:12 [Qemu-devel] [PATCH 0/6] ppc: add a IBM 40p machine (RS/6000, PReP) Hervé Poussineau
2016-12-29 22:12 ` [Qemu-devel] [PATCH 1/6] pci: add pci_vga_type(), giving the device name of the chosen VGA device Hervé Poussineau
2017-01-02 23:01   ` David Gibson [this message]
2017-01-10  3:14     ` Michael S. Tsirkin
2017-01-10 21:00       ` Hervé Poussineau
2016-12-29 22:12 ` [Qemu-devel] [PATCH 2/6] vga: increase priority of 0xa0000 memory region Hervé Poussineau
2017-01-02 23:02   ` David Gibson
2017-01-03 22:37     ` Hervé Poussineau
2017-01-04  0:05       ` David Gibson
2016-12-29 22:12 ` [Qemu-devel] [PATCH 3/6] prep: do not use global variable to access nvram Hervé Poussineau
2017-01-03  3:51   ` David Gibson
2016-12-29 22:12 ` [Qemu-devel] [PATCH 4/6] prep: QOM'ify System I/O Hervé Poussineau
2017-01-02 23:03   ` David Gibson
2017-01-03 22:51     ` Hervé Poussineau
2017-01-03 23:39       ` David Gibson
2017-01-03  4:45   ` David Gibson
2017-01-04 21:17     ` Hervé Poussineau
2017-01-05  0:41       ` David Gibson
2017-01-05 20:57         ` Hervé Poussineau
2016-12-29 22:12 ` [Qemu-devel] [PATCH 5/6] prep: add IBM RS/6000 7020 (40p) memory controller Hervé Poussineau
2017-01-03  4:57   ` David Gibson
2017-01-03 22:55     ` Hervé Poussineau
2017-01-03 23:39       ` David Gibson
2016-12-29 22:12 ` [Qemu-devel] [PATCH 6/6] prep: add IBM RS/6000 7020 (40p) machine emulation Hervé Poussineau
2017-01-03  5:02   ` David Gibson
2017-05-08 20:49   ` Eduardo Habkost
2017-05-08 21:32     ` Hervé Poussineau
2017-01-11 16:58 ` [Qemu-devel] [PATCH 0/6] ppc: add a IBM 40p machine (RS/6000, PReP) Artyom Tarasenko
2017-01-11 23:18   ` David Gibson
2017-01-12 12:57   ` Hervé Poussineau
2017-01-12 13:46     ` Artyom Tarasenko
2017-01-13 12:23     ` Mark Cave-Ayland
2017-01-13 13:26       ` Thomas Huth
2017-01-13 13:30       ` Artyom Tarasenko
2017-01-14 13:11       ` Hervé Poussineau
2017-01-15 19:23         ` Artyom Tarasenko

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=20170102230125.GE12761@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=gteodori@gmail.com \
    --cc=hpoussin@reactos.org \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.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).