diff mbox series

[v2,2/6] vga-pci: use PCI_VGA_MMIO_SIZE

Message ID 20180522165058.15404-3-kraxel@redhat.com
State New
Headers show
Series display: add new bochs-display device | expand

Commit Message

Gerd Hoffmann May 22, 2018, 4:50 p.m. UTC
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/vga-pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Marc-André Lureau May 22, 2018, 5:19 p.m. UTC | #1
On Tue, May 22, 2018 at 6:50 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Ah, now we have a user!

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  hw/display/vga-pci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
> index fb3e4cd400..700ac58c69 100644
> --- a/hw/display/vga-pci.c
> +++ b/hw/display/vga-pci.c
> @@ -232,7 +232,8 @@ static void pci_std_vga_realize(PCIDevice *dev, Error **errp)
>
>      /* mmio bar for vga register access */
>      if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_MMIO)) {
> -        memory_region_init(&d->mmio, NULL, "vga.mmio", 4096);
> +        memory_region_init(&d->mmio, NULL, "vga.mmio",
> +                           PCI_VGA_MMIO_SIZE);
>
>          if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) {
>              qext = true;
> @@ -267,7 +268,8 @@ static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp)
>      s->con = graphic_console_init(DEVICE(dev), 0, s->hw_ops, s);
>
>      /* mmio bar */
> -    memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio", 4096);
> +    memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio",
> +                       PCI_VGA_MMIO_SIZE);
>
>      if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) {
>          qext = true;
> --
> 2.9.3
>
Philippe Mathieu-Daudé May 22, 2018, 8:50 p.m. UTC | #2
On 05/22/2018 01:50 PM, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  hw/display/vga-pci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
> index fb3e4cd400..700ac58c69 100644
> --- a/hw/display/vga-pci.c
> +++ b/hw/display/vga-pci.c
> @@ -232,7 +232,8 @@ static void pci_std_vga_realize(PCIDevice *dev, Error **errp)
>  
>      /* mmio bar for vga register access */
>      if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_MMIO)) {
> -        memory_region_init(&d->mmio, NULL, "vga.mmio", 4096);
> +        memory_region_init(&d->mmio, NULL, "vga.mmio",
> +                           PCI_VGA_MMIO_SIZE);
>  
>          if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) {
>              qext = true;
> @@ -267,7 +268,8 @@ static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp)
>      s->con = graphic_console_init(DEVICE(dev), 0, s->hw_ops, s);
>  
>      /* mmio bar */
> -    memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio", 4096);
> +    memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio",
> +                       PCI_VGA_MMIO_SIZE);
>  
>      if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) {
>          qext = true;
>
diff mbox series

Patch

diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index fb3e4cd400..700ac58c69 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -232,7 +232,8 @@  static void pci_std_vga_realize(PCIDevice *dev, Error **errp)
 
     /* mmio bar for vga register access */
     if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_MMIO)) {
-        memory_region_init(&d->mmio, NULL, "vga.mmio", 4096);
+        memory_region_init(&d->mmio, NULL, "vga.mmio",
+                           PCI_VGA_MMIO_SIZE);
 
         if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) {
             qext = true;
@@ -267,7 +268,8 @@  static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp)
     s->con = graphic_console_init(DEVICE(dev), 0, s->hw_ops, s);
 
     /* mmio bar */
-    memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio", 4096);
+    memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio",
+                       PCI_VGA_MMIO_SIZE);
 
     if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) {
         qext = true;