MorphOS and R300
  • MorphOS Developer
    bigfoot
    Posts: 510 from 2003/4/11
    Hi there,

    As a quick introduction for those of you who don't know, I am the MorphOS developer also known as Mark Olsen. Together with Frank Mariak, Michal Wozniak and Nicolas Sallin we're responsible for for graphics in MorphOS, doing everything from basic hardware support (such as AGP) to high-level APIs (such as OpenGL).

    Since the release of MorphOS 3.2, there has been a lot of discussion about MorphOS' R300 support. While R300 GPUs have been supported in 2D only earlier than MorphOS 3.2, using R300 GPUs with MorphOS outside of laptops had been quite rare before MorphOS 3.2. With MorphOS 3.2, Powermac G5 support was also introduced, meaning that MorphOS got a lot of new R300 users as well. This post aims to clear up some misunderstandings when it comes to MorphOS R300 support as well as talk a bit about future R300 improvements in MorphOS.

    The Hardware

    First I want to explain a bit about the R300 family of GPUs. There is a total of 11 different chips in the R300 family of GPUs. For desktop class chips they are the R300, R350, R360, RV350, RV351, RV360, RV370 and the RV380. For laptops they are the M10, M11 and the M12. While the main difference between these chips is their hardware configuration (such as how many rendering pipelines they have), another big difference is their system bus support. The most common chips seen in MorphOS systems are the RV350 (most Radeon 9600s), the R350 (Radeon 9800, Radeon 9800 SE and Radeon 9800 Pro) and the M10/M11/M12 chips found in the laptops, which are all based on RV350.

    Hardware Compatibility

    Many users reported that their Radeon 9800 cards did not work with MorphOS 3.2. While it is a common belief that Radeon 9800s simply did not work with MorphOS 3.2, that's not true. In fact my initial R300 development system was an Efika with a Radeon 9800 Pro card installed.

    efika-9800.jpeg

    The issue here was that the R350 used in the Radeon 9800 has a compatibility problem with the AGP controller found in Powermac G5 systems, so only the combination of the two caused problems. Unfortunately G5 machines is where the vast majority of all 9800s are installed, so that's why it seemed like that Radeon 9800 cards did not work at all.

    Morphzone user Papiosaur gave me a Radeon 9800 Pro Mac card. I spent a couple of days analysing this problem from the driver point of view and found out that AGP transfers of a certain specific size would cause the lockup. I wrote some code that made the driver avoid submitting that exact amount of data to the graphics card, by padding some extra data at the end of such requests. However, while doing so made the 9800 work a lot better, in the end such a workaround proved impossible to make 100% stable as it was not possible to control how the Radeon scheduled data transfers when it had several outstanding requests waiting. The solution became to completely disable AGP support on such setups, meaning that in MorphOS 3.3 Radeon 9800 cards on G5 machines operate entirely with MMIO.

    3D Performance

    Some users have expressed dissatisfaction with the 3D performance of R300 cards on MorphOS. It is very true that compared to the R200, which has seen a lot of optimisation work done on it, R300 cards don't perform particularly well on MorphOS 3.3 compared to R200 cards.

    mini_g5-9600_g5-9800pro_fodquake-0.3_morphos-3.3.png

    As you can see, in my Fodquake test the Mac Mini with its M9+ (an RV280 chip) easily beats the G5 with both its Radeon 9600 and Radeon 9800 Pro options. What's worse, the Radeon 9600 seems to outperform the Radeon 9800 Pro in the G5.

    So what's going on here? First, let's take a look at the theoretical performance of these 3 setups. While the Radeon 9600 and 9800 Pro have a lot more pixel processing power, this is something that's not very relevant for the type of 3D games we currently have on MorphOS. These all use the fixed function OpenGL pipeline and thus tax the GPU's pixel processing power very, very lightly. What really matters for 3D performance on MorphOS is how fast you can read textures, read and update the Z buffer and write to the frame buffer. These are all mainly determined by the memory bandwidth of the graphics cards, so let's have a look at the theoretical maximum memory bandwidth of these GPUs:

    Radeon 9200: 6.4GB/s
    Radeon 9600: 6.4GB/s
    Radeon 9800 Pro: 21.76GB/s

    So actually the theoretical memory bandwidth of the Radeon 9200 and the Radeon 9600 is the same. The Radeon 9600, despite its 'high' model number, is actually a rather slow Radeon model when it comes to memory performance. The 9800 Pro, though, should perform considerably better considering it has 3 times the theoretical memory bandwidth of the Radeon 9200 and 9600. For an explanation, we have to look back at the problem with R350 GPUs and Powermac G5 AGP I mentioned earlier. The G5/Radeon 9800 combination is being crippled by the fact that all vertex data and all register updates are being pushed to the graphics card one word (4 bytes) at a time. This really, really cripples the performance of the Radeon 9800.

    I spent a couple of days working on getting more performance out of R300-based graphics cards. First I started with the Radeon 9600. It being a low performance card, I focused on optimising the vertex data processing to bring it up on par with the equivalent code in the R200 driver. This helps the system keep the graphics card busy as often as possible, improving the overall frame rate obtained.

    g5-9600_fodquake-0.3.png

    The results speak for themselves. In low resolution, the G5/9600 combination jumped from 82.8 to 159 FPS. In high resolution, the performance improvement was more modest, going from 57.1 to 61.7 FPS. Still, this brings the Radeon 9600 a lot closer to the performance of the Radeon 9200, which it should be about as fast as. Next up came the Radeon 9800. It running on MMIO on G5 machines, I had to put some extra effort into making sure that as little data as possible was pushed through its command buffer. Combining the vertex data optimisation with more aggressive OpenGL state change optimisations resulted in a
    clear performance win for the G5/9800 combination at both low and high resolutions.

    g5-9800_fodquake-0.3.png

    In both low and high resolution, the G5/9800 combination now gives a more than 3 times as high framerate as it does with MorphOS 3.3.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »19.10.13 - 16:56
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2795 from 2006/3/21
    From: Northern Calif...
    Thanks for the in depth explanation Mark!

    And also for all the hard work that you do to make MorphOS the best it can be.

    It is open communications like the one you just posted that gives MorphOS users confidence that they have chosen the right OS to stick with, plus the obvious advantages MorphOS has over any other Amiga-Like operating system.

    I hope that we will see more announcements and explanations about MorphOS development in the future from you and all other MorphOS Dev. Team members.

    One question though, do you anticipate finding an even better solution to the problem with the Radeon 9800 graphics cards in the future, or is the current solution you are working on going to be the final path chosen to work around the apparent hardware problem found in 9800 series cards?

    Thanks again for your excellent explanation of what is going on with your development work.
    MorphOS - The best Next Gen Amiga choice.
  • »19.10.13 - 18:14
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    AyoS
    Posts: 410 from 2003/8/13
    From: West Palm Beac...
    Thanks for the work done and the explanation... I just recently purchased a G5 system and look forward to getting Morphos working on it... right now it has a 9600 fitted, but knowing this it is nice to know that I could upgrade to a 9800 if I wanted or needed too. Thanks Again!
  • »19.10.13 - 19:32
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 523 from 2013/5/29
    Excelent post BigBoost...heeeerr Bigfoot! Thanks.
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »19.10.13 - 20:34
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    Great post. I really appreciate getting some insight to the status of MorphOS internals. How much potential is there for further improvements to R300 support?
    PPC assembly ain't so bad... ;)
  • »19.10.13 - 22:21
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12157 from 2003/5/22
    From: Germany
    > The issue here was that the R350 used in the Radeon 9800 has a compatibility
    > problem with the AGP controller found in Powermac G5 systems [...]. [...] The
    > solution became to completely disable AGP support on such setups, meaning that
    > in MorphOS 3.3 Radeon 9800 cards on G5 machines operate entirely with MMIO.

    Do you know if this compatibility problem is also there on MacOSX? If yes, do you know if Apple implemented the same solution?
  • »19.10.13 - 22:26
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12157 from 2003/5/22
    From: Germany
    > the apparent hardware problem found in 9800 series cards

    Reading bigfoot's posting I think it's not quite clear whether the root of the problem is in the R350 chip of the 9800 series cards or in the AGP controller of the CPC925/U3 northbridge chip in the PowerMac G5. He just says there's an incompatibility, which I'd say leaves either possibility. After all, the Radeon 9800 series cards seem to work fine in the PowerMac G4 with AGP transfers enabled.
  • »19.10.13 - 22:43
    Profile
  • Caterpillar
    Caterpillar
    saib0t
    Posts: 24 from 2010/3/20
    From: Hunnebostrand,...
    Excellent post Mark!
    It's posts like this from you developers that makes the MorphOS community to the best community.
    Thanks for sharing, great and interesting reading!
    MorphOS Nordic
    011100110110000101101001011000100011000001110100
  • »20.10.13 - 06:43
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Zylesea
    Posts: 2057 from 2003/6/4
    Thank you for that post and your work. As others said already, that kind of communication is greatly appreaciated. And seeing R3xx support getting better is also awsome.
    --
    http://via.bckrs.de

    Whenever you're sad just remember the world is 4.543 billion years old and you somehow managed to exist at the same time as David Bowie.
    ...and Matthias , my friend - RIP
  • »20.10.13 - 08:52
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Jambalah
    Posts: 820 from 2008/3/30
    From: Roma, Italy
    Nice and interesting explanation! Like the work you are doing.
    Thanks Mark!!
    Pegasos II 1 ghz
    Powermac G4 Quicksilver with Sonnet Encore 1.8 ghz
    Powermac G4 MDD single 1.25 ghz, silenced for ears health...
    Powermac G5 dual 2.7 ghz I'll be back...
    Powermac G5 dual 2.0 ghz
    Powerbook G4 1.67 ghz 17
  • »20.10.13 - 10:33
    Profile
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 464 from 2003/7/25
    From: Wroclaw/Poland
    Great infos! Thank you for your job.

    I have a question about graphics drivers for PowerBookG4 (Radeon 9700). Is any chance for enable creating other graphics modes? I have only native gfx mode (1440x960) but sometimes I would like to use screens with smaller resolutions (e.g. demos, games).
  • »20.10.13 - 14:39
    Profile Visit Website
  • MorphOS Developer
    cyfm
    Posts: 537 from 2003/4/11
    From: Germany
    Quote:

    MDW schrieb:
    Great infos! Thank you for your job.

    I have a question about graphics drivers for PowerBookG4 (Radeon 9700). Is any chance for enable creating other graphics modes? I have only native gfx mode (1440x960) but sometimes I would like to use screens with smaller resolutions (e.g. demos, games).


    We will add that in some future update - this is without a doubt a eagerly anticipated feature requested by many PowerBook users running MorphOS ....
  • »20.10.13 - 17:11
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    boot_wb
    Posts: 874 from 2007/4/9
    From: Kingston upon ...
    Quote:

    pega-1 wrote:
    Quote:

    MDW schrieb:
    Great infos! Thank you for your job.

    I have a question about graphics drivers for PowerBookG4 (Radeon 9700). Is any chance for enable creating other graphics modes? I have only native gfx mode (1440x960) but sometimes I would like to use screens with smaller resolutions (e.g. demos, games).


    We will add that in some future update - this is without a doubt a eagerly anticipated feature requested by many PowerBook users running MorphOS ....



    /me hugs Frank.

    Thanks guys, I guess this really is the kind of thing MorphOS developers do in an afternoon. ;-)
    www.hullchimneyservices.co.uk

    UI: Powerbook 5,6 (1.67GHz, 128MB VRam): OS3.1, OSX 10.5.8
    HTPC: Mac Mini G4 (1,5GHz, 64MB VRam): OS3.1 (ZVNC)
    Audiophile: Efika 5200b (SB Audigy): OS3.1 (VNC + Virtual Monitor)

    Windows free since 2011!
  • »20.10.13 - 17:40
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 510 from 2003/4/11
    Quote:

    One question though, do you anticipate finding an even better solution to the problem with the Radeon 9800 graphics cards in the future, or is the current solution you are working on going to be the final path chosen to work around the apparent hardware problem found in 9800 series cards?


    Experience unfortunately shows that I'm very bad at predicting the future ;) Since I don't have any way to find out what is really going on on the hardware/bus level, all I can do is come up with an idea and try it. Either I manage to guess right or I decide that the time I'm putting into it is no longer worth it.

    Quote:

    Great post. I really appreciate getting some insight to the status of MorphOS internals. How much potential is there for further improvements to R300 support?


    For any remotely complex piece of software there will always be optimisation opportunities. But since I am of course picking the low hanging fruit first, each successive thing I do to optimise the driver will result in a gradually smaller improvement compared to the time spent doing the optimisation. At some point it stops being worth it, and sometimes you also end up valuing the clarity of the source code over a 0.05% speed improvement, which is also something to consider.

    Quote:

    Do you know if this compatibility problem is also there on MacOSX? If yes, do you know if Apple implemented the same solution?


    Since hardware bugs are independent from software, there are two possibilities: either the way they use the hardware never exposed the problem in the first place or they ran into the problem, got their hardware guys to analyse it and implemented a workaround. In any case, I have no specific knowledge of what Apple have (or haven't) done.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »20.10.13 - 18:14
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Thanks for the update Mark, much appreciated. I'm sticking with the 9650 in my G5 at the moment despite having a 9800 in a drawer doing nothing.

    I might try the 9800 under Linux though if I get the time just to see how it performs there.
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »20.10.13 - 19:21
    Profile
  • Just looking around
    Valwit
    Posts: 3 from 2008/4/21
    From: Ireland
    Quote:

    bigfoot wrote:

    Since hardware bugs are independent from software, there are two possibilities: either the way they use the hardware never exposed the problem in the first place or they ran into the problem, got their hardware guys to analyse it and implemented a workaround. In any case, I have no specific knowledge of what Apple have (or haven't) done.



    any chance some Linux guys came across the issue? Or maybe it also affects the PC cards? If not it would narrow it down to the Mac hardware.
  • »21.10.13 - 06:02
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Crumb
    Posts: 732 from 2003/2/24
    From: aGaS & CUAZ Al...
    thank you Mark. Excellent post and excellent work :-)
  • »21.10.13 - 11:14
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2795 from 2006/3/21
    From: Northern Calif...
    Too soon to know, but maybe the problem with the Radeon 9800 and G5 PowerMac models will disappear when we can move up another notch to the R400 series Radeon video cards. I already have an excellent R400 Radeon FireGL video card for my dual 2.7GHz G5 PowerMac, and would love to run MorphOS3.x on that combination. It works quite well running MacOSX 10.5.8, and I will soon also test it running a couple different flavors of Linux PPC.

    If even just 2D support could be completed for the R400 series cards, I would be satisfied for a year or two while waiting for 3D support to be completed.

    Mark, can you tell us if any work has been started (or completed) regarding 2D support for any R400 Radeon cards, or when we might be able to run MorphOS3.x in 2D only mode on any R400 Radeon video card?

    I have already tried to install the earliest version of MorphOS3.2 on my dual 2.7GHz G5 PowerMac with my Radeon FireGL X3 video card, but did not see any video response, so gave up.

    Does anyone else have MorphOS3.3 running on any of the R400 based Radeon video cards, in either a G4, or G5 PowerMac?

    [ Edited by amigadave 21.10.2013 - 14:49 ]
    MorphOS - The best Next Gen Amiga choice.
  • »21.10.13 - 21:44
    Profile
  • MorphOS Developer
    cyfm
    Posts: 537 from 2003/4/11
    From: Germany
    Quote:


    amigadave wrote:
    Does anyone else have MorphOS3.3 running on any of the R400 based Radeon video cards, in either a G4, or G5 PowerMac?



    Maybe everyone else has read http://www.morphos-team.net/hardware, especially the section where it lists the supported graphics cards ?

    Quote:


    .... or when we might be able to run MorphOS3.x in 2D only mode on any R400 Radeon video card?



    Didn't Mark already mention that he is bad at predicting the future ? :)

    So amigadave, as Jim might have told you already, he was so kind to send us both a genuine G5 X800 and reflashed FireGLX3 card to add support in the future. There is been some work ongoing, it might be supported in the future but don't expect us to leave R300 class drivers behind in favour of R400 support, this would just be plain silly considering the fact that a large amount of currently supported MorphOS systems still relies on R200/R300 class drivers.
    Adding R400 support to the current driver is possible with reasonable efforts but we should probably leave "X is already running X800 in his closet" and "Y is releasing R500 drivers in Q3/Q4 2014" style statements up to others ....
    It's done when you find it in our update notes :P

    And while many people already dislike the idea of buying a used system to run MorphOS, what do you think would be the reaction if we told anyone to get hold of a reflashed PC BIOS R4xx card just to use 3D acceleration at max speed ?

    Just my two cents and thanks for your attention ....
  • »21.10.13 - 23:14
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2795 from 2006/3/21
    From: Northern Calif...
    Quote:

    pega-1 wrote:
    Quote:


    amigadave wrote:
    Does anyone else have MorphOS3.3 running on any of the R400 based Radeon video cards, in either a G4, or G5 PowerMac?



    Maybe everyone else has read http://www.morphos-team.net/hardware, especially the section where it lists the supported graphics cards ?


    Of course you are correct, but I was not asking if any R400 video card was "Officially Supported" yet. Being a layman who is unfamiliar with how video card drivers work, I wrote my question above to find out if it was possible for the existing R200, or R300 drivers to work with an R400 video card, in just the 2D mode. I was asking if any other users had even tried to use an R400 video card with the current R200/R300 drivers. If that is a stupid question, then just consider the uneducated source and ignore my stupidity.
    Quote:


    Quote:


    .... or when we might be able to run MorphOS3.x in 2D only mode on any R400 Radeon video card?



    Didn't Mark already mention that he is bad at predicting the future ? :)

    So amigadave, as Jim might have told you already, he was so kind to send us both a genuine G5 X800 and reflashed FireGLX3 card to add support in the future. There is been some work ongoing, it might be supported in the future but don't expect us to leave R300 class drivers behind in favour of R400 support, this would just be plain silly considering the fact that a large amount of currently supported MorphOS systems still relies on R200/R300 class drivers.
    Adding R400 support to the current driver is possible with reasonable efforts but we should probably leave "X is already running X800 in his closet" and "Y is releasing R500 drivers in Q3/Q4 2014" style statements up to others ....
    It's done when you find it in our update notes :P


    As I tried to explain above, I was interested in knowing if an R400 video card could work with existing R200/R300 drivers, in 2D mode only, not asking about any progress or estimated time frame when a true R400 driver would be completed.

    If it is not possible for an R400 video card to work at all with either of the existing MorphOS video card drivers, then I don't expect any work on the R300 driver to be sacrificed, in favor of working on the R400 driver instead.


    Quote:

    And while many people already dislike the idea of buying a used system to run MorphOS, what do you think would be the reaction if we told anyone to get hold of a reflashed PC BIOS R4xx card just to use 3D acceleration at max speed ?

    Just my two cents and thanks for your attention ....





    I don't think anyone would object to the idea of needing to purchase a reflashed PC BIOS R4xx card to use 3D acceleration at max speed. If for some strange reason the R400 driver proved to be easier to implement than the R300 driver, I think that most all MorphOS users would be glad to upgrade to the fastest supported video card they can get with no complaints about skipping a generation of video cards that may, or may not have some kind of hardware flaw that makes completing the 3D support difficult, or impossible, in the G5 PowerMac models. The R400 cards can after all be modified to be used in the G4 PowerMac's as well as the G5's.

    I hope this clears up the intentions of my "uneducated" questions.



    [ Edited by amigadave 21.10.2013 - 21:13 ]
    MorphOS - The best Next Gen Amiga choice.
  • »22.10.13 - 04:00
    Profile
  • MorphOS Developer
    cyfm
    Posts: 537 from 2003/4/11
    From: Germany
    I'm sorry if I sounded a bit rude in my previous reply but it really doesn't make any sense to try a graphics card that is not upon the list of supported cards. The Radeon driver will just quit silently if it detects an unknown graphics card.
  • »22.10.13 - 23:17
    Profile Visit Website
  • Butterfly
    Butterfly
    Get27
    Posts: 90 from 2004/8/23
    From: Vinzelles, France
    @pega-1 : It can have "no officialy / top secret" supported hardware that works. For example :

    Radeon 9500 pro are not listed but works (ok it's like Radeon 9700 but not the same name).

    On this grab (http://www.exception-dev.de/mos/g5gfxcard.png), GraphicBoards say "Radeon 9600 / X1050" so Radeon X1050 must works even if there are not listed too.

    Dev can forget a beta driver at release too :)

    So i'm happy to say that i'm a bit silly to test unsupported graphic card when new MorphOS release come out :)
    PowerMac 3.5, G4 1.0GHz DP, 1GB ram, 80GB HD + NAS, Radeon 9600 128MB Mac, 1680x1050
    PowerMac 7.3, G5 2.3GHz DP, 4GB ram, 160GB HD + NAS, Radeon 9800 128MB PC, 1680x1050
    Amiga 500+, Vampire 500v2+, HxC Floppy
  • »22.10.13 - 23:52
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Quote:

    Get27 wrote:
    @pega-1 : It can have "no officialy / top secret" supported hardware that works. For example :

    Radeon 9500 pro are not listed but works (ok it's like Radeon 9700 but not the same name).

    On this grab (http://www.exception-dev.de/mos/g5gfxcard.png), GraphicBoards say "Radeon 9600 / X1050" so Radeon X1050 must works even if there are not listed too.

    Dev can forget a beta driver at release too :)

    So i'm happy to say that i'm a bit silly to test unsupported graphic card when new MorphOS release come out :)


    Yeah, my G5 came with a 9650 Pro and I wasn't expecting it to work so I was pleasantly surprised when it did. :)

    It's actually a worse performing card for 3D than the 9600XT, it just has more RAM and dual DVI outputs.

    http://www.barefeats.com/rad9650.html
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »23.10.13 - 00:03
    Profile