From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PATCH-for-7.0 4/5] hw/mips/jazz: Inline vga_mmio_init() and remove it
Date: Fri, 19 Nov 2021 18:12:01 +0100 [thread overview]
Message-ID: <20211119171202.458919-5-f4bug@amsat.org> (raw)
In-Reply-To: <20211119171202.458919-1-f4bug@amsat.org>
vga_mmio_init() is used only one time and not very helpful,
inline and remove it.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/display/vga.h | 6 ------
hw/display/vga-mmio.c | 20 --------------------
hw/mips/jazz.c | 9 ++++++++-
3 files changed, 8 insertions(+), 27 deletions(-)
diff --git a/include/hw/display/vga.h b/include/hw/display/vga.h
index 03c65a14218..451e4c9898c 100644
--- a/include/hw/display/vga.h
+++ b/include/hw/display/vga.h
@@ -9,8 +9,6 @@
#ifndef QEMU_HW_DISPLAY_VGA_H
#define QEMU_HW_DISPLAY_VGA_H
-#include "exec/hwaddr.h"
-
/*
* modules can reference this symbol to avoid being loaded
* into system emulators without vga support
@@ -24,8 +22,4 @@ enum vga_retrace_method {
extern enum vga_retrace_method vga_retrace_method;
-int vga_mmio_init(hwaddr vram_base,
- hwaddr ctrl_base, int it_shift,
- MemoryRegion *address_space);
-
#endif
diff --git a/hw/display/vga-mmio.c b/hw/display/vga-mmio.c
index d1c5f31c134..af9229794c9 100644
--- a/hw/display/vga-mmio.c
+++ b/hw/display/vga-mmio.c
@@ -25,7 +25,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "hw/display/vga.h"
#include "hw/sysbus.h"
#include "hw/qdev-properties.h"
#include "vga_int.h"
@@ -87,25 +86,6 @@ static void vga_mmio_reset(DeviceState *dev)
vga_common_reset(s);
}
-int vga_mmio_init(hwaddr vram_base,
- hwaddr ctrl_base, int it_shift,
- MemoryRegion *address_space)
-{
- DeviceState *dev;
- SysBusDevice *s;
-
- dev = qdev_new(TYPE_VGA_MMIO);
- qdev_prop_set_uint8(dev, "it_shift", it_shift);
- s = SYS_BUS_DEVICE(dev);
- sysbus_realize_and_unref(s, &error_fatal);
-
- sysbus_mmio_map(s, 0, ctrl_base);
- sysbus_mmio_map(s, 1, vram_base + 0x000a0000);
- sysbus_mmio_map(s, 2, VBE_DISPI_LFB_PHYSICAL_ADDRESS);
-
- return 0;
-}
-
static void vga_mmio_realizefn(DeviceState *dev, Error **errp)
{
VGAMmioState *s = VGA_MMIO(dev);
diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index 8f345afd137..bd9815c773e 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -43,6 +43,7 @@
#include "hw/rtc/mc146818rtc.h"
#include "hw/timer/i8254.h"
#include "hw/display/vga.h"
+#include "hw/display/bochs-vbe.h"
#include "hw/audio/pcspk.h"
#include "hw/input/i8042.h"
#include "hw/sysbus.h"
@@ -274,7 +275,13 @@ static void mips_jazz_init(MachineState *machine,
}
break;
case JAZZ_PICA61:
- vga_mmio_init(0x40000000, 0x60000000, 0, get_system_memory());
+ dev = qdev_new("vga-mmio");
+ qdev_prop_set_uint8(dev, "it_shift", 0);
+ sysbus = SYS_BUS_DEVICE(dev);
+ sysbus_realize_and_unref(sysbus, &error_fatal);
+ sysbus_mmio_map(sysbus, 0, 0x60000000);
+ sysbus_mmio_map(sysbus, 1, 0x400a0000);
+ sysbus_mmio_map(sysbus, 2, VBE_DISPI_LFB_PHYSICAL_ADDRESS);
break;
default:
break;
--
2.31.1
next prev parent reply other threads:[~2021-11-19 17:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-19 17:11 [PATCH-for-7.0 0/5] hw/display: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO Philippe Mathieu-Daudé
2021-11-19 17:11 ` [PATCH-for-7.0 1/5] hw/display: Rename VGA_ISA_MM -> VGA_MMIO Philippe Mathieu-Daudé
2021-11-19 18:15 ` BALATON Zoltan
2021-11-22 15:06 ` Thomas Huth
2021-11-19 17:11 ` [PATCH-for-7.0 2/5] hw/display/vga-mmio: Inline vga_mm_init() Philippe Mathieu-Daudé
2021-11-19 18:20 ` BALATON Zoltan
2021-11-19 18:23 ` BALATON Zoltan
2021-11-19 18:28 ` Philippe Mathieu-Daudé
2021-11-22 15:08 ` Thomas Huth
2021-11-19 17:12 ` [PATCH-for-7.0 3/5] hw/display/vga-mmio: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO Philippe Mathieu-Daudé
2021-11-19 18:40 ` BALATON Zoltan
2021-11-19 17:12 ` Philippe Mathieu-Daudé [this message]
2021-11-19 18:43 ` [PATCH-for-7.0 4/5] hw/mips/jazz: Inline vga_mmio_init() and remove it BALATON Zoltan
2021-11-19 17:12 ` [NOTFORMERGE PATCH 5/5] tests/avocado: Test NetBSD 9.2 on the Jazz Magnum machine Philippe Mathieu-Daudé
2021-11-22 20:05 ` Willian Rampazzo
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=20211119171202.458919-5-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=hpoussin@reactos.org \
--cc=kraxel@redhat.com \
--cc=qemu-devel@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).