Take a look in the source tree for either of the open source DDX drivers at http://cgit.freedesktop.org :
Click on "tree" to view the source code, then look at the file src/atombios/includes/atombios.h. That header file contains all of the atombios structure definitions. We released the header file with a license which lets you use it in other projects as well.
Note that we update this file from time to time, in order to add or revise data structures relevent to new GPUs.
Thanks. I have to write graphics driver for HD series for QNX 6.4.x RTOS. The main problem which I have is how to detect XTAL clock frequency to calculate proper CRTC settings. Can I rely on fact that it is fixed to 27MHz only or some manufacturers could change reference clock ? That is why I need to read reference clock from ATOM BIOS structures, but I supposed to obtain a good datasheet for it Ok, I have to read the sources.
By the way, xf86-video-ati doesn't uses overlays, only textured video. And open RV630 documentation doesn't have any video overlay format descriptions, except for RGB. But a couple of registers are used for colorspace conversion, so I suppose RV630 is able to show YUV overlays, not RGB with 16/32 bpp only, but these formats are no documented, am I right ?
If that's all you need then you probably don't need to look at the source. There's a ROM header at the front of the image; that structure points to a list of data tables. One of the data tables is FirmwareInfo; the structure for ATOM_FIRMWARE_INFO includes the reference clock freq in 10 KHz units.
The radeon (xf86-video-ati) driver does use overlays (or textured video) on pre-5xx GPUs with the older display controller. That display controller had a lot of video processing hardware in the overlay block; on the newer chips have enough processing power to do it easily on the 3D engine.
If you really need an overlay, the 630 and m76 docs do give you format information for either ARGB or ACbYCr (look under the 32-bit formats). I believe you need to set up the conversion matrix to go from YCbCr to RGB; don't think we use that capability in either open or proprietary drivers today so I'm guessing...
Are you planning to support just one GPU (eg an embedded app) or the whole range ? If the latter, you might want to think about porting the AtomBIOS interpreter across to make your life simpler.
I know that this is a (relatively) old topic, but I would like to extend it with a simple question:
Is there any documentation on using AtomBIOS from outside the linux kernel like there is for the VESA VBE ( http://www.petesqbsite.com/sections/tutorials/tuts/vbe3.pdf ) (i.e., explanations of interrupts)?
AFAIK, the pci (and pci express) configuration space is all about that: interrupts (IRQs), ports, and device-mapped memory regions. You probably won't provide any documentation about this.
The BIOS, on the other hand, is all about "software" interrupts, and most of the BIOS code is firmware loaded from physical hardware.
So: How do you access AtomBios? I assume it is done through some interrupts, like VESA BIOS. But why is this required AtomBIOS documentation such a big secret at AMD that all you can do is send us to the AtomBIOS.h header file? There is no useful information for us there! It's just a bunch of #defines, typedefs and structure definitions - with no informational comments or anything at all. No wonder your open source driver developers didn't want to use it at first!
Plainly put: What interrupts are involved in accessing AtomBios and which are the functions supported by those interrupts?
If you don't have this documentation, then why are you hyping on about supporting open-source developers? Either stop doing that, or give us some documentation!
Quick answer is that the AtomBIOS calls (aka "command tables") are written in an interpreted bytecode and called by passing the table address and parameters to an AtomBIOS interpreter written in C and compiled into your OS/driver/app/whatever.
We provide a couple of interpreters... the original one is used in the user modesetting drivers (radeonhd and radeon) while a more recent one is used in the kernel modesetting driver.
The best place to pick up the interpreter is from the Linux kernel tree in the drivers/gpu/drm/radeon folder, but over the years those files have had a lot of driver-specific bits added to them. Take a look at the kgrids-atom.zip contents at http://www.x.org/docs/AMD to see the original files.
The initial drivers were developed using internal atombios docs issued under NDA, and after the drivers were working there wasn't much demand for documentation so we've been focusing on other things like getting support and docs out for more recent GPU generations. If you are trying to write something using atombios shoot us an email -- gpudriverdevsupport at amd dot com - and we should be able to get you set up with better information.
The important thing to understand is that AtomBIOS does not define a static "least common denominator" set of functionality like traditional BIOS calls -- the API does evolve slowly as the GPU hardware evolves... but the API changes a lot less frequently than the hardware.