hw/display: Add basic ATI VGA emulation
PATCH v2 1/1 hw/display: Add basic ATI VGA emulation
At 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 console 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 only enabled for mips64le and ppc now but only the fulong2e (which currently has no display output at all) is set to use it by default (in a separate patch).
---
Tested with Debian 8.11.0 powerpc on mac99 and the pmon_2e.bin fulong2e firmware from https://mirrors.cloud.tencent.com/loongson/pmon/
v2:
- Extended debug logs
- Fix mode switching and some registers
- Fixes to 2D functions
default-configs/mips64el-softmmu.mak | 1 + default-configs/ppc-softmmu.mak | 1 + hw/display/Makefile.objs | 2 + hw/display/ati.c | 638 +++++++++++++++++++++++++++++++++++ hw/display/ati_2d.c | 75 ++++ hw/display/ati_dbg.c | 254 ++++++++++++++ hw/display/ati_int.h | 75 ++++ hw/display/ati_regs.h | 454 +++++++++++++++++++++++++ hw/display/trace-events | 4 + 9 files changed, 1504 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
default-configs/mips64el-softmmu.mak +1 -0
@@ -13,3 +13,4 @@ CONFIG_VT82C686=y CONFIG_MIPS_BOSTON=y CONFIG_FITLOADER=y CONFIG_PCI_EXPRESS_XILINX=y +CONFIG_ATI_VGA=y
default-configs/ppc-softmmu.mak +1 -0
@@ -56,6 +56,7 @@ CONFIG_DEC_PCI=y CONFIG_IDE_MACIO=y CONFIG_MAC_OLDWORLD=y CONFIG_MAC_NEWWORLD=y +CONFIG_ATI_VGA=y # For PReP CONFIG_PREP=y
hw/display/Makefile.objs +2 -0
@@ -53,3 +53,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 +638 -0
638 lines not on this page · raw message
hw/display/ati_2d.c new file +75 -0
75 lines not on this page · raw message
hw/display/ati_dbg.c new file +254 -0
254 lines not on this page · raw message
hw/display/ati_int.h new file +75 -0
75 lines not on this page · raw message
hw/display/ati_regs.h new file +454 -0
454 lines not on this page · raw message
hw/display/trace-events +4 -0
@@ -137,3 +137,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) "%d 0x%"HWADDR_PRIx " %s -> 0x%"PRIx64 +ati_mm_write(unsigned int size, uint64_t addr, const char *name, uint64_t val) "%d 0x%"HWADDR_PRIx " %s <- 0x%"PRIx64
Signature · 1 line
2.13.7