• Showing Page History #114123

ATI VGA Emulation

This subproject is about emulating an ATI VGA graphics card. This is not an easy task due to the complexity of these GPUs and while the final goal may be to emulate most features of some real GPU it should be done step-by-step, starting from simple and adding more features incrementally, otherwise this would be too big a task. It should probably also be broken down into smaller areas such as 2D, video accel, 3D, etc. so this subproject is likely bigger than others and almost has its own subprojects.

Where to start?

Two of the machines currently emulated by QEMU have an on-board or default ATI GPU:

The Rage 128 Pro is the last of the Rage GPUs while the Radeon Mobility 7000 is the simplest of the next generation Radeon GPUs (originally meant to be Rage 6, hence the M6 code name for the Mobility version). The 7000 (originally also called Radeon VE) and the M6 are built on the RV100 GPU which is a simplified version of the R100 Radeon chip lacking its more advanced features. These two chips, being almost direct descendents, are in practice very close so they can likely be emulated by mostly the same code only with some differences so they could be targeted together. MorphOS has driver for both but only supports 3D with the RV100, AmigaOS only supports RV100. MacOS (on mac99) and Linux also has drivers for both so these are a good first target (that may later be enhanced up to X1000/R520 which are the last Radeon chips after which the architecture has changed again).

To further trace back the genealogy of these chips, they are improved versions of the Rage 128 GL which itself stems from the Rage Pro. Therefore, information on these chips could also be useful to understand how these chips have evolved and what has changed between versions. Documentation of these GPUs are not freely available (ATI/AMD has only published info on chips newer than R300) so they cannot be collected here but careful readers should notice that they are not too hard to find.

So the plan is to start with Rage 128 Pro and RV100 and implement enough to get a Linux console on mac99 and mips_fulong2e then improve 2D acceleration to get X working, after that maybe add video overlay so MorphOS R128 driver can work and then implement 3D to reach RV100. From there it could be enhanced towards R520 which may seem very distant but mentioning it is no accident, it is what the Xenos GPU of the XBox 360 is based on and Xenia already has some emulation of, so it might be possible to take inspiration or even code from there to improve 3D emulation without doing it from scratch. Of course this is still a lot of work and likely I can't do it alone but that's why this project was created to bring together interested people who could together reach a goal that could not be reached individually.

Current status and known issues

We are at the very beginning but I could get console output with Linux on mac99 and with the PMON2000 firmware on mips_fulong2e. This is now in upstream QEMU in the form of the experimental ati-vga device. Problems with everything else will be detailed in tickets later for tracking but just mentioning for reference that sam460ex firmware has the same problem with VGA BIOS that is mentioned at known issues with Pegasos2 so its BIOS emulator fails with QEMU's default vgabios. The same work around (or using a ROM from a real card) could be used but then mode switching fails and it cannot set right resolution. On mac99 OpenBIOS does not run the option ROM but has its own driver which seems to work at least with Linux but MacOS does not find the card presumably because of missing info in device tree and driver that the Mac ROM of the real card would set up. (I've also tried with a real card ROM but OpenBIOS seems to miss support for runing fcode ROMs. There's a workaround for this in the QEMU command line so the ROM start but then it's missing EDID info or some other parts so it's not working yet.)