Projects » Amiga OS 4 Projects » RadeonHD Driver » RadeonHD Development Log » RadeonHD.chip - Radeon HD 4350 PCI VGA Output is Working

RadeonHD.chip - Radeon HD 4350 PCI VGA Output is Working

Radeon HD 4350 screenmode closeupAfter days of persistent effort, the VGA output on Radeon HD 4350 that eXec magazine donated to me is finally working on Amiga OS 4.x. This is the first time that a current generation graphics card is working on Amiga OS 4.x. Granted, there is no hardware acceleration yet, but the start is there. The problem was small, but very hard to find. To give people an idea of how frustrating driver development can be, here is the whole saga.

Finding a needle in a Haystack

HIS Radeon HD 4350 PCI boxEverything started when I received the HIS Radeon HD 4350 PCI card in a nice shiny box. Given that the  AtomBIOS is supposed to enable initialization of any card regardless of type, I was hopeful that I would get an image immediately. After plugging in the card and starting the driver, the card was recognized, but the monitor gave a "no signal" message. The DVI output also failed to work, but the debug log indicated that the driver did not know how to handle the new output type. Rather disappointing.

With progressively more debug output enabled, the long and arduoud task of debugging began. Eventually I noticed that the SetPixelClock AtomBIOS call was disabling the output, and the driver was calling this after enabling the output; one bug fixed, but still nothing.

Digging deeper, I discovered that SetPixelClock was overwriting parameters before using them. This turned out to be a n endianness bug in the AtomBIOS interpreter (lesson, C bitfields can be problematic). With this bug fixed, the monitor finally  indicated that it had a signal with the right resolution, but the display was black.

After many more hours of trying to track down the issue, I fired off an email to AMD's Open GPU email address that explained my problem, and asking what order the AtomBIOS calls should be made in; maybe there was a similar issue to SetPixelClock disabliing the output. The response from AMD was surprisingly fast; within a day I had the call order, and debugging proceeded. Eventually I noticed that the screen was still blanked; I could change the screen colour by changing the blanking colour.

At this point I was running out of ideas. So I decided to plug in my Radeon 2400 pro card and record register settings. Hopefully the framevuffer registers were similar enough that I could compare the registers and look for anomalies. To my horror, I was greeted with a black screen. After looking back at previous revisions, I eventually found out that I had introduced a bug over the course of trying to get the new card running. This bug left the first output in a blanked state.

With the blanking bug fixed, the Radeon HD 4350 was reinserted, and, produced a black screen. This time the blanking was not to blame. I decided that it was time to test the card out on a PC, and perform a register dump for comparison. So, the card was inserted into a machine and the Windows drivers were installed. Unfortunately the register dump tool (hws_script) refused to work on Windows. Next a Mythbuntu CD was inserted, the fglrx driver (i.e., AMD's driver)  was installed and a register dump made. This register dump turned out to be bogus due to the radeon_dump tool not recognizing the card, and dumping the zero page. After fixing radeon_dump, a real register dump was made. Comparing this to a register dump from the RadeonHD.chip driver showed nothing wrong.

By this stage many days had passed, and most possibilities had already been tried. Using the AtomBIOS disassembler and poring over the code drew a blank. I wrote a small tool that would allow me to copy portions of the  fglrx register dump into the card's registers; perhaps I had missed something, and this would show me which registers were wrong. This was a bit dangerous, since one shouldn't be poking values into registers without knowing what they do, but I could think of nothing else to try. Still nothing. Copying the fglrx register values - almost all of them - into the graphics card's registers still resulted in a synced but black screen. 

Clearly the final register values were correct, but there was still something preventing the card from working. I suspected that the memory controller was frozen somehow, but how should this be solved? Well, this morning I remembered an issue with a different card freezing, which was related to the memory controller initialization, and that the AtomBIOS' ASICInit call also initialized the memory controller, I modified the driver to disable the VGA output, and wait for the memory controller to be idle before executing ASIC Init. A recompile later, and I was greeted with the screen-mode test image. Finally.

Radeon HD 4350 test screen

Radeon HD 4350 test screen close-up

This bug also exists in the open source Linux drivers, so I have sent an email to the Linux driver developers to let them know about this issue. That way they won't have to spend so many frustrating hours tracking it down. It's always nice to be able to contribute back to the open-source project that has helped me get this far.

Thank You Once Again to eXec Magazine and All Those Who Donated

Once again a big thank you to the eXec magazine and all those generous people who have donated to this project. Thanks to these donations it is now possible to use the Radeon 4350 with Amiga OS, albeit minus hardware accelation at present. Tracking down the bug has been time consuming and frustrating, but it has improved the driver, and paves the way for using the latest generation Radeon HD cards.

Where to Now?

Now that the VGA output on this card works, I am gooing to return to adding compositing support for R500 based cards. DVI output for the Radeon HD 4350 can wait. After that, work on hardware acceleration for R600+ cards will begin. Those with an eye for detail may notice a change for R600+ cards in the screen-shots above (hint, look at screen shots in previous entries to this development log).



Projects » Amiga OS 4 Projects » RadeonHD Driver » RadeonHD Development Log » RadeonHD.chip - Radeon HD 4350 PCI VGA Output is Working

Post your comment

Comments

  • This test pattern should be uploaded on to you tube. It's such a great looking test pattern.in full hd 16x9 version would look fantastic.

    Posted by Kevin williams, 22/07/2015 11:35pm (2 years ago)

  • Hi Zvezdan,

    You're better off to use the forums (http://hdrlab.org.nz/forums/) to ask questions rather than the comments here; I'm more likely to see forum posts.

    To answer your question, I don't have a time-frame for driver completion. It will be several months at least before it's ready. In the meantime I recommend that people use a Radeon 9000 series card, because 3D drivers for Radeon HD cards will take even longer.

    regards,
    Hans

    Posted by Hans, 24/10/2009 6:44pm (8 years ago)

  • Congratulations,

    i am thinking to buy Sam Amiga and new driver is a great advantage.
    Hans, what is aproximate estimation in months about finishing driver?
    Thank you in advance.
    Greetings from Serbia

    Posted by Zvezdan, 24/10/2009 1:07pm (8 years ago)

  • Hi Harald,

    Congratulations on spotting the change. Yes, it's the byte-order change; the driver now uses big-endian modes on R600+ cards too. No prize other than being the first (only) person to figure it out. I was starting to think that no-one would find it.

    regards,
    Hans

    Posted by Hans, 20/10/2009 3:56pm (8 years ago)

  • I guess the byte order changed from ARGB to BGRA.

    Did I win a price? ;-)

    Nice to see that 16:9 is also supported. You got yourself a new monitor to replace that old BenQ?

    THe Dutch "dozenschuiver" Club3D has also announched an HD4350 PCI card. As soon as they release this card, i'll buy one and apply for beta testing.

    Posted by Harald, 20/10/2009 2:50am (8 years ago)

  • Just received my copy of Amiga Future, read the news and immediately came here for infos (and to make a donation of course ;) ) Keep up the great work this would be the best development for Amiga together with 4.1 and SamFlex ^__^

    Posted by David, 29/09/2009 4:14am (8 years ago)

  • Hi Greg,

    No, it's not the drop-shadow, which I hadn't even thought about when I captured the screenshot.

    Posted by Hans, 29/08/2009 4:26pm (8 years ago)

  • Nice work!

    My guess on "eye for detail": drop-shadow on the dialog.

    Posted by gregthecanuck, 28/08/2009 11:04pm (8 years ago)

  • Hans,

    All that mess looks oh so familiar to me... welcome to driver writer's hell :)

    Posted by Stéphane Guillard (sg2), 28/08/2009 3:39pm (8 years ago)

  • Hans, you does an amazing work ! Thanks for that. You also share information and it is very much appreciated.
    Last, you explain perfectly the difficult task that development is, with frustration but so also much fun and pride at the end !

    Posted by Corto, 25/08/2009 1:18pm (8 years ago)

RSS feed for comments on this page | RSS feed for all comments


Projects » Amiga OS 4 Projects » RadeonHD Driver » RadeonHD Development Log » RadeonHD.chip - Radeon HD 4350 PCI VGA Output is Working