From: Jan Kiszka <jan.kiszka@web.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 3/4] vga: make Cirrus ISA device optional
Date: Fri, 13 Jan 2012 21:09:04 +0100 [thread overview]
Message-ID: <4F108F60.5070803@web.de> (raw)
In-Reply-To: <CAAu8pHv8j_s38ypQAW6jmOo6bN6GzqRt7uMN44qA1pmrPTodEQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 12194 bytes --]
This actually also converts it to a proper ISADevice - a value of its own.
On 2012-01-08 22:11, Blue Swirl wrote:
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
> Makefile.target | 13 +++-------
> default-configs/alpha-softmmu.mak | 2 +
> default-configs/arm-softmmu.mak | 1 +
> default-configs/i386-softmmu.mak | 2 +
> default-configs/mips-softmmu.mak | 2 +
> default-configs/mips64-softmmu.mak | 2 +
> default-configs/mips64el-softmmu.mak | 2 +
> default-configs/mipsel-softmmu.mak | 2 +
> default-configs/ppc-softmmu.mak | 1 +
> default-configs/ppc64-softmmu.mak | 1 +
> default-configs/ppcemb-softmmu.mak | 1 +
> default-configs/sparc64-softmmu.mak | 2 +
> default-configs/x86_64-softmmu.mak | 2 +
> hw/cirrus_vga.c | 41 ++++++++++++++++++++++++----------
> hw/pc.c | 2 +-
> hw/pc.h | 1 -
> 16 files changed, 54 insertions(+), 23 deletions(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index ed4c3bf..03fe7b0 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -202,6 +202,8 @@ obj-$(CONFIG_VHOST_NET) += vhost.o
> obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
> obj-$(CONFIG_KVM) += kvm.o kvm-all.o
> obj-$(CONFIG_NO_KVM) += kvm-stub.o
> +obj-$(CONFIG_VGA) += vga.o
> +obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
> obj-y += memory.o savevm.o
> LIBS+=-lz
>
> @@ -227,9 +229,8 @@ endif
> obj-$(CONFIG_IVSHMEM) += ivshmem.o
>
> # Hardware support
> -obj-i386-y += vga.o
> obj-i386-y += mc146818rtc.o pc.o
> -obj-i386-y += cirrus_vga.o sga.o apic.o ioapic.o piix_pci.o
> +obj-i386-y += sga.o apic.o ioapic.o piix_pci.o
> obj-i386-y += vmport.o
> obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o
> obj-i386-y += debugcon.o multiboot.o
> @@ -239,7 +240,6 @@ obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
>
> # shared objects
> obj-ppc-y = ppc.o ppc_booke.o
> -obj-ppc-y += vga.o
> # PREP target
> obj-ppc-y += mc146818rtc.o
> obj-ppc-y += ppc_prep.o
> @@ -293,10 +293,8 @@ obj-lm32-y += framebuffer.o
>
> obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
> obj-mips-y += mips_addr.o mips_timer.o mips_int.o
> -obj-mips-y += vga.o
> obj-mips-y += jazz_led.o
> obj-mips-y += gt64xxx.o mc146818rtc.o
> -obj-mips-y += cirrus_vga.o
> obj-mips-$(CONFIG_FULONG) += bonito.o vt82c686.o mips_fulong2e.o
>
> obj-microblaze-y = petalogix_s3adsp1800_mmu.o
> @@ -326,9 +324,7 @@ obj-cris-y += etraxfs_ser.o
>
> ifeq ($(TARGET_ARCH), sparc64)
> obj-sparc-y = sun4u.o apb_pci.o
> -obj-sparc-y += vga.o
> obj-sparc-y += mc146818rtc.o
> -obj-sparc-y += cirrus_vga.o
> else
> obj-sparc-y = sun4m.o lance.o tcx.o sun4m_iommu.o slavio_intctl.o
> obj-sparc-y += slavio_timer.o slavio_misc.o sparc32_dma.o
> @@ -356,7 +352,7 @@ obj-arm-y += omap1.o omap_lcdc.o omap_dma.o
> omap_clk.o omap_mmc.o omap_i2c.o \
> obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
> omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
> obj-arm-y += omap_sx1.o palm.o tsc210x.o
> -obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
> +obj-arm-y += nseries.o blizzard.o onenand.o cbus.o tusb6010.o usb-musb.o
> obj-arm-y += mst_fpga.o mainstone.o
> obj-arm-y += z2.o
> obj-arm-y += musicpal.o bitbang_i2c.o marvell_88w8618_audio.o
> @@ -376,7 +372,6 @@ obj-m68k-y += m68k-semi.o dummy_m68k.o
> obj-s390x-y = s390-virtio-bus.o s390-virtio.o
>
> obj-alpha-y = mc146818rtc.o
> -obj-alpha-y += vga.o cirrus_vga.o
> obj-alpha-y += alpha_pci.o alpha_dp264.o alpha_typhoon.o
>
> obj-xtensa-y += xtensa_pic.o
> diff --git a/default-configs/alpha-softmmu.mak
> b/default-configs/alpha-softmmu.mak
> index bd1dd95..501dd41 100644
> --- a/default-configs/alpha-softmmu.mak
> +++ b/default-configs/alpha-softmmu.mak
> @@ -4,7 +4,9 @@ include pci.mak
> CONFIG_SERIAL=y
> CONFIG_I8254=y
> CONFIG_PCKBD=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> +CONFIG_VGA_CIRRUS=y
> CONFIG_IDE_CORE=y
> CONFIG_IDE_QDEV=y
> CONFIG_VMWARE_VGA=y
> diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
> index 8d1174f1..e542b4f 100644
> --- a/default-configs/arm-softmmu.mak
> +++ b/default-configs/arm-softmmu.mak
> @@ -2,6 +2,7 @@
>
> include pci.mak
> CONFIG_GDBSTUB_XML=y
> +CONFIG_VGA=y
> CONFIG_ISA_MMIO=y
> CONFIG_NAND=y
> CONFIG_ECC=y
> diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
> index e67ebb3..662348e 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -1,8 +1,10 @@
> # Default configuration for i386-softmmu
>
> include pci.mak
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_VGA_ISA=y
> +CONFIG_VGA_CIRRUS=y
> CONFIG_VMWARE_VGA=y
> CONFIG_VMMOUSE=y
> CONFIG_SERIAL=y
> diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak
> index 94a3486..308d04a 100644
> --- a/default-configs/mips-softmmu.mak
> +++ b/default-configs/mips-softmmu.mak
> @@ -3,9 +3,11 @@
> include pci.mak
> CONFIG_ISA_MMIO=y
> CONFIG_ESP=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_VGA_ISA=y
> CONFIG_VGA_ISA_MM=y
> +CONFIG_VGA_CIRRUS=y
> CONFIG_VMWARE_VGA=y
> CONFIG_SERIAL=y
> CONFIG_PARALLEL=y
> diff --git a/default-configs/mips64-softmmu.mak
> b/default-configs/mips64-softmmu.mak
> index b5d3108..f1b92da 100644
> --- a/default-configs/mips64-softmmu.mak
> +++ b/default-configs/mips64-softmmu.mak
> @@ -3,9 +3,11 @@
> include pci.mak
> CONFIG_ISA_MMIO=y
> CONFIG_ESP=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_VGA_ISA=y
> CONFIG_VGA_ISA_MM=y
> +CONFIG_VGA_CIRRUS=y
> CONFIG_VMWARE_VGA=y
> CONFIG_SERIAL=y
> CONFIG_PARALLEL=y
> diff --git a/default-configs/mips64el-softmmu.mak
> b/default-configs/mips64el-softmmu.mak
> index 2831f44..567396c 100644
> --- a/default-configs/mips64el-softmmu.mak
> +++ b/default-configs/mips64el-softmmu.mak
> @@ -3,9 +3,11 @@
> include pci.mak
> CONFIG_ISA_MMIO=y
> CONFIG_ESP=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_VGA_ISA=y
> CONFIG_VGA_ISA_MM=y
> +CONFIG_VGA_CIRRUS=y
> CONFIG_VMWARE_VGA=y
> CONFIG_SERIAL=y
> CONFIG_PARALLEL=y
> diff --git a/default-configs/mipsel-softmmu.mak
> b/default-configs/mipsel-softmmu.mak
> index 14c949d..a8e421b 100644
> --- a/default-configs/mipsel-softmmu.mak
> +++ b/default-configs/mipsel-softmmu.mak
> @@ -3,9 +3,11 @@
> include pci.mak
> CONFIG_ISA_MMIO=y
> CONFIG_ESP=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_VGA_ISA=y
> CONFIG_VGA_ISA_MM=y
> +CONFIG_VGA_CIRRUS=y
> CONFIG_VMWARE_VGA=y
> CONFIG_SERIAL=y
> CONFIG_PARALLEL=y
> diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak
> index c85cdce..3277291 100644
> --- a/default-configs/ppc-softmmu.mak
> +++ b/default-configs/ppc-softmmu.mak
> @@ -5,6 +5,7 @@ CONFIG_GDBSTUB_XML=y
> CONFIG_ISA_MMIO=y
> CONFIG_ESCC=y
> CONFIG_M48T59=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_SERIAL=y
> CONFIG_I8254=y
> diff --git a/default-configs/ppc64-softmmu.mak
> b/default-configs/ppc64-softmmu.mak
> index 8874115..f490368 100644
> --- a/default-configs/ppc64-softmmu.mak
> +++ b/default-configs/ppc64-softmmu.mak
> @@ -5,6 +5,7 @@ CONFIG_GDBSTUB_XML=y
> CONFIG_ISA_MMIO=y
> CONFIG_ESCC=y
> CONFIG_M48T59=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_SERIAL=y
> CONFIG_I8254=y
> diff --git a/default-configs/ppcemb-softmmu.mak
> b/default-configs/ppcemb-softmmu.mak
> index 5db7205..829f462 100644
> --- a/default-configs/ppcemb-softmmu.mak
> +++ b/default-configs/ppcemb-softmmu.mak
> @@ -5,6 +5,7 @@ CONFIG_GDBSTUB_XML=y
> CONFIG_ISA_MMIO=y
> CONFIG_ESCC=y
> CONFIG_M48T59=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_SERIAL=y
> CONFIG_I8254=y
> diff --git a/default-configs/sparc64-softmmu.mak
> b/default-configs/sparc64-softmmu.mak
> index d8f17e7..c9a36c1 100644
> --- a/default-configs/sparc64-softmmu.mak
> +++ b/default-configs/sparc64-softmmu.mak
> @@ -4,7 +4,9 @@ include pci.mak
> CONFIG_ISA_MMIO=y
> CONFIG_M48T59=y
> CONFIG_PTIMER=y
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> +CONFIG_VGA_CIRRUS=y
> CONFIG_SERIAL=y
> CONFIG_PARALLEL=y
> CONFIG_PCKBD=y
> diff --git a/default-configs/x86_64-softmmu.mak
> b/default-configs/x86_64-softmmu.mak
> index b75757e..b445be2 100644
> --- a/default-configs/x86_64-softmmu.mak
> +++ b/default-configs/x86_64-softmmu.mak
> @@ -1,8 +1,10 @@
> # Default configuration for x86_64-softmmu
>
> include pci.mak
> +CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_VGA_ISA=y
> +CONFIG_VGA_CIRRUS=y
> CONFIG_VMWARE_VGA=y
> CONFIG_VMMOUSE=y
> CONFIG_SERIAL=y
> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
> index 4a7de84..a031079 100644
> --- a/hw/cirrus_vga.c
> +++ b/hw/cirrus_vga.c
> @@ -250,6 +250,11 @@ typedef struct PCICirrusVGAState {
> CirrusVGAState cirrus_vga;
> } PCICirrusVGAState;
>
> +typedef struct ISACirrusVGAState {
> + ISADevice dev;
> + CirrusVGAState cirrus_vga;
> +} ISACirrusVGAState;
> +
> static uint8_t rop_to_index[256];
>
> /***************************************
> @@ -2879,23 +2884,35 @@ static void cirrus_init_common(CirrusVGAState
> * s, int device_id, int is_pci,
> *
> ***************************************/
>
> -DeviceState *isa_cirrus_vga_init(MemoryRegion *system_memory)
> +static int vga_initfn(ISADevice *dev)
> {
> - CirrusVGAState *s;
> -
> - s = g_malloc0(sizeof(CirrusVGAState));
> -
> - vga_common_init(&s->vga, VGA_RAM_SIZE);
> - cirrus_init_common(s, CIRRUS_ID_CLGD5430, 0, system_memory);
> - s->vga.ds = graphic_console_init(s->vga.update, s->vga.invalidate,
> - s->vga.screen_dump, s->vga.text_update,
> - &s->vga);
> - vmstate_register(NULL, 0, &vmstate_cirrus_vga, s);
> + ISACirrusVGAState *d = DO_UPCAST(ISACirrusVGAState, dev, dev);
> + VGACommonState *s = &d->cirrus_vga.vga;
> +
> + vga_common_init(s, VGA_RAM_SIZE);
> + cirrus_init_common(&d->cirrus_vga, CIRRUS_ID_CLGD5430, 0,
> + isa_address_space(dev));
> + s->ds = graphic_console_init(s->update, s->invalidate,
> + s->screen_dump, s->text_update,
> + s);
> rom_add_vga(VGABIOS_CIRRUS_FILENAME);
> /* XXX ISA-LFB support */
> /* FIXME not qdev yet */
> - return NULL;
> + return 0;
> +}
> +
> +static ISADeviceInfo isa_cirrus_vga_info = {
> + .qdev.name = "isa-cirrus-vga",
> + .qdev.size = sizeof(ISACirrusVGAState),
> + .qdev.vmsd = &vmstate_cirrus_vga,
> + .init = vga_initfn,
> +};
> +
> +static void isa_cirrus_vga_register(void)
> +{
> + isa_qdev_register(&isa_cirrus_vga_info);
> }
> +device_init(isa_cirrus_vga_register)
>
> /***************************************
> *
> diff --git a/hw/pc.c b/hw/pc.c
> index 8cb78d9..b1fd4b0 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -1080,7 +1080,7 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)
> if (pci_bus) {
> dev = pci_cirrus_vga_init(pci_bus);
> } else {
> - dev = isa_cirrus_vga_init(get_system_memory());
> + dev = &isa_create_simple(isa_bus, "isa-cirrus-vga")->qdev;
> }
> } else if (vmsvga_enabled) {
> if (pci_bus) {
> diff --git a/hw/pc.h b/hw/pc.h
> index 13e41f1..58a7ea9 100644
> --- a/hw/pc.h
> +++ b/hw/pc.h
> @@ -226,7 +226,6 @@ int isa_vga_mm_init(target_phys_addr_t vram_base,
>
> /* cirrus_vga.c */
> DeviceState *pci_cirrus_vga_init(PCIBus *bus);
> -DeviceState *isa_cirrus_vga_init(MemoryRegion *address_space);
>
> /* ne2000.c */
> static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2012-01-13 20:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-08 21:11 [Qemu-devel] [PATCH 3/4] vga: make Cirrus ISA device optional Blue Swirl
2012-01-13 20:09 ` Jan Kiszka [this message]
2012-01-13 22:16 ` Andreas Färber
2012-01-21 18:49 ` Blue Swirl
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=4F108F60.5070803@web.de \
--to=jan.kiszka@web.de \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.