Basic ATI VGA emulation
v7 cover Basic ATI VGA emulation
Rebase on master to fix build with new Kconfig based stuff.
BALATON Zoltan (2):
hw/display: Add basic ATI VGA emulation
mips_fulong2e: Add on-board graphics chip
hw/display/Kconfig | 6 + hw/display/Makefile.objs | 2 + hw/display/ati.c | 865 +++++++++++++++++++++++++++++++++++++++++++++++ hw/display/ati_2d.c | 167 +++++++++ hw/display/ati_dbg.c | 259 ++++++++++++++ hw/display/ati_int.h | 96 ++++++ hw/display/ati_regs.h | 461 +++++++++++++++++++++++++ hw/display/trace-events | 4 + hw/mips/mips_fulong2e.c | 7 + vl.c | 1 + 10 files changed, 1868 insertions(+) create mode 100644 hw/display/ati.c create mode 100644 hw/display/ati_2d.c create mode 100644 hw/display/ati_dbg.c create mode 100644 hw/display/ati_int.h create mode 100644 hw/display/ati_regs.h
Signature · 1 line
2.13.7
PATCH v7 2/2 mips_fulong2e: Add on-board graphics chip
Add (partial) emulation of the on-board GPU of the machine. This allows the PMON2000 firmware to run and should also work with Linux console but probably not with X yet.
---
v7:
- set vgamem_mb explicitely to match board instead of relying on default
hw/mips/mips_fulong2e.c | 7 +++++++ 1 file changed, 7 insertions(+)
hw/mips/mips_fulong2e.c +7 -0
@@ -287,6 +287,7 @@ static void mips_fulong2e_init(MachineState *machine)I2CBus *smbus;MIPSCPU *cpu;CPUMIPSState *env; +DeviceState *dev;/* init CPUs */ cpu =MIPS_CPU (cpu_create (machine->cpu_type));
@@ -347,6 +348,12 @@ static void mips_fulong2e_init(MachineState *machine)vt82c686b_southbridge_init (pci_bus,FULONG2E_VIA_SLOT , env->irq[5 ], &smbus, &isa_bus); +/* GPU */ + dev =DEVICE (pci_create (pci_bus,-1 ,"ati-vga" )); +qdev_prop_set_uint32 (dev,"vgamem_mb" ,16 ); +qdev_prop_set_uint16 (dev,"x-device-id" ,0x5159 ); +qdev_init_nofail (dev); +/* Populate SPD eeprom data */ spd_data =spd_data_generate (DDR , ram_size, &err);if (err) {
Signature · 1 line
2.13.7
PATCH v7 1/2 hw/display: Add basic ATI VGA emulation
In reply to BALATON ZoltanAt least two machines, the PPC mac99 and MIPS fulong2e, have an ATI gfx chip by default (Rage 128 Pro and M6/RV100 respectively) and guests running on these and the PMON2000 firmware of the fulong2e expect this to be available. Fortunately these are very similar chips so they can be mostly emulated in the same device model. This patch adds basic emulation of these ATI VGA chips.
While this is incomplete and currently only enough to run the MIPS firmware and get framebuffer output with Linux, it allows the fulong2e board to work more like the real hardware and having it in QEMU in this state provides a way to experiment with it and allows others to contribute to improve it. It is compiled for all archs but only the fulong2e (which currently has no display output at all) is set to use it by default (in a separate patch).
---
v7:
- rebased for Kconfig changes in master
- added Tested-by: tags
v6:
- add support for hwcursor rendered in device as well, enable with guest_hwcursor=true property
v5:
- review suggestions: add const to model aliases, \n to log, %u in trace
- implemented hardware cursor support
v4:
- fix mingw build (from Gerd)
- set dev_id in realize to allow pci_patch_ids to change bios rom
- add model aliases to select device variant by name instead of id
- misc mode switch and 2d fixes (better but still not quite right)
v3:
- add to default-configs/pci.mak instead of mips64el and ppc only
- rename device_id property to x-device-id
- use extract32/deposit32 in *_offs functions
- add ati-vga to vl.c default_list[]
v2:
- Extended debug logs
- Fix mode switching and some registers
- Fixes to 2D functions
hw/display/Kconfig | 6 + hw/display/Makefile.objs | 2 + hw/display/ati.c | 865 +++++++++++++++++++++++++++++++++++++++++++++++ hw/display/ati_2d.c | 167 +++++++++ hw/display/ati_dbg.c | 259 ++++++++++++++ hw/display/ati_int.h | 96 ++++++ hw/display/ati_regs.h | 461 +++++++++++++++++++++++++ hw/display/trace-events | 4 + vl.c | 1 + 9 files changed, 1861 insertions(+) create mode 100644 hw/display/ati.c create mode 100644 hw/display/ati_2d.c create mode 100644 hw/display/ati_dbg.c create mode 100644 hw/display/ati_int.h create mode 100644 hw/display/ati_regs.h
hw/display/Kconfig +6 -0
@@ -106,3 +106,9 @@ config VIRTIO_VGA config DPCD bool + +config ATI_VGA + bool + default y if PCI_DEVICES + depends on PCI + select VGA
hw/display/Makefile.objs +2 -0
@@ -51,3 +51,5 @@ virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS) virtio-gpu-3d.o-libs += $(VIRGL_LIBS) obj-$(CONFIG_DPCD) += dpcd.o obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o + +obj-$(CONFIG_ATI_VGA) += ati.o ati_2d.o ati_dbg.o
hw/display/ati.c new file +865 -0
865 lines not on this page · raw message
hw/display/ati_2d.c new file +167 -0
167 lines not on this page · raw message
hw/display/ati_dbg.c new file +259 -0
259 lines not on this page · raw message
hw/display/ati_int.h new file +96 -0
96 lines not on this page · raw message
hw/display/ati_regs.h new file +461 -0
461 lines not on this page · raw message
hw/display/trace-events +4 -0
@@ -138,3 +138,7 @@ vga_cirrus_write_blt(uint32_t offset, uint32_t val) "offset 0x%x, val 0x%x" sii9022_read_reg(uint8_t addr, uint8_t val) "addr 0x%02x, val 0x%02x" sii9022_write_reg(uint8_t addr, uint8_t val) "addr 0x%02x, val 0x%02x" sii9022_switch_mode(const char *mode) "mode: %s" + +# hw/display/ati*.c +ati_mm_read(unsigned int size, uint64_t addr, const char *name, uint64_t val) "%u 0x%"HWADDR_PRIx " %s -> 0x%"PRIx64 +ati_mm_write(unsigned int size, uint64_t addr, const char *name, uint64_t val) "%u 0x%"HWADDR_PRIx " %s <- 0x%"PRIx64
vl.c +1 -0
@@ -237,6 +237,7 @@ static struct { { .driver = "vmware-svga", .flag = &default_vga }, { .driver = "qxl-vga", .flag = &default_vga }, { .driver = "virtio-vga", .flag = &default_vga }, + { .driver = "ati-vga", .flag = &default_vga }, }; static QemuOptsList qemu_rtc_opts = {
Signature · 1 line
2.13.7
Re: [Qemu-devel] [PATCH v7 2/2] mips_fulong2e: Add on-board graphics chip
In reply to BALATON ZoltanQuoted 7 lines · BALATON Zoltan
Add (partial) emulation of the on-board GPU of the machine. This allows the PMON2000 firmware to run and should also work with Linux console but probably not with X yet.
Signed-off-by BALATON Zoltan <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Mojibaked again :(
I guess this is the last respin and this series will be applied, so to the maintainer: Can you fix using:
Zoltan if you have to respin, please simply use:
Quoted 34 lines
Reviewed-by Aleksandar Markovic <[email protected]>---
v7:
- setvgamem_mbexplicitely to match board instead of relying on defaulthw/mips/mips_fulong2e.c | 7 +++++++ 1 file changed, 7 insertions(+)hw/mips/mips_fulong2e.c +7
-0@@ -287,6 +287,7 @@ static void mips_fulong2e_init(MachineState *machine)I2CBus *smbus;MIPSCPU *cpu;CPUMIPSState *env; +DeviceState *dev;/* init CPUs */ cpu =MIPS_CPU (cpu_create (machine->cpu_type));@@ -347,6 +348,12 @@ static void mips_fulong2e_init(MachineState *machine)vt82c686b_southbridge_init (pci_bus,FULONG2E_VIA_SLOT , env->irq[5 ], &smbus, &isa_bus); +/* GPU */ + dev =DEVICE (pci_create (pci_bus,-1 ,"ati-vga" )); +qdev_prop_set_uint32 (dev,"vgamem_mb" ,16 ); +qdev_prop_set_uint16 (dev,"x-device-id" ,0x5159 ); +qdev_init_nofail (dev); +/* Populate SPD eeprom data */ spd_data =spd_data_generate (DDR , ram_size, &err);if (err) {
Re: [Qemu-devel] [PATCH v7 2/2] mips_fulong2e: Add on-board graphics chip
Quoted 5 lines · Philippe Mathieu-Daudé
Quoted 4 lines · BALATON Zoltan
Add (partial) emulation of the on-board GPU of the machine. This allows the PMON2000 firmware to run and should also work with Linux console but probably not with X yet.
Quoted 8 lines
Quoted 3 lines
Signed-off-by BALATON Zoltan <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Mojibaked again :(
I guess this is the last respin and this series will be applied, so to the maintainer: Can you fix using:
Don't worry, Gerd said before it came out OK as he also uses UTF8 so maybe it only shows up wrong in your email client.
Quoted 4 lines
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Zoltan if you have to respin, please simply use:
I've tried adding some headers to specify encoding which I'll use next but I did not bother for this resend as it worked before.
Regards,
BALATON Zoltan
Quoted 1 line · BALATON Zoltan
Rebase on master to fix build with new
Kconfigbased stuff.
Thanks. Pull v2 sent.
cheers,
Gerd